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

    Interface ViewApi

    Minimal view API the action layer consumes. May be refined later.

    interface ViewApi {
        get(): View;
        hostSize?(): { height: number; width: number } | null;
        recenter?(): void;
        set(v: View): void;
    }
    Index

    Methods

    • Optional canvas-local host dimensions (CSS px). When wired, viewportZoomAction's keyboard branches (Cmd+= / Cmd+-) anchor at the host center instead of the top-left origin. Null when the host isn't measurable (unmounted).

      Returns { height: number; width: number } | null

    • Optional recenter callback. When wired, viewportZoomAction's reset branch (Cmd-0) calls this instead of resetting to identity — letting consumers re-fit the page (or other reference bounds) into the workspace. Receives no args; the consumer reads its own bounds

      • host dims and dispatches setView(...).

      Returns void