Skip to content

pivotick v3.0.0


pivotick / InterractionCallbacks / NodeCreateDecision

Type Alias: NodeCreateDecision ​

NodeCreateDecision = boolean | { accept: boolean; data?: NodeData; id?: string; persisted?: boolean; style?: Partial<NodeStyle>; }

Defined in: interfaces/InterractionCallbacks.ts:595

The decision returned by InterractionCallbacks.onBeforeNodeCreate.

true accepts the library's default node, false vetoes. The object form accepts (when accept is true) and lets the consumer supply the new node's id / data / style.

Type Declaration ​

boolean

{ accept: boolean; data?: NodeData; id?: string; persisted?: boolean; style?: Partial<NodeStyle>; }

accept ​

accept: boolean

data? ​

optional data: NodeData

id? ​

optional id: string

persisted? ​

optional persisted: boolean

The consumer wrote this creation through to its own backend — only the consumer can know a write happened, so only the consumer can declare it. The history row is marked saved and still reverses: undo takes the element off the canvas, the backend keeps its copy, and the menu says so before the click.

style? ​

optional style: Partial<NodeStyle>