update!: graphnode and node typing
* graphnode is a node containing internal Vue Flow data * move util files to util directory * move flow actions type into store file * rename panel type file to zoom * rename types file to flow * Rename Node to NodeWrapper * Rename Edge to EdgeWrapper Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
This commit is contained in:
+17
-12
@@ -1,21 +1,22 @@
|
||||
import { Component, CSSProperties, DefineComponent } from 'vue'
|
||||
import { XYPosition, ElementId, Position } from './types'
|
||||
import { HandleElement } from '~/types/handle'
|
||||
import { XYPosition, ElementId, Position } from './flow'
|
||||
import { HandleElement } from './handle'
|
||||
|
||||
interface VFInternals {
|
||||
position: XYPosition
|
||||
isDragging?: boolean
|
||||
width: number
|
||||
height: number
|
||||
handleBounds: {
|
||||
source: HandleElement[] | null
|
||||
target: HandleElement[] | null
|
||||
}
|
||||
}
|
||||
|
||||
export interface Node<T = any> {
|
||||
id: ElementId
|
||||
position: XYPosition
|
||||
type?: string
|
||||
__vf?: {
|
||||
position: XYPosition
|
||||
isDragging?: boolean
|
||||
width: number
|
||||
height: number
|
||||
handleBounds?: {
|
||||
source?: HandleElement[] | null
|
||||
target?: HandleElement[] | null
|
||||
}
|
||||
}
|
||||
class?: string
|
||||
style?: CSSProperties
|
||||
data?: T
|
||||
@@ -27,6 +28,10 @@ export interface Node<T = any> {
|
||||
connectable?: boolean
|
||||
}
|
||||
|
||||
export interface GraphNode<T = any> extends Node<T> {
|
||||
__vf: VFInternals
|
||||
}
|
||||
|
||||
export type NodePosUpdate = {
|
||||
id: ElementId
|
||||
pos: XYPosition
|
||||
|
||||
Reference in New Issue
Block a user