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

    Interface IngestCtx

    Context handed to every content handler for one ingest event.

    interface IngestCtx {
        clipboard?: ClipboardIngestCtx;
        consumedWeaselPayload?: boolean;
        deps: ActionDeps;
        insert: InsertDep;
        point: { x: number; y: number } | null;
        resolveSrc?: (file: File) => Promise<string>;
        scene: Scene<unknown, string, unknown>;
        selection: SelectionApi;
        svg?: SvgIngestOptions;
        applyOps(ops: Op[], label?: string): void;
        viewportWorldRect(): {
            height: number;
            width: number;
            x: number;
            y: number;
        };
    }
    Index

    Properties

    clipboard?: ClipboardIngestCtx

    Clipboard-paste seam — present when the hosting SceneCanvas supplied an adapter with commitPaste. reviver comes from SceneCanvasProps.ingestion.clipboard. Absent ⇒ the kit weasel-JSON handler declines inert (dwarn, nothing ingested) — its matched items were already consumed at match time, so they do NOT fall through; only match-level misses flow on to other handlers.

    consumedWeaselPayload?: boolean

    Set to true by the kit weasel-JSON handler when it successfully pastes a payload in this event. The ctx object is shared across all handlers in one runIngest call, and higher-priority handlers' handle bodies run (synchronously) before lower ones — so kit:svg's text/plain SVG fallback reads this to decline the SVG flavor of a copy whose canonical weasel-JSON flavor already ingested (avoids a double-paste when both flavors ride one clipboard event).

    Full action-deps bag, for consumer handlers that need more.

    insert: InsertDep

    The kit insert dep — id/layer/undoable-op supplied; the canonical way for a handler to mint a node (insert.commit(bounds, { kind, ... })).

    point: { x: number; y: number } | null

    World-space arrival point (drop / pointed imperative ingest); null for paste and point-less calls — handlers pick their own policy (the kit image handler centers on the viewport).

    resolveSrc?: (file: File) => Promise<string>

    Consumer file→src resolver (SceneCanvas ingestion.resolveSrc). When absent, the kit image handler embeds as a data: URI.

    scene: Scene<unknown, string, unknown>
    selection: SelectionApi

    Kit SVG-handler options (SceneCanvas ingestion.svg) — e.g. { unpack: unpackSvgFiles } (from @weasel-js/svg) to parse SVG files into scene nodes.

    Methods