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

    Interface AreaSelectAdapter

    Narrow adapter for useAreaSelect. Transient: no checkpoint, no history. The hook calls applyOps(ops) instead of applyOps(ops, label).

    All fields are optional — area-select is opt-in. useSelectTool only wires the default marquee behavior when hitTestArea, getSelection, setSelection, and applyOps are all present on the adapter; otherwise the gesture short-circuits (empty-space drags do nothing, sub-threshold empty clicks still clear selection via the tool's onClick path). Demos that don't need marquee selection can omit these methods entirely.

    interface AreaSelectAdapter {
        applyOps?(ops: Op[], label?: string): void;
        getSelection?(): string[];
        hitTestArea?(
            rect: { height: number; width: number; x: number; y: number },
        ): string[];
        setSelection?(ids: string[]): void;
    }

    Hierarchy (View Summary)

    Index

    Methods

    • Apply ops without checkpointing or pushing a history entry. The optional label parameter is accepted (and ignored by transient implementations) so that this signature is compatible with MoveAdapter.applyOps.

      Parameters

      • ops: Op[]
      • Optionallabel: string

      Returns void

    • Returns ids of nodes intersecting the world-space rect.

      Parameters

      • rect: { height: number; width: number; x: number; y: number }

      Returns string[]