拓展 / InterractionCallbacks / NodeCreateDecision
类型别名: NodeCreateDecision
NodeCreateDecision =
boolean| {accept:boolean;data?:NodeData;id?:string;persisted?:boolean;style?:Partial<NodeStyle>; }
定义于:interfaces/InterractionCallbacks.ts:595
由InterractionCallbacks.onBeforeNodeCreate返回的决定。
true接受库的默认节点,false否决。对象形式接受(当accept为真时)并让消费者提供新节点的id/数据/样式。
类型声明
boolean
{ accept: boolean; data?: NodeData; id?: string; persisted?: boolean; style?: Partial<NodeStyle>; }
accept
accept:
boolean
data?
optionaldata:NodeData
id?
optionalid:string
persisted?
optionalpersisted:boolean
消费者将这个创建写入到自己的后端——只有消费者才能知道发生了写入,因此只有消费者才能声明它。历史行被标记为已保存,并且仍然反转:撤消将元素从画布上移走,后端保留其副本,并且菜单在单击之前如此显示。
style?
optionalstyle:Partial<NodeStyle>