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

    Type Alias OngoingOverlay

    OngoingOverlay:
        | {
            current: { x: number; y: number };
            kind: "marquee";
            shiftHeld: boolean;
            start: { x: number; y: number };
        }
        | {
            current: { x: number; y: number };
            kind: "lasso";
            shiftHeld: boolean;
            vertices: ReadonlyArray<{ x: number; y: number }>;
        }
        | {
            commands: readonly DrawCommand[];
            kind: "commands";
            space?: "world"
            | "screen";
        }
        | {
            anchorPoint?: { x: number; y: number };
            bounds: { height: number; width: number; x: number; y: number };
            extras: unknown;
            kind: "insertPreview";
            shape: "rect" | "ellipse" | "line" | "polygon" | "star" | "pencil";
        }

    Discriminated overlay shape returned by OngoingHandle.overlay(). Dispatcher-side chrome surface for in-flight gestures that paint non-ghost visuals. The canvas's useDispatcherOverlayLayer walks every in-flight handle, calls overlay(), and dispatches on kind to draw the appropriate shape.

    marquee mirrors AreaSelectOverlay; lasso mirrors LassoSelectOverlay. commands is the generic escape hatch — actions emit arbitrary DrawCommand[] for previews the typed variants can't express (insert shape outlines, paste ghosts of synthetic nodes, custom chrome). World- space is the default; the layer wraps in viewToMat3 so commands track the camera. Set space: 'screen' for projections you've already done yourself (rare).

    Type Declaration

    • {
          current: { x: number; y: number };
          kind: "marquee";
          shiftHeld: boolean;
          start: { x: number; y: number };
      }
    • {
          current: { x: number; y: number };
          kind: "lasso";
          shiftHeld: boolean;
          vertices: ReadonlyArray<{ x: number; y: number }>;
      }
    • {
          commands: readonly DrawCommand[];
          kind: "commands";
          space?: "world" | "screen";
      }
      • commands: readonly DrawCommand[]
      • kind: "commands"
      • Optionalspace?: "world" | "screen"

        Coordinate space the commands are authored in. Default 'world' — the layer wraps them in viewToMat3(view) so they track the camera. 'screen' emits them as-is (CSS pixels).

    • {
          anchorPoint?: { x: number; y: number };
          bounds: { height: number; width: number; x: number; y: number };
          extras: unknown;
          kind: "insertPreview";
          shape: "rect" | "ellipse" | "line" | "polygon" | "star" | "pencil";
      }
      • OptionalanchorPoint?: { x: number; y: number }

        World-space point to paint a small "anchor" dot at. Sells the click point as the drag's anchor — particularly useful for radial shapes (polygon/star) where no vertex sits on the click point, and for any shape in center mode where the dot marks the center the shape grows around.

      • bounds: { height: number; width: number; x: number; y: number }
      • extras: unknown
      • kind: "insertPreview"

        Live insert-drag preview — dispatched by insertAction while the user is dragging out a new shape. Pre-commit there is no scene node to ghost via previewIds()/previewPose(), so insert paints its preview through the dispatcher overlay layer instead.

        shape is the kit's built-in insert kind. bounds is the AABB of the current drag (start/current normalized). extras is the per-kind extras the action already collected — the overlay renderer rebuilds the shape using the same path builders the commit factory uses, so the preview matches the eventual node.

        extras is opaque (unknown) at the union level; the overlay renderer narrows on shape and casts the field shape it expects.

      • shape: "rect" | "ellipse" | "line" | "polygon" | "star" | "pencil"