feat(nodes): Allow nodes to pass all draggable options

* omits scale, grid, enableuserselecthack and enabletransformfix as valid options for draggable
* remove event interface and emits from nodewrapper

Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
This commit is contained in:
Braks
2021-11-24 00:02:30 +01:00
parent 71a10b2536
commit da4fd4f7ce
2 changed files with 10 additions and 59 deletions
+2 -1
View File
@@ -30,6 +30,7 @@ export interface NodeProps<T = any> {
export type NodeComponent = Component<NodeProps> | DefineComponent<NodeProps, any, any, any, any> | string
export type DefaultNodeTypes = { [key in 'input' | 'output' | 'default']: Component<NodeProps> }
export type NodeTypes = (keyof DefaultNodeTypes | string)[]
export type Draggable = Omit<DraggableOptions, 'scale' | 'grid' | 'enableUserSelectHack' | 'enableTransformFix'> | boolean
export interface Node<T = any> {
id: ElementId
@@ -41,7 +42,7 @@ export interface Node<T = any> {
targetPosition?: Position
sourcePosition?: Position
isHidden?: boolean
draggable?: boolean
draggable?: Draggable
selectable?: boolean
connectable?: boolean
dragHandle?: string