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

    Interface SelectionOverlayLayerOpts<TPose>

    Options for createSelectionOverlayLayer.

    interface SelectionOverlayLayerOpts<TPose> {
        getBounds?: (pose: TPose) => Bounds;
        getChildren?: (id: string) => readonly string[];
        getOutlineIds?: () => readonly NodeId[];
        getPose: (id: string) => TPose | null;
        getSelection: () => readonly NodeId[];
        getSuppressedIds?: () => ReadonlySet<string>;
        handles?: false | { fill?: FillStyle; outline?: Stroke; size?: number };
        handlesOf?: (bounds: Bounds) => { x: number; y: number }[];
        isContainer?: (id: string) => boolean;
        outline?: Stroke & { pad?: number };
        rotationHandle?: boolean | { distance?: number };
    }

    Type Parameters

    • TPose

    Hierarchy

    • SelectionLayerCommon<TPose>
      • SelectionOverlayLayerOpts
    Index

    Properties

    getBounds?: (pose: TPose) => Bounds

    Project a pose into its AABB. Defaults to the identity — rect-shaped poses ({x, y, width, height}) need no override. For Path poses pass boundsOfPath.

    getChildren?: (id: string) => readonly string[]

    Walk a container's direct children (e.g. scene.childrenOf). When supplied with isContainer, any id that resolves to a container is rendered using the union bounds of all its transitive leaves.

    getOutlineIds?: () => readonly NodeId[]

    Optional separate id list for the per-item outline pass. Use this in multi-selection contexts where the handle pass works against a synthetic union id (e.g. MULTI_RESIZE_TARGET_ID) but consumers still want to see outlines around each real member. When omitted, the outline pass uses the same getSelection ids as the handle pass.

    getPose: (id: string) => TPose | null

    Return null to skip rendering for an id (e.g. resolved pose unavailable). Takes string rather than NodeId because the container-aware bounds resolver internally walks expanded leaf ids via getChildren, which is generic over arbitrary string ids. NodeIds flow in fine — a NodeId is a string.

    getSelection: () => readonly NodeId[]
    getSuppressedIds?: () => ReadonlySet<string>

    Optional set of ids to suppress entirely — both outline and handles are skipped. Used by SceneCanvas to hide the standard selection chrome on the node currently in path-anchor edit mode, where the per-anchor chrome takes over.

    handles?: false | { fill?: FillStyle; outline?: Stroke; size?: number }

    Pass false to render outlines only.

    handlesOf?: (bounds: Bounds) => { x: number; y: number }[]
    isContainer?: (id: string) => boolean

    True when id is a structural container.

    outline?: Stroke & { pad?: number }
    rotationHandle?: boolean | { distance?: number }