refactor(edges): update edge type to include default edge types

This commit is contained in:
Braks
2022-05-11 22:10:40 +02:00
parent e2e3a650c1
commit 1fab0317d5
+4 -2
View File
@@ -1,7 +1,7 @@
import { Component, CSSProperties, VNode } from 'vue'
import { Position, BaseElement, ElementData } from './flow'
import { GraphNode } from './node'
import { EdgeComponent, EdgeTextProps } from './components'
import { DefaultEdgeTypes, EdgeComponent, EdgeTextProps } from './components'
/** Edge markers */
export enum MarkerType {
@@ -44,6 +44,8 @@ export type EdgeMarkerType = string | MarkerType | EdgeMarker
export interface Edge<Data = ElementData> extends BaseElement<Data> {
label?: string | VNode | Component<EdgeTextProps>
/** node type, can be a default type or a custom type */
type?: keyof DefaultEdgeTypes | string
/** Source node id */
source: string
/** Target node id */
@@ -84,7 +86,7 @@ export interface Edge<Data = ElementData> extends BaseElement<Data> {
export type DefaultEdgeOptions = Omit<
Edge,
'id' | 'source' | 'target' | 'sourceHandle' | 'targetHandle' | 'sourceNode' | 'targetNode'
>
>
export interface EdgePositions {
sourceX: number