import { i as Scene } from "./scene.js"; import { Timeline } from "@glissade/core"; //#region src/diff.d.ts /** A node reference in the added/removed lists — its id + node type. */ interface NodeRef { /** the node id (only id-bearing nodes are diffed by identity). */ node: string; /** the node's `describeType` (e.g. `'Rect'`, `'Text'`). */ type: string; } /** A composed-world bbox (rendered layer), same shape as critique's geometry. */ interface Region { minX: number; minY: number; maxX: number; maxY: number; } /** * One change. The `op` tags WHAT KIND of change it is: * - `'moved'` — a node was RE-PARENTED (structural) or its rendered box shifted * (rendered layer). `from`/`to` are the parent ids (structural) or bboxes. * - `'retargeted'` — a track now points at a different target (its keys are * unchanged; only `target` moved). `from`/`to` are the old/new target strings. * - `'changed'` — a node prop value, a track's keys, a track's presence, or a * rendered command field changed. `from`/`to` are the old/new values. */ type ChangeOp = 'moved' | 'retargeted' | 'changed'; interface Change { op: ChangeOp; /** the node id this change concerns (node-level changes). */ node?: string; /** the track/prop target this change concerns (track-level + prop changes). */ target?: string; /** the specific property that changed (e.g. `'position'`, `'keys'`, `'type'`). */ property?: string; /** the value BEFORE (in `a`). */ from: unknown; /** the value AFTER (in `b`). */ to: unknown; /** rendered layer: the composed-world region the change occupies. */ region?: Region; } /** * The typed change-set `diff(a, b)` returns. Programmatically checkable — an agent * asserts `diff == exactly my intended change-set`, never parses a text blob. * `empty` is a convenience (`added=removed=changed=[]`), so `diff(a,a).empty` is * the one-liner clean check. */ interface ChangeSet { /** nodes present in `b` but not `a` (by id). */ added: NodeRef[]; /** nodes present in `a` but not `b` (by id). */ removed: NodeRef[]; /** every moved / retargeted / changed entry, canonically sorted. */ changed: Change[]; /** true iff `added`, `removed`, and `changed` are all empty. */ empty: boolean; } /** The two sides of a diff — a bound-or-buildable scene + its optional document. */ interface DiffInput { scene: Scene; timeline?: Timeline; } interface DiffOptions { /** * ALSO run the rendered (DisplayList) layer at `at` — surfaces VISUAL deltas the * semantic structural layer ignores (a paint that moved, a color that changed * mid-flight). Default false (structural only). */ rendered?: boolean; /** the time (seconds) the rendered layer samples. Default 0. */ at?: number; } /** * Diff two scenes (+ optional timelines) into a typed {@link ChangeSet}. Default * is the SEMANTIC structural layer (node tree + timeline); pass `{ rendered: true }` * to also diff the DisplayList at `at`. Pure read; `diff(a, a)` is EMPTY. */ declare function diff(a: DiffInput, b: DiffInput, opts?: DiffOptions): ChangeSet; //#endregion export { DiffOptions as a, diff as c, DiffInput as i, ChangeOp as n, NodeRef as o, ChangeSet as r, Region as s, Change as t };