From 817f69ccb550e09057daca302a535ebdff85890d Mon Sep 17 00:00:00 2001 From: Braks <78412429+bcakmakoglu@users.noreply.github.com> Date: Fri, 8 Apr 2022 20:37:57 +0200 Subject: [PATCH] update(nodes): NodeProps comments --- package/src/types/node.ts | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/package/src/types/node.ts b/package/src/types/node.ts index 13c5632a..73eec86a 100644 --- a/package/src/types/node.ts +++ b/package/src/types/node.ts @@ -67,10 +67,15 @@ export interface GraphNode extends Node { /** these props are passed to node components */ export interface NodeProps { + /** unique node id */ id: string - type: string + /** node type */ + type: keyof DefaultNodeTypes | string + /** additional data of node */ data?: Data + /** is node selected */ selected: boolean + /** can node be connected */ connectable: boolean /** absolute position in relation to parent elements + z-index */ computedPosition: XYZPosition @@ -88,12 +93,19 @@ export interface NodeProps { isValidTargetPos?: ValidConnectionFunc /** called when used as source for new connection */ isValidSourcePos?: ValidConnectionFunc + /** parent node id */ parentNode?: string + /** is node currently dragging */ dragging: boolean + /** node z-index */ zIndex: number + /** handle position */ targetPosition?: Position + /** handle position */ sourcePosition?: Position + /** drag handle query selector */ dragHandle?: string + /** node DOM-element */ nodeElement: HTMLDivElement }