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

    Interface UseResizeOptions<TPose>

    interface UseResizeOptions<TPose> {
        behaviors?: TPose extends ResizePose ? BoundsConstraint<TPose>[] : never;
        debug?: DebugSink;
        expandIds?: (ids: string[]) => string[];
        geometry?: PoseProjection<TPose>;
        handleHitRadius?: number;
        onGestureEnd?: (committed: boolean) => void;
        onGestureStart?: (id: string) => void;
        pointSnapBehaviors?: TPose extends ResizePose
            ? PointSnapBehavior<TPose>[]
            : never;
        resizable?: (id: string) => boolean;
        resizeLabel?: string;
        transient?: boolean;
    }

    Type Parameters

    • TPose
    Index

    Properties

    behaviors?: TPose extends ResizePose ? BoundsConstraint<TPose>[] : never

    Behaviors are rect-typed: they read/write {x,y,width,height}. When TPose is non-rect, pass geometry to project pose↔bounds; behaviors in that case are typed never because none in the kit's library would understand the pose shape.

    debug?: DebugSink

    Optional debug sink. When supplied, records corner-handle positions + circular hitboxes when the gesture starts (covers the on-screen handles for the resized target). Tree-shakes via optional-chain when omitted.

    expandIds?: (ids: string[]) => string[]

    Optional: expand the incoming id into leaf ids before pose lookups. Mirrors useMove's expandIds. Used for group expansion: when the gesture is started against a group id, the kit resizes by computing the union AABB of the leaves' origin bounds, running the compute pipeline on that union rect (group bounds), and remapping each leaf via geometry.remapBounds(leaf, originGroupBounds, proposedGroupBounds).

    When expandIds is omitted or returns the original single id, the gesture takes the single-leaf path (the leaf's own bounds become both the origin and the target of the same remapBounds call).

    Called once at start(). Returning [] aborts the gesture cleanly.

    geometry?: PoseProjection<TPose>

    Projection from TPose to bounds and back. Defaults to rect identity when TPose extends ResizePose. Required for non-rect TPose (Path, polygon, etc.).

    handleHitRadius?: number

    Hit-test radius for corner handles, in screen pixels. Used purely for the recorded debug hitbox circle radius — does not affect actual hit math (which lives in usePointerGestures). Default 8.

    onGestureEnd?: (committed: boolean) => void
    onGestureStart?: (id: string) => void
    pointSnapBehaviors?: TPose extends ResizePose
        ? PointSnapBehavior<TPose>[]
        : never

    Behaviors that operate on world-space anchor points. Fire after behaviors[] (bounds-frame). Each behavior receives a PointSnapContext with world-space frame points and returns at most one PointSnapResult; the hook back-solves the local pose so the chosen frame's world point lands on the snap target. First non-null result wins.

    resizable?: (id: string) => boolean

    Per-node resizability predicate. Returns false for nodes that should never show resize handles (and thus can't start a resize gesture) — e.g. fixed-footprint icons, locked layers. <SceneCanvas> folds this over the current selection into the selectionResizable rule-ctx flag, so the default selection.resize-handles chrome rule hides handles whenever any selected node is non-resizable (which also disables the affordance, since visible==hittable). Default: every node resizable.

    resizeLabel?: string
    transient?: boolean

    Reserved; resize is never transient in practice. Ignored.