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

    Interface SceneAdapter<TNode, TPose>

    Full scene adapter. Most consumers implement narrow per-hook subsets (MoveAdapter, ResizeAdapter, ClipboardAdapter, ...) — TypeScript's structural typing means a wider adapter satisfies any narrower interface.

    Pose semantics: getPose / setPose work in local coordinates — relative to the node's direct parent (or world, for root-parented nodes). The kit composes world poses via composeWorldPose when it needs to render, hit-test, or snap. For the common axis-aligned rect pose, composeRectPose / decomposeRectPose ship as the canonical compose pair.

    interface SceneAdapter<TNode extends { id: string }, TPose> {
        applyOps?(ops: Op[], label?: string): void;
        getNode(id: string): TNode | undefined;
        getNodes(): TNode[];
        getParent(id: string): string | null;
        getPose(id: string): TPose;
        getSelection(): string[];
        hitTest(worldX: number, worldY: number): string | null;
        insertNode(node: TNode): void;
        removeNode(id: string): void;
        setParent(id: string, parentId: string | null): void;
        setPose(id: string, pose: TPose): void;
        setSelection(ids: string[]): void;
    }

    Type Parameters

    • TNode extends { id: string }
    • TPose
    Index

    Methods