refactor(edges): update edge type to include default edge types
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
import { Component, CSSProperties, VNode } from 'vue'
|
import { Component, CSSProperties, VNode } from 'vue'
|
||||||
import { Position, BaseElement, ElementData } from './flow'
|
import { Position, BaseElement, ElementData } from './flow'
|
||||||
import { GraphNode } from './node'
|
import { GraphNode } from './node'
|
||||||
import { EdgeComponent, EdgeTextProps } from './components'
|
import { DefaultEdgeTypes, EdgeComponent, EdgeTextProps } from './components'
|
||||||
|
|
||||||
/** Edge markers */
|
/** Edge markers */
|
||||||
export enum MarkerType {
|
export enum MarkerType {
|
||||||
@@ -44,6 +44,8 @@ export type EdgeMarkerType = string | MarkerType | EdgeMarker
|
|||||||
|
|
||||||
export interface Edge<Data = ElementData> extends BaseElement<Data> {
|
export interface Edge<Data = ElementData> extends BaseElement<Data> {
|
||||||
label?: string | VNode | Component<EdgeTextProps>
|
label?: string | VNode | Component<EdgeTextProps>
|
||||||
|
/** node type, can be a default type or a custom type */
|
||||||
|
type?: keyof DefaultEdgeTypes | string
|
||||||
/** Source node id */
|
/** Source node id */
|
||||||
source: string
|
source: string
|
||||||
/** Target node id */
|
/** Target node id */
|
||||||
@@ -84,7 +86,7 @@ export interface Edge<Data = ElementData> extends BaseElement<Data> {
|
|||||||
export type DefaultEdgeOptions = Omit<
|
export type DefaultEdgeOptions = Omit<
|
||||||
Edge,
|
Edge,
|
||||||
'id' | 'source' | 'target' | 'sourceHandle' | 'targetHandle' | 'sourceNode' | 'targetNode'
|
'id' | 'source' | 'target' | 'sourceHandle' | 'targetHandle' | 'sourceNode' | 'targetNode'
|
||||||
>
|
>
|
||||||
|
|
||||||
export interface EdgePositions {
|
export interface EdgePositions {
|
||||||
sourceX: number
|
sourceX: number
|
||||||
|
|||||||
Reference in New Issue
Block a user