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

    Interface LassoSelectAdapter

    Narrow adapter for useLassoSelect. Extends AreaSelectAdapter with a polygon hit-test method. Transient — uses applyOps like its rectangular sibling. hitTestLasso is optional; when omitted, useLassoTool skips wiring the default behavior (same opt-in pattern as hitTestArea).

    interface LassoSelectAdapter {
        applyOps?(ops: Op[], label?: string): void;
        getSelection?(): string[];
        hitTestArea?(
            rect: { height: number; width: number; x: number; y: number },
        ): string[];
        hitTestLasso?(
            polygon: readonly { x: number; y: number }[],
            mode: LassoHitMode,
        ): 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

    • Hit-test against a closed polygon. Vertex order may be CW or CCW; the closing edge from last → first is implicit.

      Parameters

      • polygon: readonly { x: number; y: number }[]
      • mode: LassoHitMode

      Returns string[]