weasel API - v0.8.0
    Preparing search index...

    Interface BooleansAdapter

    Adapter the hook and the pure core both consume.

    interface BooleansAdapter {
        applyOps?(ops: Op[], label?: string): void;
        compareZ(a: NodeId, b: NodeId): number;
        createPathNode(path: Path, producedBy: BooleanOp): { id: string };
        getNode?(id: NodeId): { id: string } | null | undefined;
        getSelection(): NodeId[];
        getWorldPath(id: NodeId): Path | undefined;
        getZOrder?(id: NodeId): BooleanZOrder | undefined;
        insertNode?(node: { id: string }): void;
        removeNode?(id: string): void;
        setSelection?(ids: NodeId[]): void;
    }
    Index

    Methods

    • Optional: return the full object for an id, used by the delete ops so their invert (an insert) can restore the complete object on undo. If omitted, a { id } stub is captured — undo will reinstate the id but consumers reading other fields (path, fill, etc.) will see them as undefined. Mirrors DeleteAdapter.getNode; should be provided whenever undo over boolean ops is expected to be lossless.

      Parameters

      Returns { id: string } | null | undefined

    • Optional: return the parent + child-index of id so the result of a boolean op can be placed in the topmost source's z-slot. Adapters that also expose getChildren/setChildOrder (the ReorderAdapter contract) will have the kit emit a createMoveToIndexOp after the inserts. Adapters that omit this method get v1 behavior — the result lands wherever the adapter's plain insertNode defaults to.

      Parameters

      Returns BooleanZOrder | undefined