pivotick - v2.0.1
    Preparing search index...

    Type Alias NodeCreateDecision

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

    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: boolean
      • Optionaldata?: NodeData
      • Optionalid?: string
      • 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.

      • Optionalstyle?: Partial<NodeStyle>