fix: typings

This commit is contained in:
Braks
2021-10-22 14:29:27 +02:00
parent cb96b1ab00
commit 6ec8258f33
50 changed files with 165 additions and 142 deletions
+13 -3
View File
@@ -9,7 +9,12 @@ export interface Edge<T = any> {
target: ElementId
sourceHandle?: ElementId | null
targetHandle?: ElementId | null
label?: string | VNode
label?:
| string
| {
component: any
props?: any
}
labelStyle?: any
labelShowBg?: boolean
labelBgStyle?: any
@@ -20,7 +25,7 @@ export interface Edge<T = any> {
arrowHeadType?: ArrowHeadType
isHidden?: boolean
data?: T
className?: string
class?: string
}
export interface EdgeProps<T = any> {
@@ -35,7 +40,12 @@ export interface EdgeProps<T = any> {
animated?: boolean
sourcePosition: Position
targetPosition: Position
label?: string | VNode
label?:
| string
| {
component: any
props?: any
}
labelStyle?: any
labelShowBg?: boolean
labelBgStyle?: any
+12 -10
View File
@@ -6,13 +6,15 @@ export interface Node<T = any> {
id: ElementId
position: XYPosition
type?: string
__rf: {
position: XYPosition
isDragging?: boolean
width: number | null
height: number | null
handleBounds?: any
}
__rf?:
| {
position?: XYPosition
isDragging?: boolean
width?: number
height?: number
handleBounds?: any
}
| any
data?: T
style?: any
className?: string
@@ -45,8 +47,8 @@ export type NodeDimensionUpdate = {
}
export interface NodeProps<T = any> {
id: ElementId
type: string
id?: ElementId
type?: string
data?: T
selected?: boolean
connectable?: boolean
@@ -57,4 +59,4 @@ export interface NodeProps<T = any> {
dragging?: boolean
}
export type NodeType = DefineComponent<NodeProps>
export type NodeType = DefineComponent<NodeProps, any, any, any, any>
+1 -1
View File
@@ -8,7 +8,7 @@ export type ElementId = string
export type FlowElement<T = any> = Node<T> | Edge<T>
export type Elements<T = any> = Array<FlowElement<T>>
export type Elements<T = any> = FlowElement<T>[]
export type Transform = [number, number, number]