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

    Interface SelectionHandlesLayerOpts<TPose>

    Options for createSelectionHandlesLayer.

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

    Type Parameters

    • TPose

    Hierarchy

    • SelectionLayerCommon<TPose>
      • SelectionHandlesLayerOpts
    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.

    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[]
    handles?: { fill?: FillStyle; outline?: Stroke; size?: number }

    Handle visuals. Omit for defaults.

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

    Override handle placement. Default: 4 corners of the AABB.

    isContainer?: (id: string) => boolean

    True when id is a structural container.

    rotationHandle?: boolean | { distance?: number }

    Render a rotation handle above the (rotated) top-center of the AABB. When true, uses default visuals + distance. When an object, override the world-space distance from the top edge. Defaults to false — consumers opt in only when wiring useRotate.

    Type Declaration

    • boolean
    • { distance?: number }
      • Optionaldistance?: number

        World-pixel distance from the top edge to the handle center.