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?
optionaldata:NodeData
id?
optionalid:string
persisted?
optionalpersisted: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?
optionalstyle:Partial<NodeStyle>