refactor(types)!: Remove ElementId type

Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
This commit is contained in:
Braks
2021-12-20 19:29:52 +01:00
parent fe0eeaeae9
commit f00f34d84b
28 changed files with 99 additions and 150 deletions
+7 -5
View File
@@ -1,7 +1,9 @@
import { DraggableOptions } from '@braks/revue-draggable'
import { XYPosition, ElementId, Position, SnapGrid, Element } from './flow'
import { XYPosition, Position, SnapGrid, Element } from './flow'
import { HandleElement, ValidConnectionFunc } from './components'
export type CoordinateExtent = [[number, number], [number, number]]
export interface VFInternals {
isDragging?: boolean
width: number
@@ -25,6 +27,8 @@ export interface Node<T = any> extends Element<T> {
snapGrid?: SnapGrid
isValidTargetPos?: ValidConnectionFunc
isValidSourcePos?: ValidConnectionFunc
extent?: 'parent' | CoordinateExtent
parentNode?: string
}
export interface GraphNode<T = any> extends Node<T> {
@@ -32,7 +36,7 @@ export interface GraphNode<T = any> extends Node<T> {
}
export interface NodeProps<T = any> extends GraphNode {
id: ElementId
id: string
position: XYPosition
type?: string
data?: T
@@ -46,10 +50,8 @@ export interface NodeProps<T = any> extends GraphNode {
__vf: VFInternals
}
export type CoordinateExtent = [[number, number], [number, number]]
export type NodeDimensionUpdate = {
id: ElementId
id: string
nodeElement: HTMLDivElement
forceUpdate?: boolean
}