/** * TransitionNode interpreter — the keystone motion reader (#130 child 2). * * Walks the existing graph chain (no schema change): * TransitionNode.fromPose → PoseNode.entityRef → EntityNode → ComponentNode * * Diffs pose bindings into typed (from,to) pairs, maps discrete state crossings, * and reads routing/durationMs for keyframe sequencing and timing. Emits both a * CSS projection plan and a runtime leaf-write plan (motion is intent, not a target). * * @module */ import type { ContentAddress, SignalInput, StateName } from './brands.js'; import type { DocumentGraph } from './document-graph.js'; import type { DiagnosticPayload } from './diagnostics.js'; import type { EdgeType } from './plan.js'; import type { RuntimeEasing } from './easing.js'; import { type TypedValue } from './interpolate.js'; /** One property tween with typed endpoints. */ export interface MotionPropertyTween { readonly property: string; readonly from: TypedValue; readonly to: TypedValue; } /** A single CSS keyframe step for sequential routing. */ export interface CssKeyframeStep { readonly offset: number; readonly properties: Readonly>; /** * The easing curve governing the SEGMENT that starts at this stop (until the next * stop), emitted as a per-keyframe `animation-timing-function`. Present on a composed * program that uses any NON-DEFAULT easing, where the animation-level timing function * (which the compiler defaults to `ease`) cannot serve the segment — a native * `animation-timeline` browser would otherwise sample it as `ease` while the * JS/stage/worker floors use the authored curve (uniform or mixed). Absent on * default-`ease` plans (the compiler default already matches) and on single-step * transitions; also absent — with a loud `interpretProgram` diagnostic — on a segment * where overlapping windows disagree on easing (a `par` of differently-eased children), * which no single per-keyframe curve can express. */ readonly easing?: RuntimeEasing; } /** CSS projection plan — keyframes / transition keyed on discrete state. */ export interface CssMotionPlan { readonly selector: string; readonly fromState: StateName; readonly toState: StateName; readonly properties: readonly MotionPropertyTween[]; readonly durationMs: number; readonly routing: EdgeType; readonly keyframes: readonly CssKeyframeStep[]; readonly transitionProperty: string; } /** One runtime leaf-write descriptor (typed CSS custom property floor). */ export interface RuntimeWriteProperty { readonly cssVar: string; readonly from: TypedValue; readonly to: TypedValue; } /** * A per-window runtime sub-sampler for a composed {@link TransitionProgram}: the * properties one transition tweens over its `[windowStart, windowEnd]` slice of the * global `[0,1]` timeline, with its OWN easing descriptor. Populated by * `interpretProgram`; absent on a single-step plan (the flat `properties`/`easing` * path). The `client:motion` floor samples these to scrub a multi-step chain. */ export interface RuntimeWriteWindow { readonly windowStart: number; readonly windowEnd: number; readonly properties: readonly RuntimeWriteProperty[]; readonly easing: RuntimeEasing; } /** Runtime leaf-write plan — the permanent floor when native CSS is unavailable. */ export interface RuntimeWritePlan { readonly properties: readonly RuntimeWriteProperty[]; readonly durationMs: number; readonly routing: EdgeType; readonly fromState: StateName; readonly toState: StateName; /** * The easing descriptor the JS floor samples (`sampleRuntimeEasing`). Self-describing * so the floor never depends on a driver to hand it a curve — and read from the * SAME authored source (`TransitionNode.easing`) the native CSS path compiles into * `linear()`, so the two floors sample one identical `Easing.spring` (Law 4). */ readonly easing: RuntimeEasing; /** * Per-window sub-samplers for a composed {@link TransitionProgram} (from * `interpretProgram`). Present ⇒ the floor scrubs each window at its own local * eased progress (a multi-step chain); absent ⇒ the flat `properties`/`easing` * single-tween path. The composite `durationMs`/`fromState`/`toState` describe the * whole program. */ readonly windows?: readonly RuntimeWriteWindow[]; } /** Lowered motion intent — CSS projection + runtime floor + diagnostics. */ export interface LoweredMotionPlan { readonly graphId: ContentAddress; readonly target: string; readonly signals: readonly SignalInput[]; readonly css?: CssMotionPlan; readonly runtime?: RuntimeWritePlan; readonly diagnostics: readonly DiagnosticPayload[]; } /** * Interpret a {@link TransitionNode} into CSS + runtime motion plans. * * Reads `fromPose`, `toPose`, `routing`, and `durationMs`; resolves the boundary * transitively via pose → entity → component; diffs bindings into typed tweens. */ export declare function interpretTransition(graph: DocumentGraph, transitionId: ContentAddress): LoweredMotionPlan; //# sourceMappingURL=interpret-transition.d.ts.map