@mkbabb/keyframes.js 5.1.0 → 5.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,21 +1,23 @@
1
- import { AnimationRangeValue } from '@mkbabb/value.js';
2
- import { AnimationTimelineValue } from '@mkbabb/value.js';
3
- import { ColorSpace } from '@mkbabb/value.js';
4
- import { CSSTimelineOptions } from '@mkbabb/value.js';
5
- import { CustomFunctionDescriptor } from '@mkbabb/value.js';
6
- import { extractAnimationOptions } from '@mkbabb/value.js';
7
- import { HueInterpolationMethod } from '@mkbabb/value.js';
8
- import { InterpolatedVar } from '@mkbabb/value.js';
9
- import { ParseDiagnostic } from '@mkbabb/value.js';
10
- import { PropertyDescriptor as PropertyDescriptor_2 } from '@mkbabb/value.js';
11
- import { RangeBoundary } from '@mkbabb/value.js';
12
- import { RangePhase } from '@mkbabb/value.js';
13
- import { Stylesheet } from '@mkbabb/value.js';
14
- import { timingFunctions } from '@mkbabb/value.js';
15
- import { ValueArray } from '@mkbabb/value.js';
16
- import { ValueUnit } from '@mkbabb/value.js';
17
-
18
- declare const accordionExpand: (options?: InputAnimationOptions) => CSSKeyframesAnimation< Vars>;
1
+ import { AnimationRangeValue } from '@mkbabb/value.js/parsing';
2
+ import { AnimationTimelineValue } from '@mkbabb/value.js/parsing';
3
+ import { AnimationTriggerValue } from '@mkbabb/value.js/parsing';
4
+ import { ColorSpace } from '@mkbabb/value.js/color';
5
+ import { CSSTimelineOptions } from '@mkbabb/value.js/parsing';
6
+ import { CustomFunctionDescriptor } from '@mkbabb/value.js/parsing';
7
+ import { extractAnimationOptions } from '@mkbabb/value.js/parsing';
8
+ import { HueInterpolationMethod } from '@mkbabb/value.js/color';
9
+ import { InterpolatedVar } from '@mkbabb/value.js/units';
10
+ import { ParseDiagnostic } from '@mkbabb/value.js/parsing';
11
+ import { PropertyDescriptor as PropertyDescriptor_2 } from '@mkbabb/value.js/parsing';
12
+ import { RangeBoundary } from '@mkbabb/value.js/parsing';
13
+ import { RangePhase } from '@mkbabb/value.js/parsing';
14
+ import { Stylesheet } from '@mkbabb/value.js/parsing';
15
+ import { timingFunctions } from '@mkbabb/value.js/easing';
16
+ import { TriggerType } from '@mkbabb/value.js/parsing';
17
+ import { ValueArray } from '@mkbabb/value.js/units';
18
+ import { ValueUnit } from '@mkbabb/value.js/units';
19
+
20
+ declare const accordionExpand: PresetFactory;
19
21
 
20
22
  /**
21
23
  * The outcome of an {@link adoptRunning} takeover. `animation` is the kf object
@@ -24,7 +26,7 @@ declare const accordionExpand: (options?: InputAnimationOptions) => CSSKeyframes
24
26
  * carries any honest refusal (no running animation by that name → a row, never
25
27
  * a silent no-op).
26
28
  */
27
- export declare interface AdoptResult<V extends Vars = any> {
29
+ export declare interface AdoptResult<V extends Vars = Vars> {
28
30
  /** The kf animation now driving the element (null on a refused adopt). */
29
31
  animation: CSSKeyframesAnimation<V> | null;
30
32
  /** The captured native `currentTime` (ms) the kf playhead seeded from. */
@@ -60,7 +62,7 @@ export declare interface AdoptResult<V extends Vars = any> {
60
62
  * // the kf object now drives `el` from the exact playhead — no visible seam.
61
63
  * animation?.pause(); // ...now scrub / spring-ify / re-color it.
62
64
  */
63
- declare const adoptRunning: <V extends Vars = any>(el: Element, options: AdoptRunningOptions) => Promise<AdoptResult<V>>;
65
+ export declare const adoptRunning: <V extends Vars = Vars>(el: Element, options: AdoptRunningOptions) => Promise<AdoptResult<V>>;
64
66
 
65
67
  /** Options for {@link adoptRunning}. */
66
68
  export declare interface AdoptRunningOptions extends IngestOptions {
@@ -80,92 +82,51 @@ export declare interface AdoptRunningOptions extends IngestOptions {
80
82
  commit?: boolean;
81
83
  }
82
84
 
83
- /**
84
- * The value.js-bearing engine surface, resolved through `loadAnimationEngine()`.
85
- *
86
- * Spelled as an explicit interface (rather than `typeof import("./engine")`)
87
- * because the dts roll-up — API Extractor — cannot resolve a `typeof import()`
88
- * type node that points at an internal module. The shape stays in lockstep
89
- * with `./engine`'s runtime exports.
90
- */
91
85
  export declare interface AnimationEngine {
92
- /** The core engine base class (CSS-keyframe parsing + playback). */
93
86
  KeyframesAnimation: typeof KeyframesAnimation;
94
- /** The CSS-parsing `CSSKeyframesAnimation` subclass — the primary "in". */
95
87
  CSSKeyframesAnimation: typeof CSSKeyframesAnimation;
96
- /** Multi-animation compositor (replace/add/weighted layer blending). */
97
88
  AnimationGroup: typeof AnimationGroup;
98
- /** Stable string id for an animation (or string passthrough). */
99
- getAnimationId: (animation: KeyframesAnimation | string) => string;
100
- /** Easing name/literal → a typed `TimingFunction` (value.js registry). */
101
- getTimingFunction: (timingFunction: TimingFunction | TimingFunctionNames | string | undefined) => TimingFunction | undefined;
102
- /** CSS `@keyframes` text/stylesheet → resolved keyframes. */
103
- resolveKeyframes: (input: string | Stylesheet) => ResolvedKeyframes;
104
- /** CSS-native MotionPath — offset-distance over an author offset-path. */
89
+ getAnimationId: typeof getAnimationId;
90
+ getTimingFunction: typeof getTimingFunction;
91
+ resolveKeyframes: typeof resolveKeyframes;
105
92
  MotionPath: typeof MotionPath;
106
- /** Construct a MotionPath sweep over a target. */
107
93
  fromMotionPath: typeof fromMotionPath;
108
- /** CSS-native DrawSVG — stroke-dashoffset sweep over the path length. */
109
94
  DrawSVG: typeof DrawSVG;
110
- /** Construct a DrawSVG line-draw over an SVG geometry target. */
111
95
  fromDrawSVG: typeof fromDrawSVG;
112
- /** SVG path-shape morphing over value.js's `PathGeometry`. */
113
96
  MorphSVG: typeof MorphSVG;
114
- /** Construct a MorphSVG between two `d` strings. */
115
97
  fromMorphSVG: typeof fromMorphSVG;
116
- /** The preset library (`fadeIn`, `bounce`, `shake`, …) as a namespace. */
117
98
  presets: typeof AnimationPresets;
118
- /** The valid `direction` values, as a const tuple. */
119
99
  DIRECTIONS: readonly AnimationOptions["direction"][];
120
- /** The valid `fillMode` values, as a const tuple. */
121
100
  FILL_MODES: readonly AnimationOptions["fillMode"][];
122
- /** The `AnimationOptions` defaults. */
123
101
  defaultOptions: AnimationOptions;
124
- /** The per-layer blend-config defaults. */
125
102
  defaultLayerConfig: AnimationLayerConfig;
126
- /** Walk the document's stylesheets → reconstructed kf animations + CORS diagnostics. */
127
103
  fromStyleSheets: typeof fromStyleSheets;
128
- /** Narrow to the names currently RUNNING via `getAnimations()`. */
129
104
  fromLiveAnimations: typeof fromLiveAnimations;
130
- /** The lowest-level live-CSSOM walk (live analogue of `resolveKeyframes`). */
131
105
  resolveLiveKeyframes: typeof resolveLiveKeyframes;
132
- /** Mid-flight takeover of a running CSS animation (currentTime handoff). */
133
106
  adoptRunning: typeof adoptRunning;
134
- /** Scroll-driven animation as CSS — the JS driver over a parsed scroll grammar. */
135
107
  ScrollScene: typeof ScrollScene;
136
- /** Construct a `ScrollScene` driver. */
137
108
  createScrollScene: typeof createScrollScene;
138
- /** Parse a scroll-as-CSS rule → typed scroll options. */
109
+ driveScrollCSS: typeof driveScrollCSS;
139
110
  parseScrollCSS: typeof parseScrollCSS;
140
- /** Parse an `animation-timeline` value. */
141
111
  parseScrollTimeline: typeof parseScrollTimeline;
142
- /** Parse an `animation-range` value. */
143
112
  parseScrollRange: typeof parseScrollRange;
144
- /** Serialize scroll options back to valid CSS. */
145
113
  serializeScrollOptions: typeof serializeScrollOptions;
146
- /** Round-trip scroll CSS (parse → serialize). */
147
114
  roundTripScrollCSS: typeof roundTripScrollCSS;
148
- /** Conservative-correct scroll backend dispatch. */
149
115
  dispatchScrollBackend: typeof dispatchScrollBackend;
150
- /** Resolve a scroll `animation-range` to concrete boundaries. */
151
116
  resolveRange: typeof resolveRange;
152
- /** `position:sticky` pin synthesis. */
153
117
  pinCSS: typeof pinCSS;
154
- /** The round-trip's BACKWARD half: orchestration graph → zero-runtime CSS. */
118
+ TriggerScene: typeof TriggerScene;
119
+ createTriggerScene: typeof createTriggerScene;
120
+ supportsNativeTrigger: typeof supportsNativeTrigger;
155
121
  compileToCSS: typeof compileToCSS;
156
- /** Read-only validation envelope over the compile/adapter/WAAPI channels. */
122
+ compileToViewTransition: typeof compileToViewTransition;
123
+ compileToEntry: typeof compileToEntry;
157
124
  validate: typeof validate;
158
- /** Format the `validate` verdict as deterministic human/LLM-readable text. */
159
125
  explain: typeof explain;
160
- /** Re-serialize parsed keyframes back to a CSS string. */
161
126
  CSSKeyframesToString: typeof CSSKeyframesToString;
162
- /** Re-serialize parsed keyframes back to per-rule CSS strings. */
163
127
  CSSKeyframesToStrings: typeof CSSKeyframesToStrings;
164
- /** Trim one keyframe body for display. */
165
128
  formatCSSKeyframeString: typeof formatCSSKeyframeString;
166
- /** Paint a `Vars` snapshot onto DOM targets (the run-loop painter). */
167
129
  transformTargetsStyle: typeof transformTargetsStyle;
168
- /** The engine's INP-relief yield ladder. */
169
130
  yieldToMain: typeof yieldToMain;
170
131
  }
171
132
 
@@ -201,6 +162,18 @@ export declare interface AnimationFrame<V extends Vars> {
201
162
  * falls back to the all-boxed walk. Bit-identical to the boxed path.
202
163
  */
203
164
  _numericPlan?: NumericFoldPlan<V>;
165
+ /**
166
+ * T.A6 — the nested PLAIN authored-shape projection a custom `transform`
167
+ * consumes (numbers where the author wrote numbers, strings where a unit or
168
+ * color demands one). Built lazily on the first apply — `undefined` for a
169
+ * DOM-style default-renderer frame (which consumes `flatVars` directly) and
170
+ * before the first `interpFrames(..., true)`. Invalidated at
171
+ * `finalizeFrameVars` so a color-space renormalize rebuilds it against the
172
+ * fresh interp carriers.
173
+ */
174
+ plainVars?: V;
175
+ /** T.A6 — the per-leaf refresh-writer plan backing {@link plainVars}. */
176
+ _plainProj?: PlainProjection | undefined;
204
177
  transform: TransformFunction<V>;
205
178
  timingFunction: Easing;
206
179
  /**
@@ -234,19 +207,43 @@ export declare class AnimationGroup<V extends Vars> {
234
207
  /** Children-per-slice before `advanceTo()` yields to the main thread; larger
235
208
  * groups batch with a `scheduler.yield()` between slices (INP relief). */
236
209
  static readonly YIELD_BATCH = 32;
210
+ /** Construct a group from a first animation + rest (S.B4 / a06 F1/F2 — the
211
+ * genuine-ownership replacement for the excised `KeyframesAnimation.group()`
212
+ * service locator; each input is a bare animation or `{ animation, layer }`). */
213
+ static of<V extends Vars>(first: KeyframesAnimation<V> | AnimationGroupInput<V>, ...rest: (KeyframesAnimation<V> | AnimationGroupInput<V>)[]): AnimationGroup<V>;
237
214
  singleTarget: boolean;
215
+ /**
216
+ * T.A6 — true when the group's composite `transform` is a CUSTOM (non-DOM)
217
+ * consumer that expects the nested PLAIN authored-shape projection (the
218
+ * "animate any object" seam), inherited from the first child's own
219
+ * `unflatten` flag alongside its transform. False (the default) keeps the
220
+ * DOM-style default renderer's FLAT `_grouped` map, byte-unchanged.
221
+ */
222
+ unflatten: boolean;
238
223
  lastTickTime: number;
239
224
  /** THE rAF owner for the group's draw loop. */
240
225
  readonly playback: RAFPlayback;
226
+ /** Native effects installed by the additive group-WAAPI fast lane.
227
+ * INTERNAL: lifecycle owns pause/resume/cancel; an empty array means the
228
+ * group is on its ordinary rAF compositor path. */
229
+ readonly _waAnimations: globalThis.Animation[];
230
+ /** True while the current play is delegated to native effects. The group
231
+ * still runs its shadow transport loop so events and completion retain the
232
+ * rAF contract, but it does not overwrite native compositor output. */
233
+ _waapiDelegated: boolean;
241
234
  resolvePromise: ((value: void | PromiseLike<void>) => void) | null;
242
- private _playingPromise;
243
- /** Pre-bound frame callback — allocated once to avoid a per-loop closure. */
244
- private _boundFrame;
235
+ /** The ONE held play promise the `finished` front-door exposes. INTERNAL
236
+ * (S.B5) — read/written by the transport free functions in `./lifecycle`. */
237
+ _playingPromise: Promise<void> | null;
238
+ /** Pre-bound frame callback — allocated once to avoid a per-loop closure.
239
+ * INTERNAL (S.B5) — read by `./lifecycle`'s `play`/`resume` loop start. */
240
+ _boundFrame: (t: number) => boolean | Promise<boolean>;
245
241
  /** Cached entries sorted by layer zIndex (see `getEntries`). */
246
242
  private _entries;
247
243
  private _entriesDirty;
248
244
  /** Long-lived composite buffer, cleared in place each frame (zero-alloc).
249
245
  * INTERNAL (R.W2) — read/written by `./compositor`. */
246
+ readonly _compositeState: CompositeState;
250
247
  _grouped: Record<string, unknown>;
251
248
  /** The compile-stable union of every child's contributed keys — what `_grouped`
252
249
  * is null-filled to each frame so the composite clears WITHOUT `delete` (F.W4
@@ -259,6 +256,13 @@ export declare class AnimationGroup<V extends Vars> {
259
256
  * `buildSoAPlans` in `./soa`, rebuilt ONLY on a structural change). INTERNAL
260
257
  * (R.W2) — read/written by `./compositor`. */
261
258
  _soaPlans: SoALayerPlan[] | null;
259
+ /**
260
+ * T.A6 — the group's PLAIN authored-shape projection (built from the
261
+ * composite `_grouped` leaf map when `unflatten` is set), rebuilt lazily on a
262
+ * structural change (the SAME `_groupedKeysDirty` seam that drops the SoA
263
+ * plan). Null until the first composited frame populates `_grouped`. INTERNAL
264
+ * — read/written by `./compositor`. */
265
+ _plainProj: PlainProjection | null;
262
266
  /** The long-lived SoA fold scratch — the contiguous numeric accumulate buffer,
263
267
  * sized to the WIDEST single-layer pair count once per structural change
264
268
  * (reused, zero per-frame alloc). INTERNAL (R.W2) — read by `./compositor`. */
@@ -301,35 +305,31 @@ export declare class AnimationGroup<V extends Vars> {
301
305
  private _frame;
302
306
  /** The post-advance render half of `_frame` — composite, or settle on done. */
303
307
  private _renderFrame;
304
- private _resolvePlay;
305
308
  /** The completion front-door (G.W13) — `await group.finished` resolves once
306
309
  * the in-flight composite play settles. Exposes the ONE held `_playingPromise`
307
310
  * (a settled/never-played group resolves immediately). */
308
311
  get finished(): Promise<void>;
309
312
  /** Start the group. Resolves when all children complete (or on stop/reset).
310
- * Re-entrant: an in-flight `play()` returns the same promise. Under
311
- * `respectReducedMotion` + an active query, snaps to final (no rAF loop). */
313
+ * Re-entrant, and PRM-aware — body in `./lifecycle` (S.B5 / a19 F1). */
312
314
  play(): Promise<void>;
313
- /** `prefers-reduced-motion` snap: rest = final, paint it, settle — the SAME
314
- * terminal path a completed play takes, motion elided. */
315
- private _playReducedMotion;
316
- /** Pause the group — idempotent. Pausing an already-paused (or not-yet-started)
317
- * group is a no-op, NOT a resume. Cancels the rAF loop + renders a final-frame
318
- * snapshot so the visual matches the pause moment. */
315
+ /** Pause the group — idempotent. Cancels the rAF loop + renders a final-frame
316
+ * snapshot so the visual matches the pause moment; records each child's
317
+ * jump-free `pausedTime`. Body in `./lifecycle` (S.B5). */
319
318
  pause(): this;
320
- /** Resume the group — idempotent. Unpauses every child DIRECTLY (not via
321
- * `child.resume()` — the group's draw loop owns the ticking) + re-registers it. */
319
+ /** Resume the group — idempotent. Unpauses every child DIRECTLY (the group's
320
+ * draw loop owns the ticking). Body in `./lifecycle` (S.B5). */
322
321
  resume(): this;
323
322
  /** The explicit flip: pauses if playing, resumes if paused. */
324
- toggle(): this;
323
+ toggle(): void;
325
324
  /** Pure state teardown — never paints. Releases every child (`managed = false`,
326
- * `child.settle()`) and clears the group flags, leaving the rest frame painted. */
325
+ * `child.settle()`) and clears the group flags. Body in `./lifecycle` (S.B5). */
327
326
  settle(): this;
328
327
  /** Explicit rewind: paint every started child back to its INITIAL frame, then
329
- * settle — the user-facing "return to start" (completion does NOT come here). */
328
+ * settle — the user-facing "return to start". Body in `./lifecycle` (S.B5). */
330
329
  reset(): this;
331
330
  /** Halt the draw loop, rewind to the initial frame (the transport-stop
332
- * semantic the demo's controls expect), and resolve any pending `play()`. */
331
+ * semantic the demo's controls expect), and resolve any pending `play()`.
332
+ * Body in `./lifecycle` (S.B5). */
333
333
  stop(): this;
334
334
  playing(): boolean;
335
335
  /** Set layer config for an animation by name or reference. Chainable. */
@@ -363,15 +363,37 @@ export declare interface AnimationGroupEntry<V extends Vars> {
363
363
  }
364
364
 
365
365
  /** Input — a bare Animation or one with a layer config. */
366
- declare type AnimationGroupInput<V extends Vars> = KeyframesAnimation<V> | {
366
+ export declare type AnimationGroupInput<V extends Vars> = KeyframesAnimation<V> | {
367
367
  animation: KeyframesAnimation<V>;
368
368
  layer?: Partial<AnimationLayerConfig>;
369
369
  };
370
370
 
371
- declare interface AnimationGroupObject<V extends Vars> {
371
+ export declare interface AnimationGroupObject<V extends Vars> {
372
372
  [key: string]: AnimationGroupEntry<V>;
373
373
  }
374
374
 
375
+ /**
376
+ * `internal/animation-id.ts` — the shared animation-identity helper (R.W2c).
377
+ *
378
+ * `getAnimationId` was a static member of `engine/animation.ts`, which made
379
+ * `group/group.ts` + `group/entries.ts` reach BACK into the engine zone at
380
+ * runtime purely to resolve a name — one of the two runtime edges that closed
381
+ * the engine↔group ring. It is pure string logic over the minimal identity
382
+ * shape (`{ name?, id }`) every animation already carries, so it belongs in the
383
+ * value.js-free leaf zone, depending on neither engine nor group.
384
+ *
385
+ * Structural by design: it takes `AnimationIdentity` (NOT `KeyframesAnimation`)
386
+ * so it carries ZERO edge to the engine class. The engine barrel re-exports it
387
+ * for the public `getAnimationId` surface; group/compile read it from here.
388
+ *
389
+ * value.js-free (LIGHT).
390
+ */
391
+ /** The minimal identity shape every animation carries — name (optional) + numeric id. */
392
+ declare interface AnimationIdentity {
393
+ name?: string | undefined;
394
+ id: number;
395
+ }
396
+
375
397
  export declare interface AnimationLayerConfig {
376
398
  /** Higher wins. Default: 0 */
377
399
  zIndex: number;
@@ -397,6 +419,8 @@ export declare interface AnimationLayerConfig {
397
419
  * blends by replacement, the least-surprising composite.
398
420
  */
399
421
  blendMode: BlendMode;
422
+ /** Canonical composition operation. Omission preserves `blendMode` callers. */
423
+ op?: CompositeOperator;
400
424
  /** Layer toggle. Default: true */
401
425
  enabled: boolean;
402
426
  /** Optional property whitelist — only these properties will be output from this layer */
@@ -543,26 +567,22 @@ export { AnimationRangeValue }
543
567
 
544
568
  export { AnimationTimelineValue }
545
569
 
546
- /** Attention animations — a one-shot nudge to draw the eye. */
547
- declare const attentionPresets: {
548
- readonly pulse: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
549
- readonly shake: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
550
- readonly bounce: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
551
- readonly flip: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
552
- readonly notificationBounce: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
553
- readonly springPop: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
554
- readonly springWobble: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
555
- };
570
+ declare const attentionPresets: Readonly<Record<string, PresetFactory>>;
556
571
 
557
- export declare type BlendMode = "replace" | "add" | "weighted";
572
+ /**
573
+ * Public layer vocabulary. `weighted` is retained as a compatibility alias;
574
+ * the canonical operation axis is {@link CompositeOperator}. `accumulate` is
575
+ * additive and maps to the same un-clamped fold as `add` at group scope.
576
+ */
577
+ export declare type BlendMode = CompositeOperator | "weighted";
558
578
 
559
- declare const blurIn: (options?: InputAnimationOptions) => CSSKeyframesAnimation< Vars>;
579
+ declare const blurIn: PresetFactory;
560
580
 
561
- declare const blurInOut: (options?: InputAnimationOptions) => CSSKeyframesAnimation< Vars>;
581
+ declare const blurInOut: PresetFactory;
562
582
 
563
- declare const blurOut: (options?: InputAnimationOptions) => CSSKeyframesAnimation< Vars>;
583
+ declare const blurOut: PresetFactory;
564
584
 
565
- declare const bounce: (options?: InputAnimationOptions) => CSSKeyframesAnimation< Vars>;
585
+ declare const bounce: PresetFactory;
566
586
 
567
587
  /** The compile result — the artifact + the CC-3 ineligibility report. */
568
588
  export declare interface CompiledCSS {
@@ -582,11 +602,35 @@ export declare interface CompiledCSS {
582
602
  refusals: CompileRefusal[];
583
603
  }
584
604
 
605
+ /** The entry compile result — the artifact + the refusal report. */
606
+ export declare interface CompiledEntryCSS {
607
+ /** The zero-runtime CSS: base rule + open rule + `@starting-style` per selector. */
608
+ css: string;
609
+ /** True iff EVERY selector compiled faithfully. */
610
+ eligible: boolean;
611
+ /** One refusal per selector that could not compile as a two-endpoint transition. */
612
+ refusals: EntryRefusal[];
613
+ }
614
+
615
+ /** The VT compile result — the artifact + the widened refusal report + the names. */
616
+ export declare interface CompiledViewTransitionCSS extends Omit<CompiledCSS, "refusals"> {
617
+ /** One refusal per role that could not compile faithfully (CC-3 ∪ the VT four). */
618
+ refusals: VTCompileRefusal[];
619
+ /** The `view-transition-name` set the consumer assigns to its elements. */
620
+ names: string[];
621
+ }
622
+
585
623
  /** The input shapes `compileToCSS` accepts. */
586
- export declare type CompileInput<V extends Vars = any> = AnimationGroup<V> | Sequence<V> | ReadonlyArray<KeyframesAnimation<V> | {
624
+ export declare type CompileInput<V extends Vars = Vars> = AnimationGroup<V> | Sequence<V> | ReadonlyArray<KeyframesAnimation<V> | {
587
625
  animation: KeyframesAnimation<V>;
588
626
  }>;
589
627
 
628
+ /**
629
+ * The reason a child could not compile faithfully. Generalizes
630
+ * `waapiIneligibleReason` to the CSS-compile domain — the trust surface. Each
631
+ * names the kf axis that exceeds pure CSS (the refusal is marketing for the
632
+ * moat). A refused child's JS playback is the only faithful path.
633
+ */
590
634
  /** Options for {@link compileToCSS}. */
591
635
  export declare interface CompileOptions {
592
636
  /**
@@ -616,21 +660,12 @@ export declare interface CompileOptions {
616
660
  printWidth?: number;
617
661
  }
618
662
 
619
- /** A single refusal — the child name + a typed reason + a human message. */
620
663
  export declare interface CompileRefusal {
621
- /** The compiled child's class/animation name. */
622
664
  name: string;
623
665
  reason: CompileRefusalReason;
624
- /** The verbatim message the demo's ineligibility UI shows (CC-4). */
625
666
  message: string;
626
667
  }
627
668
 
628
- /**
629
- * The reason a child could not compile faithfully. Generalizes
630
- * `waapiIneligibleReason` to the CSS-compile domain — the trust surface. Each
631
- * names the kf axis that exceeds pure CSS (the refusal is marketing for the
632
- * moat). A refused child's JS playback is the only faithful path.
633
- */
634
669
  export declare type CompileRefusalReason = "weighted-blend" | "custom-renderer" | "perceptual-oklab" | "computed-unit-drift";
635
670
 
636
671
  /**
@@ -645,7 +680,34 @@ export declare type CompileRefusalReason = "weighted-blend" | "custom-renderer"
645
680
  *
646
681
  * @returns `{ css, eligible, refusals }` — the artifact + the trust surface.
647
682
  */
648
- declare function compileToCSS<V extends Vars>(input: CompileInput<V>, opts?: CompileOptions): Promise<CompiledCSS>;
683
+ export declare function compileToCSS<V extends Vars>(input: CompileInput<V>, opts?: CompileOptions): Promise<CompiledCSS>;
684
+
685
+ /**
686
+ * THE ENTRY/EXIT EMITTER (C-22 revised, P2-2) — compile a selector-keyed
687
+ * entry/exit spec to zero-runtime `@starting-style` + `allow-discrete` CSS. Emits
688
+ * per selector: the base/closed rule (exit endpoint + `display:none` + the exit
689
+ * transition list), the open rule (enter endpoint + `display` + the entry list),
690
+ * and the `@starting-style` block (enter's FIRST frame). Asymmetric entry/exit
691
+ * timing rides the two lists; `linear()` springs ride verbatim; color endpoints
692
+ * canonicalize to `oklab()`. REFUSES with a NAMED reason (3 inherited + 6
693
+ * entry-specific) what cannot compile as a two-endpoint transition.
694
+ *
695
+ * @returns `{ css, eligible, refusals }`.
696
+ */
697
+ export declare function compileToEntry<V extends Vars>(spec: Record<string, EntryRoleSpec<V>>, opts?: EntryCompileOptions): Promise<CompiledEntryCSS>;
698
+
699
+ /**
700
+ * THE VIEW-TRANSITIONS EMITTER (SF-1/SF-2/SF-3) — compile a name-keyed role spec
701
+ * to a zero-runtime `::view-transition-*` CSS artifact. Emits per name: the
702
+ * old/new `@keyframes` + shorthand, the MANDATORY timing-only group override, an
703
+ * optional class-cohort rule, wrapped in `:active-view-transition-type(...)` when
704
+ * `types` are given; prepends the cross-doc preamble under `crossDocument`; and
705
+ * appends the PRM `animation: none` degrade by default. REFUSES with a NAMED
706
+ * reason (the CC-3 four ∪ the VT four) what cannot round-trip faithfully.
707
+ *
708
+ * @returns `{ css, eligible, refusals, names }` — the artifact + the trust surface.
709
+ */
710
+ export declare function compileToViewTransition<V extends Vars>(spec: Record<string, VTRoleSpec<V>>, opts?: ViewTransitionCompileOptions): Promise<CompiledViewTransitionCSS>;
649
711
 
650
712
  /**
651
713
  * The CSS `animation-composition` operator (K.W7). Distinct from
@@ -659,6 +721,18 @@ declare function compileToCSS<V extends Vars>(input: CompileInput<V>, opts?: Com
659
721
  */
660
722
  declare type CompositeOperator = "replace" | "add" | "accumulate";
661
723
 
724
+ /** Stable, compositor-owned leaves. Foreign frame arrays are copied, never retained. */
725
+ declare class CompositeState {
726
+ readonly values: Record<string, unknown>;
727
+ private keys;
728
+ private readonly epochs;
729
+ private epoch;
730
+ configure(keys: string[]): void;
731
+ clear(): void;
732
+ copy(key: string, incoming: unknown): unknown;
733
+ pruneInactive(): void;
734
+ }
735
+
662
736
  /**
663
737
  * Feature-detect (`"ScrollTimeline" in window` / `"ViewTimeline" in window`)
664
738
  * and construct a NATIVE `AnimationTimeline` for the additive WAAPI scroll
@@ -690,7 +764,21 @@ export declare function createNativeTimeline(spec: NativeTimelineSpec): Animatio
690
764
  * // spec-fed (value.js-independent):
691
765
  * const scene = createScrollScene({ range: { start: { offset: "0%" }, end: { offset: "100%" } } });
692
766
  */
693
- declare function createScrollScene(spec?: ScrollSceneOptions | CSSTimelineOptions): ScrollScene;
767
+ export declare function createScrollScene(spec?: ScrollSceneOptions | CSSTimelineOptions): ScrollScene;
768
+
769
+ /**
770
+ * Construct a `TriggerScene` from a parsed `AnimationTriggerValue` OR a full
771
+ * `CSSTimelineOptions` (the {@link parseScrollCSS} output — the `.trigger` field
772
+ * is used). The CSS-fed construction is the round-trip's driving half (parse →
773
+ * behavior); the value-fed construction is value.js-INDEPENDENT.
774
+ *
775
+ * @example
776
+ * // grammar → behavior (the round-trip):
777
+ * const opts = parseScrollCSS(stylesheet); // { …, trigger: { type: "repeat", range } }
778
+ * const scene = createTriggerScene(opts);
779
+ * scene.triggerProgress(0.5); // → "active"
780
+ */
781
+ export declare function createTriggerScene(spec?: AnimationTriggerValue | CSSTimelineOptions): TriggerScene;
694
782
 
695
783
  export declare class CSSKeyframesAnimation<V extends Vars> extends KeyframesAnimation<V> {
696
784
  /**
@@ -750,10 +838,9 @@ export declare class CSSKeyframesAnimation<V extends Vars> extends KeyframesAnim
750
838
  */
751
839
  scrollOptions?: CSSTimelineOptions;
752
840
  fromString(keyframes: string, transform?: TransformFunction<V>): this;
753
- transform(vars: V): void;
754
841
  }
755
842
 
756
- declare function CSSKeyframesToString<V extends Vars>(animation: KeyframesAnimation<V>, name?: string, printWidth?: number | undefined): Promise<string>;
843
+ export declare function CSSKeyframesToString<V extends Vars>(animation: KeyframesAnimation<V>, name?: string, printWidth?: number | undefined): Promise<string>;
757
844
 
758
845
  /**
759
846
  * Per-stop card serializer for the editor pane — ONE formatted keyframe
@@ -765,7 +852,7 @@ declare function CSSKeyframesToString<V extends Vars>(animation: KeyframesAnimat
765
852
  * last card simply did not exist) and read `frame.flatVars` (DOM-resolved,
766
853
  * interp-mutated) — both defects die with the unification.
767
854
  */
768
- declare const CSSKeyframesToStrings: <V extends Vars>(animation: KeyframesAnimation<V>) => Promise<string[]>;
855
+ export declare const CSSKeyframesToStrings: <V extends Vars>(animation: KeyframesAnimation<V>) => Promise<string[]>;
769
856
 
770
857
  export { CSSTimelineOptions }
771
858
 
@@ -836,16 +923,19 @@ export declare interface DecaySample {
836
923
  velocity: number;
837
924
  }
838
925
 
926
+ export declare const defaultLayerConfig: AnimationLayerConfig;
927
+
928
+ export declare const defaultOptions: AnimationOptions;
929
+
839
930
  /**
840
931
  * A structured parse/honoring diagnostic (K.W7 S4). Extends the value.js
841
- * `ParseDiagnostic` producer (the CONSUMED shape — `message`/`offset`/`line`/
932
+ * parser diagnostic shape (the consumed shape — `message`/`offset`/`line`/
842
933
  * `column`/`expected`/`input`) with a stable kf-side {@link DiagnosticCode} and
843
934
  * an optional `property` (the leaf a `COMPOSITION_FALLBACK` names). The
844
935
  * value.js half (`message`/`offset`/…) is `Partial` because the engine-internal
845
936
  * rows (EMPTY_PARSE, COMPOSITION_FALLBACK) are NOT byte-offset parse failures —
846
- * they carry a `message` + `code` only; a row sourced from the value.js
847
- * `OnParseError` producer carries the full positional record. NOT a kf-local
848
- * re-author of the producer: it CONSUMES `ParseDiagnostic`'s field shape and
937
+ * they carry a `message` + `code` only. Positional fields are retained for
938
+ * ingest callers that attach source locations.
849
939
  * widens it with the stable code (inv-16 published-only consumption holds).
850
940
  */
851
941
  declare interface Diagnostic extends Partial<ParseDiagnostic> {
@@ -864,14 +954,13 @@ declare interface Diagnostic extends Partial<ParseDiagnostic> {
864
954
  * lifted onto the structured field). The engine-internal rows
865
955
  * (`EMPTY_PARSE`/`UNKNOWN_TIMING_FN`) were J.W1-landed as typed throws; W7 lifts
866
956
  * them onto this field. `COMPOSITION_FALLBACK` is the K.W7 honesty row (the
867
- * non-numeric composite leaf's refusal). `PARSE_ERROR` carries the value.js
868
- * `OnParseError` producer's structured diagnostic verbatim. The CORS-skip /
957
+ * non-numeric composite leaf's refusal). The CORS-skip /
869
958
  * WAAPI-reason rows are AUTHORED here but POPULATED by K.W8 (which owns the
870
959
  * CSSOM walk that produces them).
871
960
  */
872
961
  declare type DiagnosticCode = "EMPTY_PARSE" | "UNKNOWN_TIMING_FN" | "COMPOSITION_FALLBACK" | "PARSE_ERROR" | "CORS_SKIP" | "WAAPI_INELIGIBLE" | "ADOPT_REFUSE" | "PROPERTY_REGISTER_REJECTED" | "CUSTOM_FN_ARG_DROP";
873
962
 
874
- declare const DIRECTIONS: readonly ["normal", "reverse", "alternate", "alternate-reverse"];
963
+ export declare const DIRECTIONS: readonly ["normal", "reverse", "alternate", "alternate-reverse"];
875
964
 
876
965
  /**
877
966
  * SO-1/SO-2 the DISPATCH (conservative-correct, with a queryable reason). The
@@ -888,7 +977,7 @@ declare const DIRECTIONS: readonly ["normal", "reverse", "alternate", "alternate
888
977
  * an ineligible animation — the reason string is the honesty surface (the
889
978
  * `waapiIneligibleReason` idiom). This ADDS a tier; it deletes no driver.
890
979
  */
891
- declare function dispatchScrollBackend<V extends Vars>(request: ScrollDispatchRequest<V>): ScrollDispatch;
980
+ export declare function dispatchScrollBackend<V extends Vars>(request: ScrollDispatchRequest<V>): ScrollDispatch;
892
981
 
893
982
  /**
894
983
  * Functional sugar over {@link Draggable}: construct, `attach(element)`,
@@ -1155,18 +1244,8 @@ export declare type DragSubscriber = (value: number, velocity: number) => void;
1155
1244
  * is the factory: `new DrawSVG(target).animation` is the control handle. The
1156
1245
  * factory is the canonical entry; this is a thin ergonomic wrapper.
1157
1246
  */
1158
- declare class DrawSVG<V extends Record<string, any> = any> {
1159
- /** The underlying stroke-dashoffset animation — the control handle. */
1160
- readonly animation: CSSKeyframesAnimation<V>;
1247
+ export declare class DrawSVG<V extends Vars = Vars> extends SVGAnimationHandle<V> {
1161
1248
  constructor(target: SVGDrawTarget, options?: DrawSVGOptions);
1162
- /** Start (or re-enter) the line-drawing play loop. */
1163
- play(): Promise<void>;
1164
- /** Pause the play loop, retaining the playhead. */
1165
- pause(): this;
1166
- /** Halt and rewind the play loop. */
1167
- stop(): this;
1168
- /** Resolve once the draw completes — the {@link Animation.finished} front-door. */
1169
- get finished(): Promise<void>;
1170
1249
  }
1171
1250
 
1172
1251
  export declare interface DrawSVGOptions extends Partial<InputAnimationOptions> {
@@ -1188,6 +1267,14 @@ export declare interface DrawSVGOptions extends Partial<InputAnimationOptions> {
1188
1267
  autoPlay?: boolean;
1189
1268
  }
1190
1269
 
1270
+ /**
1271
+ * Compose the parsed scroll CSS into its range scene, optional trigger scene,
1272
+ * and conservative native/JS backend decision. No declaration is reparsed:
1273
+ * the exact `CSSTimelineOptions` returned by `parseScrollCSS` is fanned out to
1274
+ * every lane, preserving parse→drive symmetry.
1275
+ */
1276
+ export declare function driveScrollCSS<V extends Vars = Vars>(options: CSSTimelineOptions, target?: ScrollDriveTarget<V>, driverOptions?: ScrollDriveOptions<V>): ScrollCSSDrive<V>;
1277
+
1191
1278
  /**
1192
1279
  * The typed easing value — a callable curve plus, when one exists, the CSS
1193
1280
  * easing string that reproduces it (e.g. a spring's `linear()` stops).
@@ -1251,29 +1338,44 @@ export declare interface ElementMorphOptions {
1251
1338
  transformOrigin?: string;
1252
1339
  }
1253
1340
 
1254
- /** Entrance animations — bring an element INTO view. */
1255
- declare const enterPresets: {
1256
- readonly fadeIn: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
1257
- readonly slideIn: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
1258
- readonly slideInLeft: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
1259
- readonly slideInRight: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
1260
- readonly rotateIn: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
1261
- readonly blurIn: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
1262
- readonly springScaleIn: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
1263
- readonly springSlideIn: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
1264
- readonly jumpUp: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
1265
- };
1341
+ declare const enterPresets: Readonly<Record<string, PresetFactory>>;
1266
1342
 
1267
- /** Exit animations — take an element OUT of view. */
1268
- declare const exitPresets: {
1269
- readonly fadeOut: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
1270
- readonly slideOutLeft: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
1271
- readonly slideOutRight: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
1272
- readonly blurOut: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
1273
- readonly warpLeft: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
1274
- readonly warpRight: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
1275
- readonly jumpDown: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
1276
- };
1343
+ /** Options for {@link compileToEntry}. */
1344
+ export declare interface EntryCompileOptions {
1345
+ /** The open-state selector suffix, concatenated onto the base selector. Default `".open"`. */
1346
+ openSelector?: ".open" | "[data-open]" | ":popover-open" | "[open]" | (string & {});
1347
+ /** The open `display` value (the base rule is always `display: none`). Default `"block"`. */
1348
+ display?: string;
1349
+ /**
1350
+ * Emit `overlay <dur> allow-discrete` on both lists (default `true`). Emitted
1351
+ * UNCONDITIONALLY — it materializes only for top-layer elements (popover/
1352
+ * dialog), inert-but-harmless elsewhere, so a caller rarely turns it off.
1353
+ */
1354
+ overlay?: boolean;
1355
+ /** Prettier print-width for the emitted artifact. Omit for the default. */
1356
+ printWidth?: number;
1357
+ }
1358
+
1359
+ /** A single entry refusal — the selector + a typed reason + a human message. */
1360
+ export declare interface EntryRefusal {
1361
+ /** The refused selector (spec key). */
1362
+ name: string;
1363
+ reason: EntryRefusalReason;
1364
+ message: string;
1365
+ }
1366
+
1367
+ /** The refusal taxonomy — 3 inherited + 6 entry-specific (P2-2.3). */
1368
+ export declare type EntryRefusalReason = "custom-renderer" | "weighted-blend" | "computed-unit-drift" | "entry-multi-keyframe" | "entry-iteration" | "entry-composition" | "entry-scroll-grammar" | "entry-color-space" | "entry-easing-twin";
1369
+
1370
+ /** The per-selector entry/exit role. Each animation is 2-stop (a transition endpoint pair). */
1371
+ export declare interface EntryRoleSpec<V extends Vars = Vars> {
1372
+ /** The ENTER animation: first frame → `@starting-style`, last frame → the open rule. */
1373
+ enter?: KeyframesAnimation<V>;
1374
+ /** The EXIT animation: last frame → the closed rule. Defaults to `enter` REVERSED. */
1375
+ exit?: KeyframesAnimation<V>;
1376
+ }
1377
+
1378
+ declare const exitPresets: Readonly<Record<string, PresetFactory>>;
1277
1379
 
1278
1380
  /**
1279
1381
  * `explain(css, opts?)` — the human/LLM-readable companion. Calls
@@ -1295,13 +1397,13 @@ declare const exitPresets: {
1295
1397
  * diagnostics:
1296
1398
  * – COMPOSITION_FALLBACK: …
1297
1399
  */
1298
- declare function explain(css: string, opts?: ValidateOptions): Promise<string>;
1400
+ export declare function explain(css: string, opts?: ValidateOptions): Promise<string>;
1299
1401
 
1300
- declare const fadeIn: (options?: InputAnimationOptions) => CSSKeyframesAnimation< Vars>;
1402
+ declare const fadeIn: PresetFactory;
1301
1403
 
1302
- declare const fadeOut: (options?: InputAnimationOptions) => CSSKeyframesAnimation< Vars>;
1404
+ declare const fadeOut: PresetFactory;
1303
1405
 
1304
- declare const FILL_MODES: readonly ["none", "forwards", "backwards", "both"];
1406
+ export declare const FILL_MODES: readonly ["none", "forwards", "backwards", "both"];
1305
1407
 
1306
1408
  /**
1307
1409
  * Animate a layout change on `element`: measure (First), run `mutate` (Last),
@@ -1326,21 +1428,7 @@ export declare interface FlipOptions {
1326
1428
  transformOrigin?: string;
1327
1429
  }
1328
1430
 
1329
- /**
1330
- * The card-flip attention preset.
1331
- *
1332
- * ── PKG-3 RENAME (L.W8 §S4 · audit W126). Formerly the preset `flip`. Renamed
1333
- * `flip` → `flipPreset` because the rolled-up `dist/keyframes.d.ts` placed this
1334
- * preset (reachable as `presets.flip`) and the LIGHT top-level `flip` export
1335
- * (the FLIP-layout helper in `flip.ts`) under the same name `flip`, so API
1336
- * Extractor renamed this one with a numeric suffix and re-exported it under the
1337
- * `flip` name inside the `AnimationPresets` namespace — a numeric-suffixed alias
1338
- * `proof:pkg3-clean` greps for. Naming the preset `flipPreset` (distinct from the
1339
- * light `flip`) clears the collision. BREAKING (5.0.0): the access path is now
1340
- * `presets.flipPreset`; the nested taxonomy key `attentionPresets.flip` is
1341
- * unchanged (a property name, not a top-level declaration — no collision).
1342
- */
1343
- declare const flipPreset: (options?: InputAnimationOptions) => CSSKeyframesAnimation< Vars>;
1431
+ declare const flipPreset: PresetFactory;
1344
1432
 
1345
1433
  /**
1346
1434
  * Shared-element FLIP: animate element `a` onto the rect of element `b`
@@ -1358,9 +1446,9 @@ declare const flipPreset: (options?: InputAnimationOptions) => CSSKeyframesAnima
1358
1446
  */
1359
1447
  export declare function flipShared(a: HTMLElement, b: HTMLElement, options?: FlipOptions): Promise<void>;
1360
1448
 
1361
- declare function formatCSSKeyframeString(keyframe: string): string;
1449
+ export declare function formatCSSKeyframeString(keyframe: string): string;
1362
1450
 
1363
- declare class FrameCompiler<V extends Vars = any> {
1451
+ declare class FrameCompiler<V extends Vars = Vars> {
1364
1452
  private readonly _options;
1365
1453
  templateFrames: TemplateAnimationFrame<V>[];
1366
1454
  parsedVars: ParsedVarMap[];
@@ -1446,7 +1534,7 @@ declare class FrameCompiler<V extends Vars = any> {
1446
1534
  * ONCE, set `stroke-dasharray` to that length (one solid full-length dash), and
1447
1535
  * sweep `stroke-dashoffset` from → to (default `0% → 100%` ⇒ offset `L → 0`,
1448
1536
  * the line draws in). Returns the constructed {@link CSSKeyframesAnimation} as
1449
- * the control handle (the `animate()` contract — `.play()` / `.pause()` /
1537
+ * the control handle (the control-handle contract — `.play()` / `.pause()` /
1450
1538
  * `.stop()` / `.finished`), consistent with the `from*` factory family.
1451
1539
  *
1452
1540
  * The returned animation passes the EXISTING WAAPI eligibility gate
@@ -1465,7 +1553,7 @@ declare class FrameCompiler<V extends Vars = any> {
1465
1553
  * // Draw a path stroke in over 2s:
1466
1554
  * fromDrawSVG(pathEl, { duration: 2000 });
1467
1555
  */
1468
- declare function fromDrawSVG<V extends Record<string, any> = any>(target: SVGDrawTarget, options?: DrawSVGOptions): CSSKeyframesAnimation<V>;
1556
+ export declare function fromDrawSVG<V extends Vars = Vars>(target: SVGDrawTarget, options?: DrawSVGOptions): CSSKeyframesAnimation<V>;
1469
1557
 
1470
1558
  /**
1471
1559
  * K1 — `fromLiveAnimations`: adopt every RUNNING CSS animation on the document
@@ -1480,14 +1568,14 @@ declare function fromDrawSVG<V extends Record<string, any> = any>(target: SVGDra
1480
1568
  * rule, running or not): `fromLiveAnimations` narrows to the names currently
1481
1569
  * RUNNING on the page — the animations a user actually sees in motion.
1482
1570
  */
1483
- declare const fromLiveAnimations: <V extends Vars = any>(target?: Document | Element, options?: IngestOptions) => IngestResult<V>;
1571
+ export declare const fromLiveAnimations: <V extends Vars = Vars>(target?: Document | Element, options?: IngestOptions) => IngestResult<V>;
1484
1572
 
1485
1573
  /**
1486
1574
  * Build an SVG path-shape morph: sample two `d` strings at `samples` uniform
1487
1575
  * arc-length steps each, pair the point sets, and interpolate the `(x, y)`
1488
1576
  * pairs from the `from`-polyline (`0%`) to the `to`-polyline (`100%`). Returns
1489
1577
  * the constructed {@link CSSKeyframesAnimation} as the control handle (the
1490
- * `animate()` contract — `.play()` / `.pause()` / `.stop()` / `.finished`),
1578
+ * control-handle contract — `.play()` / `.pause()` / `.stop()` / `.finished`),
1491
1579
  * consistent with the `from*` factory family.
1492
1580
  *
1493
1581
  * value.js's `PathGeometry` owns the geometry (the `d`-parse + arc-length
@@ -1517,13 +1605,13 @@ declare const fromLiveAnimations: <V extends Vars = any>(target?: Document | Ele
1517
1605
  * // morphing shape paints directly (no author-side reader needed on Chromium/
1518
1606
  * // Safari; `<path style="d: var(--morph-d)">` is the Firefox-lags fallback).
1519
1607
  */
1520
- declare function fromMorphSVG<V extends Record<string, any> = any>(from: string, to: string, options?: MorphSVGOptions): CSSKeyframesAnimation<V>;
1608
+ export declare function fromMorphSVG<V extends Vars = Vars>(from: string, to: string, options?: MorphSVGOptions): CSSKeyframesAnimation<V>;
1521
1609
 
1522
1610
  /**
1523
1611
  * Build a CSS-native path-motion animation: set the author `offset-path` (and
1524
1612
  * optional `offset-rotate`) on the target(s), and sweep `offset-distance` from
1525
1613
  * → to. Returns the constructed {@link CSSKeyframesAnimation} as the control
1526
- * handle (the `animate()` contract — `.play()` / `.pause()` / `.stop()` / the
1614
+ * handle (the control-handle contract — `.play()` / `.pause()` / `.stop()` / the
1527
1615
  * awaitable play promise), consistent with the `from*` factory family.
1528
1616
  *
1529
1617
  * The returned animation passes the EXISTING WAAPI eligibility gate
@@ -1541,7 +1629,7 @@ declare function fromMorphSVG<V extends Record<string, any> = any>(from: string,
1541
1629
  * duration: 2000,
1542
1630
  * });
1543
1631
  */
1544
- declare function fromMotionPath<V extends Record<string, any> = any>(target: HTMLElement | HTMLElement[], options: MotionPathOptions): CSSKeyframesAnimation<V>;
1632
+ export declare function fromMotionPath<V extends Vars = Vars>(target: HTMLElement | HTMLElement[], options: MotionPathOptions): CSSKeyframesAnimation<V>;
1545
1633
 
1546
1634
  /**
1547
1635
  * K1 — `fromStyleSheets`: the consumer-facing front door over
@@ -1556,15 +1644,40 @@ declare function fromMotionPath<V extends Record<string, any> = any>(target: HTM
1556
1644
  * pulse?.setTargets(el).play(); // re-drive the page's OWN animation
1557
1645
  * for (const d of diagnostics) console.warn(d.code, d.message); // honest skips
1558
1646
  */
1559
- declare const fromStyleSheets: <V extends Vars = any>(source?: Document | ShadowRoot | CSSStyleSheet[] | CSSStyleSheet, options?: IngestOptions) => IngestResult<V>;
1647
+ export declare const fromStyleSheets: <V extends Vars = Vars>(source?: Document | ShadowRoot | CSSStyleSheet[] | CSSStyleSheet, options?: IngestOptions) => IngestResult<V>;
1560
1648
 
1561
- declare const glow: (options?: InputAnimationOptions) => CSSKeyframesAnimation< Vars>;
1649
+ /**
1650
+ * Resolve a stable name for an animation reference: the explicit `name` when
1651
+ * set, else the numeric `id` stringified. A bare string passes through (the ONE
1652
+ * place a name-or-animation reference collapses to a name).
1653
+ */
1654
+ export declare const getAnimationId: (animation: AnimationIdentity | string) => string;
1655
+
1656
+ /**
1657
+ * Resolve a timing-function input to a callable `TimingFunction`.
1658
+ *
1659
+ * Accepts:
1660
+ * - a `TimingFunction` — returned as-is
1661
+ * - a named entry in `timingFunctions` (`ease-out-cubic`,
1662
+ * `easeOutCubic`, `linear`, etc.) — looked up in the registry
1663
+ * - a CSS `cubic-bezier(x1, y1, x2, y2)` literal string —
1664
+ * parsed to control points and resolved via `CSSCubicBezier`
1665
+ * - a CSS `steps(n[, position])` literal plus the `step-start` /
1666
+ * `step-end` keywords — resolved via `steppedEase`, so the full
1667
+ * CSS Easing Level 1 vocabulary round-trips through `fromString`
1668
+ * - `undefined` or a name/literal the registry can't find —
1669
+ * returns `undefined` so callers can decide (the option setters
1670
+ * throw a typed `AnimationOptionError`, fail-explicit)
1671
+ */
1672
+ export declare const getTimingFunction: (timingFunction: TimingFunction | TimingFunctionNames | string | undefined) => TimingFunction | undefined;
1562
1673
 
1563
- declare const gradientBackground: (options?: InputAnimationOptions) => CSSKeyframesAnimation< Vars>;
1674
+ declare const glow: PresetFactory;
1564
1675
 
1565
- declare const heartbeat: (options?: InputAnimationOptions) => CSSKeyframesAnimation< Vars>;
1676
+ declare const gradientBackground: PresetFactory;
1566
1677
 
1567
- declare const hover: (options?: InputAnimationOptions) => CSSKeyframesAnimation< Vars>;
1678
+ declare const heartbeat: PresetFactory;
1679
+
1680
+ declare const hover: PresetFactory;
1568
1681
 
1569
1682
  /**
1570
1683
  * One ingested animation + the diagnostics its reconstruction produced. The
@@ -1574,7 +1687,7 @@ declare const hover: (options?: InputAnimationOptions) => CSSKeyframesAnimation<
1574
1687
  * rows for THIS rule (a malformed body → `PARSE_ERROR`, etc.); the walk-level
1575
1688
  * rows (`CORS_SKIP`) ride {@link IngestResult.diagnostics}.
1576
1689
  */
1577
- export declare interface IngestedAnimation<V extends Vars = any> {
1690
+ export declare interface IngestedAnimation<V extends Vars = Vars> {
1578
1691
  /** The `@keyframes` identifier (CSSOM `CSSKeyframesRule.name`). */
1579
1692
  name: string;
1580
1693
  /** The reconstructed kf animation — replay-equal to the source CSS. */
@@ -1607,7 +1720,7 @@ export declare interface IngestOptions {
1607
1720
  * `animations` for the recovered objects and `diagnostics` for the citable
1608
1721
  * reasons the walk could not complete a step faithfully — NEVER a silent drop.
1609
1722
  */
1610
- export declare interface IngestResult<V extends Vars = any> {
1723
+ export declare interface IngestResult<V extends Vars = Vars> {
1611
1724
  /** Every `@keyframes` rule reconstructed, keyed by its CSS name. */
1612
1725
  animations: Map<string, IngestedAnimation<V>>;
1613
1726
  /**
@@ -1638,9 +1751,9 @@ export declare type InputAnimationOptions = Partial<{
1638
1751
 
1639
1752
  export { InterpolatedVar }
1640
1753
 
1641
- declare const jumpDown: (options?: InputAnimationOptions) => CSSKeyframesAnimation< Vars>;
1754
+ declare const jumpDown: PresetFactory;
1642
1755
 
1643
- declare const jumpUp: (options?: InputAnimationOptions) => CSSKeyframesAnimation< Vars>;
1756
+ declare const jumpUp: PresetFactory;
1644
1757
 
1645
1758
  /**
1646
1759
  * The core animation engine — keyframes, timing, interpolation, playback.
@@ -1650,7 +1763,7 @@ declare const jumpUp: (options?: InputAnimationOptions) => CSSKeyframesAnimation
1650
1763
  * leaking a suffixed collision alias into the d.ts. The legacy `Animation`
1651
1764
  * re-export alias was DROPPED in 5.0.0 (Q.WE1 — NO-LEGACY).
1652
1765
  */
1653
- export declare class KeyframesAnimation<V extends Vars = any> {
1766
+ export declare class KeyframesAnimation<V extends Vars = Vars> {
1654
1767
  id: number;
1655
1768
  name: string | undefined;
1656
1769
  superKey: string | undefined;
@@ -1674,10 +1787,22 @@ export declare class KeyframesAnimation<V extends Vars = any> {
1674
1787
  * the excised `PlaybackHost` interface; the `./playback` free functions now
1675
1788
  * own them via `this._playback` directly (no cast, no re-publication). */
1676
1789
  readonly _playback: PlaybackState;
1677
- startTime: number | undefined;
1678
- pausedTime: number;
1679
- t: number;
1680
- iteration: number;
1790
+ get startTime(): number | undefined;
1791
+ set startTime(v: number | undefined);
1792
+ get pausedTime(): number;
1793
+ set pausedTime(v: number);
1794
+ get t(): number;
1795
+ set t(v: number);
1796
+ get iteration(): number;
1797
+ set iteration(v: number);
1798
+ get started(): boolean;
1799
+ set started(v: boolean);
1800
+ get done(): boolean;
1801
+ set done(v: boolean);
1802
+ get reversed(): boolean;
1803
+ set reversed(v: boolean);
1804
+ get paused(): boolean;
1805
+ set paused(v: boolean);
1681
1806
  /** Structured parse/honoring diagnostics (K.W7 S4) — a FLAT additive array
1682
1807
  * of stable-coded {@link Diagnostic} rows surfaced from `resolveKeyframes` +
1683
1808
  * the engine's composition-fallback rows; empty on a clean parse. Every
@@ -1687,6 +1812,8 @@ export declare class KeyframesAnimation<V extends Vars = any> {
1687
1812
  * per-element numeric base `add`/`accumulate` accumulates ONTO; empty for a
1688
1813
  * pure-`replace` animation. INTERNAL — read by `./interpolate` (R.W2). */
1689
1814
  _compositionBase: Map<string, number[]>;
1815
+ /** Parsed underlying CSS pose, cached once per property for a capture run. */
1816
+ _compositionPose: Map<string, number[]>;
1690
1817
  /** Properties whose non-numeric composite already emitted its
1691
1818
  * `COMPOSITION_FALLBACK` row (once per property, not per frame). INTERNAL —
1692
1819
  * read by `./interpolate` (R.W2). */
@@ -1694,10 +1821,6 @@ export declare class KeyframesAnimation<V extends Vars = any> {
1694
1821
  /** True once a non-`replace` operator was seen — the hot path skips ALL
1695
1822
  * composition work when false. INTERNAL — read by `./interpolate` (R.W2). */
1696
1823
  _hasComposition: boolean;
1697
- started: boolean;
1698
- done: boolean;
1699
- reversed: boolean;
1700
- paused: boolean;
1701
1824
  /** True when an `AnimationGroup` drives this animation's `advanceTo()`/
1702
1825
  * `interpFrames()` from its own rAF loop. Standalone `.play()` throws when
1703
1826
  * set rather than racing the group. */
@@ -1804,14 +1927,13 @@ export declare class KeyframesAnimation<V extends Vars = any> {
1804
1927
  pause(): this;
1805
1928
  resume(): this;
1806
1929
  /** The explicit flip: pauses if playing, resumes if paused. */
1807
- toggle(): this;
1930
+ toggle(): void;
1808
1931
  stop(): void;
1809
1932
  playing(): boolean;
1810
1933
  get effectiveT(): number;
1811
1934
  settle(): this;
1812
1935
  reset(): this;
1813
1936
  setTargets(...targets: HTMLElement[]): this;
1814
- group(...animations: KeyframesAnimation<V>[]): AnimationGroup<V>;
1815
1937
  }
1816
1938
 
1817
1939
  /**
@@ -1853,20 +1975,25 @@ export declare interface KeyframesScrollTimelineOptions extends TimelineOptions
1853
1975
  */
1854
1976
  declare type LayerTransitionSpring = Partial<Omit<SpringProgressOptions, "initial" | "initialVelocity">>;
1855
1977
 
1978
+ /**
1979
+ * Resolve the heavy CSS-keyframe engine and its companion front doors.
1980
+ *
1981
+ * This is intentionally the same module used by the `./engine` package
1982
+ * subpath. Module evaluation and the promise are both memoized, so warming
1983
+ * and an eventual consumer share one in-flight load.
1984
+ */
1856
1985
  export declare const loadAnimationEngine: () => Promise<AnimationEngine>;
1857
1986
 
1858
- /** Looping animations — run continuously (`iterationCount: Infinity`). */
1859
- declare const loopPresets: {
1860
- readonly heartbeat: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
1861
- readonly glow: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
1862
- readonly spinner: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
1863
- readonly rainbowText: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
1864
- readonly skeletonLoading: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
1865
- readonly gradientBackground: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
1866
- readonly parallaxScroll: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
1867
- readonly hover: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
1868
- readonly typingCursor: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
1869
- };
1987
+ declare const loopPresets: Readonly<Record<string, PresetFactory>>;
1988
+
1989
+ declare interface ManagedStepper<Callback> extends Tickable {
1990
+ readonly _playback: RAFPlayback;
1991
+ _onFrame: Callback | undefined;
1992
+ readonly respectReducedMotion: ReducedMotionPolicy;
1993
+ readonly disposed?: boolean;
1994
+ snap(): void;
1995
+ _emitManagedFrame(): void;
1996
+ }
1870
1997
 
1871
1998
  export declare class ManualTimeline extends Timeline {
1872
1999
  private value;
@@ -1904,9 +2031,7 @@ export declare interface MorphRect {
1904
2031
  * that ALSO exposes {@link sampleD} — the morphed `d` string at a normalized
1905
2032
  * `t`, reassembled from the interpolated point coordinates.
1906
2033
  */
1907
- declare class MorphSVG<V extends Record<string, any> = any> {
1908
- /** The underlying coordinate-interpolating animation — the control handle. */
1909
- readonly animation: CSSKeyframesAnimation<V>;
2034
+ export declare class MorphSVG<V extends Vars = Vars> extends SVGAnimationHandle<V> {
1910
2035
  /** The uniform-sample count (point pairs = samples + 1). */
1911
2036
  readonly samples: number;
1912
2037
  constructor(from: string, to: string, options?: MorphSVGOptions);
@@ -1918,14 +2043,6 @@ declare class MorphSVG<V extends Record<string, any> = any> {
1918
2043
  * from BOTH endpoint polylines at any interior `t`.
1919
2044
  */
1920
2045
  sampleD(t: number): string;
1921
- /** Start (or re-enter) the morph play loop. */
1922
- play(): Promise<void>;
1923
- /** Pause the play loop, retaining the playhead. */
1924
- pause(): this;
1925
- /** Halt and rewind the play loop. */
1926
- stop(): this;
1927
- /** Resolve once the morph completes — the {@link Animation.finished} front-door. */
1928
- get finished(): Promise<void>;
1929
2046
  }
1930
2047
 
1931
2048
  export declare interface MorphSVGOptions extends Partial<InputAnimationOptions> {
@@ -1992,16 +2109,8 @@ declare interface MorphValues {
1992
2109
  * the factory: `new MotionPath(target, { path }).animation` is the control
1993
2110
  * handle. The factory is the canonical entry; this is a thin ergonomic wrapper.
1994
2111
  */
1995
- declare class MotionPath<V extends Record<string, any> = any> {
1996
- /** The underlying offset-distance animation — the control handle. */
1997
- readonly animation: CSSKeyframesAnimation<V>;
2112
+ export declare class MotionPath<V extends Vars = Vars> extends SVGAnimationHandle<V> {
1998
2113
  constructor(target: HTMLElement | HTMLElement[], options: MotionPathOptions);
1999
- /** Start (or re-enter) the path-motion play loop. */
2000
- play(): Promise<void>;
2001
- /** Pause the play loop, retaining the playhead. */
2002
- pause(): this;
2003
- /** Halt and rewind the play loop. */
2004
- stop(): this;
2005
2114
  }
2006
2115
 
2007
2116
  export declare interface MotionPathOptions extends Partial<InputAnimationOptions> {
@@ -2058,7 +2167,7 @@ export declare type NativeTimelineSpec = {
2058
2167
  inset?: string;
2059
2168
  };
2060
2169
 
2061
- declare const notificationBounce: (options?: InputAnimationOptions) => CSSKeyframesAnimation< Vars>;
2170
+ declare const notificationBounce: PresetFactory;
2062
2171
 
2063
2172
  /**
2064
2173
  * Zero-allocation numeric keyframe interpolator.
@@ -2073,6 +2182,8 @@ declare const notificationBounce: (options?: InputAnimationOptions) => CSSKeyfra
2073
2182
  * that resolves when the animation completes
2074
2183
  */
2075
2184
  export declare class NumericAnimation<T extends Record<string, number>> {
2185
+ /** Per-instance interpolation scratch: reentrant sibling `.at()` calls cannot clobber it. */
2186
+ private _out;
2076
2187
  private keyframes;
2077
2188
  private segments;
2078
2189
  private positions;
@@ -2253,10 +2364,16 @@ export declare interface OscillatorConfig {
2253
2364
  * phase clock, NOT a CSS value parser, so it carries ZERO static edge to
2254
2365
  * `@mkbabb/value.js` (proof:boundary gates it as a value.js-free LIGHT entry).
2255
2366
  *
2256
- * The consume signal is glass-ui BB's `W-EASING-PRIMITIVE` wave — its speedtest
2257
- * idle-breath and the demo's `KF-OSCILLATOR` scene read the phase to drive a
2258
- * looping motion. glass-ui co-schedules; kf owns the phase math
2259
- * (`docs/tranches/L/waves/L.W9.md §S5`).
2367
+ * ── C-13 (S.G2 S12, fold row 56) — INTENTIONAL PUBLIC LEAF ─────────────────────
2368
+ * `Oscillator` is an intentional public LIGHT leaf: the phase math IS the product,
2369
+ * consumed EXTERNALLY (glass-ui BB's `W-EASING-PRIMITIVE` wave — its speedtest
2370
+ * idle-breath reads the phase to drive a looping motion; glass-ui co-schedules, kf
2371
+ * owns the phase math — `docs/tranches/L/waves/L.W9.md §S5`). It carries NO internal
2372
+ * demo scene: the former header claim of a "demo `KF-OSCILLATOR` scene" was fictional
2373
+ * (no such scene exists on disk), so the C-13 decision STRIPPED the claim rather than
2374
+ * build a scene disproportionate to a periodic phase clock — a published primitive
2375
+ * that stands on its own beside `SmoothProgress`/`SpringProgress`, gated LIGHT by
2376
+ * proof:boundary, needs no in-repo demo to justify its export.
2260
2377
  *
2261
2378
  * NO rAF ownership — the caller drives the loop. `tick(dt)` advances the phase
2262
2379
  * by `frequency × dt` (with `dt` in SECONDS from the caller's `RAFPlayback`
@@ -2268,7 +2385,7 @@ export declare interface OscillatorConfig {
2268
2385
  /** The four canonical periodic waveforms the phase clock shapes a phase into. */
2269
2386
  export declare type OscillatorWaveform = "sine" | "triangle" | "square" | "sawtooth";
2270
2387
 
2271
- declare const parallaxScroll: (options?: InputAnimationOptions) => CSSKeyframesAnimation< Vars>;
2388
+ declare const parallaxScroll: PresetFactory;
2272
2389
 
2273
2390
  declare type ParsedVarMap = Record<string, ValueArray>;
2274
2391
 
@@ -2291,13 +2408,13 @@ declare type ParsedVarMap = Record<string, ValueArray>;
2291
2408
  * // range: { start: { phase: "entry", offset: "0%" },
2292
2409
  * // end: { phase: "cover", offset: "40%" } } }
2293
2410
  */
2294
- declare function parseScrollCSS(input: string | Stylesheet): CSSTimelineOptions;
2411
+ export declare function parseScrollCSS(input: string | Stylesheet): CSSTimelineOptions;
2295
2412
 
2296
2413
  /**
2297
2414
  * Parse an `animation-range` shorthand (`entry 0% cover 40%`) to its typed
2298
2415
  * `{ start, end? }` form — a pass-through to value.js's `parseAnimationRange`.
2299
2416
  */
2300
- declare function parseScrollRange(input: string): AnimationRangeValue;
2417
+ export declare function parseScrollRange(input: string): AnimationRangeValue;
2301
2418
 
2302
2419
  /**
2303
2420
  * Parse a single `animation-timeline` value (`scroll(root block)`, `view()`,
@@ -2305,7 +2422,7 @@ declare function parseScrollRange(input: string): AnimationRangeValue;
2305
2422
  * value.js's `parseAnimationTimeline` (kf consumes the VALUE grammar; it never
2306
2423
  * re-derives a local parser). Emits the value VERBATIM; resolves no defaults.
2307
2424
  */
2308
- declare function parseScrollTimeline(input: string): AnimationTimelineValue;
2425
+ export declare function parseScrollTimeline(input: string): AnimationTimelineValue;
2309
2426
 
2310
2427
  /**
2311
2428
  * SO-3 the `position:sticky` pin SYNTHESIS — EMIT the pin CSS (kf authors the
@@ -2318,17 +2435,41 @@ declare function parseScrollTimeline(input: string): AnimationTimelineValue;
2318
2435
  * pinCSS() // → "position: sticky; top: 0px;"
2319
2436
  * pinCSS({ top: 24 }) // → "position: sticky; top: 24px;"
2320
2437
  */
2321
- declare function pinCSS(opts?: {
2438
+ export declare function pinCSS(opts?: {
2322
2439
  top?: number;
2323
2440
  bottom?: number;
2324
2441
  }): string;
2325
2442
 
2443
+ declare interface PlainLeafWriter {
2444
+ /** The nested parent object the leaf lives on. */
2445
+ obj: Record<string, unknown>;
2446
+ /** The leaf's own (last dot-segment) key on `obj`. */
2447
+ key: string;
2448
+ /** The live `ValueUnit[]` whose `.value`(s) the interp stride mutates in place. */
2449
+ units: ValueUnit[];
2450
+ /**
2451
+ * True iff the leaf is a single unitless numeric unit → write `.value` (a
2452
+ * bare `number`, zero-alloc). False → a units/color/multi-component leaf,
2453
+ * projected to its authored STRING each refresh (the units/color residual).
2454
+ */
2455
+ numeric: boolean;
2456
+ }
2457
+
2458
+ declare interface PlainProjection {
2459
+ /** The nested plain object a custom `transform` consumes (`plainVars`). */
2460
+ root: Record<string, unknown>;
2461
+ /** The per-leaf refresh writers, in flat-key order. */
2462
+ writers: PlainLeafWriter[];
2463
+ }
2464
+
2326
2465
  /**
2327
- * The standalone-play machine's OWN run-state (R.W2 — replaces the
2328
- * `PlaybackHost` privacy-inversion interface). `KeyframesAnimation` composes
2329
- * ONE of these as a `readonly _playback` field, so the play-machine state has a
2330
- * single owner instead of being scattered as privates the class re-published
2331
- * through a cast:
2466
+ * `engine/playback-state.ts` — the `PlaybackState` run-state STORE, carved off
2467
+ * `engine/play-lifecycle.ts` at S.B2 on the STATE↔BEHAVIOR cohesion seam (the
2468
+ * play machine's free functions live in `./play-lifecycle`; the state they mutate lives
2469
+ * HERE). A value.js-free leaf struct: it owns the standalone-play machine's OWN
2470
+ * run-state so the state has a SINGLE owner instead of being scattered as
2471
+ * privates the class re-published through a cast (R.W2 dissolved the
2472
+ * `PlaybackHost` privacy-inversion).
2332
2473
  *
2333
2474
  * - `resolvePromise` — the standalone-loop deferred resolver (`playRAF`
2334
2475
  * arms it, `resolvePlay` fires it).
@@ -2340,6 +2481,20 @@ declare function pinCSS(opts?: {
2340
2481
  * re-bound per loop (the per-loop-closure-free idiom).
2341
2482
  * - `_interpOut` — the ONE hoisted interp buffer the play loop reuses
2342
2483
  * every frame (zero-alloc steady state).
2484
+ *
2485
+ * ── S.B2 (C-15) — PlaybackState is the SOLE STORAGE for the run-state FSM.
2486
+ * The eight transition fields (`started`/`done`/`paused`/`reversed`/`iteration`/
2487
+ * `t`/`startTime`/`pausedTime`) fold OFF the `KeyframesAnimation` class body and
2488
+ * live HERE as the single backing store; the class exposes them as accessor
2489
+ * delegates over `this._playback.*` (so the FSM stays a public, externally-written
2490
+ * surface — `group/`, `sequence/`, `ingest/`, `waapi/`, the tests, and the demo's
2491
+ * `contractAnim.t =` writes all keep working through the accessors). The
2492
+ * engine-INTERNAL hot path reads/writes `anim._playback.*` DIRECTLY (one extra
2493
+ * monomorphic load — a shape cost, not an allocation; proof:standalone-zero-alloc
2494
+ * / proof:interp-fastprops stay green). `managed` is deliberately NOT here — it is
2495
+ * loop-OWNERSHIP, not run-state, and never resets in `settle`. The literal
2496
+ * single-WRITER hard fold (a public `seek(ms)` verb + MIGRATION) is a future
2497
+ * BREAKING wave (§8-3), out of S scope.
2343
2498
  */
2344
2499
  declare class PlaybackState {
2345
2500
  resolvePromise: ((value: void | PromiseLike<void>) => void) | null;
@@ -2347,55 +2502,72 @@ declare class PlaybackState {
2347
2502
  _waAnimations: globalThis.Animation[];
2348
2503
  readonly _boundFrame: (t: number) => boolean | Promise<boolean>;
2349
2504
  readonly _interpOut: Record<string, unknown>;
2505
+ startTime: number | undefined;
2506
+ pausedTime: number;
2507
+ t: number;
2508
+ iteration: number;
2509
+ started: boolean;
2510
+ done: boolean;
2511
+ reversed: boolean;
2512
+ paused: boolean;
2350
2513
  constructor(frameCb: (t: number) => boolean | Promise<boolean>);
2351
2514
  }
2352
2515
 
2353
- /**
2354
- * The full preset taxonomy, grouped by intent. Each leaf is one of the
2355
- * existing exported factory functions — the taxonomy is a discovery index over
2356
- * the library, not a second copy of it.
2357
- */
2516
+ declare type PresetFactory = (options?: InputAnimationOptions) => CSSKeyframesAnimation<any>;
2517
+
2518
+ export declare namespace presets {
2519
+ export {
2520
+ fadeIn,
2521
+ fadeOut,
2522
+ pulse,
2523
+ shake,
2524
+ bounce,
2525
+ flipPreset,
2526
+ rotateIn,
2527
+ slideIn,
2528
+ heartbeat,
2529
+ glow,
2530
+ typewriter,
2531
+ rainbowText,
2532
+ warpLeft,
2533
+ warpRight,
2534
+ blurIn,
2535
+ blurOut,
2536
+ blurInOut,
2537
+ progressBar,
2538
+ skeletonLoading,
2539
+ textFocusBlur,
2540
+ gradientBackground,
2541
+ rotateScale,
2542
+ typingCursor,
2543
+ accordionExpand,
2544
+ notificationBounce,
2545
+ spinner,
2546
+ parallaxScroll,
2547
+ slideInLeft,
2548
+ slideOutLeft,
2549
+ slideInRight,
2550
+ slideOutRight,
2551
+ hover,
2552
+ jumpUp,
2553
+ jumpDown,
2554
+ springScaleIn,
2555
+ springSlideIn,
2556
+ springPop,
2557
+ springWobble,
2558
+ enterPresets,
2559
+ exitPresets,
2560
+ attentionPresets,
2561
+ loopPresets,
2562
+ presetTaxonomy
2563
+ }
2564
+ }
2565
+
2358
2566
  declare const presetTaxonomy: {
2359
- readonly enter: {
2360
- readonly fadeIn: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
2361
- readonly slideIn: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
2362
- readonly slideInLeft: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
2363
- readonly slideInRight: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
2364
- readonly rotateIn: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
2365
- readonly blurIn: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
2366
- readonly springScaleIn: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
2367
- readonly springSlideIn: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
2368
- readonly jumpUp: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
2369
- };
2370
- readonly exit: {
2371
- readonly fadeOut: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
2372
- readonly slideOutLeft: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
2373
- readonly slideOutRight: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
2374
- readonly blurOut: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
2375
- readonly warpLeft: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
2376
- readonly warpRight: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
2377
- readonly jumpDown: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
2378
- };
2379
- readonly attention: {
2380
- readonly pulse: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
2381
- readonly shake: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
2382
- readonly bounce: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
2383
- readonly flip: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
2384
- readonly notificationBounce: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
2385
- readonly springPop: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
2386
- readonly springWobble: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
2387
- };
2388
- readonly loop: {
2389
- readonly heartbeat: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
2390
- readonly glow: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
2391
- readonly spinner: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
2392
- readonly rainbowText: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
2393
- readonly skeletonLoading: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
2394
- readonly gradientBackground: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
2395
- readonly parallaxScroll: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
2396
- readonly hover: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
2397
- readonly typingCursor: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
2398
- };
2567
+ readonly enter: Readonly<Record<string, PresetFactory>>;
2568
+ readonly exit: Readonly<Record<string, PresetFactory>>;
2569
+ readonly attention: Readonly<Record<string, PresetFactory>>;
2570
+ readonly loop: Readonly<Record<string, PresetFactory>>;
2399
2571
  };
2400
2572
 
2401
2573
  /**
@@ -2407,9 +2579,9 @@ declare const presetTaxonomy: {
2407
2579
  */
2408
2580
  export declare function probeVelocity(probe: VelocityProbe): number;
2409
2581
 
2410
- declare const progressBar: (options?: InputAnimationOptions) => CSSKeyframesAnimation< Vars>;
2582
+ declare const progressBar: PresetFactory;
2411
2583
 
2412
- declare const pulse: (options?: InputAnimationOptions) => CSSKeyframesAnimation< Vars>;
2584
+ declare const pulse: PresetFactory;
2413
2585
 
2414
2586
  /**
2415
2587
  * THE managed rAF driver. Owns the rAF handle, start timestamp, dt clock,
@@ -2529,7 +2701,7 @@ export declare interface RAFPlaybackOptions {
2529
2701
  respectReducedMotion?: boolean | undefined;
2530
2702
  }
2531
2703
 
2532
- declare const rainbowText: (options?: InputAnimationOptions) => CSSKeyframesAnimation< Vars>;
2704
+ declare const rainbowText: PresetFactory;
2533
2705
 
2534
2706
  export { RangeBoundary }
2535
2707
 
@@ -2681,7 +2853,7 @@ export declare interface ResolvedRange {
2681
2853
  * `"ease-out-cubic"`, … — or a CSS `cubic-bezier()` literal) to a typed
2682
2854
  * {@link Easing}.
2683
2855
  *
2684
- * The lookup rides the dynamic boundary: `import("./compile/easing-registry")`
2856
+ * The lookup rides the dynamic boundary: `import("./compile/easing/easing-registry")`
2685
2857
  * loads ONLY the value.js-bearing timing-function registry (R.W1 narrow — not the
2686
2858
  * full engine chunk; lib-support F7) when a named easing is actually used, so a
2687
2859
  * light-only consumer that never calls this stays value.js-free.
@@ -2697,6 +2869,54 @@ export declare interface ResolvedRange {
2697
2869
  */
2698
2870
  export declare function resolveEasing(name: string): Promise<Easing>;
2699
2871
 
2872
+ /**
2873
+ * The injectable environment a Phase-1 resolution evaluates against. Every field
2874
+ * is OPTIONAL with an SSR-safe default ({@link defaultResolveEnv}); a test injects
2875
+ * a deterministic `supports`/`matchMedia` (jsdom carries neither faithfully) the
2876
+ * way `ScrollTimeline` is handed a `getScrollY`. The Phase-2 element-aware fields
2877
+ * (`customProps`/`siblingIndex`/`siblingCount`) are typed here so the second-pass
2878
+ * call site (post-`setTargets`) threads the SAME context shape — ONE rewriter,
2879
+ * two lifecycle points, not two divergent context types.
2880
+ */
2881
+ declare interface ResolveEnv {
2882
+ /** `CSS.supports(query)` — the `if(supports(...))` evaluator. SSR → `false`. */
2883
+ supports?: (query: string) => boolean;
2884
+ /** `matchMedia(query)` — the `if(media(...))` evaluator. SSR → `{matches:false}`. */
2885
+ matchMedia?: (query: string) => {
2886
+ matches: boolean;
2887
+ };
2888
+ /** Phase 2 — resolved custom-prop reader for `if(style(--p))` (element-aware). */
2889
+ customProps?: (name: string) => string | undefined;
2890
+ /** Phase 2 — 1-based DOM position for `sibling-index()` (element-aware). */
2891
+ siblingIndex?: () => number;
2892
+ /** Phase 2 — sibling total for `sibling-count()` (element-aware). */
2893
+ siblingCount?: () => number;
2894
+ }
2895
+
2896
+ /**
2897
+ * Normalise a CSS string (or pre-parsed Stylesheet) into the shape
2898
+ * `CSSKeyframesAnimation.fromString` consumes. The single entry
2899
+ * point: replaces the legacy `parseCSSKeyframes` /
2900
+ * `parseCSSStyleBlock` / `parseCSSAnimationKeyframes` fork.
2901
+ *
2902
+ * Bare keyframe-stop lists (`from { … } to { … }`) historically work even
2903
+ * though they are not valid top-level CSS. F.W8 decides that on the parsed
2904
+ * AST, not a regex sniff: parse the raw input; if it surfaced ZERO @keyframes
2905
+ * rules and the input is non-empty, re-wrap as `@keyframes anonymous { … }`
2906
+ * and re-parse. A leading `/* @keyframes … *​/` comment no longer defeats the
2907
+ * detection (the PX-1 comment-defeat bug — the regex `/@keyframes\b/` matched
2908
+ * inside a comment and skipped the wrap, yielding a silent empty parse).
2909
+ *
2910
+ * K.W8 SIBLING — `resolveLiveKeyframes` (`./ingest`) is the LIVE-CSSOM analogue
2911
+ * of this STRING normaliser: where `resolveKeyframes` normalises a string of
2912
+ * CSS, `resolveLiveKeyframes` walks `document.styleSheets`, serialises each
2913
+ * `CSSKeyframesRule` via `rule.cssText`, and feeds THAT text into THIS function
2914
+ * — the parser pointed FORWARD at the web the page already ships. It lives in a
2915
+ * separate module (`./ingest`) to avoid an `engine → adapter → ingest → engine`
2916
+ * import cycle; reach it via `loadAnimationEngine()` (the `index.ts` HEAVY edge).
2917
+ */
2918
+ export declare const resolveKeyframes: (input: string | Stylesheet, env?: ResolveEnv) => ResolvedKeyframes;
2919
+
2700
2920
  /**
2701
2921
  * K1 — `resolveLiveKeyframes`: the lowest-level CSSOM walk. Accepts a
2702
2922
  * `Document`, an explicit `CSSStyleSheet[]`, or a single `CSSStyleSheet`, and
@@ -2709,7 +2929,7 @@ export declare function resolveEasing(name: string): Promise<Easing>;
2709
2929
  * normalises a STRING of CSS, `resolveLiveKeyframes` normalises the LIVE CSSOM —
2710
2930
  * the parser pointed forward at the web the page already ships.
2711
2931
  */
2712
- declare const resolveLiveKeyframes: <V extends Vars = any>(source?: Document | ShadowRoot | CSSStyleSheet[] | CSSStyleSheet, options?: IngestOptions) => IngestResult<V>;
2932
+ export declare const resolveLiveKeyframes: <V extends Vars = Vars>(source?: Document | ShadowRoot | CSSStyleSheet[] | CSSStyleSheet, options?: IngestOptions) => IngestResult<V>;
2713
2933
 
2714
2934
  /**
2715
2935
  * Resolve a parsed `AnimationRangeValue` (or `undefined` → the whole [0,1]
@@ -2717,11 +2937,11 @@ declare const resolveLiveKeyframes: <V extends Vars = any>(source?: Document | S
2717
2937
  * division-of-labour law: value.js emits the phases/offsets verbatim, kf turns
2718
2938
  * them into the TIME mapping.
2719
2939
  */
2720
- declare function resolveRange(range: AnimationRangeValue | undefined): ResolvedRange;
2940
+ export declare function resolveRange(range: AnimationRangeValue | undefined): ResolvedRange;
2721
2941
 
2722
- declare const rotateIn: (options?: InputAnimationOptions) => CSSKeyframesAnimation< Vars>;
2942
+ declare const rotateIn: PresetFactory;
2723
2943
 
2724
- declare const rotateScale: (options?: InputAnimationOptions) => CSSKeyframesAnimation< Vars>;
2944
+ declare const rotateScale: PresetFactory;
2725
2945
 
2726
2946
  /**
2727
2947
  * The full SO-1 round-trip in one call: `parse → serialize`. Returns the typed
@@ -2729,14 +2949,22 @@ declare const rotateScale: (options?: InputAnimationOptions) => CSSKeyframesAnim
2729
2949
  * `proof:scroll-roundtrip` gate) can assert the replay-equality invariant
2730
2950
  * (`serialize(parse(s))` canonical-form-equal to `s`).
2731
2951
  */
2732
- declare function roundTripScrollCSS(input: string | Stylesheet): {
2952
+ export declare function roundTripScrollCSS(input: string | Stylesheet): {
2733
2953
  options: CSSTimelineOptions;
2734
2954
  declarations: ReturnType<typeof serializeScrollOptions>;
2735
2955
  };
2736
2956
 
2737
- /** Which backend a `ScrollScene` dispatched to, and why the JS path was chosen. */
2957
+ /** The backend selected for a scroll-driven animation. */
2738
2958
  export declare type ScrollBackend = "native" | "js";
2739
2959
 
2960
+ /** The single handle returned by `driveScrollCSS`. */
2961
+ export declare interface ScrollCSSDrive<V extends Vars = Vars> {
2962
+ readonly scene: ScrollScene;
2963
+ readonly trigger?: TriggerScene;
2964
+ readonly backend: ScrollBackend;
2965
+ readonly reason?: string;
2966
+ }
2967
+
2740
2968
  /** The dispatch verdict — which backend, and (for JS) the human-readable reason. */
2741
2969
  export declare type ScrollDispatch = {
2742
2970
  backend: "native";
@@ -2764,6 +2992,27 @@ export declare interface ScrollDispatchRequest<V extends Vars> {
2764
2992
  velocity?: boolean | undefined;
2765
2993
  }
2766
2994
 
2995
+ /** Options for the composed `driveScrollCSS` entry. */
2996
+ export declare interface ScrollDriveOptions<V extends Vars = Vars> extends Omit<ScrollSceneOptions, "range"> {
2997
+ /** Explicit native timeline mapping; otherwise it is derived from CSS. */
2998
+ nativeSpec?: NativeTimelineSpec;
2999
+ /** Animation to offer to the native eligibility/attachment lane. */
3000
+ animation?: KeyframesAnimation<V>;
3001
+ /** Force the JS backend for a velocity/non-DOM driver. */
3002
+ velocity?: boolean;
3003
+ /** Native scroll source when the parsed timeline is `scroll()`. */
3004
+ source?: Element | null;
3005
+ /** Native view subject when the parsed timeline is `view()`. */
3006
+ subject?: Element;
3007
+ /** Native timeline axis override (CSS's parsed axis remains the default). */
3008
+ axis?: ScrollTimelineAxis;
3009
+ /** Native view inset override. */
3010
+ inset?: string;
3011
+ }
3012
+
3013
+ /** A positional target may be an animation (for WAAPI) or a view subject. */
3014
+ export declare type ScrollDriveTarget<V extends Vars = Vars> = KeyframesAnimation<V> | Element | null | undefined;
3015
+
2767
3016
  /**
2768
3017
  * The kf `ScrollScene` JS DRIVER (SO-2). Drives an engine's progress from a raw
2769
3018
  * scroll position through the parsed `animation-range`, composing the SHIPPED
@@ -2896,7 +3145,7 @@ declare type ScrollTimelineAxis = "block" | "inline" | "x" | "y";
2896
3145
  * and drives them via `Animation.advanceTo`. See the module docstring for the
2897
3146
  * booked name + subsumption decision.
2898
3147
  */
2899
- export declare class Sequence<V extends Vars = any> implements SequencePlayContext<V> {
3148
+ export declare class Sequence<V extends Vars = Vars> implements SequencePlayContext<V> {
2900
3149
  /** Resolved segments, in insertion order. */
2901
3150
  readonly entries: SequenceEntry<V>[];
2902
3151
  /** Named positions on the master clock, registered via {@link label}. */
@@ -2916,13 +3165,14 @@ export declare class Sequence<V extends Vars = any> implements SequencePlayConte
2916
3165
  private cursor;
2917
3166
  /** Master clock (ms) of the current playhead. */
2918
3167
  _time: number;
2919
- private readonly respectReducedMotion;
3168
+ /* Excluded from this release type: respectReducedMotion */
2920
3169
  /** THE rAF owner for the sequence's play loop. */
2921
3170
  readonly playback: RAFPlayback;
2922
- private _boundFrame;
3171
+ /* Excluded from this release type: _boundFrame */
2923
3172
  _resolvePlay: (() => void) | null;
2924
3173
  _playOrigin: number | undefined;
2925
- private _playingPromise;
3174
+ /* Excluded from this release type: _playingPromise */
3175
+ private _duration;
2926
3176
  /**
2927
3177
  * The scalar playback rate — the single field that drives `timeScale`
2928
3178
  * and `reverse`. `_rate = 1` is real-time forward (the existing
@@ -3012,17 +3262,6 @@ export declare class Sequence<V extends Vars = any> implements SequencePlayConte
3012
3262
  * set on each `animation` directly before `.add`. Chainable.
3013
3263
  */
3014
3264
  setTargets(...targets: HTMLElement[]): this;
3015
- /**
3016
- * Drive the sequence over real time via `RAFPlayback`. Each child is driven
3017
- * through the published `Animation.advanceTo(absoluteClock)` map: its
3018
- * `startTime` is seeded to its resolved `at`, so `advanceTo(masterClock)`
3019
- * yields the child's local clock as `masterClock − at` exactly. Resolves
3020
- * when the master playhead passes the sequence `duration`.
3021
- *
3022
- * Re-entrant: a `play()` while one is in flight returns the same promise.
3023
- * Under `respectReducedMotion` + an active query, snaps to the rest frame
3024
- * in one paint (a terminal `seek(duration)`), no draw loop.
3025
- */
3026
3265
  /**
3027
3266
  * The completion front-door (G.W13) — `await sequence.finished` resolves
3028
3267
  * once the in-flight transport settles. Exposes the ONE held
@@ -3032,55 +3271,34 @@ export declare class Sequence<V extends Vars = any> implements SequencePlayConte
3032
3271
  * sequence resolves immediately.
3033
3272
  */
3034
3273
  get finished(): Promise<void>;
3274
+ /** Drive the sequence over real time via `RAFPlayback` — re-entrant, and
3275
+ * PRM-aware. Body in `./lifecycle` (S.B5). */
3035
3276
  play(): Promise<void>;
3036
3277
  _frame(clock: number): Promise<boolean>;
3037
- private _reanchor;
3038
- private _settle;
3039
- /** Halt the play loop where it stands and resolve any pending `play()`. */
3278
+ /** Halt the play loop where it stands and resolve any pending `play()`.
3279
+ * Body in `./lifecycle` (S.B5). */
3040
3280
  stop(): this;
3041
- /**
3042
- * Halt the play loop where it stands WITHOUT releasing the playhead — the
3043
- * managed-pause contract. The rAF loop stops; `_time` and the play promise
3044
- * are RETAINED (children stay `managed`, unlike `stop()`/`_settle`), so a
3045
- * later {@link resume} continues from exactly here. No-op when not playing
3046
- * or already paused. Chainable.
3047
- */
3281
+ /** Halt the play loop WITHOUT releasing the playhead — the managed-pause
3282
+ * contract (`_time` + the play promise are retained for `resume`). No-op when
3283
+ * not playing or already paused. Body in `./lifecycle` (S.B5). */
3048
3284
  pause(): this;
3049
- /**
3050
- * Resume a paused sequence — restart the rAF loop with the origin
3051
- * re-anchored so the FIRST resumed frame's master clock equals the
3052
- * retained `_time` (the no-forward-jump re-anchor, the same `RAFPlayback`/
3053
- * `AnimationGroup` managed-pause contract — `src/animation/CLAUDE.md`
3054
- * §Managed-child lifecycle). No-op when not paused. Chainable.
3055
- */
3285
+ /** Resume a paused sequence — restart the rAF loop with the origin
3286
+ * re-anchored so the first resumed frame's master clock equals the retained
3287
+ * `_time` (no forward jump). No-op when not paused. Body in `./lifecycle`. */
3056
3288
  resume(): this;
3057
- /**
3058
- * Set the scalar playback rate — slow-mo (`< 1`), real-time (`1`),
3059
- * fast-forward (`> 1`), or backward (`< 0`, the {@link reverse} form). The
3060
- * master clock is re-anchored so the playhead is CONTINUOUS at the
3061
- * rate-change instant (no jump) — the same re-anchor as {@link resume}.
3062
- * Takes effect immediately whether or not the sequence is playing.
3063
- * Chainable.
3064
- */
3289
+ /** Set the scalar playback rate — slow-mo (`< 1`), real-time (`1`),
3290
+ * fast-forward (`> 1`), or backward (`< 0`, the {@link reverse} form); the
3291
+ * master clock is re-anchored so the playhead is C⁰-continuous at the flip.
3292
+ * Body in `./lifecycle` (S.B5). */
3065
3293
  timeScale(n: number): this;
3066
- /**
3067
- * Flip the playback direction — the playhead walks backward from where it
3068
- * stands (a negative rate) or forward again, preserving `|rate|`. C⁰-
3069
- * continuous: the re-anchor keeps the playhead exactly where it is at the
3070
- * flip instant (locked by the F.W9 seek↔play parity gate). Chainable.
3071
- */
3294
+ /** Flip the playback direction — the playhead walks backward (negative rate)
3295
+ * or forward again, preserving `|rate|`, C⁰-continuous. Body in `./lifecycle`. */
3072
3296
  reverse(): this;
3073
- /**
3074
- * Set how many cycles `play()` runs before settling — `1` is single-play,
3075
- * `n` runs `n` cycles, `Infinity` loops forever (until `stop()`). The
3076
- * master clock folds modulo `duration` per cycle. Chainable.
3077
- */
3297
+ /** Set how many cycles `play()` runs before settling — `1` single-play, `n`
3298
+ * cycles, `Infinity` loops forever. Body in `./lifecycle` (S.B5). */
3078
3299
  repeat(count: number): this;
3079
- /**
3080
- * Toggle yoyo (ping-pong) — when on, odd cycles run reflected
3081
- * (`duration − phase`) so the playhead bounces back and forth across the
3082
- * `repeat` cycles. Chainable.
3083
- */
3300
+ /** Toggle yoyo (ping-pong) — odd cycles run reflected across the `repeat`
3301
+ * cycles. Body in `./lifecycle` (S.B5). */
3084
3302
  yoyo(on?: boolean): this;
3085
3303
  }
3086
3304
 
@@ -3236,26 +3454,26 @@ export declare type SequenceSubscriber = SequenceSegmentSubscriber | SequenceLab
3236
3454
  * a REFUSAL (a parse that drops a phase reds the gate), never a silent
3237
3455
  * approximation. See {@link roundTripScrollCSS}.
3238
3456
  */
3239
- declare function serializeScrollOptions(opts: CSSTimelineOptions): {
3457
+ export declare function serializeScrollOptions(opts: CSSTimelineOptions): {
3240
3458
  "animation-timeline"?: string;
3241
3459
  "animation-range"?: string;
3242
3460
  "timeline-scope"?: string;
3243
3461
  "animation-trigger"?: string;
3244
3462
  };
3245
3463
 
3246
- declare const shake: (options?: InputAnimationOptions) => CSSKeyframesAnimation< Vars>;
3464
+ declare const shake: PresetFactory;
3247
3465
 
3248
- declare const skeletonLoading: (options?: InputAnimationOptions) => CSSKeyframesAnimation< Vars>;
3466
+ declare const skeletonLoading: PresetFactory;
3249
3467
 
3250
- declare const slideIn: (options?: InputAnimationOptions) => CSSKeyframesAnimation< Vars>;
3468
+ declare const slideIn: PresetFactory;
3251
3469
 
3252
- declare const slideInLeft: (options?: InputAnimationOptions) => CSSKeyframesAnimation< Vars>;
3470
+ declare const slideInLeft: PresetFactory;
3253
3471
 
3254
- declare const slideInRight: (options?: InputAnimationOptions) => CSSKeyframesAnimation< Vars>;
3472
+ declare const slideInRight: PresetFactory;
3255
3473
 
3256
- declare const slideOutLeft: (options?: InputAnimationOptions) => CSSKeyframesAnimation< Vars>;
3474
+ declare const slideOutLeft: PresetFactory;
3257
3475
 
3258
- declare const slideOutRight: (options?: InputAnimationOptions) => CSSKeyframesAnimation< Vars>;
3476
+ declare const slideOutRight: PresetFactory;
3259
3477
 
3260
3478
  /** Per-frame callback for `.play()` mode. Receives the smoothed current value. */
3261
3479
  declare type SmoothFrameCallback = (value: number) => void;
@@ -3265,8 +3483,10 @@ export declare class SmoothProgress {
3265
3483
  private targetValue;
3266
3484
  private currentValue;
3267
3485
  private isSettled;
3268
- private _playback;
3269
- private _onFrame;
3486
+ readonly _playback: RAFPlayback;
3487
+ _onFrame: SmoothFrameCallback | undefined;
3488
+ get respectReducedMotion(): boolean;
3489
+ _emitManagedFrame(): void;
3270
3490
  constructor(options?: Partial<SmoothProgressOptions>);
3271
3491
  get target(): number;
3272
3492
  get current(): number;
@@ -3373,7 +3593,11 @@ declare interface SoALayerPlan {
3373
3593
  /** The pure-numeric carrier units the fold seeds the composite buffer from + writes back to. */
3374
3594
  carriers: ValueUnit<number>[];
3375
3595
  /** The incoming numeric units folded against each carrier (parallel to `carriers`). */
3376
- incomings: ValueUnit<number>[];
3596
+ incomingSlots: Array<{
3597
+ values: Record<string, unknown>;
3598
+ key: string;
3599
+ index: number;
3600
+ }>;
3377
3601
  /**
3378
3602
  * The keys this layer touches that the SoA fold does NOT cover — a non-array
3379
3603
  * carrier (first-touch of a key, or a scalar that a lower layer left
@@ -3383,11 +3607,128 @@ declare interface SoALayerPlan {
3383
3607
  * `add`/`weighted` blend stays byte-identical on the non-numeric tail. EMPTY
3384
3608
  * for the dominant all-numeric transform shape (every leaf a numeric
3385
3609
  * `ValueUnit[]`), so the whole `for..in` collapses to the SoA fold.
3386
- */
3387
- boxedKeys: string[];
3610
+ *
3611
+ * S.F5a S1 — a precomputed `Set`, built ONCE here at `buildSoAPlans`
3612
+ * (structural-change time). The compositor's boxed residual (`boxedBlendArm`)
3613
+ * takes it DIRECTLY as its `only` membership test — killing the per-frame
3614
+ * `new Set(only)` the boxed arm rebuilt every frame on the mixed-leaf shape
3615
+ * (the allocation is hoisted to plan-build time, `proof:zero-alloc`
3616
+ * mixed-leaf clause).
3617
+ */
3618
+ boxedKeys: Set<string>;
3619
+ }
3620
+
3621
+ declare const spinner: PresetFactory;
3622
+
3623
+ /** The split granularity. `"word"`/`"grapheme"` are layout-independent; `"line"`
3624
+ * is measure-or-refuse (SF-10). */
3625
+ export declare type SplitBy = "word" | "grapheme" | "line";
3626
+
3627
+ /**
3628
+ * Split a text element into an animatable fragment cohort + a ready stagger,
3629
+ * a11y-first. See {@link SplitTextOptions} / {@link SplitTextResult}.
3630
+ *
3631
+ * @param el — the text element to split (its `textContent` is the pre-split
3632
+ * string). For `by: "line"` it must be laid out, else the split refuses.
3633
+ * @param options — `{ by, a11y, role, locale, stagger, fragmentClass, onRefuse }`.
3634
+ * @throws {SplitTextRefusalError} `by: "line"` on an unmeasurable container.
3635
+ */
3636
+ export declare function splitText(el: HTMLElement, options?: SplitTextOptions): SplitTextResult;
3637
+
3638
+ export declare interface SplitTextOptions {
3639
+ /** Granularity — `"word"` (default), `"grapheme"`, or `"line"`. */
3640
+ by?: SplitBy;
3641
+ /**
3642
+ * A11Y-FIRST (default `true`): consolidate the accessible name onto the
3643
+ * container (`aria-label` = the pre-split string, over a naming role) and
3644
+ * mark every fragment `aria-hidden`, so AT reads the whole text as one label.
3645
+ * `false` leaves the split fragments in the a11y tree (opt-out for callers
3646
+ * that own their own AT handling).
3647
+ */
3648
+ a11y?: boolean;
3649
+ /**
3650
+ * The container role applied under `a11y` **only when the element has no
3651
+ * role of its own** — a plain `<div>`/`<span>` maps to `role="generic"`,
3652
+ * which PROHIBITS an author name, so a bare `aria-label` would not compute.
3653
+ * Defaults to `"img"` (the canonical "graphical composite whose text
3654
+ * alternative is …" role). Pass a naming-capable role to override.
3655
+ */
3656
+ role?: string;
3657
+ /** Locale for `Intl.Segmenter` (word/grapheme boundaries). */
3658
+ locale?: string;
3659
+ /** Options for the ready {@link StaggerFn} built over the cohort. */
3660
+ stagger?: StaggerOptions;
3661
+ /** Class set on each fragment element. Defaults to `"kf-split"`. */
3662
+ fragmentClass?: string;
3663
+ /**
3664
+ * `by: "line"` only — invoked when a resize-driven RE-measure cannot hold
3665
+ * (the container became unmeasurable or a container-query loop kept the line
3666
+ * map from converging). The observer disconnects and the last good map is
3667
+ * left in place; the caller decides whether to fall back to `by: "word"`.
3668
+ */
3669
+ onRefuse?: (error: SplitTextRefusalError) => void;
3670
+ }
3671
+
3672
+ /**
3673
+ * Thrown by `splitText(el, { by: "line" })` when the line measurement cannot be
3674
+ * taken (or held) — the typed half of the measure-or-refuse posture. Never
3675
+ * thrown for `by: "word"`/`"grapheme"` (those are layout-independent).
3676
+ */
3677
+ export declare class SplitTextRefusalError extends Error {
3678
+ readonly name = "SplitTextRefusalError";
3679
+ /** The machine-readable refusal cause. */
3680
+ readonly reason: SplitTextRefusalReason;
3681
+ constructor(reason: SplitTextRefusalReason, detail?: string);
3388
3682
  }
3389
3683
 
3390
- declare const spinner: (options?: InputAnimationOptions) => CSSKeyframesAnimation< Vars>;
3684
+ /**
3685
+ * The typed REFUSAL for `splitText`'s `by: "line"` measure-or-refuse posture
3686
+ * (SF-10 / S.F2 §S2). A line-split is layout-DEPENDENT: it groups fragments by
3687
+ * their measured `getClientRects` line box. When the container is not laid out
3688
+ * (detached, `display:none`, zero-width), or when a container-query/resize
3689
+ * feedback loop makes the measurement unable to converge, the ONLY honest
3690
+ * outcome is to REFUSE — never to emit a stale line map that silently goes wrong
3691
+ * on the next reflow (the exact failure mode this posture forbids).
3692
+ *
3693
+ * It is a distinct named error (mirroring `AnimationOptionError`) so a caller can
3694
+ * `instanceof`-narrow the refusal and fall back to `by: "word"` (layout-
3695
+ * independent) rather than swallow a generic throw.
3696
+ */
3697
+ /**
3698
+ * Why a `by: "line"` split refused to produce a line map:
3699
+ *
3700
+ * - `"unmeasurable"` — the container yielded no usable client rects at split
3701
+ * time (detached / `display:none` / zero-area). Lines cannot be grouped
3702
+ * without a laid-out box, and emitting an ungrouped (or all-collapsed) map
3703
+ * would be the silent-stale failure the posture forbids.
3704
+ * - `"unstable"` — a re-measure (driven by the resize observer) could not
3705
+ * hold: the container's own size depends on its content flow (a
3706
+ * container-query / intrinsic-size feedback loop), so the line grouping
3707
+ * oscillates and never converges. Refused rather than latched to a stale map.
3708
+ * - `"empty"` — there is no text to split into lines.
3709
+ */
3710
+ export declare type SplitTextRefusalReason = "unmeasurable" | "unstable" | "empty";
3711
+
3712
+ export declare interface SplitTextResult {
3713
+ /** The split container (the element passed in). */
3714
+ container: HTMLElement;
3715
+ /** The animatable fragment cohort, in source order. */
3716
+ fragments: HTMLElement[];
3717
+ /** The granularity that produced {@link fragments}. */
3718
+ by: SplitBy;
3719
+ /** The pre-split string — the container's consolidated accessible name. */
3720
+ text: string;
3721
+ /** A ready per-index delay generator over the cohort (the ready stagger). */
3722
+ stagger: StaggerFn;
3723
+ /** The materialized stagger delays, one per fragment (convenience). */
3724
+ delays: number[];
3725
+ /** Restore the container's original markup + a11y attributes. */
3726
+ revert(): void;
3727
+ /** `by: "line"` — re-measure + re-group the lines now (no-op otherwise). */
3728
+ remeasure(): void;
3729
+ /** Tear down the resize observer (does not revert the DOM). */
3730
+ dispose(): void;
3731
+ }
3391
3732
 
3392
3733
  /**
3393
3734
  * The modern, time-based spring surface — the idiom Motion now leads its
@@ -3471,8 +3812,31 @@ export declare interface SpringLinearStopsOptions {
3471
3812
  maxDuration?: number;
3472
3813
  }
3473
3814
 
3474
- /** Spring-eased attention "pop" — the bouncy spring drives the scale pulse. */
3475
- declare const springPop: (options?: InputAnimationOptions) => CSSKeyframesAnimation< Vars>;
3815
+ /**
3816
+ * The managed-playback surface a `SpringProgress` exposes to the colocated
3817
+ * `./managed-play` loop helpers (S.B5 — the progress.ts ceiling carve). Declared
3818
+ * HERE (the spring family's ring-break home) so `managed-play.ts` drives the
3819
+ * spring's rAF loop through a structural contract WITHOUT importing the
3820
+ * `SpringProgress` class module — keeping the progress→managed-play edge
3821
+ * one-directional (no import cycle under `tsPreCompilationDeps`). The stepper is
3822
+ * a `Tickable` (the `RAFPlayback.drive` loop steps `tickDt` until `settled`); the
3823
+ * helpers additionally read its current `(value, velocity)` for the per-frame
3824
+ * callback and route the reduced-motion snap through `snap()`.
3825
+ */
3826
+ declare interface SpringPlayback extends ManagedStepper<SpringFrameCallback> {
3827
+ /** True once `dispose()` has torn the spring down (a disposed spring never plays). */
3828
+ readonly disposed: boolean;
3829
+ /** Current position — passed to the per-frame callback. */
3830
+ readonly value: number;
3831
+ /** Current velocity — passed to the per-frame callback. */
3832
+ readonly velocity: number;
3833
+ /** The reduced-motion policy routing `play` to snap vs. run. */
3834
+ readonly respectReducedMotion: ReducedMotionPolicy;
3835
+ /** The reduced-motion snap (jump to target at zero velocity, settle, emit). */
3836
+ snap(): void;
3837
+ }
3838
+
3839
+ declare const springPop: PresetFactory;
3476
3840
 
3477
3841
  /**
3478
3842
  * Live-target spring tracker. Sibling of `SmoothProgress` for animations
@@ -3492,8 +3856,11 @@ declare const springPop: (options?: InputAnimationOptions) => CSSKeyframesAnimat
3492
3856
  *
3493
3857
  * API mirrors SwiftUI's `.spring(response:dampingFraction:)`.
3494
3858
  */
3495
- export declare class SpringProgress {
3859
+ export declare class SpringProgress implements SpringPlayback {
3496
3860
  private options;
3861
+ /** The reduced-motion policy — read by `./managed-play`'s `springPlay` to
3862
+ * route the snap vs. run branch (the {@link SpringPlayback} contract). */
3863
+ get respectReducedMotion(): ReducedMotionPolicy;
3497
3864
  private targetValue;
3498
3865
  private currentValue;
3499
3866
  private currentVelocity;
@@ -3520,10 +3887,11 @@ export declare class SpringProgress {
3520
3887
  private zeta;
3521
3888
  private omegaD;
3522
3889
  private subscribers;
3523
- private disposed;
3890
+ /* Excluded from this release type: disposed */
3524
3891
  private vectorLanes;
3525
- private _playback;
3526
- private _onFrame;
3892
+ readonly _playback: RAFPlayback;
3893
+ /* Excluded from this release type: _onFrame */
3894
+ /* Excluded from this release type: _emitManagedFrame */
3527
3895
  constructor(options?: Partial<SpringProgressOptions>);
3528
3896
  /**
3529
3897
  * Construct a spring from the modern time-based surface
@@ -3584,28 +3952,6 @@ export declare class SpringProgress {
3584
3952
  snap(): void;
3585
3953
  /** Reset position + velocity to a specified value (default 0). */
3586
3954
  reset(value?: number, velocity?: number): void;
3587
- /**
3588
- * Re-seat a MULTI-CHANNEL spring vector onto `targets` (one lane per
3589
- * element), under this spring's `(response, dampingFraction)`. The lanes
3590
- * ring identically to a scalar `SpringProgress` of the same config — the
3591
- * solver is the SAME closed form (`evaluateAt`) shared across channels — but
3592
- * step in ONE `tickVector(dt)` call into one `Float64Array` per tick, the
3593
- * dispatch/alloc amortization the W122 probe measured at 2.97–3.78× over K
3594
- * independent scalar instances (ADOPT @ K=8, `proof:spring-vector`).
3595
- *
3596
- * First call ARMS the lanes (lazily — a scalar-only spring never allocates
3597
- * the vector buffers, so the scalar hot path is unchanged). Subsequent calls
3598
- * re-seat each lane's origin from the lane's CURRENT `(x, v)`, so a mid-flight
3599
- * target change is continuous per channel — the vector analogue of the scalar
3600
- * `set target` re-seat. The lane count is fixed by the FIRST `setTargets`
3601
- * length; a later call with a different length throws (the buffers are
3602
- * stable references the consumer reads via {@link values}).
3603
- *
3604
- * `initialVelocity` (the scalar seed) does NOT carry into the lanes — a fresh
3605
- * vector starts each lane at rest unless re-seated from prior motion. The
3606
- * scalar `currentValue` / `target` are untouched; the two modes are
3607
- * independent surfaces on one solver.
3608
- */
3609
3955
  setTargets(targets: Float64Array): void;
3610
3956
  /**
3611
3957
  * The shared output lane buffer — the K channels' current values, written
@@ -3640,21 +3986,15 @@ export declare class SpringProgress {
3640
3986
  /** Tear down the spring. Cancels the rAF loop and clears subscribers. */
3641
3987
  dispose(): void;
3642
3988
  /**
3643
- * Start a managed rAF loop that calls `tick(dt)` each frame until
3644
- * `settled`, invoking `onFrame(value, velocity)` per tick. Idempotent
3645
- * — repeat calls re-bind the callback without spawning a second loop.
3646
- * Once settled the loop auto-stops; setting `target` while a callback
3647
- * is bound auto-resumes the loop without needing another `.play()`.
3989
+ * Start a managed rAF loop that calls `tickDt(dt)` each frame until
3990
+ * `settled`, invoking `onFrame(value, velocity)` per tick. Idempotent;
3991
+ * PRM-aware (snaps under an active reduced-motion query). Body in
3992
+ * `./managed-play` (S.B5).
3648
3993
  */
3649
3994
  play(onFrame?: SpringFrameCallback): void;
3650
- /** Cancel the managed rAF loop and detach the per-frame callback. */
3995
+ /** Cancel the managed rAF loop and detach the per-frame callback. Body in
3996
+ * `./managed-play` (S.B5). */
3651
3997
  stop(): void;
3652
- /**
3653
- * Arm the shared driver: it steps `tickDt(dt)` once per frame until
3654
- * `settled` flips true, emitting `onFrame` per step. Idempotent —
3655
- * the driver no-ops while already running.
3656
- */
3657
- private _startLoop;
3658
3998
  }
3659
3999
 
3660
4000
  /**
@@ -3714,14 +4054,9 @@ export declare interface SpringProgressOptions {
3714
4054
  respectReducedMotion: ReducedMotionPolicy;
3715
4055
  }
3716
4056
 
3717
- /**
3718
- * Spring-eased scale-in entrance — the canonical iOS "pop" with overshoot.
3719
- * Uses the bouncy spring (ζ 0.5) so the element settles past 1 before resting.
3720
- */
3721
- declare const springScaleIn: (options?: InputAnimationOptions) => CSSKeyframesAnimation< Vars>;
4057
+ declare const springScaleIn: PresetFactory;
3722
4058
 
3723
- /** Spring-eased slide-up entrance — the snappy spring (ζ 0.78). */
3724
- declare const springSlideIn: (options?: InputAnimationOptions) => CSSKeyframesAnimation< Vars>;
4059
+ declare const springSlideIn: PresetFactory;
3725
4060
 
3726
4061
  /** Subscriber callback. Receives current position + velocity each emission. */
3727
4062
  export declare type SpringSubscriber = (value: number, velocity: number) => void;
@@ -3785,8 +4120,7 @@ export declare interface SpringTimingFunctionOptions {
3785
4120
  maxDuration?: number;
3786
4121
  }
3787
4122
 
3788
- /** Spring-eased wobble — gentle spring (ζ 0.95) for a soft attention nudge. */
3789
- declare const springWobble: (options?: InputAnimationOptions) => CSSKeyframesAnimation< Vars>;
4123
+ declare const springWobble: PresetFactory;
3790
4124
 
3791
4125
  /**
3792
4126
  * Build a per-index delay generator. Pure construction-time — the returned
@@ -3798,14 +4132,20 @@ declare const springWobble: (options?: InputAnimationOptions) => CSSKeyframesAni
3798
4132
  export declare function stagger(countOrItems: number | ArrayLike<unknown>, options?: StaggerOptions): StaggerFn;
3799
4133
 
3800
4134
  /**
3801
- * A per-index delay function: `(i, total) => delayMs`. Carries a
3802
- * `.delays(total)` helper that materializes the whole distribution as an
3803
- * array — convenient when the count is known up front.
4135
+ * A per-index delay function: `(i, total?) => delayMs`. Carries a
4136
+ * `.delays(total?)` helper that materializes the whole distribution as an
4137
+ * array — convenient when the count is known up front. Both `total` args are
4138
+ * OPTIONAL: the implementation defaults them to the construction-time count
4139
+ * (`stagger(items, …)` / `stagger(count, …)`), so `fn(i)` and `fn.delays()`
4140
+ * are valid — the type must mirror that (it did not before S.B7, which is why
4141
+ * `test/stagger.test.ts`'s defaulting assertions RED'd once `test/` joined the
4142
+ * typecheck).
3804
4143
  */
3805
4144
  export declare interface StaggerFn {
3806
- (index: number, total: number): number;
3807
- /** Materialize the delays for a run of `total` indices. */
3808
- delays(total: number): number[];
4145
+ (index: number, total?: number): number;
4146
+ /** Materialize the delays for a run of `total` indices (defaults to the
4147
+ * construction-time count). */
4148
+ delays(total?: number): number[];
3809
4149
  }
3810
4150
 
3811
4151
  export declare interface StaggerOptions {
@@ -3839,6 +4179,32 @@ export declare interface StaggerOptions {
3839
4179
  */
3840
4180
  export declare type StaggerOrigin = "first" | "last" | "center" | "edges" | number;
3841
4181
 
4182
+ /**
4183
+ * Feature-detect native `animation-trigger` — Chrome 145+ ships it; nothing else
4184
+ * (yet) does. `CSS.supports` is the FEATURE probe (never a UA sniff — r5 / the
4185
+ * CE-1.0 precedent). Returns `false` where `CSS`/`CSS.supports` is absent (SSR,
4186
+ * jsdom) OR the property/keyword is unknown, so the caller keeps the kf driver.
4187
+ */
4188
+ export declare function supportsNativeTrigger(): boolean;
4189
+
4190
+ declare abstract class SVGAnimationHandle<V extends Vars = Vars> {
4191
+ readonly animation: CSSKeyframesAnimation<V>;
4192
+ /**
4193
+ * The underlying animation — the control handle. Set by the subclass through
4194
+ * `super(fromX(...))` (the `fromX` factory is the canonical construction).
4195
+ */
4196
+ constructor(animation: CSSKeyframesAnimation<V>);
4197
+ /** Start (or re-enter) the play loop. Resolves when the animation completes. */
4198
+ play(): Promise<void>;
4199
+ /** Pause the play loop, retaining the playhead. Chainable. */
4200
+ pause(): this;
4201
+ /** Halt and rewind the play loop. Chainable. */
4202
+ stop(): this;
4203
+ /** Resolve once the animation completes — the {@link Animation.finished}
4204
+ * completion front-door, uniform across every SVG handle. */
4205
+ get finished(): Promise<void>;
4206
+ }
4207
+
3842
4208
  /**
3843
4209
  * The minimal geometry contract DrawSVG needs: any SVG element that exposes
3844
4210
  * `getTotalLength()` (`SVGGeometryElement` — `<path>`, `<line>`, `<circle>`,
@@ -3868,7 +4234,33 @@ export declare interface TemplateAnimationFrame<V extends Vars> {
3868
4234
  composition?: CompositeOperator;
3869
4235
  }
3870
4236
 
3871
- declare const textFocusBlur: (options?: InputAnimationOptions) => CSSKeyframesAnimation< Vars>;
4237
+ declare const textFocusBlur: PresetFactory;
4238
+
4239
+ /**
4240
+ * The layout-INDEPENDENT segmenters for `splitText` — `by: "word"` and
4241
+ * `by: "grapheme"` (S.F2 §S2). Both ride the platform `Intl.Segmenter` (the SOTA
4242
+ * bar GSAP's 2025 rewrite set: grapheme-correct splitting handles emoji,
4243
+ * combining marks, and ZWJ sequences that a naive `text.split("")` shreds into
4244
+ * mojibake). A conservative regex fallback covers the (rare) no-`Intl.Segmenter`
4245
+ * runtime so the primitive never throws on capability alone.
4246
+ *
4247
+ * A segmenter emits an ordered run of {@link TextSegment}s: each is either a
4248
+ * `"unit"` (a word or grapheme — an animatable fragment) or `"space"` (inter-unit
4249
+ * whitespace — kept as a live text node so the browser can still wrap the run at
4250
+ * real break opportunities; the per-glyph inline-blocks otherwise defeat
4251
+ * `text-wrap: balance`, the AnimatedText X-5 lesson). Punctuation rides as its
4252
+ * own `"unit"` under word granularity (`isWordLike === false` but non-blank).
4253
+ */
4254
+ /** One ordered piece of the source text. */
4255
+ export declare interface TextSegment {
4256
+ /** The literal substring. */
4257
+ text: string;
4258
+ /**
4259
+ * `"unit"` — an animatable fragment (word or grapheme). `"space"` — inter-
4260
+ * unit whitespace, preserved as a text node (not wrapped, not in the cohort).
4261
+ */
4262
+ kind: "unit" | "space";
4263
+ }
3872
4264
 
3873
4265
  /**
3874
4266
  * A dt-driven stepper the {@link RAFPlayback.drive} loop can own:
@@ -3931,7 +4323,7 @@ export declare interface TimelineOptions {
3931
4323
  *
3932
4324
  * ```ts
3933
4325
  * const easing = await resolveEasing("ease-out-cubic");
3934
- * new ScrollTimeline({ easing });
4326
+ * new KeyframesScrollTimeline({ easing });
3935
4327
  * ```
3936
4328
  */
3937
4329
  easing?: TimingFunction | Easing | undefined;
@@ -3966,11 +4358,94 @@ export declare type TransformFunction<V extends Vars> = (v: V, t: number) => voi
3966
4358
  * one `_defaultTransform` (`usesDefaultRenderer`) — typed and
3967
4359
  * bind-proof, not a Symbol tag a wrapper would silently drop.
3968
4360
  */
3969
- declare function transformTargetsStyle<V extends Vars>(vars: V, targets: HTMLElement[], flat?: boolean): void;
4361
+ export declare function transformTargetsStyle<V extends Vars>(vars: V, targets: HTMLElement[], flat?: boolean): void;
3970
4362
 
3971
- declare const typewriter: (options?: InputAnimationOptions) => CSSKeyframesAnimation< Vars>;
4363
+ /** The play direction a trigger cycle runs — `alternate` flips it each entry. */
4364
+ export declare type TriggerDirection = "forward" | "backward";
3972
4365
 
3973
- declare const typingCursor: (options?: InputAnimationOptions) => CSSKeyframesAnimation< Vars>;
4366
+ /**
4367
+ * The kf `TriggerScene` — realizes a parsed `AnimationTriggerValue` as the
4368
+ * idle→active→done lifecycle over a raw scroll position. The caller drives the
4369
+ * loop (`triggerProgress(p)` per scroll event); the scene owns no rAF and no
4370
+ * DOM. The four `<trigger-type>`s differ ONLY in their crossing semantics:
4371
+ *
4372
+ * • `once` — fires once. `idle →enter→ active →exit→ done`; `done` LATCHES
4373
+ * (a re-entry never re-fires). The one-shot reveal.
4374
+ * • `repeat` — re-fires. `idle →enter→ active →exit→ idle` (RESET — the exit
4375
+ * returns to the pre-animation state); each re-entry re-plays
4376
+ * forward, `cycles` incrementing. Never permanently `done`.
4377
+ * • `alternate` — re-fires with a FLIPPED direction. `idle →enter→
4378
+ * active(forward) →exit→ done →enter→ active(backward) → …`;
4379
+ * `direction` alternates each entry (the backward semantics).
4380
+ * • `state` — the play state FOLLOWS presence. `inside ⇒ active`,
4381
+ * `outside ⇒ done` (after the first entry) — the playhead is
4382
+ * HELD across the boundary (pause/resume, NOT reset).
4383
+ *
4384
+ * The `playhead` (0..1) is the animation's own progress the consumer writes to
4385
+ * an engine; it advances with the within-range fraction while `active`. The gate
4386
+ * asserts the STATE sequence (scrub-based, C-10 — never a frame/ms threshold).
4387
+ */
4388
+ export declare class TriggerScene {
4389
+ /** The parsed `<trigger-type>` (CSS initial value is `once`). */
4390
+ readonly type: TriggerType;
4391
+ private readonly triggerRange;
4392
+ private _state;
4393
+ private _direction;
4394
+ private _playhead;
4395
+ private _cycles;
4396
+ private wasInside;
4397
+ private everEntered;
4398
+ constructor(trigger?: AnimationTriggerValue);
4399
+ /** The current lifecycle state. */
4400
+ get state(): TriggerState;
4401
+ /** The current play direction (`alternate` flips it each entry). */
4402
+ get direction(): TriggerDirection;
4403
+ /** The animation's own progress (0..1) — the engine-write the driver tracks. */
4404
+ get playhead(): number;
4405
+ /** How many times the trigger has fired (entered `active` from idle/done). */
4406
+ get cycles(): number;
4407
+ /** The resolved [start,end] scroll-extent fractions of the trigger range. */
4408
+ get range(): ResolvedRange;
4409
+ /**
4410
+ * True when the platform will run this trigger NATIVELY (Chrome 145+). The
4411
+ * dispatch is the caller's: `usesNative` ⇒ author a native `animation-trigger`
4412
+ * declaration; else drive THIS scene. Feature-detected, never UA-sniffed.
4413
+ */
4414
+ get usesNative(): boolean;
4415
+ /**
4416
+ * Drive the trigger from a raw scroll position `p ∈ [0,1]` (the caller
4417
+ * resolves the live scroller; kf maps it over the trigger range). Advances
4418
+ * the idle→active→done state machine per the `<trigger-type>` semantics and
4419
+ * returns the new state.
4420
+ */
4421
+ triggerProgress(p: number): TriggerState;
4422
+ /** Rewind the lifecycle to `idle` (re-arm a `once`/`state` scene). */
4423
+ reset(): void;
4424
+ /** `once` — fire once, then LATCH `done` (a re-entry never re-fires). */
4425
+ private stepOnce;
4426
+ /** `repeat` — RESET to `idle` on exit; each re-entry re-plays forward. */
4427
+ private stepRepeat;
4428
+ /** `alternate` — exit `done`; each re-entry FLIPS the play direction. */
4429
+ private stepAlternate;
4430
+ /** `state` — play state FOLLOWS presence; the playhead is HELD across exits. */
4431
+ private stepState;
4432
+ private directedPlayhead;
4433
+ }
4434
+
4435
+ /**
4436
+ * The three lifecycle states a `<single-animation-trigger>` traverses:
4437
+ * • `idle` — the timeline has not (yet) triggered the animation.
4438
+ * • `active` — the trigger fired; the animation is playing.
4439
+ * • `done` — the trigger cycle completed (latched for `once`; transient for
4440
+ * the re-firing types).
4441
+ * The canonical `once` lifecycle is `idle → active → done`; the other three
4442
+ * types are variations over the SAME vocabulary (§`triggerProgress`).
4443
+ */
4444
+ export declare type TriggerState = "idle" | "active" | "done";
4445
+
4446
+ declare const typewriter: PresetFactory;
4447
+
4448
+ declare const typingCursor: PresetFactory;
3974
4449
 
3975
4450
  /** Thrown when a string easing name cannot be resolved through the registry. */
3976
4451
  export declare class UnknownEasingError extends Error {
@@ -3993,7 +4468,7 @@ export declare class UnknownEasingError extends Error {
3993
4468
  * 3. `compileToCSS([anim], opts.compile)` → `{ eligible, refusals }`.
3994
4469
  * 4. `isWAAPIEligible(anim)` → the compositor-thread verdict.
3995
4470
  */
3996
- declare function validate(css: string, opts?: ValidateOptions): Promise<ValidateResult>;
4471
+ export declare function validate(css: string, opts?: ValidateOptions): Promise<ValidateResult>;
3997
4472
 
3998
4473
  /**
3999
4474
  * Options for {@link validate} / {@link explain}. A thin pass-through to the
@@ -4018,7 +4493,7 @@ export declare interface ValidateOptions {
4018
4493
  */
4019
4494
  export declare interface ValidateResult {
4020
4495
  /**
4021
- * True iff value.js parsed the CSS without a `PARSE_ERROR` diagnostic — the
4496
+ * True iff the adapter produced no `EMPTY_PARSE` diagnostic — the
4022
4497
  * block surfaced at least one recognized stylesheet item (a `@keyframes` /
4023
4498
  * `@property` / style rule). A spec-invalid keyframe `!important` declaration
4024
4499
  * is SILENTLY dropped at the AST by value.js (the L.W1 S1 reality) — that drop
@@ -4079,6 +4554,127 @@ export declare interface VelocityProbe {
4079
4554
  };
4080
4555
  }
4081
4556
 
4557
+ /**
4558
+ * Mutate the DOM behind a View Transition where the platform supports one, else
4559
+ * fall back to a `flipShared` shared-element morph (or a bare immediate
4560
+ * mutation). Returns a normalized {@link ViewTransitionHandle} whose `backend`
4561
+ * is queryable and whose promises never reject.
4562
+ *
4563
+ * @param mutate — the synchronous (or async) DOM mutation the transition captures.
4564
+ * @param opts — `{ types, duration, timingFunction, shared, fallback, respectReducedMotion }`.
4565
+ */
4566
+ export declare function viewTransition(mutate: ViewTransitionMutate, opts?: ViewTransitionOptions): ViewTransitionHandle;
4567
+
4568
+ /** Options for {@link compileToViewTransition}, extending {@link CompileOptions}. */
4569
+ export declare interface ViewTransitionCompileOptions extends CompileOptions {
4570
+ /** Typed same-doc VT — wraps every rule in `:root:active-view-transition-type(...)`. */
4571
+ types?: readonly string[];
4572
+ /** Prepend the cross-doc `@view-transition { navigation: auto }` preamble (opt-in). */
4573
+ crossDocument?: boolean;
4574
+ /** Append the PRM `animation: none` degrade block (default `true`). */
4575
+ reducedMotion?: boolean;
4576
+ /**
4577
+ * Emit the MANDATORY timing-only group pseudo (default `true`). Turning it
4578
+ * OFF ships the 250ms/ease temporal incoherence p09 observed — exposed only
4579
+ * so the born-RED gate's falsifiability clause can prove the omission REDs.
4580
+ */
4581
+ emitGroup?: boolean;
4582
+ }
4583
+
4584
+ /**
4585
+ * The normalized transition handle — settles cleanly whether a native View
4586
+ * Transition, a `flipShared` fallback, or a bare immediate mutation ran. Its
4587
+ * promises NEVER reject (a skipped/aborted transition settles), so a consumer's
4588
+ * `await handle.finished` is always safe.
4589
+ */
4590
+ export declare interface ViewTransitionHandle {
4591
+ /** Resolves once the transition's pseudo-tree is ready to animate (or immediately off-platform). */
4592
+ ready: Promise<void>;
4593
+ /** Resolves when the transition (or fallback) has fully settled. Never rejects. */
4594
+ finished: Promise<void>;
4595
+ /** Resolves once the DOM mutation callback has run. */
4596
+ updateCallbackDone: Promise<void>;
4597
+ /** Skip the running transition to its end state (no-op off-platform). */
4598
+ skip(): void;
4599
+ /**
4600
+ * Which path actually ran — set SYNCHRONOUSLY at dispatch so a caller can
4601
+ * branch immediately: `"view-transition"` (native), `"flip"` (the
4602
+ * `flipShared` fallback), `"immediate"` (bare mutate — no platform, PRM snap,
4603
+ * or `fallback: "none"`).
4604
+ */
4605
+ backend: "view-transition" | "flip" | "immediate";
4606
+ }
4607
+
4608
+ /** A synchronous DOM mutation the transition captures (may be async). */
4609
+ export declare type ViewTransitionMutate = () => void | Promise<void>;
4610
+
4611
+ /** Options for {@link viewTransition}. */
4612
+ export declare interface ViewTransitionOptions {
4613
+ /**
4614
+ * Typed same-doc View Transitions (`:active-view-transition-type(...)`).
4615
+ * Passed through the platform's typed-`update` object overload where the
4616
+ * browser supports it; DROPPED (the untyped cross-fade) where it does not —
4617
+ * conservative-correct, never a throw.
4618
+ */
4619
+ types?: readonly string[];
4620
+ /** Fallback play duration (ms) — the `flipShared` pairs. Defaults to `300`. */
4621
+ duration?: number;
4622
+ /**
4623
+ * Fallback easing — a callable {@link TimingFunction} or typed {@link Easing}
4624
+ * (e.g. `springTimingFunction(...)` for a springy fallback).
4625
+ */
4626
+ timingFunction?: TimingFunction | Easing;
4627
+ /**
4628
+ * The shared-element pairs the `flip` fallback morphs (`[from, to]`). When
4629
+ * the platform has no `startViewTransition`, each `from` morphs onto its
4630
+ * `to`'s rect via `flipShared` — the zero-peer visual-equivalence letter.
4631
+ */
4632
+ shared?: ReadonlyArray<readonly [HTMLElement, HTMLElement]>;
4633
+ /**
4634
+ * The fallback strategy when View Transitions are unavailable: `"flip"`
4635
+ * (default — run the `shared` pairs; a bare mutate when none are given),
4636
+ * `"none"` (mutate immediately, no motion), or a custom async runner.
4637
+ */
4638
+ fallback?: "flip" | "none" | ((mutate: ViewTransitionMutate) => Promise<void>);
4639
+ /**
4640
+ * Route through the ONE `withReducedMotion` gate (default `true`): under an
4641
+ * active `prefers-reduced-motion: reduce` the transition SNAPS — `mutate()`
4642
+ * runs directly and the handle settles (`backend: "immediate"`), skipping
4643
+ * `startViewTransition` entirely. The platform's own degrade, WCAG-aligned.
4644
+ */
4645
+ respectReducedMotion?: boolean;
4646
+ }
4647
+
4648
+ /** A VT refusal — the CC-3 shape widened to the VT reason union. */
4649
+ export declare interface VTCompileRefusal extends Omit<CompileRefusal, "reason"> {
4650
+ reason: VTCompileRefusalReason;
4651
+ }
4652
+
4653
+ /** The four VT refusals atop the inherited CC-3 {@link CompileRefusalReason}. */
4654
+ export declare type VTCompileRefusalReason = CompileRefusalReason | "vt-scroll-grammar" | "vt-element-scoped-computed" | "vt-snapshot-inapplicable" | "vt-name-collision";
4655
+
4656
+ /**
4657
+ * The per-name VT role mapping (SF-1). A group/Sequence has NO old/new axis (the
4658
+ * group-as-primary reading is REJECTED), so the emitter's PRIMARY input is this
4659
+ * name-keyed role spec. `old`/`new` are the same `KeyframesAnimation`s
4660
+ * `compileToCSS` walks; `group` is timing-only by design.
4661
+ */
4662
+ export declare type VTRoleSpec<V extends Vars = Vars> = {
4663
+ /** The outgoing snapshot's animation (`::view-transition-old(name)`). */
4664
+ old?: KeyframesAnimation<V>;
4665
+ /** The incoming snapshot's animation (`::view-transition-new(name)`). */
4666
+ new?: KeyframesAnimation<V>;
4667
+ /**
4668
+ * Timing-only for the group pseudo: duration + easing onto the UA geometry
4669
+ * morph (NEVER `animation-name`). A `KeyframesAnimation` contributes its
4670
+ * `options.duration`/`timingFunction`; a bare `{ duration, timingFunction }`
4671
+ * gives them directly. Omit → derived from `new ?? old` (the coherent default).
4672
+ */
4673
+ group?: Pick<AnimationOptions, "duration" | "timingFunction"> | KeyframesAnimation<V>;
4674
+ /** A `view-transition-class` cohort name — uniform cohorts ride one rule. */
4675
+ class?: string;
4676
+ };
4677
+
4082
4678
  declare type WAAPIEligibility = {
4083
4679
  eligible: true;
4084
4680
  } | {
@@ -4086,19 +4682,12 @@ declare type WAAPIEligibility = {
4086
4682
  reason: string;
4087
4683
  };
4088
4684
 
4089
- /**
4090
- * Fire-and-forget idle-warmer for the heavy engine. Pre-flights
4091
- * `loadAnimationEngine()`'s dynamic import during idle (`requestIdleCallback` /
4092
- * `visibilitychange` / `mouseenter`) so the first `new CSSKeyframesAnimation()`
4093
- * on a cold page resolves against an already-in-flight Promise. Idempotent and
4094
- * value.js-free — it shares the one memoized `_enginePromise` (no double import)
4095
- * and names only a dynamic import (`proof:boundary` stays green).
4096
- */
4685
+ /** Start loading the heavy surface without awaiting it. */
4097
4686
  export declare const warmEngine: () => void;
4098
4687
 
4099
- declare const warpLeft: (options?: InputAnimationOptions) => CSSKeyframesAnimation< Vars>;
4688
+ declare const warpLeft: PresetFactory;
4100
4689
 
4101
- declare const warpRight: (options?: InputAnimationOptions) => CSSKeyframesAnimation< Vars>;
4690
+ declare const warpRight: PresetFactory;
4102
4691
 
4103
4692
  /**
4104
4693
  * Map a phase ∈ ℝ to its waveform value ∈ [-1, 1]. Pure — the phase is reduced
@@ -4144,6 +4733,6 @@ export declare interface WeightStepper {
4144
4733
  * fallback per the Baseline browser policy. SSR-safe: resolves immediately
4145
4734
  * off-DOM (no event loop to yield to that matters for a headless render).
4146
4735
  */
4147
- declare function yieldToMain(): Promise<void>;
4736
+ export declare function yieldToMain(): Promise<void>;
4148
4737
 
4149
4738
  export { }