update(nodes): add __vf to node props

* move edge/node component-types to components file

Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
This commit is contained in:
Braks
2021-11-25 15:21:36 +01:00
parent 3855e9fe3f
commit f2e38ca7ac
6 changed files with 39 additions and 37 deletions
+3 -9
View File
@@ -1,12 +1,8 @@
import { Component, CSSProperties, DefineComponent } from 'vue'
import { CSSProperties } from 'vue'
import { ArrowHeadType, ElementId, Position } from './flow'
import { EdgeTextProps } from './components'
import { EdgeTextProps, EdgeTypes } from './components'
import { GraphNode } from './node'
// eslint-disable-next-line no-use-before-define
export type DefaultEdgeTypes = { [key in 'default' | 'straight' | 'smoothstep' | 'step']: Component<EdgeProps> }
export type EdgeTypes = (keyof DefaultEdgeTypes | string)[]
export interface Edge<T = any> {
id: ElementId
type?: EdgeTypes[number]
@@ -42,7 +38,7 @@ export interface GraphEdge<T = any> extends Edge<T> {
targetNode: GraphNode
}
export interface EdgeProps<T = any> extends Edge<T> {
export interface EdgeProps<T = any> extends GraphEdge<T> {
sourceX: number
sourceY: number
targetX: number
@@ -65,5 +61,3 @@ export interface EdgePositions {
targetX: number
targetY: number
}
export type EdgeComponent = Component<EdgeProps> | DefineComponent<EdgeProps, any, any, any, any, any> | string