@mkbabb/keyframes.js 5.0.0 → 5.1.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.
Files changed (39) hide show
  1. package/README.md +31 -216
  2. package/dist/animation-BGyzfzBq.js +947 -0
  3. package/dist/compile-CcSUwM8R.js +276 -0
  4. package/dist/{waapi-D0ssxKy1.js → delegation-DWwr4IXr.js} +115 -93
  5. package/dist/{draw-svg-Dat9mHgi.js → draw-svg-GURj9nin.js} +17 -13
  6. package/dist/easing-registry-DHV2-5gA.js +27 -0
  7. package/dist/easing-registry-y1p9McFy.js +2 -0
  8. package/dist/engine/index.d.ts +2873 -0
  9. package/dist/engine/index.js +17 -0
  10. package/dist/engine-DEVgCTUy.js +156 -0
  11. package/dist/engine-DrBtsKaf.js +4 -0
  12. package/dist/{format-BUgCTjmr.js → format-C-Gi9r7L.js} +4 -4
  13. package/dist/{scroll-grammar-B4kPvGh5.js → grammar-BLucehC4.js} +1 -1
  14. package/dist/group-vJcsHKN9.js +360 -0
  15. package/dist/{ingest-CU-kdYcM.js → ingest-S5hUe20K.js} +62 -56
  16. package/dist/keyframes.d.ts +475 -942
  17. package/dist/keyframes.js +196 -137
  18. package/dist/morph-svg-BToeumw5.js +89 -0
  19. package/dist/{motion-path-C0OHqcA3.js → motion-path-pQVbamWT.js} +16 -12
  20. package/dist/parse-flatten-DRMHFytp.js +2 -0
  21. package/dist/parse-flatten-ZZUSEQEL.js +63 -0
  22. package/dist/{animations-CZxf0rep.js → presets-BG2Fczzq.js} +124 -73
  23. package/dist/{scheduler-7eIr_q1g.js → scheduler-CUtVnuoU.js} +1 -1
  24. package/dist/{scroll-scene-DQxhxn9I.js → scroll-CxpYFO4u.js} +50 -46
  25. package/dist/sequence-C_DCiOIQ.js +708 -0
  26. package/dist/validate-DDeGnvSt.js +39 -0
  27. package/package.json +12 -3
  28. package/dist/animate-CTWr6K7j.js +0 -26
  29. package/dist/compile-YRJRdpKF.js +0 -251
  30. package/dist/decay-BvNmFk51.js +0 -25
  31. package/dist/engine-DQcb7CLW.js +0 -1349
  32. package/dist/errors-W8zkvPw4.js +0 -21
  33. package/dist/morph-svg-83uyYxoW.js +0 -84
  34. package/dist/rolldown-runtime-Dy4uBu1J.js +0 -11
  35. package/dist/sequence-cBr7thU8.js +0 -198
  36. package/dist/springTimingFunction-D26gPkAy.js +0 -63
  37. package/dist/timeline-vY3eD3Ax.js +0 -430
  38. package/dist/utils-BPRImVl5.js +0 -100
  39. package/dist/validate-B1pE-Y_T.js +0 -35
@@ -0,0 +1,2873 @@
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>;
19
+
20
+ /**
21
+ * The outcome of an {@link adoptRunning} takeover. `animation` is the kf object
22
+ * now driving the element (seeded at the captured playhead, already playing);
23
+ * `currentTime` is the playhead (ms) the takeover seeded from; `diagnostics`
24
+ * carries any honest refusal (no running animation by that name → a row, never
25
+ * a silent no-op).
26
+ */
27
+ export declare interface AdoptResult<V extends Vars = any> {
28
+ /** The kf animation now driving the element (null on a refused adopt). */
29
+ animation: CSSKeyframesAnimation<V> | null;
30
+ /** The captured native `currentTime` (ms) the kf playhead seeded from. */
31
+ currentTime: number;
32
+ /** Honest refusal rows (e.g. no running animation by that name). */
33
+ diagnostics: Diagnostic[];
34
+ }
35
+
36
+ /**
37
+ * K2 — `adoptRunning`: the mid-flight TEMPORAL takeover. Given a live element
38
+ * with a running CSS animation, seamlessly hand control to the kf engine:
39
+ *
40
+ * 1. `el.getAnimations()` → find the running `CSSAnimation` matching
41
+ * `{ animationName }`; read its `currentTime` + `playState`.
42
+ * 2. Reconstruct the kf `CSSKeyframesAnimation` from the CSSOM `@keyframes`
43
+ * RULE (via {@link resolveLiveKeyframes} — the AUTHORED form, preserving
44
+ * `var()`/`cqw`/oklab), NOT from `getAnimations().getKeyframes()` (which has
45
+ * px-resolved `var()`/`cqw` and RGB-baked oklab — the very axes kf preserves).
46
+ * 3. Seed the kf animation at the captured `currentTime` (the continuity seed
47
+ * — NOT seed-at-zero, which flashes the element to its 0% state).
48
+ * 4. Commit the current frame inline (the commit-on-ADOPT), then `cancel()`
49
+ * the native animation, so there is no leaked-precedence flash (the inverse
50
+ * of `playWAAPI`'s commit-on-finish discipline — `waapi.ts`).
51
+ * 5. Hand control to the kf engine (the kf animation plays from `currentTime`).
52
+ *
53
+ * NAMED `adoptRunning` to disambiguate from `engine.ts`'s `adoptCompiled`
54
+ * (compiled-state internal adopt — untouched; HARDENING-5 HAZARD-1).
55
+ *
56
+ * @example
57
+ * const { adoptRunning } = await loadAnimationEngine();
58
+ * // el is mid-flight on `.spin { animation: spin 2s linear infinite }`
59
+ * const { animation } = await adoptRunning(el, { animationName: "spin" });
60
+ * // the kf object now drives `el` from the exact playhead — no visible seam.
61
+ * animation?.pause(); // ...now scrub / spring-ify / re-color it.
62
+ */
63
+ export declare const adoptRunning: <V extends Vars = any>(el: Element, options: AdoptRunningOptions) => Promise<AdoptResult<V>>;
64
+
65
+ /** Options for {@link adoptRunning}. */
66
+ export declare interface AdoptRunningOptions extends IngestOptions {
67
+ /**
68
+ * The running CSS animation's name to adopt. REQUIRED — an element may host
69
+ * several CSS animations, and the takeover must name exactly one (the
70
+ * `@keyframes` rule to reconstruct + the `getAnimations()` entry to read the
71
+ * playhead from).
72
+ */
73
+ animationName: string;
74
+ /**
75
+ * Commit the native animation's current computed frame inline before
76
+ * cancelling it (the commit-on-ADOPT, the inverse of `playWAAPI`'s
77
+ * commit-on-finish), so there is no flash between the native paint and the
78
+ * kf paint. Default true; set false only when the caller commits itself.
79
+ */
80
+ commit?: boolean;
81
+ }
82
+
83
+ declare interface AnimationFrame<V extends Vars> {
84
+ id: number;
85
+ start: ValueUnit;
86
+ ixs: {
87
+ start: number;
88
+ stop: number;
89
+ };
90
+ time: {
91
+ start: number;
92
+ stop: number;
93
+ };
94
+ flatVars: V;
95
+ vars: V;
96
+ interpVars: {
97
+ [arg: string]: Array<InterpolatedVar<V>>;
98
+ };
99
+ /**
100
+ * Pre-flattened array of all interpolation variables across all properties.
101
+ * Built once during parse() to avoid Object.values().flat() allocation
102
+ * on every interpFrames() call in the hot path.
103
+ */
104
+ allInterpVars: Array<InterpolatedVar<V>>;
105
+ /**
106
+ * Q.WB3 S2 — the precomputed numeric SoA fold layout (built ONCE at `parse`
107
+ * over the stable `allInterpVars` set). `processFrame` folds the numeric subset
108
+ * through ONE `lerpArray` over the packed `Float64Array` buffers and strides
109
+ * the result back into the numeric leaves' `.value` slots; the boxed residual
110
+ * (color/computed/mixed) keeps the per-element `lerpValue`. Absent (undefined)
111
+ * for a frame with no numeric ivs, or before `parse` runs — `processFrame`
112
+ * falls back to the all-boxed walk. Bit-identical to the boxed path.
113
+ */
114
+ _numericPlan?: NumericFoldPlan<V>;
115
+ transform: TransformFunction<V>;
116
+ timingFunction: Easing;
117
+ /**
118
+ * The compiled per-segment `animation-composition` operator (K.W7). A
119
+ * segment runs from a START stop to a STOP stop; the operator is the STOP
120
+ * stop's declared composition (CSS attaches `animation-composition` to the
121
+ * keyframe being composited TOWARD). `replace` (or omission) is the legacy
122
+ * behaviour — the apply writes the lerped value verbatim. `add` accumulates
123
+ * the lerped numeric leaf onto the captured underlying base (un-clamped,
124
+ * element-wise — the same leaf `group.ts`'s `add` layer runs); `accumulate`
125
+ * is repeat-aware (iteration N stacks onto N−1's end). A non-numeric leaf
126
+ * (color, `<custom-ident>`) `replace`-falls-back AND emits a
127
+ * `COMPOSITION_FALLBACK` diagnostic — never a silent wrong pixel.
128
+ */
129
+ composition?: CompositeOperator;
130
+ }
131
+
132
+ export declare class AnimationGroup<V extends Vars> {
133
+ animations: AnimationGroupObject<V>;
134
+ /** The group's composite transform. Defaults to a real no-op at the FIELD
135
+ * (I.W0 S3) — a childless/pre-`parse()` group composites nothing instead of
136
+ * throwing; the constructor overrides it with the first child's transform. */
137
+ transform: TransformFunction<V>;
138
+ superKey: string | undefined;
139
+ paused: boolean;
140
+ started: boolean;
141
+ done: boolean;
142
+ /** When true, `play()` honors `prefers-reduced-motion: reduce` by snapping
143
+ * every child to its final frame in one composite, no rAF loop. Default false. */
144
+ respectReducedMotion: boolean;
145
+ /** Children-per-slice before `advanceTo()` yields to the main thread; larger
146
+ * groups batch with a `scheduler.yield()` between slices (INP relief). */
147
+ static readonly YIELD_BATCH = 32;
148
+ singleTarget: boolean;
149
+ lastTickTime: number;
150
+ /** THE rAF owner for the group's draw loop. */
151
+ readonly playback: RAFPlayback;
152
+ resolvePromise: ((value: void | PromiseLike<void>) => void) | null;
153
+ private _playingPromise;
154
+ /** Pre-bound frame callback — allocated once to avoid a per-loop closure. */
155
+ private _boundFrame;
156
+ /** Cached entries sorted by layer zIndex (see `getEntries`). */
157
+ private _entries;
158
+ private _entriesDirty;
159
+ /** Long-lived composite buffer, cleared in place each frame (zero-alloc).
160
+ * INTERNAL (R.W2) — read/written by `./compositor`. */
161
+ _grouped: Record<string, unknown>;
162
+ /** The compile-stable union of every child's contributed keys — what `_grouped`
163
+ * is null-filled to each frame so the composite clears WITHOUT `delete` (F.W4
164
+ * S2; fold in `./entries`). INTERNAL (R.W2) — the `./compositor` null-fill. */
165
+ _groupedKeys: string[];
166
+ _groupedKeysDirty: boolean;
167
+ /** P.W2 — the SoA composite layout for the `add`/`weighted` blend arms (the
168
+ * validated 3.7×, bit-identical): one {@link SoALayerPlan} per entry, the FLAT
169
+ * pure-numeric pairs hoisted into a {@link Float64Array} fold (built by
170
+ * `buildSoAPlans` in `./soa`, rebuilt ONLY on a structural change). INTERNAL
171
+ * (R.W2) — read/written by `./compositor`. */
172
+ _soaPlans: SoALayerPlan[] | null;
173
+ /** The long-lived SoA fold scratch — the contiguous numeric accumulate buffer,
174
+ * sized to the WIDEST single-layer pair count once per structural change
175
+ * (reused, zero per-frame alloc). INTERNAL (R.W2) — read by `./compositor`. */
176
+ _compositeBuf: Float64Array | null;
177
+ /** K.W11 PHYS-C — true iff ANY layer carries a `weightSpring`; when false (the
178
+ * universal case) `advanceTo` skips the per-frame spring scan (ZERO new work).
179
+ * INTERNAL (R.W2) — set by `./layer-api`'s `transitionLayer`. */
180
+ _hasLayerSprings: boolean;
181
+ constructor(...inputs: (KeyframesAnimation<V> | AnimationGroupInput<V>)[]);
182
+ /** The animation entries sorted by layer zIndex, dirty-flag cached — rebuilt
183
+ * only on a mutation. INTERNAL (R.W2): read by the colocated `./compositor`/
184
+ * `./entries`/`./scheduler`/`./springs` helpers + all hot-path iteration. */
185
+ getEntries(): AnimationGroupEntry<V>[];
186
+ /** Mark entries cache stale. Called at all mutation boundaries.
187
+ * INTERNAL (R.W2) — also called by `./layer-api`. */
188
+ invalidateEntries(): void;
189
+ setSuperKey(superKey: string): this;
190
+ setTargets(...targets: HTMLElement[]): this;
191
+ /** Composite all values into a single grouped transform (single-target,
192
+ * per-frame). R.W2 — `private` (lib-group F8): the PUBLIC single-frame-paint
193
+ * entry is `render(t?)`; the body lives in `./compositor`. Thin delegate. */
194
+ private transformFramesGrouped;
195
+ /**
196
+ * Render the current composition as a static frame — the public entry for
197
+ * state mutated outside the rAF loop (scrubbing, restore, pause snapshots).
198
+ * R.W2 — the silent `|| performance.now()` fabrication is EXCISED: the
199
+ * composite `t` is non-normative for a pure-CSS transform, so a caller with a
200
+ * clock passes it (`render(now)`); a scrub uses the group's REAL `lastTickTime`
201
+ * (0 for a never-ticked group), never a fabricated wall-clock.
202
+ */
203
+ render(t?: number): void;
204
+ /** Set a child's current time without touching its siblings (updates
205
+ * `pausedTime` for a jump-free resume). Chainable; `render()` to reflect it. */
206
+ setChildTime(nameOrAnim: string | KeyframesAnimation<V>, t: number): this;
207
+ /** Advance all child animations to absolute clock `t`. SYNC on the steady path
208
+ * (J.W6 S1): all-synchronous children advance with no per-frame microtask hop;
209
+ * a thenable only on an async child or the over-`YIELD_BATCH` yield path. */
210
+ advanceTo(t: number): this | Promise<this>;
211
+ /** One frame of the group's draw loop: tick all children, then render. */
212
+ private _frame;
213
+ /** The post-advance render half of `_frame` — composite, or settle on done. */
214
+ private _renderFrame;
215
+ private _resolvePlay;
216
+ /** The completion front-door (G.W13) — `await group.finished` resolves once
217
+ * the in-flight composite play settles. Exposes the ONE held `_playingPromise`
218
+ * (a settled/never-played group resolves immediately). */
219
+ get finished(): Promise<void>;
220
+ /** Start the group. Resolves when all children complete (or on stop/reset).
221
+ * Re-entrant: an in-flight `play()` returns the same promise. Under
222
+ * `respectReducedMotion` + an active query, snaps to final (no rAF loop). */
223
+ play(): Promise<void>;
224
+ /** `prefers-reduced-motion` snap: rest = final, paint it, settle — the SAME
225
+ * terminal path a completed play takes, motion elided. */
226
+ private _playReducedMotion;
227
+ /** Pause the group — idempotent. Pausing an already-paused (or not-yet-started)
228
+ * group is a no-op, NOT a resume. Cancels the rAF loop + renders a final-frame
229
+ * snapshot so the visual matches the pause moment. */
230
+ pause(): this;
231
+ /** Resume the group — idempotent. Unpauses every child DIRECTLY (not via
232
+ * `child.resume()` — the group's draw loop owns the ticking) + re-registers it. */
233
+ resume(): this;
234
+ /** The explicit flip: pauses if playing, resumes if paused. */
235
+ toggle(): this;
236
+ /** Pure state teardown — never paints. Releases every child (`managed = false`,
237
+ * `child.settle()`) and clears the group flags, leaving the rest frame painted. */
238
+ settle(): this;
239
+ /** Explicit rewind: paint every started child back to its INITIAL frame, then
240
+ * settle — the user-facing "return to start" (completion does NOT come here). */
241
+ reset(): this;
242
+ /** Halt the draw loop, rewind to the initial frame (the transport-stop
243
+ * semantic the demo's controls expect), and resolve any pending `play()`. */
244
+ stop(): this;
245
+ playing(): boolean;
246
+ /** Set layer config for an animation by name or reference. Chainable. */
247
+ setLayerConfig(nameOrAnim: string | KeyframesAnimation<V>, config: Partial<AnimationLayerConfig>): this;
248
+ /** Convenience toggle for enabling/disabling a layer. Chainable. */
249
+ setLayerEnabled(nameOrAnim: string | KeyframesAnimation<V>, enabled: boolean): this;
250
+ /** Read the layer config for an animation by name or reference. */
251
+ getLayerConfig(nameOrAnim: string | KeyframesAnimation<V>): AnimationLayerConfig | undefined;
252
+ /** Spring a layer's blend `weight` to `weight` (K.W11 PHYS-C — body in
253
+ * `./layer-api`; a mid-flight re-target re-seats velocity-continuously). */
254
+ transitionLayer(nameOrAnim: string | KeyframesAnimation<V>, target: {
255
+ weight: number;
256
+ spring?: LayerTransitionSpring;
257
+ }): this;
258
+ /** Crossfade two layers (K.W11 PHYS-C — body in `./layer-api`): two spring
259
+ * `transitionLayer` calls, a→0 and b→1. Chainable. */
260
+ crossfade(a: string | KeyframesAnimation<V>, b: string | KeyframesAnimation<V>, options?: {
261
+ spring?: LayerTransitionSpring;
262
+ }): this;
263
+ /** Advance every spring-driven layer weight by `dt` ms (K.W11 PHYS-C). Called
264
+ * from `advanceTo` ONLY when `_hasLayerSprings` is true. R.W2 (lib-group C2):
265
+ * the integrate BODY moved to `./springs`; this thin delegate updates
266
+ * `_hasLayerSprings` from its "any still active?" return. */
267
+ private advanceLayerSprings;
268
+ }
269
+
270
+ export declare interface AnimationGroupEntry<V extends Vars> {
271
+ animation: KeyframesAnimation<V>;
272
+ values: Record<string, unknown>;
273
+ layer: AnimationLayerConfig;
274
+ }
275
+
276
+ /** Input — a bare Animation or one with a layer config. */
277
+ export declare type AnimationGroupInput<V extends Vars> = KeyframesAnimation<V> | {
278
+ animation: KeyframesAnimation<V>;
279
+ layer?: Partial<AnimationLayerConfig>;
280
+ };
281
+
282
+ export declare interface AnimationGroupObject<V extends Vars> {
283
+ [key: string]: AnimationGroupEntry<V>;
284
+ }
285
+
286
+ /**
287
+ * `internal/animation-id.ts` — the shared animation-identity helper (R.W2c).
288
+ *
289
+ * `getAnimationId` was a static member of `engine/animation.ts`, which made
290
+ * `group/group.ts` + `group/entries.ts` reach BACK into the engine zone at
291
+ * runtime purely to resolve a name — one of the two runtime edges that closed
292
+ * the engine↔group ring. It is pure string logic over the minimal identity
293
+ * shape (`{ name?, id }`) every animation already carries, so it belongs in the
294
+ * value.js-free leaf zone, depending on neither engine nor group.
295
+ *
296
+ * Structural by design: it takes `AnimationIdentity` (NOT `KeyframesAnimation`)
297
+ * so it carries ZERO edge to the engine class. The engine barrel re-exports it
298
+ * for the public `getAnimationId` surface; group/compile read it from here.
299
+ *
300
+ * value.js-free (LIGHT).
301
+ */
302
+ /** The minimal identity shape every animation carries — name (optional) + numeric id. */
303
+ declare interface AnimationIdentity {
304
+ name?: string | undefined;
305
+ id: number;
306
+ }
307
+
308
+ declare interface AnimationLayerConfig {
309
+ /** Higher wins. Default: 0 */
310
+ zIndex: number;
311
+ /** 0–1 for 'weighted' blend mode. Default: 1 */
312
+ weight: number;
313
+ /**
314
+ * Optional spring (or any {@link WeightStepper}) DRIVING this layer's
315
+ * blend `weight` (K.W11 PHYS-C — the spring-driven crossfade). When
316
+ * present the `weighted` blend leaf reads `weightSpring.value` in place of
317
+ * the constant `weight` (one nullish read; the per-frame lerp untouched),
318
+ * so a layer transition follows a PHYSICAL trajectory that can overshoot
319
+ * and settle — the flagship demo moment only kf's weighted-blend substrate
320
+ * can hold. Constructed + advanced by `AnimationGroup.transitionLayer` /
321
+ * `crossfade`; cleared on settle, when the read falls back to the
322
+ * now-updated constant `weight`. Absent on a static-weight layer (the
323
+ * read is `?? layer.weight`), so the constant path is byte-unchanged.
324
+ */
325
+ weightSpring?: WeightStepper;
326
+ /**
327
+ * Default: 'replace'. Defaulting on a genuinely-omitted blend mode is
328
+ * the sanctioned contract (the fail-explicit seam throws only on
329
+ * malformed PRESENT input, never on omission) — an unspecified layer
330
+ * blends by replacement, the least-surprising composite.
331
+ */
332
+ blendMode: BlendMode;
333
+ /** Layer toggle. Default: true */
334
+ enabled: boolean;
335
+ /** Optional property whitelist — only these properties will be output from this layer */
336
+ properties?: Set<string>;
337
+ }
338
+
339
+ declare type AnimationOptions = {
340
+ duration: number;
341
+ delay: number;
342
+ iterationCount: number;
343
+ direction: (typeof DIRECTIONS)[number];
344
+ fillMode: (typeof FILL_MODES)[number];
345
+ timingFunction: Easing;
346
+ useWAAPI: boolean;
347
+ /**
348
+ * When true, honor `prefers-reduced-motion: reduce` by snapping the
349
+ * `Animation`/`AnimationGroup` `play()` path to the final frame in a
350
+ * single paint instead of running the rAF/WAAPI loop. SSR-safe no-op
351
+ * off-DOM. Default false (consumers opt in).
352
+ */
353
+ respectReducedMotion: boolean;
354
+ colorSpace: ColorSpace;
355
+ hueMethod?: HueInterpolationMethod;
356
+ /**
357
+ * The LAYER-level `animation-composition` operator (L.W1 S5, Band A) — the
358
+ * round-trip field for an authored `animation-composition: add` that arrived
359
+ * through a sibling `.class { animation: … }` shorthand/longhand ingest.
360
+ * Distinct from the per-KEYFRAME {@link TemplateAnimationFrame.composition}
361
+ * (the per-stop operator); this is the whole-animation composite the engine
362
+ * carries off `extractAnimationOptions`'s `composition` field. Omission means
363
+ * `replace` (the CSS default — the serializer omits it). value.js 0.13.0's
364
+ * `CSSAnimationOptions.composition` surfaces it; `fromString` reads it here.
365
+ */
366
+ composite?: CompositeOperator;
367
+ /**
368
+ * `animation-iteration-composite` (CSS Animations L2). BOOKED, not
369
+ * implemented: the L2 draft marks this property experimental — there is no
370
+ * stable value.js parse for it and no honoring path in the engine. The field
371
+ * is a typed `never` placeholder (a named tripwire): a future
372
+ * silently-WRONG implementation that tries to assign anything to it reddens
373
+ * the type check, forcing the implementation to land alongside a real
374
+ * `proof:iteration-composite-baseline` gate rather than sliding in unproven.
375
+ */
376
+ iterationComposite?: never;
377
+ };
378
+
379
+ export { AnimationRangeValue }
380
+
381
+ export { AnimationTimelineValue }
382
+
383
+ /** Attention animations — a one-shot nudge to draw the eye. */
384
+ declare const attentionPresets: {
385
+ readonly pulse: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
386
+ readonly shake: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
387
+ readonly bounce: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
388
+ readonly flip: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
389
+ readonly notificationBounce: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
390
+ readonly springPop: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
391
+ readonly springWobble: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
392
+ };
393
+
394
+ declare type BlendMode = "replace" | "add" | "weighted";
395
+
396
+ declare const blurIn: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
397
+
398
+ declare const blurInOut: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
399
+
400
+ declare const blurOut: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
401
+
402
+ declare const bounce: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
403
+
404
+ /** The compile result — the artifact + the CC-3 ineligibility report. */
405
+ declare interface CompiledCSS {
406
+ /**
407
+ * The zero-runtime CSS artifact — `@keyframes` blocks + `.class { animation }`
408
+ * rules. Empty string when EVERY child refused (then `refusals` carries the
409
+ * whole story).
410
+ */
411
+ css: string;
412
+ /**
413
+ * True iff EVERY walked child compiled faithfully. False when one or more
414
+ * refused — `refusals` names each, and the JS playback is the only faithful
415
+ * path for those.
416
+ */
417
+ eligible: boolean;
418
+ /** The CC-3 refusals — one per child that could not compile faithfully. */
419
+ refusals: CompileRefusal[];
420
+ }
421
+
422
+ /** The input shapes `compileToCSS` accepts. */
423
+ declare type CompileInput<V extends Vars = any> = AnimationGroup<V> | Sequence<V> | ReadonlyArray<KeyframesAnimation<V> | {
424
+ animation: KeyframesAnimation<V>;
425
+ }>;
426
+
427
+ /** Options for {@link compileToCSS}. */
428
+ declare interface CompileOptions {
429
+ /**
430
+ * Per-child stagger delays (ms), index-aligned with the walked children —
431
+ * the materialized output of `stagger.delays(total)`. CC-1 emits these as
432
+ * literal per-child `animation-delay`, expressing an eased origin-aware
433
+ * curve `sibling-index()` cannot (the universal literal-delay form;
434
+ * `@supports (sibling-index)` is CC-6 BOOK, not the default).
435
+ */
436
+ staggerDelays?: readonly number[];
437
+ /**
438
+ * CC-2 — the oklab densify stop count (the N intermediate `oklab()` stops
439
+ * baked per color segment, INCLUSIVE of endpoints). Default
440
+ * {@link DEFAULT_DENSIFY_STOPS}. Raise it for a longer color arc; the ΔE
441
+ * proof decides ship-vs-refuse.
442
+ */
443
+ densifyStops?: number;
444
+ /**
445
+ * CC-2 — the ΔE-ε ship-vs-refuse threshold (the perceptual-distance band the
446
+ * densified `oklab()` stops must hold against kf's JS lerp). Default
447
+ * {@link DEFAULT_DELTA_E_EPSILON}. A track whose densify exceeds this REFUSES
448
+ * with the perceptual-oklab reason (a drifting densify is worse than an
449
+ * honest refusal).
450
+ */
451
+ deltaEEpsilon?: number;
452
+ /** Prettier print-width for the emitted artifact. Omit for the default. */
453
+ printWidth?: number;
454
+ }
455
+
456
+ /** A single refusal — the child name + a typed reason + a human message. */
457
+ declare interface CompileRefusal {
458
+ /** The compiled child's class/animation name. */
459
+ name: string;
460
+ reason: CompileRefusalReason;
461
+ /** The verbatim message the demo's ineligibility UI shows (CC-4). */
462
+ message: string;
463
+ }
464
+
465
+ /**
466
+ * The reason a child could not compile faithfully. Generalizes
467
+ * `waapiIneligibleReason` to the CSS-compile domain — the trust surface. Each
468
+ * names the kf axis that exceeds pure CSS (the refusal is marketing for the
469
+ * moat). A refused child's JS playback is the only faithful path.
470
+ */
471
+ declare type CompileRefusalReason = "weighted-blend" | "custom-renderer" | "perceptual-oklab" | "computed-unit-drift";
472
+
473
+ /**
474
+ * THE compiler (CC-1/CC-2/CC-3) — compile an orchestration graph to zero-runtime
475
+ * CSS. Walks the input (`AnimationGroup` / `Sequence` / child list), emits one
476
+ * `@keyframes` + one `animation` shorthand per child (the `replace`/`add`
477
+ * layering as `animation-composition`, springs as `linear()`, stagger delays
478
+ * materialized, computed units verbatim, color tracks densified into perceptual
479
+ * `oklab()` stops under the ΔE-ε proof), and REFUSES with a NAMED reason what
480
+ * cannot compile faithfully (CC-3 — the replay-equality invariant's honest
481
+ * refusal). The result is async because `formatCSS` (Prettier) is.
482
+ *
483
+ * @returns `{ css, eligible, refusals }` — the artifact + the trust surface.
484
+ */
485
+ export declare function compileToCSS<V extends Vars>(input: CompileInput<V>, opts?: CompileOptions): Promise<CompiledCSS>;
486
+
487
+ /**
488
+ * The CSS `animation-composition` operator (K.W7). Distinct from
489
+ * {@link BlendMode} (the GROUP's per-LAYER blend tier — `replace`/`add`/
490
+ * `weighted`): this is the per-KEYFRAME composite operator the author declares
491
+ * on a single animation, matching the CSS grammar exactly (`weighted` is not a
492
+ * CSS composite; `accumulate` is the repeat-aware one CSS adds). The engine
493
+ * routes `add`/`accumulate` onto the SAME un-clamped numeric leaf the group's
494
+ * `add` layer runs (`group.ts`), so the two tiers share one accumulation
495
+ * semantic without sharing a type.
496
+ */
497
+ declare type CompositeOperator = "replace" | "add" | "accumulate";
498
+
499
+ /**
500
+ * Construct a `ScrollScene` from a parsed `CSSTimelineOptions` (the SO-1 parse
501
+ * output) OR a direct `ScrollSceneOptions` spec. The CSS-fed construction is the
502
+ * round-trip's driving half (parse → drive); the spec-fed construction is
503
+ * value.js-INDEPENDENT (it needs no grammar — only the physics primitives).
504
+ *
505
+ * @example
506
+ * // CSS-fed (value.js-gated parse → JS driver):
507
+ * const opts = parseScrollCSS(stylesheet);
508
+ * const scene = createScrollScene({ range: opts.range, scrub: 0.2 });
509
+ * // spec-fed (value.js-independent):
510
+ * const scene = createScrollScene({ range: { start: { offset: "0%" }, end: { offset: "100%" } } });
511
+ */
512
+ export declare function createScrollScene(spec?: ScrollSceneOptions | CSSTimelineOptions): ScrollScene;
513
+
514
+ export declare class CSSKeyframesAnimation<V extends Vars> extends KeyframesAnimation<V> {
515
+ /**
516
+ * Q.WD1-bind S2 (DM-22) — the timeline a scroll-range named selector resolves
517
+ * its phase against. Stored by {@link bindTimeline} for the no-timeline guard's
518
+ * check; `undefined` until a timeline is bound. A scroll-context operation
519
+ * specific to CSS keyframes with named selectors (the base `Animation` class is
520
+ * value.js-/scroll-agnostic), so the field + method live here.
521
+ */
522
+ private _boundTimeline?;
523
+ constructor(options?: Partial<InputAnimationOptions>, ...targets: HTMLElement[]);
524
+ /**
525
+ * Q.WD1-bind S2 (DM-22) — the attach-time deferred-resolution seam. A
526
+ * scroll-range named keyframe selector (`entry`/`exit`/`cover`/`contain`)
527
+ * ingests OPAQUELY (the L.W1 S4 floor) and is RESOLVABLE only under a timeline;
528
+ * `bindTimeline` is where that resolution happens. It walks `templateFrames`,
529
+ * resolves each named-selector start to a numeric `%` `ValueUnit` via
530
+ * {@link namedSelectorToFraction}, CLEARS the `NAMED_SELECTOR_SUPERTYPE` tag (so
531
+ * the resolved frame is indistinguishable from an author-written `%` at the sort
532
+ * step — no NaN), and re-compiles. The play-time guard
533
+ * (`assertNoUnresolvedNamedSelector`) then finds zero unresolved frames and
534
+ * passes silently — so this MUST land before the guard fires (the gate-enforced
535
+ * sub-wave ordering: the guard over-throws on a bound animation if the resolver
536
+ * is absent).
537
+ *
538
+ * Idempotent + safe to call before `fromString`: with no named frames the walk
539
+ * is a no-op; calling it after a NaN-producing `parse()` purges the NaN frames.
540
+ */
541
+ bindTimeline(timeline: Timeline): this;
542
+ /**
543
+ * One transform-resolution seam for the three `from*` entry points:
544
+ * a supplied transform is the consumer's renderer (vars arrive
545
+ * unflattened); genuine omission resolves to the instance's ONE
546
+ * default DOM-style renderer, which keeps WAAPI eligibility a
547
+ * reference comparison (`usesDefaultRenderer`).
548
+ */
549
+ private resolveTransform;
550
+ fromVars(vars: V[], transform?: TransformFunction<V>): this;
551
+ fromKeyframes(keyframes: Map<string, Partial<V>> | Record<string, Partial<V>>, transform?: TransformFunction<V>): this;
552
+ /**
553
+ * Property registry from `@property` declarations parsed by
554
+ * `fromString`. Empty when the input had no `@property` rules.
555
+ * Consumers can read this to recover the type metadata for
556
+ * custom properties (syntax string, initial value, inheritance
557
+ * flag) without re-parsing the source CSS.
558
+ */
559
+ propertyRegistry: Map<string, PropertyDescriptor_2>;
560
+ /**
561
+ * Parsed scroll-grammar (`animation-timeline` / `animation-range` /
562
+ * `timeline-scope` / `animation-trigger`) recovered from a sibling style rule
563
+ * by `fromString` (L.W2 S1 — CC-6) via `recoverScrollOptions` (the
564
+ * CSS-metadata-recovery seam); `undefined` when the input carried no scroll
565
+ * grammar (the canonical time-clock animation). A read-only metadata field —
566
+ * no hot-path impact, analogous to {@link propertyRegistry}. The compiler
567
+ * (`compileToCSS`) reads it to EMIT the scroll longhands back out, closing the
568
+ * round-trip's EMIT half.
569
+ */
570
+ scrollOptions?: CSSTimelineOptions;
571
+ fromString(keyframes: string, transform?: TransformFunction<V>): this;
572
+ transform(vars: V): void;
573
+ }
574
+
575
+ export declare function CSSKeyframesToString<V extends Vars>(animation: KeyframesAnimation<V>, name?: string, printWidth?: number | undefined): Promise<string>;
576
+
577
+ /**
578
+ * Per-stop card serializer for the editor pane — ONE formatted keyframe
579
+ * string per DECLARED template stop, index-aligned with
580
+ * `animation.templateFrames` (the pairing the card list renders by).
581
+ * Unified onto the declared-template authority (J.W1 S1): each card is
582
+ * {@link declaredKeyframeBody} — the AUTHORED values. The former path mapped
583
+ * `animation.frames` (the interp PAIRS — N−1 segments for N stops, so the
584
+ * last card simply did not exist) and read `frame.flatVars` (DOM-resolved,
585
+ * interp-mutated) — both defects die with the unification.
586
+ */
587
+ export declare const CSSKeyframesToStrings: <V extends Vars>(animation: KeyframesAnimation<V>) => Promise<string[]>;
588
+
589
+ export { CSSTimelineOptions }
590
+
591
+ export declare const defaultLayerConfig: AnimationLayerConfig;
592
+
593
+ export declare const defaultOptions: AnimationOptions;
594
+
595
+ /**
596
+ * A structured parse/honoring diagnostic (K.W7 S4). Extends the value.js
597
+ * `ParseDiagnostic` producer (the CONSUMED shape — `message`/`offset`/`line`/
598
+ * `column`/`expected`/`input`) with a stable kf-side {@link DiagnosticCode} and
599
+ * an optional `property` (the leaf a `COMPOSITION_FALLBACK` names). The
600
+ * value.js half (`message`/`offset`/…) is `Partial` because the engine-internal
601
+ * rows (EMPTY_PARSE, COMPOSITION_FALLBACK) are NOT byte-offset parse failures —
602
+ * they carry a `message` + `code` only; a row sourced from the value.js
603
+ * `OnParseError` producer carries the full positional record. NOT a kf-local
604
+ * re-author of the producer: it CONSUMES `ParseDiagnostic`'s field shape and
605
+ * widens it with the stable code (inv-16 published-only consumption holds).
606
+ */
607
+ declare interface Diagnostic extends Partial<ParseDiagnostic> {
608
+ /** A stable, branch-on-able code — never scrape `message`. */
609
+ code: DiagnosticCode;
610
+ /** The human-readable summary (always present; the producer's or kf's). */
611
+ message: string;
612
+ /** The CSS property a `COMPOSITION_FALLBACK` refuses to composite. */
613
+ property?: string;
614
+ }
615
+
616
+ /**
617
+ * The stable diagnostic `code`s the kf-side sink emits (K.W7 S4). A FLAT,
618
+ * additive enum — NOT a logging framework — so a programmatic consumer branches
619
+ * on the reason without scraping a message string (the J.W1 typed-throw idiom
620
+ * lifted onto the structured field). The engine-internal rows
621
+ * (`EMPTY_PARSE`/`UNKNOWN_TIMING_FN`) were J.W1-landed as typed throws; W7 lifts
622
+ * them onto this field. `COMPOSITION_FALLBACK` is the K.W7 honesty row (the
623
+ * non-numeric composite leaf's refusal). `PARSE_ERROR` carries the value.js
624
+ * `OnParseError` producer's structured diagnostic verbatim. The CORS-skip /
625
+ * WAAPI-reason rows are AUTHORED here but POPULATED by K.W8 (which owns the
626
+ * CSSOM walk that produces them).
627
+ */
628
+ 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";
629
+
630
+ export declare const DIRECTIONS: readonly ["normal", "reverse", "alternate", "alternate-reverse"];
631
+
632
+ /**
633
+ * SO-1/SO-2 the DISPATCH (conservative-correct, with a queryable reason). The
634
+ * WAAPI-eligibility seam pointed at the scroll clock:
635
+ *
636
+ * DOM target + WAAPI-eligible + native ScrollTimeline present + NO scrub/snap/
637
+ * velocity → NATIVE (zero main-thread)
638
+ * scrub OR snap OR velocity requested → JS (native has no smoother/snap)
639
+ * non-DOM target / no animation → JS (the universal driver)
640
+ * WAAPI-ineligible (computed unit / color / custom curve) → JS (the ineligible set)
641
+ * native ScrollTimeline ABSENT (Firefox, jsdom, SSR) → JS (createNativeTimeline → null)
642
+ *
643
+ * The JS path NEVER deletes the native lane and the native path NEVER swallows
644
+ * an ineligible animation — the reason string is the honesty surface (the
645
+ * `waapiIneligibleReason` idiom). This ADDS a tier; it deletes no driver.
646
+ */
647
+ export declare function dispatchScrollBackend<V extends Vars>(request: ScrollDispatchRequest<V>): ScrollDispatch;
648
+
649
+ /**
650
+ * `DrawSVG` — the class form of {@link fromDrawSVG}, for callers who prefer a
651
+ * named primitive alongside `CSSKeyframesAnimation` / `MotionPath`. Construction
652
+ * is the factory: `new DrawSVG(target).animation` is the control handle. The
653
+ * factory is the canonical entry; this is a thin ergonomic wrapper.
654
+ */
655
+ export declare class DrawSVG<V extends Record<string, any> = any> {
656
+ /** The underlying stroke-dashoffset animation — the control handle. */
657
+ readonly animation: CSSKeyframesAnimation<V>;
658
+ constructor(target: SVGDrawTarget, options?: DrawSVGOptions);
659
+ /** Start (or re-enter) the line-drawing play loop. */
660
+ play(): Promise<void>;
661
+ /** Pause the play loop, retaining the playhead. */
662
+ pause(): this;
663
+ /** Halt and rewind the play loop. */
664
+ stop(): this;
665
+ /** Resolve once the draw completes — the {@link Animation.finished} front-door. */
666
+ get finished(): Promise<void>;
667
+ }
668
+
669
+ export declare interface DrawSVGOptions extends Partial<InputAnimationOptions> {
670
+ /**
671
+ * Start of the draw sweep — a percent STRING (`"0%"` → `"100%"`) or a 0..1
672
+ * NUMBER fraction (`0` → `1`), the two unambiguous forms. Default `"0%"` —
673
+ * the stroke starts undrawn (full `stroke-dashoffset`) and draws IN; `"100%"`
674
+ * → `"0%"` (or `1` → `0`) erases it. A number outside `[0, 1]` throws (a
675
+ * percent must be a string — no silent `50`-means-5000% footgun).
676
+ */
677
+ from?: string | number;
678
+ /** End of the draw sweep — same `"100%"`/`1` two-form contract. Default `"100%"`. */
679
+ to?: string | number;
680
+ /**
681
+ * Auto-start the play loop after construction + targeting. Default true.
682
+ * `false` returns a constructed, targeted, NOT-yet-playing handle so the
683
+ * caller can drive the returned animation (`.play()` / `.pause()` / `.stop()`).
684
+ */
685
+ autoPlay?: boolean;
686
+ }
687
+
688
+ /**
689
+ * The typed easing value — a callable curve plus, when one exists, the CSS
690
+ * easing string that reproduces it (e.g. a spring's `linear()` stops).
691
+ *
692
+ * Replaces the former Symbol-on-a-closure side channel: the "this closure
693
+ * has a CSS twin" fact now flows through the type system, so wrapping or
694
+ * binding the callable can no longer silently drop it. `waapi.ts` reads
695
+ * `.css` to run the true curve on the compositor; everything else reads
696
+ * `.fn`.
697
+ */
698
+ declare interface Easing {
699
+ /** The callable curve — the hot-path interpolation function. */
700
+ fn: TimingFunction;
701
+ /** CSS easing string that faithfully reproduces `fn`, when one exists. */
702
+ css?: string;
703
+ }
704
+
705
+ /** Entrance animations — bring an element INTO view. */
706
+ declare const enterPresets: {
707
+ readonly fadeIn: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
708
+ readonly slideIn: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
709
+ readonly slideInLeft: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
710
+ readonly slideInRight: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
711
+ readonly rotateIn: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
712
+ readonly blurIn: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
713
+ readonly springScaleIn: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
714
+ readonly springSlideIn: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
715
+ readonly jumpUp: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
716
+ };
717
+
718
+ /** Exit animations — take an element OUT of view. */
719
+ declare const exitPresets: {
720
+ readonly fadeOut: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
721
+ readonly slideOutLeft: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
722
+ readonly slideOutRight: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
723
+ readonly blurOut: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
724
+ readonly warpLeft: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
725
+ readonly warpRight: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
726
+ readonly jumpDown: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
727
+ };
728
+
729
+ /**
730
+ * `explain(css, opts?)` — the human/LLM-readable companion. Calls
731
+ * {@link validate} and formats the result as a concise, DETERMINISTIC string
732
+ * (field order fixed, no locale-sensitive formatting) so a doctest can assert it
733
+ * byte-for-byte. The shape the demo's ineligibility panel produces, as a
734
+ * first-class library API. An LLM agent can present it verbatim or parse it for a
735
+ * fix suggestion.
736
+ *
737
+ * Format (one block; the `–` bullets enumerate the refusals / WAAPI reason /
738
+ * diagnostics, each on its own line):
739
+ *
740
+ * @keyframes color-drift:
741
+ * parseable: yes
742
+ * compile-eligible: no
743
+ * – perceptual-oklab: color-drift cannot compile: …
744
+ * waapi-eligible: no
745
+ * – color interpolation requires perceptual lerp
746
+ * diagnostics:
747
+ * – COMPOSITION_FALLBACK: …
748
+ */
749
+ export declare function explain(css: string, opts?: ValidateOptions): Promise<string>;
750
+
751
+ declare const fadeIn: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
752
+
753
+ declare const fadeOut: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
754
+
755
+ export declare const FILL_MODES: readonly ["none", "forwards", "backwards", "both"];
756
+
757
+ /**
758
+ * The card-flip attention preset.
759
+ *
760
+ * ── PKG-3 RENAME (L.W8 §S4 · audit W126). Formerly the preset `flip`. Renamed
761
+ * `flip` → `flipPreset` because the rolled-up `dist/keyframes.d.ts` placed this
762
+ * preset (reachable as `presets.flip`) and the LIGHT top-level `flip` export
763
+ * (the FLIP-layout helper in `flip.ts`) under the same name `flip`, so API
764
+ * Extractor renamed this one with a numeric suffix and re-exported it under the
765
+ * `flip` name inside the `AnimationPresets` namespace — a numeric-suffixed alias
766
+ * `proof:pkg3-clean` greps for. Naming the preset `flipPreset` (distinct from the
767
+ * light `flip`) clears the collision. BREAKING (5.0.0): the access path is now
768
+ * `presets.flipPreset`; the nested taxonomy key `attentionPresets.flip` is
769
+ * unchanged (a property name, not a top-level declaration — no collision).
770
+ */
771
+ declare const flipPreset: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
772
+
773
+ export declare function formatCSSKeyframeString(keyframe: string): string;
774
+
775
+ declare class FrameCompiler<V extends Vars = any> {
776
+ private readonly _options;
777
+ templateFrames: TemplateAnimationFrame<V>[];
778
+ parsedVars: ParsedVarMap[];
779
+ frames: AnimationFrame<V>[];
780
+ /**
781
+ * Next TEMPLATE frame id — a monotonic handle assigned in `addFrame`
782
+ * (stable across re-parse, since `parse` does not re-add templates).
783
+ * Compiled-frame ids are content-derived from `(startIx, stopIx)`
784
+ * (see `createFrame`), NOT this counter, so `parse()` is idempotent.
785
+ */
786
+ frameId: number;
787
+ /**
788
+ * The compile inputs live on the owning `Animation`'s `options` object.
789
+ * The compiler holds a REFERENCE to it (the setters mutate it in place,
790
+ * never replace it), so the NEXT compile always reads the current
791
+ * `duration`/`easing`/`colorSpace` without re-linking. For values baked
792
+ * into already-compiled frames, the setter triggers a targeted re-derive:
793
+ * `setDuration` rescales `frame.time` in place; `setColorSpace`/
794
+ * `setHueMethod` call {@link renormalizeColors} (the color resolution is
795
+ * the only baked state that depends on them). No setter silently no-ops a
796
+ * change to compiled state.
797
+ */
798
+ constructor(_options: AnimationOptions);
799
+ /**
800
+ * The live options object the compiler reads (a REFERENCE to the owning
801
+ * `Animation`'s `options` — the setters mutate it in place). Read-only:
802
+ * the compiler never replaces it. Exposed so `Animation.adoptCompiled`
803
+ * can re-bind `Animation.options` to the adopted compiler's options object
804
+ * BY CONSTRUCTION (`this.options === this.compiler.options`, the live-options
805
+ * invariant — G.W19 / the `6e29236` lock), without poking a private field.
806
+ */
807
+ get options(): AnimationOptions;
808
+ addFrame<K extends V>(start: number | string | ValueUnit<number>, vars: Partial<K>, transform?: TransformFunction<K>, timingFunction?: InputAnimationOptions["timingFunction"], composition?: CompositeOperator): void;
809
+ createFrame(startIx: number, endIx: number): AnimationFrame<V>;
810
+ /**
811
+ * Build an index mapping each variable name to the frame indices where
812
+ * it appears. Used by reconcileVars() for O(1) "next occurrence" lookups
813
+ * instead of O(N) findIndex scans per variable.
814
+ */
815
+ private buildVarIndex;
816
+ /**
817
+ * Reconcile interpolation variables across non-adjacent keyframes.
818
+ * For each variable at frame `ix`, find the next frame that also
819
+ * defines that variable and create an interpolation segment between them.
820
+ *
821
+ * Uses a pre-built variable index (from buildVarIndex) to avoid
822
+ * O(frames²) findIndex scans.
823
+ */
824
+ reconcileVars(ix: number, varIndex: Map<string, number[]>): void;
825
+ /**
826
+ * Compile `templateFrames` into the sampled `frames[]`. `targets` is the
827
+ * one DOM input — each parsed var is bound to it so computed-unit
828
+ * resolution can read the live box. Pure otherwise.
829
+ */
830
+ parse(targets: HTMLElement[]): void;
831
+ /**
832
+ * Derive a frame's `flatVars`/`vars`/`allInterpVars` from its
833
+ * `interpVars` — the pre-flattened forms the hot path
834
+ * (`interpFrames`) iterates without re-walking. Called once per frame
835
+ * at the tail of `parse`, and again by `renormalizeColors` after a
836
+ * color-space change re-derives the interp carriers in place.
837
+ */
838
+ private finalizeFrameVars;
839
+ /**
840
+ * Re-derive the color-resolved interpolation carriers in place after a
841
+ * `colorSpace`/`hueMethod` change on already-compiled frames. Only the
842
+ * per-`InterpolatedVar` color resolution depends on the color space —
843
+ * the flatten/sort/reconcile structure does not — so this re-runs
844
+ * `createInterpVarValue` over the existing `frames`/`parsedVars` and
845
+ * rebuilds the hot-path arrays, with NO re-flatten and NO re-sort. The
846
+ * new carriers derive from the already-target-bound `parsedVars`, the
847
+ * same provenance `parse` gives them, so DOM binding is preserved.
848
+ *
849
+ * The owning `Animation`'s `setColorSpace`/`setHueMethod` call this when
850
+ * frames already exist; before `parse`, the option is simply read by the
851
+ * next compile.
852
+ */
853
+ renormalizeColors(): void;
854
+ }
855
+
856
+ /**
857
+ * Build a CSS-native SVG line-drawing animation: read the target's path length
858
+ * ONCE, set `stroke-dasharray` to that length (one solid full-length dash), and
859
+ * sweep `stroke-dashoffset` from → to (default `0% → 100%` ⇒ offset `L → 0`,
860
+ * the line draws in). Returns the constructed {@link CSSKeyframesAnimation} as
861
+ * the control handle (the `animate()` contract — `.play()` / `.pause()` /
862
+ * `.stop()` / `.finished`), consistent with the `from*` factory family.
863
+ *
864
+ * The returned animation passes the EXISTING WAAPI eligibility gate
865
+ * (`isWAAPIEligible`) for an SVG DOM target with a uniform CSS-twin easing, and
866
+ * delegates compositor-thread via `playWAAPI` — no new eligibility predicate.
867
+ *
868
+ * The line length `L` is read a SINGLE time at construction (the
869
+ * `motion-path.ts` "browser owns the geometry" pattern). A path mutated mid-draw
870
+ * is a re-construct, not a per-frame re-measure — a per-frame `getTotalLength`
871
+ * would be a layout round-trip the Mandate's measure-first forbids.
872
+ *
873
+ * @param target an SVG geometry element exposing `getTotalLength()`.
874
+ * @param options `{ from?, to?, ...animationOptions }`.
875
+ *
876
+ * @example
877
+ * // Draw a path stroke in over 2s:
878
+ * fromDrawSVG(pathEl, { duration: 2000 });
879
+ */
880
+ export declare function fromDrawSVG<V extends Record<string, any> = any>(target: SVGDrawTarget, options?: DrawSVGOptions): CSSKeyframesAnimation<V>;
881
+
882
+ /**
883
+ * K1 — `fromLiveAnimations`: adopt every RUNNING CSS animation on the document
884
+ * (or a single element) by reconstructing each from its source `@keyframes`
885
+ * RULE (via the CSSOM walk — NOT from `getAnimations().getKeyframes()`, the
886
+ * computed form that has lost `var()`/`cqw`/oklab). The `getAnimations()` read
887
+ * provides the SET of live animation names; the reconstruction provides the
888
+ * authored keyframes. The result maps each live animation name → its
889
+ * reconstructed kf object (the recovered, axis-preserving source).
890
+ *
891
+ * Distinct from {@link fromStyleSheets} (which walks EVERY declared `@keyframes`
892
+ * rule, running or not): `fromLiveAnimations` narrows to the names currently
893
+ * RUNNING on the page — the animations a user actually sees in motion.
894
+ */
895
+ export declare const fromLiveAnimations: <V extends Vars = any>(target?: Document | Element, options?: IngestOptions) => IngestResult<V>;
896
+
897
+ /**
898
+ * Build an SVG path-shape morph: sample two `d` strings at `samples` uniform
899
+ * arc-length steps each, pair the point sets, and interpolate the `(x, y)`
900
+ * pairs from the `from`-polyline (`0%`) to the `to`-polyline (`100%`). Returns
901
+ * the constructed {@link CSSKeyframesAnimation} as the control handle (the
902
+ * `animate()` contract — `.play()` / `.pause()` / `.stop()` / `.finished`),
903
+ * consistent with the `from*` factory family.
904
+ *
905
+ * value.js's `PathGeometry` owns the geometry (the `d`-parse + arc-length
906
+ * table, built ONCE per path at construction); the engine's native numeric
907
+ * `lerp` traverses the per-point coordinate keys. The morphed `d` at any `t` is
908
+ * reassembled from the interpolated points — read it via the `MorphSVG` class's
909
+ * {@link MorphSVG.sampleD}.
910
+ *
911
+ * Refuses a degenerate input: a zero-length `from` or `to` path throws a typed
912
+ * {@link AnimationOptionError} rather than faking a silent zero-frame / identity
913
+ * morph (the honest-or-refuse law — a morph between a zero-length path and
914
+ * anything is a malformed input, not a morph).
915
+ *
916
+ * @param from the source SVG path `d` string.
917
+ * @param to the target SVG path `d` string (differing geometry).
918
+ * @param options `{ samples?, target?, orient?, autoPlay?, ...animationOptions }`.
919
+ *
920
+ * @example
921
+ * // Morph a triangle into a square over 1s, RENDERING onto a live <path>:
922
+ * const path = document.querySelector("path");
923
+ * const m = fromMorphSVG(
924
+ * "M 0 0 L 100 0 L 50 100 Z",
925
+ * "M 0 0 L 100 0 L 100 100 L 0 100 Z",
926
+ * { duration: 1000, target: path },
927
+ * );
928
+ * // each frame the engine writes path.style.d = path("…") + --morph-d so the
929
+ * // morphing shape paints directly (no author-side reader needed on Chromium/
930
+ * // Safari; `<path style="d: var(--morph-d)">` is the Firefox-lags fallback).
931
+ */
932
+ export declare function fromMorphSVG<V extends Record<string, any> = any>(from: string, to: string, options?: MorphSVGOptions): CSSKeyframesAnimation<V>;
933
+
934
+ /**
935
+ * Build a CSS-native path-motion animation: set the author `offset-path` (and
936
+ * optional `offset-rotate`) on the target(s), and sweep `offset-distance` from
937
+ * → to. Returns the constructed {@link CSSKeyframesAnimation} as the control
938
+ * handle (the `animate()` contract — `.play()` / `.pause()` / `.stop()` / the
939
+ * awaitable play promise), consistent with the `from*` factory family.
940
+ *
941
+ * The returned animation passes the EXISTING WAAPI eligibility gate
942
+ * (`isWAAPIEligible`) for a DOM target with a uniform CSS-twin easing, and
943
+ * delegates compositor-thread via `playWAAPI` — no new eligibility predicate.
944
+ *
945
+ * @param target one or more DOM elements (or a single element) to move.
946
+ * @param options `{ path, from?, to?, rotate?, ...animationOptions }`.
947
+ *
948
+ * @example
949
+ * // Move a box along a quadratic path, facing along it, over 2s:
950
+ * fromMotionPath(box, {
951
+ * path: "path('M 0 0 Q 100 -100 200 0')",
952
+ * rotate: "auto",
953
+ * duration: 2000,
954
+ * });
955
+ */
956
+ export declare function fromMotionPath<V extends Record<string, any> = any>(target: HTMLElement | HTMLElement[], options: MotionPathOptions): CSSKeyframesAnimation<V>;
957
+
958
+ /**
959
+ * K1 — `fromStyleSheets`: the consumer-facing front door over
960
+ * {@link resolveLiveKeyframes}. Walk the document's (or the given list's)
961
+ * stylesheets and return every reconstructed `@keyframes` animation. The honest
962
+ * `CORS_SKIP`/`PARSE_ERROR` rows ride the returned {@link IngestResult}.
963
+ *
964
+ * @example
965
+ * const { CSSKeyframesAnimation, fromStyleSheets } = await loadAnimationEngine();
966
+ * const { animations, diagnostics } = fromStyleSheets();
967
+ * const pulse = animations.get("pulse")?.animation;
968
+ * pulse?.setTargets(el).play(); // re-drive the page's OWN animation
969
+ * for (const d of diagnostics) console.warn(d.code, d.message); // honest skips
970
+ */
971
+ export declare const fromStyleSheets: <V extends Vars = any>(source?: Document | ShadowRoot | CSSStyleSheet[] | CSSStyleSheet, options?: IngestOptions) => IngestResult<V>;
972
+
973
+ /**
974
+ * Resolve a stable name for an animation reference: the explicit `name` when
975
+ * set, else the numeric `id` stringified. A bare string passes through (the ONE
976
+ * place a name-or-animation reference collapses to a name).
977
+ */
978
+ export declare const getAnimationId: (animation: AnimationIdentity | string) => string;
979
+
980
+ /**
981
+ * Resolve a timing-function input to a callable `TimingFunction`.
982
+ *
983
+ * Accepts:
984
+ * - a `TimingFunction` — returned as-is
985
+ * - a named entry in `timingFunctions` (`ease-out-cubic`,
986
+ * `easeOutCubic`, `linear`, etc.) — looked up in the registry
987
+ * - a CSS `cubic-bezier(x1, y1, x2, y2)` literal string —
988
+ * parsed to control points and resolved via `CSSCubicBezier`
989
+ * - a CSS `steps(n[, position])` literal plus the `step-start` /
990
+ * `step-end` keywords — resolved via `steppedEase`, so the full
991
+ * CSS Easing Level 1 vocabulary round-trips through `fromString`
992
+ * - `undefined` or a name/literal the registry can't find —
993
+ * returns `undefined` so callers can decide (the option setters
994
+ * throw a typed `AnimationOptionError`, fail-explicit)
995
+ */
996
+ export declare const getTimingFunction: (timingFunction: TimingFunction | TimingFunctionNames | string | undefined) => TimingFunction | undefined;
997
+
998
+ declare const glow: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
999
+
1000
+ declare const gradientBackground: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
1001
+
1002
+ declare const heartbeat: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
1003
+
1004
+ declare const hover: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
1005
+
1006
+ /**
1007
+ * One ingested animation + the diagnostics its reconstruction produced. The
1008
+ * `name` is the `@keyframes` identifier (the CSSOM `CSSKeyframesRule.name`); the
1009
+ * `animation` is the reconstructed `CSSKeyframesAnimation`, already carrying any
1010
+ * sibling-style-rule `animation-*` options. `diagnostics` carries the honesty
1011
+ * rows for THIS rule (a malformed body → `PARSE_ERROR`, etc.); the walk-level
1012
+ * rows (`CORS_SKIP`) ride {@link IngestResult.diagnostics}.
1013
+ */
1014
+ export declare interface IngestedAnimation<V extends Vars = any> {
1015
+ /** The `@keyframes` identifier (CSSOM `CSSKeyframesRule.name`). */
1016
+ name: string;
1017
+ /** The reconstructed kf animation — replay-equal to the source CSS. */
1018
+ animation: CSSKeyframesAnimation<V>;
1019
+ /** Per-rule reconstruction diagnostics (empty on a clean ingest). */
1020
+ diagnostics: Diagnostic[];
1021
+ }
1022
+
1023
+ /** Options shared by the ingest entry points. */
1024
+ export declare interface IngestOptions {
1025
+ /**
1026
+ * Restrict the ingest to a single `@keyframes` name. When set, only the
1027
+ * matching rule is reconstructed (the rest are skipped without a
1028
+ * diagnostic — a name filter is an intentional narrowing, not a failure).
1029
+ */
1030
+ animationName?: string;
1031
+ /**
1032
+ * Animation options applied as the BASE for each reconstructed animation,
1033
+ * BELOW any sibling-style-rule `animation-*` declarations the source CSS
1034
+ * carries (the source's declared options win — the round-trip preserves the
1035
+ * AUTHORED timing). Empty by default.
1036
+ */
1037
+ options?: Partial<InputAnimationOptions>;
1038
+ }
1039
+
1040
+ /**
1041
+ * The result of a CSSOM walk: every `@keyframes` rule reconstructed into a kf
1042
+ * animation, plus the WALK-LEVEL diagnostics (the `CORS_SKIP` rows a
1043
+ * cross-origin sheet produces — the honesty surface S3). A consumer reads
1044
+ * `animations` for the recovered objects and `diagnostics` for the citable
1045
+ * reasons the walk could not complete a step faithfully — NEVER a silent drop.
1046
+ */
1047
+ export declare interface IngestResult<V extends Vars = any> {
1048
+ /** Every `@keyframes` rule reconstructed, keyed by its CSS name. */
1049
+ animations: Map<string, IngestedAnimation<V>>;
1050
+ /**
1051
+ * Walk-level diagnostics — the `CORS_SKIP` rows (a cross-origin sheet whose
1052
+ * `cssRules` throws `SecurityError`) and any other reason the walk could not
1053
+ * read a sheet. A typed {@link Diagnostic}[] on the same stable-`code` idiom
1054
+ * as `resolveKeyframes`; empty when every sheet was same-origin + parsed.
1055
+ */
1056
+ diagnostics: Diagnostic[];
1057
+ }
1058
+
1059
+ declare type InputAnimationOptions = Partial<{
1060
+ duration: number | string;
1061
+ delay: number | string;
1062
+ iterationCount: number | string | "infinite" | undefined;
1063
+ direction: (typeof DIRECTIONS)[number];
1064
+ fillMode: (typeof FILL_MODES)[number];
1065
+ timingFunction: TimingFunction | Easing | TimingFunctionNames | string | undefined;
1066
+ /** When true (default), eligible animations may use the Web Animations API for compositor-thread execution. Set to false to force rAF. */
1067
+ useWAAPI: boolean;
1068
+ /** When true, snap `play()` to the final frame under `prefers-reduced-motion: reduce`. Default false. */
1069
+ respectReducedMotion: boolean;
1070
+ colorSpace?: ColorSpace;
1071
+ hueMethod?: HueInterpolationMethod;
1072
+ /** The LAYER-level `animation-composition` operator (L.W1 S5). Omission ⇒ `replace`. */
1073
+ composite?: CompositeOperator;
1074
+ }>;
1075
+
1076
+ declare const jumpDown: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
1077
+
1078
+ declare const jumpUp: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
1079
+
1080
+ /**
1081
+ * The core animation engine — keyframes, timing, interpolation, playback.
1082
+ *
1083
+ * PKG-3 RENAME (L.W8): formerly `Animation`; renamed to `KeyframesAnimation`
1084
+ * because the old name collided with the ambient `globalThis.Animation` (WAAPI),
1085
+ * leaking a suffixed collision alias into the d.ts. The legacy `Animation`
1086
+ * re-export alias was DROPPED in 5.0.0 (Q.WE1 — NO-LEGACY).
1087
+ */
1088
+ export declare class KeyframesAnimation<V extends Vars = any> {
1089
+ id: number;
1090
+ name: string | undefined;
1091
+ superKey: string | undefined;
1092
+ targets: HTMLElement[];
1093
+ options: AnimationOptions;
1094
+ /** The frame-compilation half — template frames → sampled `frames[]`. The
1095
+ * class composes one and delegates `addFrame`/`parse` + the frame accessors
1096
+ * to it. READ-ONLY surface (G.W19): the backing `_compiler` is written ONLY
1097
+ * by the constructor + `adoptCompiled` (via `_setCompiler`); an external
1098
+ * `animation.compiler = …` reach-in is a COMPILE error (the live-options
1099
+ * desync lock). */
1100
+ private _compiler;
1101
+ get compiler(): FrameCompiler<V>;
1102
+ /** THE rAF owner for this animation — the standalone play loop and the WAAPI
1103
+ * shadow tick both ride it, so `stop()` halts either uniformly. */
1104
+ readonly playback: RAFPlayback;
1105
+ /** The standalone-play machine's OWN run-state (R.W2 — DI by composition):
1106
+ * the deferred play resolver, the held play promise, the live WAAPI handles,
1107
+ * the bound frame callback, the hoisted zero-alloc interp buffer. The five
1108
+ * fields formerly privacy-inverted onto the class body + re-published through
1109
+ * the excised `PlaybackHost` interface; the `./playback` free functions now
1110
+ * own them via `this._playback` directly (no cast, no re-publication). */
1111
+ readonly _playback: PlaybackState;
1112
+ startTime: number | undefined;
1113
+ pausedTime: number;
1114
+ t: number;
1115
+ iteration: number;
1116
+ /** Structured parse/honoring diagnostics (K.W7 S4) — a FLAT additive array
1117
+ * of stable-coded {@link Diagnostic} rows surfaced from `resolveKeyframes` +
1118
+ * the engine's composition-fallback rows; empty on a clean parse. Every
1119
+ * SILENT fallback site is mirrored here (`proof:diagnostics-channel`). */
1120
+ diagnostics: Diagnostic[];
1121
+ /** The captured UNDERLYING base value per composited leaf (K.W7 S1) — the
1122
+ * per-element numeric base `add`/`accumulate` accumulates ONTO; empty for a
1123
+ * pure-`replace` animation. INTERNAL — read by `./interpolate` (R.W2). */
1124
+ _compositionBase: Map<string, number[]>;
1125
+ /** Properties whose non-numeric composite already emitted its
1126
+ * `COMPOSITION_FALLBACK` row (once per property, not per frame). INTERNAL —
1127
+ * read by `./interpolate` (R.W2). */
1128
+ _compositionFallbackSeen: Set<string>;
1129
+ /** True once a non-`replace` operator was seen — the hot path skips ALL
1130
+ * composition work when false. INTERNAL — read by `./interpolate` (R.W2). */
1131
+ _hasComposition: boolean;
1132
+ started: boolean;
1133
+ done: boolean;
1134
+ reversed: boolean;
1135
+ paused: boolean;
1136
+ /** True when an `AnimationGroup` drives this animation's `advanceTo()`/
1137
+ * `interpFrames()` from its own rAF loop. Standalone `.play()` throws when
1138
+ * set rather than racing the group. */
1139
+ managed: boolean;
1140
+ /** If the most recent `play()` fell back from WAAPI to rAF despite
1141
+ * `useWAAPI: true`, this records the reason. Queryable; no console output. */
1142
+ waapiIneligibleReason: string | undefined;
1143
+ unflatten: boolean;
1144
+ /** The compile-stable union of every frame's `flatVars` keys, fixed at
1145
+ * `parse` — what `clearBuffer` null-fills to keep a reused buffer stale-free
1146
+ * WITHOUT `delete` (F.W4 S1, the V8 dictionary-mode trap). Exposed read-only
1147
+ * as `flatKeys` so the group sizes its composite buffer the same way.
1148
+ * INTERNAL — read by `./interpolate` (R.W2). */
1149
+ _stableKeys: string[];
1150
+ /** The consumer's EXPLICIT constructor options (NOT merged with defaults) —
1151
+ * retained so `fromString` can layer a parsed style-rule `animation`
1152
+ * shorthand UNDER them (constructor-explicit wins, F.W8). */
1153
+ protected _ctorOptions: Partial<InputAnimationOptions>;
1154
+ /** The compile-stable union of this animation's interpolated keys. */
1155
+ get flatKeys(): readonly string[];
1156
+ /**
1157
+ * The instance's ONE default DOM-style renderer, allocated once. "Did the
1158
+ * consumer supply a custom transform?" is a reference comparison against this
1159
+ * single value ({@link usesDefaultRenderer}) — typed and bind-proof.
1160
+ */
1161
+ protected readonly _defaultTransform: TransformFunction<V>;
1162
+ /** True when `fn` is this instance's default DOM-style renderer. */
1163
+ usesDefaultRenderer(fn: TransformFunction<V> | undefined): boolean;
1164
+ /**
1165
+ * Fire a lifecycle `AnimationEvent` on each bound target (R.W2 — F-6, body in
1166
+ * `./playback`). INTERNAL: the play machine calls it on the concrete
1167
+ * animation — kept ON the class but NOT `private`, reached by direct field
1168
+ * access (the old `PlaybackHost` re-publication + cast are excised).
1169
+ */
1170
+ dispatchAnimationEvent(type: string): void;
1171
+ constructor(options?: Partial<InputAnimationOptions>, targets?: HTMLElement[] | HTMLElement | undefined, name?: string | undefined, superKey?: string | undefined);
1172
+ get templateFrames(): TemplateAnimationFrame<V>[];
1173
+ set templateFrames(value: TemplateAnimationFrame<V>[]);
1174
+ get parsedVars(): ParsedVarMap[];
1175
+ get frames(): AnimationFrame<V>[];
1176
+ get frameId(): number;
1177
+ /** Append a template frame (delegated to the compiler). Chainable. */
1178
+ addFrame<K extends V>(start: number | string | ValueUnit<number>, vars: Partial<K>, transform?: TransformFunction<K>, timingFunction?: InputAnimationOptions["timingFunction"], composition?: CompositeOperator): KeyframesAnimation<K>;
1179
+ /** Compile the template frames into the sampled `frames[]` (R.W2 body in
1180
+ * `./compile-bridge`). Chainable. */
1181
+ parse(): this;
1182
+ /**
1183
+ * Adopt another animation's ALREADY-COMPILED state as ONE atomic motion
1184
+ * (G.W19 — body in `./compile-bridge`): moves the `{ compiler, options,
1185
+ * unflatten }` triad + re-binds the live-options reference BY CONSTRUCTION
1186
+ * (`proof:adopt-compiled`). Chainable.
1187
+ */
1188
+ adoptCompiled(source: KeyframesAnimation<V>): this;
1189
+ /** INTERNAL (R.W2): the sanctioned backing-field write for `_compiler` (used
1190
+ * ONLY by `./compile-bridge`'s `adoptCompiled`). The `compiler` accessor
1191
+ * stays get-only — an external `animation.compiler = …` reach-in is a COMPILE
1192
+ * error (the G.W19 live-options-desync lock). */
1193
+ _setCompiler(compiler: FrameCompiler<V>): void;
1194
+ setTimingFunction(timingFunction: InputAnimationOptions["timingFunction"]): this;
1195
+ setIterationCount(iterationCount: InputAnimationOptions["iterationCount"]): this;
1196
+ setDuration(duration: InputAnimationOptions["duration"]): this;
1197
+ setDelay(delay: InputAnimationOptions["delay"]): this;
1198
+ setDirection(direction: InputAnimationOptions["direction"]): this;
1199
+ setFillMode(fillMode: InputAnimationOptions["fillMode"]): this;
1200
+ setUseWAAPI(useWAAPI: InputAnimationOptions["useWAAPI"]): this;
1201
+ setRespectReducedMotion(respectReducedMotion: InputAnimationOptions["respectReducedMotion"]): this;
1202
+ setColorSpace(colorSpace: InputAnimationOptions["colorSpace"]): this;
1203
+ setHueMethod(hueMethod: InputAnimationOptions["hueMethod"]): this;
1204
+ setComposite(composite: InputAnimationOptions["composite"]): this;
1205
+ setOptions(options: Partial<InputAnimationOptions>): this;
1206
+ reverse(): this;
1207
+ fillForwards(): void;
1208
+ fillBackwards(): void;
1209
+ /** Where the playhead rests after a completed play (forwards/both → final;
1210
+ * none/backwards → initial) — body in `./interpolate`. */
1211
+ get restPosition(): "initial" | "final";
1212
+ /** Paint the rest frame per the fill contract (body in `./interpolate`). */
1213
+ paintRest(): void;
1214
+ /** The named-selector PLAY-TIME guard (Q.WD1 S3 — body in `./interpolate`).
1215
+ * INTERNAL (R.W2): the play machine + `at()` call it; NOT `private`. */
1216
+ assertNoUnresolvedNamedSelector(): void;
1217
+ /** Stateless progress query — maps [0,1] from first to last keyframe,
1218
+ * direction-agnostic (`apply=true` invokes transforms). Body in
1219
+ * `./interpolate`. */
1220
+ at(progress: number, apply?: boolean): Record<string, ValueUnit[]>;
1221
+ /**
1222
+ * Interpolate all active frames at time `t` — the hot path (once per rAF
1223
+ * frame). R.W2 body in `./interpolate`; this is the thin public sampling
1224
+ * delegate the group, sequence, WAAPI build, and `at()` all drive. Zero-alloc
1225
+ * + fast-properties contract preserved (proof:standalone-zero-alloc /
1226
+ * proof:interp-fastprops).
1227
+ */
1228
+ interpFrames(t: number, transformFrames?: boolean, out?: Record<string, ValueUnit[]>): Record<string, ValueUnit[]>;
1229
+ onStart(): Promise<void> | undefined;
1230
+ onEnd(): void;
1231
+ advanceTo(t: number): number | Promise<number>;
1232
+ /** One frame of the standalone rAF play path (driven by `RAFPlayback.loop`). */
1233
+ private _frame;
1234
+ /** The completion front-door (G.W13) — `await anim.finished` resolves once
1235
+ * the in-flight play settles (a settled/never-played animation resolves
1236
+ * immediately). Reads the ONE held promise off the composed `_playback`. */
1237
+ get finished(): Promise<void>;
1238
+ play(): Promise<void>;
1239
+ pause(): this;
1240
+ resume(): this;
1241
+ /** The explicit flip: pauses if playing, resumes if paused. */
1242
+ toggle(): this;
1243
+ stop(): void;
1244
+ playing(): boolean;
1245
+ get effectiveT(): number;
1246
+ settle(): this;
1247
+ reset(): this;
1248
+ setTargets(...targets: HTMLElement[]): this;
1249
+ group(...animations: KeyframesAnimation<V>[]): AnimationGroup<V>;
1250
+ }
1251
+
1252
+ /**
1253
+ * Options for `AnimationGroup.transitionLayer` / `crossfade` (K.W11 PHYS-C).
1254
+ * The `spring` half is the {@link SpringProgressOptions} subset that shapes the
1255
+ * weight trajectory (`response`/`dampingFraction`/`bounce`-via-config); the
1256
+ * spring is ALWAYS seeded at the layer's CURRENT weight and targets the new
1257
+ * weight, so `initial`/`initialVelocity` are managed internally and excluded.
1258
+ */
1259
+ declare type LayerTransitionSpring = Partial<Omit<SpringProgressOptions, "initial" | "initialVelocity">>;
1260
+
1261
+ /** Looping animations — run continuously (`iterationCount: Infinity`). */
1262
+ declare const loopPresets: {
1263
+ readonly heartbeat: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
1264
+ readonly glow: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
1265
+ readonly spinner: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
1266
+ readonly rainbowText: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
1267
+ readonly skeletonLoading: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
1268
+ readonly gradientBackground: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
1269
+ readonly parallaxScroll: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
1270
+ readonly hover: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
1271
+ readonly typingCursor: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
1272
+ };
1273
+
1274
+ /** A sampled point on a path polyline. */
1275
+ export declare interface MorphPoint {
1276
+ x: number;
1277
+ y: number;
1278
+ /**
1279
+ * The tangent angle (radians) of the source path at this point — populated
1280
+ * ONLY when the morph is built with `orient: true` (the
1281
+ * `PathGeometry.sampleAtLength` tangent, the `rotate: auto` value). Absent
1282
+ * (`undefined`) on a position-only morph (the default ~130-key floor).
1283
+ */
1284
+ angle?: number;
1285
+ }
1286
+
1287
+ /**
1288
+ * `MorphSVG` — the class form of {@link fromMorphSVG}, for callers who prefer a
1289
+ * named primitive alongside `CSSKeyframesAnimation` / `MotionPath` / `DrawSVG`.
1290
+ * Construction is the factory: `new MorphSVG(from, to).animation` is the control
1291
+ * handle. The factory is the canonical entry; this is a thin ergonomic wrapper
1292
+ * that ALSO exposes {@link sampleD} — the morphed `d` string at a normalized
1293
+ * `t`, reassembled from the interpolated point coordinates.
1294
+ */
1295
+ export declare class MorphSVG<V extends Record<string, any> = any> {
1296
+ /** The underlying coordinate-interpolating animation — the control handle. */
1297
+ readonly animation: CSSKeyframesAnimation<V>;
1298
+ /** The uniform-sample count (point pairs = samples + 1). */
1299
+ readonly samples: number;
1300
+ constructor(from: string, to: string, options?: MorphSVGOptions);
1301
+ /**
1302
+ * The morphed SVG path `d` string at a normalized `t` in `[0, 1]`, built
1303
+ * from the engine's interpolated point coordinates (`0` → the `from`
1304
+ * polyline, `1` → the `to` polyline, `0.5` → the point-wise midpoint). The
1305
+ * value a consumer renders (`<path d>` / a `d:` custom property), distinct
1306
+ * from BOTH endpoint polylines at any interior `t`.
1307
+ */
1308
+ sampleD(t: number): string;
1309
+ /** Start (or re-enter) the morph play loop. */
1310
+ play(): Promise<void>;
1311
+ /** Pause the play loop, retaining the playhead. */
1312
+ pause(): this;
1313
+ /** Halt and rewind the play loop. */
1314
+ stop(): this;
1315
+ /** Resolve once the morph completes — the {@link Animation.finished} front-door. */
1316
+ get finished(): Promise<void>;
1317
+ }
1318
+
1319
+ export declare interface MorphSVGOptions extends Partial<InputAnimationOptions> {
1320
+ /**
1321
+ * The number of uniform arc-length steps each path is sampled at. The
1322
+ * morph emits `samples + 1` point-pairs (the endpoints inclusive), and the
1323
+ * MATCHED count between the `0%` and `100%` frames is what makes the
1324
+ * polyline channel interpolable. Default `64` — the keystone-validated
1325
+ * resolution. Must be an integer `>= 2` (a 1-sample "morph" is just the two
1326
+ * endpoints with no body); a smaller / non-integer value throws.
1327
+ */
1328
+ samples?: number;
1329
+ /**
1330
+ * Optional target the morph drives. When given, the morph reassembles the
1331
+ * interpolated polyline into a `d` string EACH FRAME and writes it onto the
1332
+ * target's style as BOTH:
1333
+ * • the `d:` CSS property — `target.style.d = path("M … L …")` — which
1334
+ * Chromium and recent Safari render DIRECTLY on a `<path>`/`<svg>`
1335
+ * (no author wiring needed), and
1336
+ * • the `--morph-d` custom property — `var(--morph-d)` — the cross-browser
1337
+ * author channel + the Firefox-lags fallback (`<path style="d:
1338
+ * var(--morph-d)">`, or a JS reader via {@link MorphSVG.sampleD}).
1339
+ *
1340
+ * The render rides the engine's per-frame renderer seam (a custom
1341
+ * `transform` supplied to `fromKeyframes`), NOT the default DOM-style
1342
+ * renderer — so the morph is WAAPI-ineligible by construction and always
1343
+ * runs the rAF path where the renderer fires. The reassembly reuses an
1344
+ * instance-level scratch point-array, so the steady frame mints nothing.
1345
+ *
1346
+ * Default target-less: the returned handle IS the control surface, exactly
1347
+ * like `fromDrawSVG`'s target-less form — {@link MorphSVG.sampleD}(t) reads
1348
+ * the morphed `d` directly without a DOM write.
1349
+ */
1350
+ target?: HTMLElement | SVGElement;
1351
+ /**
1352
+ * Orient-along-path: when `true`, the morph ALSO samples each point's
1353
+ * tangent angle (radians) from `PathGeometry.sampleAtLength` and emits a
1354
+ * per-point `--morph-{i}-angle` channel that interpolates the `from`→`to`
1355
+ * tangent across `t` — the `rotate: auto` value a consumer reads to bank a
1356
+ * glyph along the morphed outline. Default `false` (a position-only morph
1357
+ * stays at the ~130-key floor; orient adds ~65 angle keys ONLY when asked,
1358
+ * pre-empting a "morph is too heavy" perf concern).
1359
+ */
1360
+ orient?: boolean;
1361
+ /**
1362
+ * Auto-start the play loop after construction + targeting. Default true.
1363
+ * `false` returns a constructed, NOT-yet-playing handle so the caller can
1364
+ * drive the returned animation (`.play()` / `.pause()` / `.stop()`).
1365
+ */
1366
+ autoPlay?: boolean;
1367
+ }
1368
+
1369
+ /**
1370
+ * `MotionPath` — the class form of {@link fromMotionPath}, for callers who
1371
+ * prefer a named primitive alongside `CSSKeyframesAnimation`. Construction is
1372
+ * the factory: `new MotionPath(target, { path }).animation` is the control
1373
+ * handle. The factory is the canonical entry; this is a thin ergonomic wrapper.
1374
+ */
1375
+ export declare class MotionPath<V extends Record<string, any> = any> {
1376
+ /** The underlying offset-distance animation — the control handle. */
1377
+ readonly animation: CSSKeyframesAnimation<V>;
1378
+ constructor(target: HTMLElement | HTMLElement[], options: MotionPathOptions);
1379
+ /** Start (or re-enter) the path-motion play loop. */
1380
+ play(): Promise<void>;
1381
+ /** Pause the play loop, retaining the playhead. */
1382
+ pause(): this;
1383
+ /** Halt and rewind the play loop. */
1384
+ stop(): this;
1385
+ }
1386
+
1387
+ export declare interface MotionPathOptions extends Partial<InputAnimationOptions> {
1388
+ /**
1389
+ * The author `offset-path` (required) — set on the target so the browser
1390
+ * resolves position from `offset-distance`. See {@link OffsetPath}.
1391
+ */
1392
+ path: OffsetPath;
1393
+ /**
1394
+ * Start of the `offset-distance` sweep. Default `"0%"` (the path origin).
1395
+ * Any `<length-percentage>` the property accepts; `%` is path-relative.
1396
+ */
1397
+ from?: string;
1398
+ /** End of the sweep. Default `"100%"` (the path end). */
1399
+ to?: string;
1400
+ /**
1401
+ * Optional `offset-rotate` set on the target for tangent-following — e.g.
1402
+ * `"auto"` (the element rotates to face along the path) or `"auto 90deg"`.
1403
+ * A STATIC author value (not animated); omitted leaves the CSS default.
1404
+ */
1405
+ rotate?: string;
1406
+ /**
1407
+ * Auto-start the play loop after construction + targeting. Default true.
1408
+ * `false` returns a constructed, targeted, NOT-yet-playing handle so the
1409
+ * caller can drive the returned animation (`.play()` / `.pause()` / `.stop()`).
1410
+ */
1411
+ autoPlay?: boolean;
1412
+ }
1413
+
1414
+ declare type NativeScrollAttachment = {
1415
+ attached: true;
1416
+ animations: globalThis.Animation[];
1417
+ } | {
1418
+ attached: false;
1419
+ reason: string;
1420
+ };
1421
+
1422
+ /**
1423
+ * Spec for the ADDITIVE native scroll-driven bridge (D-LIB-2 / F-5).
1424
+ *
1425
+ * A `kind: "scroll"` request maps to the platform `ScrollTimeline` (scroll
1426
+ * progress over a `source` scroller); `kind: "view"` maps to `ViewTimeline`
1427
+ * (a `subject`'s view progress through its scrollport). `axis` defaults to the
1428
+ * platform default (`block`). value.js-free — these are DOM globals.
1429
+ */
1430
+ declare type NativeTimelineSpec = {
1431
+ kind: "scroll";
1432
+ source?: Element | null;
1433
+ axis?: ScrollTimelineAxis;
1434
+ } | {
1435
+ kind: "view";
1436
+ subject: Element;
1437
+ axis?: ScrollTimelineAxis;
1438
+ inset?: string;
1439
+ };
1440
+
1441
+ declare const notificationBounce: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
1442
+
1443
+ /**
1444
+ * Q.WB3 S2 — the precomputed SoA fold layout for ONE compiled frame's NUMERIC
1445
+ * interp subset (the single-animation `processFrame` analog of the compositor's
1446
+ * `SoALayerPlan`). Built ONCE at `parse` over the STABLE iv set (the F.W4
1447
+ * zero-alloc discipline — NO per-frame allocation):
1448
+ * - `numeric` — the numeric ivs (numeric start+stop, NOT computed, NOT color),
1449
+ * in slot order. Each iv's interp-carrier `value` is the `ValueUnit` slot the
1450
+ * strided write-back fills (the SAME slot `lerpValue` writes today).
1451
+ * - `from` / `to` — the packed endpoint `Float64Array`s (`start.value` /
1452
+ * `stop.value`), one slot per `numeric[s]`.
1453
+ * - `out` — the per-frame scratch the `lerpArray` fold writes into (reused
1454
+ * across every frame — zero per-frame alloc).
1455
+ * - `boxed` — the residual ivs (color / computed / mixed) the fold CANNOT cover
1456
+ * — walked by the existing per-element `lerpValue`, UNCHANGED.
1457
+ * The boxed-color tail is the GATED `ColorChannelPlan` consume's frontier (S4,
1458
+ * value.js 1.2.0) — NOT this NOW numeric arm.
1459
+ */
1460
+ declare interface NumericFoldPlan<V extends Vars> {
1461
+ numeric: Array<InterpolatedVar<V>>;
1462
+ from: Float64Array;
1463
+ to: Float64Array;
1464
+ out: Float64Array;
1465
+ boxed: Array<InterpolatedVar<V>>;
1466
+ }
1467
+
1468
+ /**
1469
+ * The author's path geometry — the `offset-path` value set on the target. Any
1470
+ * valid CSS `offset-path`: a `path()` data string, a `ray()`, a `url(#id)`
1471
+ * SVG-path reference, or a basic shape. The browser resolves it to positions;
1472
+ * keyframes never parses it.
1473
+ */
1474
+ export declare type OffsetPath = string;
1475
+
1476
+ declare const parallaxScroll: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
1477
+
1478
+ declare type ParsedVarMap = Record<string, ValueArray>;
1479
+
1480
+ /**
1481
+ * SO-1 PARSE — extract the full scroll-grammar (`animation-timeline` /
1482
+ * `animation-range` / `timeline-scope` / `animation-trigger`) from a scroll-
1483
+ * driven stylesheet (string OR a pre-parsed `Stylesheet`) into a typed
1484
+ * `CSSTimelineOptions`. Consumes value.js 0.13.0's `extractTimelineOptions` over
1485
+ * the parsed stylesheet — the acyclic-spine consume edge (the grammar lives in
1486
+ * value.js, where the `animation-*` parsing already lives; kf re-derives no
1487
+ * parallel name table).
1488
+ *
1489
+ * @example
1490
+ * parseScrollCSS(`.card {
1491
+ * animation: reveal linear both;
1492
+ * animation-timeline: view();
1493
+ * animation-range: entry 0% cover 40%;
1494
+ * }`)
1495
+ * // → { timeline: { kind: "view" },
1496
+ * // range: { start: { phase: "entry", offset: "0%" },
1497
+ * // end: { phase: "cover", offset: "40%" } } }
1498
+ */
1499
+ export declare function parseScrollCSS(input: string | Stylesheet): CSSTimelineOptions;
1500
+
1501
+ /**
1502
+ * Parse an `animation-range` shorthand (`entry 0% cover 40%`) to its typed
1503
+ * `{ start, end? }` form — a pass-through to value.js's `parseAnimationRange`.
1504
+ */
1505
+ export declare function parseScrollRange(input: string): AnimationRangeValue;
1506
+
1507
+ /**
1508
+ * Parse a single `animation-timeline` value (`scroll(root block)`, `view()`,
1509
+ * `--named`, `auto`, `none`) to its typed form — a thin pass-through to
1510
+ * value.js's `parseAnimationTimeline` (kf consumes the VALUE grammar; it never
1511
+ * re-derives a local parser). Emits the value VERBATIM; resolves no defaults.
1512
+ */
1513
+ export declare function parseScrollTimeline(input: string): AnimationTimelineValue;
1514
+
1515
+ /**
1516
+ * SO-3 the `position:sticky` pin SYNTHESIS — EMIT the pin CSS (kf authors the
1517
+ * platform's pin; the browser pins on the compositor). The pin uses
1518
+ * `position:sticky`, NEVER `transform:translateY` (SO-4 KILLED — cross-thread
1519
+ * jitter). Returns a declaration block string the consumer applies to the
1520
+ * pinned element. `top` defaults to `0` (pin to the scrollport top).
1521
+ *
1522
+ * @example
1523
+ * pinCSS() // → "position: sticky; top: 0px;"
1524
+ * pinCSS({ top: 24 }) // → "position: sticky; top: 24px;"
1525
+ */
1526
+ export declare function pinCSS(opts?: {
1527
+ top?: number;
1528
+ bottom?: number;
1529
+ }): string;
1530
+
1531
+ /**
1532
+ * The standalone-play machine's OWN run-state (R.W2 — replaces the
1533
+ * `PlaybackHost` privacy-inversion interface). `KeyframesAnimation` composes
1534
+ * ONE of these as a `readonly _playback` field, so the play-machine state has a
1535
+ * single owner instead of being scattered as privates the class re-published
1536
+ * through a cast:
1537
+ *
1538
+ * - `resolvePromise` — the standalone-loop deferred resolver (`playRAF`
1539
+ * arms it, `resolvePlay` fires it).
1540
+ * - `_playingPromise` — the held in-flight play promise (`get finished`
1541
+ * exposes it; `play` arms it; the `finally` clears it).
1542
+ * - `_waAnimations` — the live WAAPI compositor animations during a WAAPI
1543
+ * delegation (one per target); cancelled on teardown.
1544
+ * - `_boundFrame` — the frame callback bound ONCE at construction, never
1545
+ * re-bound per loop (the per-loop-closure-free idiom).
1546
+ * - `_interpOut` — the ONE hoisted interp buffer the play loop reuses
1547
+ * every frame (zero-alloc steady state).
1548
+ */
1549
+ declare class PlaybackState {
1550
+ resolvePromise: ((value: void | PromiseLike<void>) => void) | null;
1551
+ _playingPromise: Promise<void> | null;
1552
+ _waAnimations: globalThis.Animation[];
1553
+ readonly _boundFrame: (t: number) => boolean | Promise<boolean>;
1554
+ readonly _interpOut: Record<string, unknown>;
1555
+ constructor(frameCb: (t: number) => boolean | Promise<boolean>);
1556
+ }
1557
+
1558
+ export declare namespace presets {
1559
+ export {
1560
+ fadeIn,
1561
+ fadeOut,
1562
+ pulse,
1563
+ shake,
1564
+ bounce,
1565
+ flipPreset,
1566
+ rotateIn,
1567
+ slideIn,
1568
+ heartbeat,
1569
+ glow,
1570
+ typewriter,
1571
+ rainbowText,
1572
+ warpLeft,
1573
+ warpRight,
1574
+ blurIn,
1575
+ blurOut,
1576
+ blurInOut,
1577
+ progressBar,
1578
+ skeletonLoading,
1579
+ textFocusBlur,
1580
+ gradientBackground,
1581
+ rotateScale,
1582
+ typingCursor,
1583
+ accordionExpand,
1584
+ notificationBounce,
1585
+ spinner,
1586
+ parallaxScroll,
1587
+ slideInLeft,
1588
+ slideOutLeft,
1589
+ slideInRight,
1590
+ slideOutRight,
1591
+ hover,
1592
+ jumpUp,
1593
+ jumpDown,
1594
+ springScaleIn,
1595
+ springSlideIn,
1596
+ springPop,
1597
+ springWobble,
1598
+ enterPresets,
1599
+ exitPresets,
1600
+ attentionPresets,
1601
+ loopPresets,
1602
+ presetTaxonomy
1603
+ }
1604
+ }
1605
+
1606
+ /**
1607
+ * The full preset taxonomy, grouped by intent. Each leaf is one of the
1608
+ * existing exported factory functions — the taxonomy is a discovery index over
1609
+ * the library, not a second copy of it.
1610
+ */
1611
+ declare const presetTaxonomy: {
1612
+ readonly enter: {
1613
+ readonly fadeIn: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
1614
+ readonly slideIn: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
1615
+ readonly slideInLeft: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
1616
+ readonly slideInRight: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
1617
+ readonly rotateIn: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
1618
+ readonly blurIn: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
1619
+ readonly springScaleIn: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
1620
+ readonly springSlideIn: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
1621
+ readonly jumpUp: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
1622
+ };
1623
+ readonly exit: {
1624
+ readonly fadeOut: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
1625
+ readonly slideOutLeft: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
1626
+ readonly slideOutRight: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
1627
+ readonly blurOut: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
1628
+ readonly warpLeft: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
1629
+ readonly warpRight: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
1630
+ readonly jumpDown: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
1631
+ };
1632
+ readonly attention: {
1633
+ readonly pulse: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
1634
+ readonly shake: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
1635
+ readonly bounce: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
1636
+ readonly flip: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
1637
+ readonly notificationBounce: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
1638
+ readonly springPop: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
1639
+ readonly springWobble: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
1640
+ };
1641
+ readonly loop: {
1642
+ readonly heartbeat: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
1643
+ readonly glow: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
1644
+ readonly spinner: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
1645
+ readonly rainbowText: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
1646
+ readonly skeletonLoading: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
1647
+ readonly gradientBackground: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
1648
+ readonly parallaxScroll: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
1649
+ readonly hover: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
1650
+ readonly typingCursor: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
1651
+ };
1652
+ };
1653
+
1654
+ declare const progressBar: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
1655
+
1656
+ declare const pulse: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
1657
+
1658
+ /**
1659
+ * THE managed rAF driver. Owns the rAF handle, start timestamp, dt clock,
1660
+ * and resolve callback for every loop in the engine. ONE generation-guarded
1661
+ * frame-scheduler core ({@link _run}) backs three thin entry shapes:
1662
+ *
1663
+ * - {@link play} — duration-based progress loop (`NumericAnimation`,
1664
+ * `ElementMorph`), with the light reduced-motion snap gate built in.
1665
+ * - {@link drive} — settle-based dt loop over a {@link Tickable}
1666
+ * (`SmoothProgress`, `SpringProgress`): steps until the stepper settles,
1667
+ * auto-stopping; idempotent so target re-seats can re-arm it.
1668
+ * - {@link loop} — self-rescheduling frame loop over a maybe-async callback
1669
+ * (`Animation`, `AnimationGroup`, the WAAPI shadow tick): the callback
1670
+ * returns `true` to continue; a thenable result defers rescheduling until
1671
+ * it resolves, so a slow async frame never double-schedules, while a
1672
+ * sync frame (the steady `Animation`/group `_frame`, J.W6 S1) reschedules
1673
+ * inline on the sync fast-path.
1674
+ *
1675
+ * Because all three ride one core, none can diverge — the generation guard
1676
+ * that makes `loop` safe against a `stop()` + restart mid-frame protects
1677
+ * `drive` and `play` identically.
1678
+ *
1679
+ * The formerly hand-rolled copies of this lifecycle — `SmoothProgress` /
1680
+ * `SpringProgress` `_startLoop`/`_stopLoop` byte-siblings, the
1681
+ * `AnimationGroup` draw loop, `Animation._playRAF`, and the WAAPI shadow
1682
+ * loop — all delegate here. No other module owns a rAF handle.
1683
+ *
1684
+ * BIND-PROOF BY CONSTRUCTION (I.W1 S1). The public control surface —
1685
+ * `play`/`drive`/`loop`/`stop` — is declared as ARROW CLASS-FIELDS, not
1686
+ * prototype methods, so each captures `this` at construction. A consumer can
1687
+ * `const { stop } = playback`, pass `playback.stop` straight as a callback, or
1688
+ * call `playback.stop()` as a member — ALL THREE are safe, forever, because the
1689
+ * receiver can never be dropped. This closes the entire unbound-method crash
1690
+ * class at the engine seam (the `this._gen++` throw a free-standing `stop()`
1691
+ * used to raise inside a Vue reactive flush — `rootcause-rc-dfa-gen.md`):
1692
+ * binding correctness lives ONCE here, never re-asserted per call site. The
1693
+ * arrow fields move these four methods onto the INSTANCE rather than the
1694
+ * prototype — a per-instance allocation accepted because `RAFPlayback`
1695
+ * instances are FEW and long-lived (one per scene/animation). The private
1696
+ * `_run`/`_cleanup` stay prototype methods: they are only ever reached as
1697
+ * `this._run(…)` internally, never extracted as values, so they need no bind.
1698
+ */
1699
+ declare class RAFPlayback {
1700
+ private _rafId;
1701
+ private _startTime;
1702
+ private _lastFrameT;
1703
+ private _resolve;
1704
+ /**
1705
+ * Monotonic generation counter, bumped on every `play`/`drive`/`loop`/
1706
+ * `stop`. A loop's async frame captures its generation and reschedules
1707
+ * ONLY when it still matches — so a `stop()` + restart while an async
1708
+ * frame is mid-flight cannot let the stale callback re-arm a second rAF
1709
+ * chain (the generation-unaware `_rafId !== null` guard could, because
1710
+ * the restart repopulated `_rafId`).
1711
+ */
1712
+ private _gen;
1713
+ /** True while this driver owns a scheduled rAF callback. */
1714
+ get running(): boolean;
1715
+ /**
1716
+ * THE generation-guarded frame-scheduler core. `step(now)` does one
1717
+ * frame's work and returns `true` to continue, `false` to finish; it
1718
+ * may be async (the next frame waits for it). Every frame captures the
1719
+ * generation taken at start, and reschedules ONLY when it still matches
1720
+ * — so a `stop()` + restart mid-frame (even while an async `step` is in
1721
+ * flight) cannot let a stale chain re-arm a second rAF on top of the
1722
+ * restart's freshly-repopulated `_rafId`. On `false` (or a stale
1723
+ * generation that finishes) the loop cleans up. `play`/`drive`/`loop`
1724
+ * are the three thin entry shapes over this one core.
1725
+ */
1726
+ private _run;
1727
+ /**
1728
+ * Drive `onTick(progress)` once per frame for `duration` ms.
1729
+ * `progress` is clamped to [0, 1]; the loop terminates after the
1730
+ * frame at `progress === 1`. The returned promise resolves when
1731
+ * the animation completes naturally or is interrupted by `stop()`.
1732
+ *
1733
+ * Under `options.respectReducedMotion` + an active
1734
+ * `prefers-reduced-motion: reduce` query, snaps to the final frame —
1735
+ * `onTick(1)` fires once, no rAF loop is spawned, and the promise
1736
+ * resolves on the next microtask.
1737
+ */
1738
+ play: (duration: number, onTick: (progress: number) => void, options?: RAFPlaybackOptions) => Promise<void>;
1739
+ /**
1740
+ * Drive a {@link Tickable}'s dt-stepper once per frame until it
1741
+ * settles, invoking `onFrame` after each step. Idempotent — a call
1742
+ * while the loop is already running is a no-op, so consumers re-arm
1743
+ * freely on every target re-seat. The loop auto-stops on settle.
1744
+ */
1745
+ drive: (tickable: Tickable, onFrame?: () => void) => void;
1746
+ /**
1747
+ * Self-rescheduling frame loop over an async callback. `cb(now)`
1748
+ * returns `true` to continue; the next frame is scheduled only after
1749
+ * the callback (and any awaited work inside it) completes. `stop()`
1750
+ * between frames halts the loop — the in-flight callback finishes,
1751
+ * no further frame is scheduled.
1752
+ */
1753
+ loop: (cb: (now: number) => boolean | Promise<boolean>) => void;
1754
+ /** Cancel a running playback. A pending play promise resolves immediately. */
1755
+ stop: () => void;
1756
+ private _cleanup;
1757
+ }
1758
+
1759
+ /** Per-playback options for {@link RAFPlayback.play}. */
1760
+ declare interface RAFPlaybackOptions {
1761
+ /**
1762
+ * Honor `prefers-reduced-motion: reduce` by snapping to the final frame
1763
+ * (`onTick(1)`) in a single paint instead of running the rAF loop. The
1764
+ * returned promise resolves on the next microtask. Default false.
1765
+ *
1766
+ * This is THE shared reduced-motion gate for the light managed-playback
1767
+ * surface: `NumericAnimation` (and `ElementMorph`, which composes it)
1768
+ * route their `respectReducedMotion` option straight through here, so the
1769
+ * snap lives in one place rather than re-implemented per interpolator.
1770
+ * SSR-safe — off-DOM `prefersReducedMotion()` is false, so playback runs
1771
+ * normally.
1772
+ */
1773
+ respectReducedMotion?: boolean | undefined;
1774
+ }
1775
+
1776
+ declare const rainbowText: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
1777
+
1778
+ export { RangeBoundary }
1779
+
1780
+ export { RangePhase }
1781
+
1782
+ /**
1783
+ * The reduced-motion policy a surface honors (K.W11 PHYS-E). The ONE gate
1784
+ * takes a SCALE, not just a boolean — WCAG 2.3.3-aligned ("shorten the
1785
+ * travel, keep the meaning"):
1786
+ *
1787
+ * - `false` / `undefined` — do not honor reduced motion (the conservative
1788
+ * default; the animation runs at full amplitude regardless of the OS query).
1789
+ * - `true` — the classic binary snap: under an active `prefers-reduced-motion:
1790
+ * reduce` the surface jumps to its terminal state (amplitude scale `0`).
1791
+ * - a `number` ∈ [0, 1] — the INTENSITY: under an active query the surface
1792
+ * scales its motion AMPLITUDE to this fraction (`0.3` → 30 % of the
1793
+ * displacement-from-rest) while preserving the trajectory shape, settle
1794
+ * time, and the opacity/color track. `1` ≈ full motion, `0` ≡ the binary
1795
+ * snap. The scale comes from the CONSUMER's policy (a settings slider, a
1796
+ * per-animation field) — the OS exposes only a binary signal; kf provides
1797
+ * the MECHANISM, the app provides the policy.
1798
+ */
1799
+ declare type ReducedMotionPolicy = boolean | number | undefined;
1800
+
1801
+ /**
1802
+ * Result of normalising a CSS keyframes input down to the shape the
1803
+ * `CSSKeyframesAnimation.fromString` flow expects: a `Map<percent →
1804
+ * vars>` of ready-to-add frames, plus side data (per-keyframe timing
1805
+ * functions, the `@property` registry, and any animation-shorthand
1806
+ * options that came from a sibling style rule).
1807
+ */
1808
+ export declare interface ResolvedKeyframes {
1809
+ /** percent-string → flat `{prop: value}` snapshot */
1810
+ keyframes: Map<string, Record<string, unknown>>;
1811
+ /** per-keyframe `animation-timing-function`, keyed by percent string */
1812
+ timingFunctions: Map<string, string>;
1813
+ /**
1814
+ * per-keyframe `animation-composition` (`replace` | `add` | `accumulate`),
1815
+ * keyed by percent string — value.js lifts it onto `rule.composition`; the
1816
+ * adapter used to drop it. Captured (F.W8); honoring it (→ WAAPI
1817
+ * `composite` / rAF accumulate) is BOOKed, not half-wired.
1818
+ */
1819
+ composition: Map<string, string>;
1820
+ /** `@property --foo { ... }` registry */
1821
+ properties: Map<string, PropertyDescriptor_2>;
1822
+ /**
1823
+ * `@function --foo(...) { ... }` descriptor registry (P.W13 — the emerging-CSS
1824
+ * resolve seam). Collected via value.js `extractFunctions` exactly as
1825
+ * `properties` is collected via `extractProperties`. Threaded into the
1826
+ * {@link resolveValues} pass's {@link ResolveContext} so the dashed-function
1827
+ * `@function` CALL-inlining lands greenable the moment value.js-P publishes
1828
+ * the call-parse arm; the descriptor is captured NOW (a read-only registry —
1829
+ * the inlining that CONSUMES it is the value.js-P-gated seam in
1830
+ * `resolve-values.ts`).
1831
+ */
1832
+ functions: Map<string, CustomFunctionDescriptor>;
1833
+ /**
1834
+ * Animation options recovered from a top-level style rule's
1835
+ * `animation` shorthand or longhand declarations (if any). Empty
1836
+ * when the input has no matching style rule.
1837
+ */
1838
+ options: ReturnType<typeof extractAnimationOptions>;
1839
+ /**
1840
+ * Structured parse/honoring diagnostics (K.W7 S4) — every SILENT fallback
1841
+ * the resolve path used to swallow, now a citable row. CONSUMES the value.js
1842
+ * 0.12.0 `ParseDiagnostic`/`OnParseError` producer (N2 row 10): a failed
1843
+ * parse surfaced through `OnParseError` lands here as a `PARSE_ERROR` row,
1844
+ * and the kf-side fallbacks (`EMPTY_PARSE`, and the engine's
1845
+ * `COMPOSITION_FALLBACK`) join it. A FLAT additive array with stable
1846
+ * {@link DiagnosticCode}s, NOT a logging framework. Empty on a clean parse.
1847
+ * K.W8 populates the ingest rows (`CORS_SKIP`, `WAAPI_INELIGIBLE`) it owns.
1848
+ */
1849
+ diagnostics: Diagnostic[];
1850
+ /**
1851
+ * The parsed CSS `Stylesheet` AST the resolve walked (L.W2 S1). Surfaced so a
1852
+ * caller can recover scroll-grammar (`animation-timeline`/`animation-range`)
1853
+ * from the SAME parse via `extractTimelineOptions(resolved.stylesheet)` —
1854
+ * `CSSKeyframesAnimation.fromString` threads it onto `scrollOptions` so the
1855
+ * compiler's EMIT half (CC-6) can serialize the scroll longhands back out. A
1856
+ * read-only metadata field; the keyframe/option resolution is unchanged.
1857
+ */
1858
+ stylesheet: Stylesheet;
1859
+ }
1860
+
1861
+ /**
1862
+ * The resolved [start,end] scroll-extent fractions for a parsed
1863
+ * `animation-range`. The driver maps a raw scroll position `p ∈ [0,1]` over the
1864
+ * scene's extent into local progress `(p − start)/(end − start)`, clamped.
1865
+ */
1866
+ export declare interface ResolvedRange {
1867
+ start: number;
1868
+ end: number;
1869
+ }
1870
+
1871
+ /**
1872
+ * The injectable environment a Phase-1 resolution evaluates against. Every field
1873
+ * is OPTIONAL with an SSR-safe default ({@link defaultResolveEnv}); a test injects
1874
+ * a deterministic `supports`/`matchMedia` (jsdom carries neither faithfully) the
1875
+ * way `ScrollTimeline` is handed a `getScrollY`. The Phase-2 element-aware fields
1876
+ * (`customProps`/`siblingIndex`/`siblingCount`) are typed here so the second-pass
1877
+ * call site (post-`setTargets`) threads the SAME context shape — ONE rewriter,
1878
+ * two lifecycle points, not two divergent context types.
1879
+ */
1880
+ declare interface ResolveEnv {
1881
+ /** `CSS.supports(query)` — the `if(supports(...))` evaluator. SSR → `false`. */
1882
+ supports?: (query: string) => boolean;
1883
+ /** `matchMedia(query)` — the `if(media(...))` evaluator. SSR → `{matches:false}`. */
1884
+ matchMedia?: (query: string) => {
1885
+ matches: boolean;
1886
+ };
1887
+ /** Phase 2 — resolved custom-prop reader for `if(style(--p))` (element-aware). */
1888
+ customProps?: (name: string) => string | undefined;
1889
+ /** Phase 2 — 1-based DOM position for `sibling-index()` (element-aware). */
1890
+ siblingIndex?: () => number;
1891
+ /** Phase 2 — sibling total for `sibling-count()` (element-aware). */
1892
+ siblingCount?: () => number;
1893
+ }
1894
+
1895
+ /**
1896
+ * Normalise a CSS string (or pre-parsed Stylesheet) into the shape
1897
+ * `CSSKeyframesAnimation.fromString` consumes. The single entry
1898
+ * point: replaces the legacy `parseCSSKeyframes` /
1899
+ * `parseCSSStyleBlock` / `parseCSSAnimationKeyframes` fork.
1900
+ *
1901
+ * Bare keyframe-stop lists (`from { … } to { … }`) historically work even
1902
+ * though they are not valid top-level CSS. F.W8 decides that on the parsed
1903
+ * AST, not a regex sniff: parse the raw input; if it surfaced ZERO @keyframes
1904
+ * rules and the input is non-empty, re-wrap as `@keyframes anonymous { … }`
1905
+ * and re-parse. A leading `/* @keyframes … *​/` comment no longer defeats the
1906
+ * detection (the PX-1 comment-defeat bug — the regex `/@keyframes\b/` matched
1907
+ * inside a comment and skipped the wrap, yielding a silent empty parse).
1908
+ *
1909
+ * K.W8 SIBLING — `resolveLiveKeyframes` (`./ingest`) is the LIVE-CSSOM analogue
1910
+ * of this STRING normaliser: where `resolveKeyframes` normalises a string of
1911
+ * CSS, `resolveLiveKeyframes` walks `document.styleSheets`, serialises each
1912
+ * `CSSKeyframesRule` via `rule.cssText`, and feeds THAT text into THIS function
1913
+ * — the parser pointed FORWARD at the web the page already ships. It lives in a
1914
+ * separate module (`./ingest`) to avoid an `engine → adapter → ingest → engine`
1915
+ * import cycle; reach it via `loadAnimationEngine()` (the `index.ts` HEAVY edge).
1916
+ */
1917
+ export declare const resolveKeyframes: (input: string | Stylesheet, env?: ResolveEnv) => ResolvedKeyframes;
1918
+
1919
+ /**
1920
+ * K1 — `resolveLiveKeyframes`: the lowest-level CSSOM walk. Accepts a
1921
+ * `Document`, an explicit `CSSStyleSheet[]`, or a single `CSSStyleSheet`, and
1922
+ * reconstructs every `@keyframes` rule it can read. The per-sheet `try/catch` is
1923
+ * the honesty surface (S3): a cross-origin sheet whose `cssRules` getter throws
1924
+ * `SecurityError` becomes a `CORS_SKIP` diagnostic row — never an uncaught throw
1925
+ * and never a silent drop ("ingestion's honest failure mode IS a diagnostic").
1926
+ *
1927
+ * The named sibling of `resolveKeyframes` (`adapter.ts`): where `resolveKeyframes`
1928
+ * normalises a STRING of CSS, `resolveLiveKeyframes` normalises the LIVE CSSOM —
1929
+ * the parser pointed forward at the web the page already ships.
1930
+ */
1931
+ export declare const resolveLiveKeyframes: <V extends Vars = any>(source?: Document | ShadowRoot | CSSStyleSheet[] | CSSStyleSheet, options?: IngestOptions) => IngestResult<V>;
1932
+
1933
+ /**
1934
+ * Resolve a parsed `AnimationRangeValue` (or `undefined` → the whole [0,1]
1935
+ * timeline) into [start,end] extent fractions. The driver-side fill of the
1936
+ * division-of-labour law: value.js emits the phases/offsets verbatim, kf turns
1937
+ * them into the TIME mapping.
1938
+ */
1939
+ export declare function resolveRange(range: AnimationRangeValue | undefined): ResolvedRange;
1940
+
1941
+ declare const rotateIn: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
1942
+
1943
+ declare const rotateScale: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
1944
+
1945
+ /**
1946
+ * The full SO-1 round-trip in one call: `parse → serialize`. Returns the typed
1947
+ * options AND the re-serialized longhand declarations, so a consumer (or the
1948
+ * `proof:scroll-roundtrip` gate) can assert the replay-equality invariant
1949
+ * (`serialize(parse(s))` canonical-form-equal to `s`).
1950
+ */
1951
+ export declare function roundTripScrollCSS(input: string | Stylesheet): {
1952
+ options: CSSTimelineOptions;
1953
+ declarations: ReturnType<typeof serializeScrollOptions>;
1954
+ };
1955
+
1956
+ /** Which backend a `ScrollScene` dispatched to, and why the JS path was chosen. */
1957
+ export declare type ScrollBackend = "native" | "js";
1958
+
1959
+ /** The dispatch verdict — which backend, and (for JS) the human-readable reason. */
1960
+ export declare type ScrollDispatch = {
1961
+ backend: "native";
1962
+ attachment: NativeScrollAttachment;
1963
+ } | {
1964
+ backend: "js";
1965
+ reason: string;
1966
+ };
1967
+
1968
+ /**
1969
+ * The dispatch request — what the caller wants over the parsed scene. The matrix
1970
+ * reads these + the target shape to choose native vs JS (the conservative-correct
1971
+ * backend choice with a queryable reason).
1972
+ */
1973
+ export declare interface ScrollDispatchRequest<V extends Vars> {
1974
+ /** The animation to drive over the scroll clock. */
1975
+ animation?: KeyframesAnimation<V> | undefined;
1976
+ /** The native timeline spec (`scroll`/`view`) for the eligible fast lane. */
1977
+ nativeSpec?: NativeTimelineSpec | undefined;
1978
+ /** True if scrub smoothing was requested (forces JS — native has no smoother). */
1979
+ scrub?: boolean | undefined;
1980
+ /** True if snap was requested (forces JS — native has no physics snap). */
1981
+ snap?: boolean | undefined;
1982
+ /** True if scroll velocity / non-DOM driving was requested (forces JS). */
1983
+ velocity?: boolean | undefined;
1984
+ }
1985
+
1986
+ /**
1987
+ * The kf `ScrollScene` JS DRIVER (SO-2). Drives an engine's progress from a raw
1988
+ * scroll position through the parsed `animation-range`, composing the SHIPPED
1989
+ * primitives:
1990
+ *
1991
+ * scrub → `SmoothProgress` damping (the smoothing the native lane lacks)
1992
+ * snap → `decayRest` (project the idle rest point) + `SpringProgress` settle
1993
+ * (the PHYS-D snapDecay primitive — composes shipped physics, invents none)
1994
+ * enter/leave → the threshold detector DERIVED from the parsed range
1995
+ *
1996
+ * The caller drives the loop (`scrollProgress(p)` per scroll event); the scene
1997
+ * owns no rAF. `progress` is the smoother-damped local progress the engine reads.
1998
+ *
1999
+ * The driver owns TIME (the live offset resolution); value.js owns VALUES (the
2000
+ * parsed phases/offsets). The native lane is NOT deleted — this is the universal
2001
+ * fallback the dispatch falls back to.
2002
+ */
2003
+ export declare class ScrollScene {
2004
+ private readonly resolvedRange;
2005
+ private readonly snapPoints;
2006
+ private readonly snapSpring;
2007
+ private readonly scrubSeconds;
2008
+ private readonly smoother;
2009
+ private rawScroll;
2010
+ private localProgress;
2011
+ private wasInside;
2012
+ private readonly subscribers;
2013
+ constructor(options?: ScrollSceneOptions);
2014
+ /** The resolved [start,end] scroll-extent fractions for this scene. */
2015
+ get range(): ResolvedRange;
2016
+ /**
2017
+ * Drive the scene from a raw scroll position `p ∈ [0,1]` over the scene's
2018
+ * scroll extent (the caller resolves the live scroller; kf maps it to the
2019
+ * range). Maps `p` to local progress `(p − start)/(end − start)` clamped,
2020
+ * routes it through the scrub smoother (if any), and fires enter/leave at
2021
+ * the range boundaries. Returns the (possibly un-smoothed) local progress.
2022
+ *
2023
+ * The smoother converges over subsequent `.tick(dt)` calls; the immediate
2024
+ * return is the smoother's current value (so the first call seeds the
2025
+ * target). Consumers driving their own rAF call `.tick(dt)` per frame.
2026
+ */
2027
+ scrollProgress(p: number): number;
2028
+ /**
2029
+ * Advance the scrub smoother by `dt` ms (frame-rate independent). A no-op
2030
+ * when no scrub was requested (the progress tracks scroll 1:1). Returns the
2031
+ * current smoothed local progress — the engine-write input the driver tracks.
2032
+ */
2033
+ tick(dt: number): number;
2034
+ /** The current local progress (smoother-damped if scrub was requested). */
2035
+ get progress(): number;
2036
+ /** True if no scrub smoother, or the smoother has settled. */
2037
+ get settled(): boolean;
2038
+ /**
2039
+ * SO-2 `.snap()` — PHYS-D snapDecay. On scroll-idle, project the rest point
2040
+ * the current scroll momentum would coast to (`decayRest`), pick the nearest
2041
+ * configured snap point, and settle to it via `SpringProgress`. Returns the
2042
+ * chosen snap target (local progress), or `null` when no snap points are
2043
+ * configured.
2044
+ *
2045
+ * Composes the SHIPPED `decayRest` (the closed-form projected rest) +
2046
+ * `SpringProgress` (the settle) — it invents no physics (the PHYS-A coupled
2047
+ * form is KILLED). `velocity` is the release scroll velocity (units/s); `0`
2048
+ * snaps from the rest position directly.
2049
+ */
2050
+ snapTo(velocity?: number): number | null;
2051
+ /**
2052
+ * Advance the snap settle by `dt` ms. Returns the spring's current local
2053
+ * progress (and writes it to `progress`), or the unchanged progress when no
2054
+ * snap is active. Drive this per frame after `snapTo()` until `settled`.
2055
+ */
2056
+ tickSnap(dt: number): number;
2057
+ /** Subscribe to an enter/leave threshold crossing. Returns an unsubscribe fn. */
2058
+ on(event: ScrollSceneEvent, cb: ScrollSceneSubscriber): () => void;
2059
+ private fire;
2060
+ }
2061
+
2062
+ /** The set of enter/leave threshold events the range-derived detector fires. */
2063
+ export declare type ScrollSceneEvent = "enter" | "leave";
2064
+
2065
+ export declare interface ScrollSceneOptions {
2066
+ /**
2067
+ * The parsed `CSSTimelineOptions` (from {@link parseScrollCSS}) OR a direct
2068
+ * spec. The `range` drives the [0,1] mapping; the `timeline` informs the
2069
+ * native-vs-JS dispatch (a named/`auto` timeline that the platform can run
2070
+ * natively).
2071
+ */
2072
+ range?: AnimationRangeValue | undefined;
2073
+ timeline?: AnimationTimelineValue | undefined;
2074
+ /**
2075
+ * Scrub smoothing seconds (the damping the native `animation-range` lane
2076
+ * LACKS — a STRICT capability of the JS driver). `0`/omitted ⇒ no smoothing
2077
+ * (the scrub tracks scroll 1:1). A positive value enables `SmoothProgress`
2078
+ * damping. Requesting scrub forces the JS backend (native has no smoother).
2079
+ */
2080
+ scrub?: number | undefined;
2081
+ /**
2082
+ * Snap points (local progress in [0,1]) the scene settles to on scroll-idle
2083
+ * via `decayRest` + `SpringProgress`. Requesting snap forces the JS backend.
2084
+ */
2085
+ snap?: SnapPoints | undefined;
2086
+ /** Spring config for the snap settle (the PHYS-D snapDecay primitive). */
2087
+ snapSpring?: Partial<SpringProgressOptions> | undefined;
2088
+ /** Extra SmoothProgress config for the scrub smoother. */
2089
+ smoothing?: Partial<SmoothProgressOptions> | undefined;
2090
+ }
2091
+
2092
+ /** A `.on(event, cb)` subscriber. Receives the local progress at the crossing. */
2093
+ export declare type ScrollSceneSubscriber = (progress: number) => void;
2094
+
2095
+ /**
2096
+ * orchestration/timeline/native.ts — the platform native-timeline feature-detect
2097
+ * (R.W1; lib-light F-9). Split off the JS sampler family (`./index`) by the
2098
+ * consumer seam: `native.ts` is consumed by `waapi/` (the HEAVY native scroll
2099
+ * bridge) while the JS `Timeline` family is the general caller-polled sampler.
2100
+ * Both stay LIGHT (value.js-free — these are DOM globals + an `in`-detect).
2101
+ */
2102
+ /**
2103
+ * The scroll/view timeline axis — the `block|inline|x|y` keyword set. A LOCAL
2104
+ * structural alias of the DOM lib's ambient `ScrollAxis` global (R.W4b): it is
2105
+ * byte-identical to `lib.dom.d.ts`'s `type ScrollAxis = "block" | "inline" | "x"
2106
+ * | "y"`, but as a NAMED module export it is FOLLOWABLE by the `./engine` subpath
2107
+ * dts roll-up (API Extractor cannot follow a bare ambient-global reference reached
2108
+ * transitively through `ScrollScene` — it throws "Unable to follow symbol for
2109
+ * ScrollAxis"). value.js-free (a string-literal union — these are DOM keywords).
2110
+ */
2111
+ declare type ScrollTimelineAxis = "block" | "inline" | "x" | "y";
2112
+
2113
+ /**
2114
+ * The master-playhead orchestrator. Positions child animations along one clock
2115
+ * and drives them via `Animation.advanceTo`. See the module docstring for the
2116
+ * booked name + subsumption decision.
2117
+ */
2118
+ declare class Sequence<V extends Vars = any> implements SequencePlayContext<V> {
2119
+ /** Resolved segments, in insertion order. */
2120
+ readonly entries: SequenceEntry<V>[];
2121
+ /** Named positions on the master clock, registered via {@link label}. */
2122
+ readonly labels: Map<string, number>;
2123
+ /**
2124
+ * The transport-events bus — the per-event subscriber registry + the
2125
+ * crossing detector (segment-lifecycle + label straddle). `on(...)` forwards
2126
+ * to `events.subscribe`; the transport's `fireSequenceCrossings` to
2127
+ * `events.fire`. See `./events` for the channel + detector body.
2128
+ */
2129
+ readonly events: SequenceEventBus<V>;
2130
+ /**
2131
+ * The running insertion cursor (ms) — the end of the last-inserted
2132
+ * segment. Relative `"+="`/`"-="` positions and auto-append (`at` omitted)
2133
+ * measure from here, matching GSAP's append-by-default timeline.
2134
+ */
2135
+ private cursor;
2136
+ /** Master clock (ms) of the current playhead. */
2137
+ _time: number;
2138
+ private readonly respectReducedMotion;
2139
+ /** THE rAF owner for the sequence's play loop. */
2140
+ readonly playback: RAFPlayback;
2141
+ private _boundFrame;
2142
+ _resolvePlay: (() => void) | null;
2143
+ _playOrigin: number | undefined;
2144
+ private _playingPromise;
2145
+ /**
2146
+ * The scalar playback rate — the single field that drives `timeScale`
2147
+ * and `reverse`. `_rate = 1` is real-time forward (the existing
2148
+ * single-play default); `n` is `timeScale(n)` (slow-mo `< 1` /
2149
+ * fast-forward `> 1`); a negative `_rate` walks the master clock
2150
+ * backward (`reverse`). It scales the master clock in {@link _frame}:
2151
+ * `masterClock = (clock − _playOrigin) * _rate`.
2152
+ */
2153
+ _rate: number;
2154
+ /**
2155
+ * How many master-clock cycles `play()` runs before settling. `1` is the
2156
+ * existing single-play; `Infinity` never settles (the loop case);
2157
+ * `n` runs `n` cycles. The master clock folds modulo `duration`
2158
+ * (see {@link _fold}).
2159
+ */
2160
+ _repeatCount: number;
2161
+ /**
2162
+ * When true, odd cycles reflect the folded phase (`duration − phase`) —
2163
+ * the GSAP `yoyo` ping-pong. Default off (every cycle runs forward).
2164
+ */
2165
+ _yoyoOn: boolean;
2166
+ /** Whether `pause()` has halted the loop with the playhead retained. */
2167
+ _paused: boolean;
2168
+ /**
2169
+ * The loop's last rAF timestamp — the re-anchor reference. The
2170
+ * `RAFPlayback`/`AnimationGroup` managed-pause records the loop's LAST rAF
2171
+ * timestamp (not `performance.now()`) so resume adjusts the origin against
2172
+ * the SAME clock the loop reads, with no forward jump. `Sequence` records
2173
+ * it here per frame (the driver does not expose it) for that one re-anchor.
2174
+ */
2175
+ _lastClock: number | undefined;
2176
+ constructor(options?: SequenceOptions);
2177
+ /** The full span of the sequence (ms): the latest segment end. */
2178
+ get duration(): number;
2179
+ /** The current master-clock position (ms). */
2180
+ get time(): number;
2181
+ /**
2182
+ * The normalized playhead position in `[0, 1]` — the GSAP
2183
+ * `Timeline.progress()` idiom. Pure division over the existing scrub:
2184
+ * the getter is `_time / duration`; the setter scrubs to `p * duration`
2185
+ * via {@link seek}.
2186
+ */
2187
+ get progress(): number;
2188
+ set progress(p: number);
2189
+ /** The scalar playback rate (`timeScale` / sign of `reverse`). */
2190
+ get rate(): number;
2191
+ /** Register a named position on the master clock. Chainable. */
2192
+ label(name: string, at?: SequencePosition): this;
2193
+ /**
2194
+ * Subscribe to a segment-lifecycle or label crossing. Returns an
2195
+ * unsubscribe handle — the `ScrollScene.on` idiom (`scroll-scene.ts:506-514`).
2196
+ *
2197
+ * - `"segment:enter"` fires when the playhead enters a segment's
2198
+ * `[at, at + duration)` span (forward across `at`, or backward across the
2199
+ * span end); the callback receives that segment's `animation` reference
2200
+ * and the master-clock position at the crossing.
2201
+ * - `"segment:leave"` fires on the complementary crossing OUT of the span.
2202
+ * - `"label"` fires when the playhead straddles a registered label position
2203
+ * in EITHER direction; the callback receives `(name, masterClock)`.
2204
+ *
2205
+ * Crossings fire on EVERY paint — `seek` (scrub) and the rAF play loop,
2206
+ * forward, reverse, and yoyo. The callback's `masterClock` lets the consumer
2207
+ * infer direction; there is no `once` idiom — unsubscribe in the callback
2208
+ * (via the returned handle) for one-shot behaviour.
2209
+ */
2210
+ on(event: "segment:enter" | "segment:leave", cb: SequenceSegmentSubscriber): () => void;
2211
+ on(event: "label", cb: SequenceLabelSubscriber): () => void;
2212
+ /**
2213
+ * Append a child animation at `at` (absolute ms, a label, a `"+="`/`"-="`
2214
+ * relative token, or — omitted — the running cursor, i.e. after the
2215
+ * previous segment). Advances the insertion cursor to this segment's end.
2216
+ * Chainable.
2217
+ */
2218
+ add(animation: KeyframesAnimation<V>, at?: SequencePosition): this;
2219
+ /**
2220
+ * Map the master playhead to each child's LOCAL clock and paint it. This is
2221
+ * the synchronous scrub form: for every segment, the local clock is
2222
+ * `clamp(masterClock − at, 0, duration)`, applied via `interpFrames(local,
2223
+ * true)`. Segments not yet reached rest at their initial frame; segments
2224
+ * past their end rest at their final frame — the timeline-scrub contract.
2225
+ * Chainable.
2226
+ */
2227
+ seek(masterClock: number): this;
2228
+ /**
2229
+ * Set targets on every child segment. Convenience for the common case
2230
+ * where one target receives the whole sequence; per-segment targets can be
2231
+ * set on each `animation` directly before `.add`. Chainable.
2232
+ */
2233
+ setTargets(...targets: HTMLElement[]): this;
2234
+ /**
2235
+ * Drive the sequence over real time via `RAFPlayback`. Each child is driven
2236
+ * through the published `Animation.advanceTo(absoluteClock)` map: its
2237
+ * `startTime` is seeded to its resolved `at`, so `advanceTo(masterClock)`
2238
+ * yields the child's local clock as `masterClock − at` exactly. Resolves
2239
+ * when the master playhead passes the sequence `duration`.
2240
+ *
2241
+ * Re-entrant: a `play()` while one is in flight returns the same promise.
2242
+ * Under `respectReducedMotion` + an active query, snaps to the rest frame
2243
+ * in one paint (a terminal `seek(duration)`), no draw loop.
2244
+ */
2245
+ /**
2246
+ * The completion front-door (G.W13) — `await sequence.finished` resolves
2247
+ * once the in-flight transport settles. Exposes the ONE held
2248
+ * `_playingPromise` `play()` constructs (the re-entrant guard returns it;
2249
+ * the `finally`-clear nulls it on settle) — NOT a second completion
2250
+ * lifecycle. A settled (or never-played, or reduced-motion-snapped)
2251
+ * sequence resolves immediately.
2252
+ */
2253
+ get finished(): Promise<void>;
2254
+ play(): Promise<void>;
2255
+ _frame(clock: number): Promise<boolean>;
2256
+ private _reanchor;
2257
+ private _settle;
2258
+ /** Halt the play loop where it stands and resolve any pending `play()`. */
2259
+ stop(): this;
2260
+ /**
2261
+ * Halt the play loop where it stands WITHOUT releasing the playhead — the
2262
+ * managed-pause contract. The rAF loop stops; `_time` and the play promise
2263
+ * are RETAINED (children stay `managed`, unlike `stop()`/`_settle`), so a
2264
+ * later {@link resume} continues from exactly here. No-op when not playing
2265
+ * or already paused. Chainable.
2266
+ */
2267
+ pause(): this;
2268
+ /**
2269
+ * Resume a paused sequence — restart the rAF loop with the origin
2270
+ * re-anchored so the FIRST resumed frame's master clock equals the
2271
+ * retained `_time` (the no-forward-jump re-anchor, the same `RAFPlayback`/
2272
+ * `AnimationGroup` managed-pause contract — `src/animation/CLAUDE.md`
2273
+ * §Managed-child lifecycle). No-op when not paused. Chainable.
2274
+ */
2275
+ resume(): this;
2276
+ /**
2277
+ * Set the scalar playback rate — slow-mo (`< 1`), real-time (`1`),
2278
+ * fast-forward (`> 1`), or backward (`< 0`, the {@link reverse} form). The
2279
+ * master clock is re-anchored so the playhead is CONTINUOUS at the
2280
+ * rate-change instant (no jump) — the same re-anchor as {@link resume}.
2281
+ * Takes effect immediately whether or not the sequence is playing.
2282
+ * Chainable.
2283
+ */
2284
+ timeScale(n: number): this;
2285
+ /**
2286
+ * Flip the playback direction — the playhead walks backward from where it
2287
+ * stands (a negative rate) or forward again, preserving `|rate|`. C⁰-
2288
+ * continuous: the re-anchor keeps the playhead exactly where it is at the
2289
+ * flip instant (locked by the F.W9 seek↔play parity gate). Chainable.
2290
+ */
2291
+ reverse(): this;
2292
+ /**
2293
+ * Set how many cycles `play()` runs before settling — `1` is single-play,
2294
+ * `n` runs `n` cycles, `Infinity` loops forever (until `stop()`). The
2295
+ * master clock folds modulo `duration` per cycle. Chainable.
2296
+ */
2297
+ repeat(count: number): this;
2298
+ /**
2299
+ * Toggle yoyo (ping-pong) — when on, odd cycles run reflected
2300
+ * (`duration − phase`) so the playhead bounces back and forth across the
2301
+ * `repeat` cycles. Chainable.
2302
+ */
2303
+ yoyo(on?: boolean): this;
2304
+ }
2305
+
2306
+ /**
2307
+ * A resolved sequence segment: a child animation anchored at an absolute ms
2308
+ * offset. The shape {@link SequenceEventBus.fire} reads to test segment
2309
+ * membership.
2310
+ */
2311
+ declare interface SequenceEntry<V extends Vars> {
2312
+ animation: KeyframesAnimation<V>;
2313
+ /** Absolute offset (ms) of this segment's local t=0 on the master clock. */
2314
+ at: number;
2315
+ }
2316
+
2317
+ /**
2318
+ * The transport-crossing events a `Sequence` fires via {@link Sequence.on} —
2319
+ * the segment-lifecycle pair plus the named-label crossing.
2320
+ *
2321
+ * - `"segment:enter"` — the playhead crossed INTO a segment's
2322
+ * `[at, at + duration)` span (forward across `at`, or backward across the
2323
+ * span's end).
2324
+ * - `"segment:leave"` — the complementary crossing OUT of that span.
2325
+ * - `"label"` — the playhead straddled a position registered via
2326
+ * {@link Sequence.label}, in EITHER direction.
2327
+ *
2328
+ * Mirror of `ScrollSceneEvent` (`scroll-scene.ts:190`) — a typed, per-event
2329
+ * subscribe channel.
2330
+ */
2331
+ declare type SequenceEvent = "segment:enter" | "segment:leave" | "label";
2332
+
2333
+ /**
2334
+ * The Sequence transport-events BUS — the per-event subscriber registry + the
2335
+ * crossing DETECTOR, owned beside `Sequence` (`sequence.ts`). `Sequence`
2336
+ * constructs ONE bus and forwards `.on(...)` to {@link subscribe} and every
2337
+ * paint to {@link fire}; the three event fields (`subscribers`,
2338
+ * `_activeSegments`, `_prevPhase`) live here, not on the class.
2339
+ */
2340
+ declare class SequenceEventBus<V extends Vars> {
2341
+ /**
2342
+ * The per-event subscriber sets — the {@link subscribe} channel (three Sets
2343
+ * keyed by {@link SequenceEvent}). Empty by construction; {@link fire}
2344
+ * early-exits while all three stay empty (zero overhead for the common
2345
+ * no-subscriber transport). Mirror of `ScrollScene.subscribers`
2346
+ * (`scroll-scene.ts:360-366`).
2347
+ */
2348
+ private readonly subscribers;
2349
+ /**
2350
+ * The `segment:enter`/`segment:leave` edge memory: the segments whose
2351
+ * `[at, at + duration)` span held the PREVIOUS painted phase. A segment in
2352
+ * the current active set but not here ENTERED; one here but not in the
2353
+ * current set LEFT. Maintained only while a segment subscriber is registered
2354
+ * (the detector early-exits otherwise).
2355
+ */
2356
+ private readonly _activeSegments;
2357
+ /**
2358
+ * The previous painted phase (ms) — the `from` end of every crossing
2359
+ * straddle (`label`, and the directional `segment` edges). `undefined`
2360
+ * before the first paint; updated on EVERY {@link fire} so a subscriber
2361
+ * registered mid-transport straddles from the true prior playhead (not a
2362
+ * stale or zeroed origin).
2363
+ */
2364
+ private _prevPhase;
2365
+ /**
2366
+ * Register a subscriber for `event`; returns an unsubscribe handle — the
2367
+ * `ScrollScene.on` idiom (`scroll-scene.ts:506-514`). The class's overloaded
2368
+ * `on(...)` forwards here.
2369
+ */
2370
+ subscribe(event: SequenceEvent, cb: SequenceSubscriber): () => void;
2371
+ /**
2372
+ * Detect and fire segment-lifecycle + label crossings between the previous
2373
+ * painted phase (`_prevPhase`) and `phase` — the ONE detector both `seek`
2374
+ * (scrub) and `_frame` (the rAF play loop) drive, so play fires the identical
2375
+ * crossings a scrub would. Mirror of `ScrollScene.fire` (`scroll-scene.ts:513`).
2376
+ *
2377
+ * `_prevPhase` is updated on EVERY call (even the early-exit) so a subscriber
2378
+ * registered mid-transport straddles from the true prior playhead. The firing
2379
+ * loops run ONLY while at least one subscriber set is non-empty — the
2380
+ * zero-overhead path for the common no-subscriber transport.
2381
+ */
2382
+ fire(entries: readonly SequenceEntry<V>[], labels: ReadonlyMap<string, number>, phase: number): void;
2383
+ }
2384
+
2385
+ /**
2386
+ * A `label` subscriber. Receives the crossed label's `name` and the
2387
+ * master-clock position (ms) at the crossing.
2388
+ */
2389
+ declare type SequenceLabelSubscriber = (name: string, masterClock: number) => void;
2390
+
2391
+ declare interface SequenceOptions {
2392
+ /**
2393
+ * When true, `play()` honors `prefers-reduced-motion: reduce` by snapping
2394
+ * every child to its rest frame in a single paint (delegated to each
2395
+ * child's own reduced-motion contract via a terminal `seek`). Default
2396
+ * false. SSR-safe off-DOM.
2397
+ */
2398
+ respectReducedMotion?: boolean;
2399
+ }
2400
+
2401
+ /**
2402
+ * The play-machine view the rAF-loop driver reads + writes. `Sequence` IS this
2403
+ * shape (its fields), so the loop body lives here without copying state — the
2404
+ * class's `_frame`/`_settle` are thin delegates that pass `this`. Keeping the
2405
+ * fields on `Sequence` preserves the seek↔play parity test's direct reaches
2406
+ * (`seq._time` / `seq._rate` / `seq._frame(...)`); only the loop BODY moved.
2407
+ */
2408
+ declare interface SequencePlayContext<V extends Vars> {
2409
+ readonly entries: SequenceEntry<V>[];
2410
+ readonly labels: ReadonlyMap<string, number>;
2411
+ readonly events: SequenceEventBus<V>;
2412
+ readonly duration: number;
2413
+ _time: number;
2414
+ _rate: number;
2415
+ _repeatCount: number;
2416
+ _yoyoOn: boolean;
2417
+ _paused: boolean;
2418
+ _playOrigin: number | undefined;
2419
+ _lastClock: number | undefined;
2420
+ _resolvePlay: (() => void) | null;
2421
+ }
2422
+
2423
+ /**
2424
+ * A position on the master clock for a sequence entry.
2425
+ *
2426
+ * - `number` — an absolute offset in milliseconds from the sequence origin.
2427
+ * - `` `+=${n}` `` / `` `-=${n}` `` — relative to the running insertion cursor
2428
+ * (the end of the previously-inserted segment): `"+=200"` starts 200ms after
2429
+ * the cursor, `"-=200"` overlaps the previous segment by 200ms.
2430
+ * - any other string — a label registered via `Sequence.label`.
2431
+ */
2432
+ declare type SequencePosition = number | `+=${number}` | `-=${number}` | string;
2433
+
2434
+ /**
2435
+ * A `segment:enter` / `segment:leave` subscriber. Receives the crossing
2436
+ * segment's own `animation` reference and the master-clock position (ms) at the
2437
+ * crossing. The clock lets the consumer infer direction (a backward crossing
2438
+ * arrives with a smaller `masterClock` than the prior call).
2439
+ */
2440
+ declare type SequenceSegmentSubscriber = (animation: KeyframesAnimation<any>, masterClock: number) => void;
2441
+
2442
+ /** The union over the two subscriber shapes (the {@link Sequence.on} fallthrough). */
2443
+ declare type SequenceSubscriber = SequenceSegmentSubscriber | SequenceLabelSubscriber;
2444
+
2445
+ /**
2446
+ * SO-1 SERIALIZE — round-trip a typed `CSSTimelineOptions` BACK to its CSS
2447
+ * longhand declarations (`{ "animation-timeline"?, "animation-range"?,
2448
+ * "timeline-scope"?, "animation-trigger"? }`). The parser run BACKWARD over the
2449
+ * SAME data model — value.js's `serializeTimelineOptions` (the inverse mirror of
2450
+ * its extractor), NOT a re-derived lossy emitter. Emits only present fields (no
2451
+ * default padding); the keys mirror the CSS longhand names.
2452
+ *
2453
+ * THE REPLAY-EQUALITY ORACLE: `serializeScrollOptions(parseScrollCSS(s))` is
2454
+ * canonical-form-equal to `s`'s scroll declarations — a faithful round-trip, OR
2455
+ * a REFUSAL (a parse that drops a phase reds the gate), never a silent
2456
+ * approximation. See {@link roundTripScrollCSS}.
2457
+ */
2458
+ export declare function serializeScrollOptions(opts: CSSTimelineOptions): {
2459
+ "animation-timeline"?: string;
2460
+ "animation-range"?: string;
2461
+ "timeline-scope"?: string;
2462
+ "animation-trigger"?: string;
2463
+ };
2464
+
2465
+ declare const shake: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
2466
+
2467
+ declare const skeletonLoading: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
2468
+
2469
+ declare const slideIn: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
2470
+
2471
+ declare const slideInLeft: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
2472
+
2473
+ declare const slideInRight: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
2474
+
2475
+ declare const slideOutLeft: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
2476
+
2477
+ declare const slideOutRight: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
2478
+
2479
+ declare interface SmoothProgressOptions {
2480
+ /** Damping factor (0, 1]. Higher = faster convergence. Default 0.1 */
2481
+ damping: number;
2482
+ /** Snap to target when |target - current| < threshold. Default 0.001 */
2483
+ snapThreshold: number;
2484
+ /**
2485
+ * Minimum change required to update the target. Changes smaller than this
2486
+ * are ignored, filtering high-frequency noise (e.g. sub-pixel scroll jitter).
2487
+ * Default 0 (disabled — every change is accepted).
2488
+ */
2489
+ targetEpsilon: number;
2490
+ /** Starting value. Default 0 */
2491
+ initial: number;
2492
+ /** Clamp current to [0, 1]. Default true */
2493
+ clamp: boolean;
2494
+ /**
2495
+ * When true, honor `prefers-reduced-motion: reduce` by snapping to
2496
+ * target immediately rather than damping. `setTarget` short-circuits
2497
+ * the smooth-toward path; `play()` invokes `onFrame` once with the
2498
+ * target value. Default false (conservative default — opt in to the
2499
+ * reduced-motion snap).
2500
+ *
2501
+ * The check uses `matchMedia` if available; on SSR / Node the option
2502
+ * is a no-op (animations proceed normally).
2503
+ */
2504
+ respectReducedMotion: boolean;
2505
+ }
2506
+
2507
+ /** A `.snap()` snap point — a local progress in [0,1] the scene settles to. */
2508
+ export declare type SnapPoints = readonly number[];
2509
+
2510
+ /**
2511
+ * P.W2 — the precomputed SoA fold layout for ONE `add`/`weighted` blend layer.
2512
+ * `carriers[s]`/`incomings[s]` are the stable `ValueUnit<number>` refs the boxed
2513
+ * inner loop would have touched at slot `s` (the carrier is the leaf a lower
2514
+ * layer parked in `_grouped`; the incoming is this layer's `entry.values` leaf —
2515
+ * both alias `frame.flatVars` units whose `.value` `interpFrames` mutates in
2516
+ * place, so the refs are frame-stable). The per-frame fold seeds the composite
2517
+ * buffer from each carrier, applies the layer's op (`+=` for `add`, `lerp(...,w)`
2518
+ * for `weighted`) against the incoming, and writes back — replacing the
2519
+ * per-frame `for..in` + `Array.isArray` + per-element `isNumericUnit` dispatch
2520
+ * with a contiguous numeric loop. The `entry` is carried for the `weighted`
2521
+ * arm's per-LAYER `w = layer.weightSpring?.value ?? layer.weight` read (K.W11
2522
+ * PHYS-C).
2523
+ */
2524
+ declare interface SoALayerPlan {
2525
+ /**
2526
+ * The layer config — the `weighted` fold re-reads its per-frame `w =
2527
+ * weightSpring?.value ?? weight` LIVE (K.W11 PHYS-C, so a spring still drives
2528
+ * the blend), and the config is generic-independent so the plan holds it
2529
+ * without binding the group's `V`.
2530
+ */
2531
+ layer: AnimationLayerConfig;
2532
+ weighted: boolean;
2533
+ /** The pure-numeric carrier units the fold seeds the composite buffer from + writes back to. */
2534
+ carriers: ValueUnit<number>[];
2535
+ /** The incoming numeric units folded against each carrier (parallel to `carriers`). */
2536
+ incomings: ValueUnit<number>[];
2537
+ /**
2538
+ * The keys this layer touches that the SoA fold does NOT cover — a non-array
2539
+ * carrier (first-touch of a key, or a scalar that a lower layer left
2540
+ * `undefined`), or a leaf with ANY non-numeric / mixed element. These keep
2541
+ * the boxed per-element path (the `Array.isArray` guard + the
2542
+ * `Math.min(existing.length, incoming.length)` element loop), so the
2543
+ * `add`/`weighted` blend stays byte-identical on the non-numeric tail. EMPTY
2544
+ * for the dominant all-numeric transform shape (every leaf a numeric
2545
+ * `ValueUnit[]`), so the whole `for..in` collapses to the SoA fold.
2546
+ */
2547
+ boxedKeys: string[];
2548
+ }
2549
+
2550
+ declare const spinner: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
2551
+
2552
+ /** Spring-eased attention "pop" — the bouncy spring drives the scale pulse. */
2553
+ declare const springPop: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
2554
+
2555
+ /**
2556
+ * iOS-style spring physics options. The pair `(response, dampingFraction)`
2557
+ * is the SwiftUI-canonical surface — designer-tunable, normalized so
2558
+ * `dampingFraction = 1` is critically damped (no overshoot), `< 1` rings,
2559
+ * `> 1` is overdamped (sluggish). Internally these map onto a standard
2560
+ * second-order linear ODE
2561
+ *
2562
+ * x'' + 2ζω₀ x' + ω₀² x = ω₀² target
2563
+ *
2564
+ * with `ω₀ = 2π / response` and `ζ = dampingFraction`, unit mass.
2565
+ */
2566
+ declare interface SpringProgressOptions {
2567
+ /**
2568
+ * Angular period of the oscillation in seconds. Roughly the time the
2569
+ * spring takes to swing through one cycle if undamped. Default 0.5.
2570
+ * Smaller values → snappier; larger → looser.
2571
+ */
2572
+ response: number;
2573
+ /**
2574
+ * Damping ratio ζ. `1` critically damped (fastest no-overshoot);
2575
+ * `< 1` underdamped (rings); `> 1` overdamped (sluggish). Default
2576
+ * 0.86 — the iOS "smooth" preset.
2577
+ */
2578
+ dampingFraction: number;
2579
+ /** Starting position. Default 0. */
2580
+ initial: number;
2581
+ /** Starting velocity (units/s). Default 0. */
2582
+ initialVelocity: number;
2583
+ /**
2584
+ * Position settle threshold. When |x - target| AND |v| both drop
2585
+ * below `settleThreshold` and `velocitySettleThreshold` respectively,
2586
+ * the spring snaps to target and stops integrating. Default 1e-3.
2587
+ */
2588
+ settleThreshold: number;
2589
+ /** Velocity settle threshold (units/s). Default 1e-3. */
2590
+ velocitySettleThreshold: number;
2591
+ /**
2592
+ * Honor `prefers-reduced-motion: reduce` (K.W11 PHYS-E — the
2593
+ * intensity-scaled, WCAG 2.3.3-aligned gate):
2594
+ *
2595
+ * - `false` (default) — ignore the preference; the spring runs at full
2596
+ * amplitude.
2597
+ * - `true` — the classic binary snap: under an active query the spring
2598
+ * jumps to target at zero velocity (amplitude scale `0`). SSR-safe.
2599
+ * - a `number` ∈ [0, 1] — the AMPLITUDE INTENSITY: under an active query
2600
+ * the spring keeps its trajectory SHAPE (curve + settle time) but scales
2601
+ * its displacement-from-rest (`originValue − targetValue`) to this
2602
+ * fraction. At `0.3` the peak overshoot is 30 % of the full-intensity
2603
+ * peak; the envelope is preserved by construction (the analytic form
2604
+ * makes the scaling exact and free). `1` ≈ full motion, `0` ≡ the snap.
2605
+ *
2606
+ * The scale is the CONSUMER's policy (a settings slider, a per-animation
2607
+ * field) — the OS exposes only a binary signal; kf provides the mechanism.
2608
+ */
2609
+ respectReducedMotion: ReducedMotionPolicy;
2610
+ }
2611
+
2612
+ /**
2613
+ * Spring-eased scale-in entrance — the canonical iOS "pop" with overshoot.
2614
+ * Uses the bouncy spring (ζ 0.5) so the element settles past 1 before resting.
2615
+ */
2616
+ declare const springScaleIn: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
2617
+
2618
+ /** Spring-eased slide-up entrance — the snappy spring (ζ 0.78). */
2619
+ declare const springSlideIn: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
2620
+
2621
+ /** Spring-eased wobble — gentle spring (ζ 0.95) for a soft attention nudge. */
2622
+ declare const springWobble: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
2623
+
2624
+ /**
2625
+ * The minimal geometry contract DrawSVG needs: any SVG element that exposes
2626
+ * `getTotalLength()` (`SVGGeometryElement` — `<path>`, `<line>`, `<circle>`,
2627
+ * `<ellipse>`, `<rect>`, `<polygon>`, `<polyline>`). Narrower than `SVGElement`
2628
+ * so a non-geometry SVG node is a type error at the call site, not a runtime
2629
+ * surprise.
2630
+ */
2631
+ export declare type SVGDrawTarget = SVGElement & {
2632
+ getTotalLength(): number;
2633
+ };
2634
+
2635
+ declare interface TemplateAnimationFrame<V extends Vars> {
2636
+ id: number;
2637
+ start: ValueUnit;
2638
+ vars: V;
2639
+ transform?: TransformFunction<V>;
2640
+ timingFunction?: Easing;
2641
+ /**
2642
+ * The author-declared `animation-composition` operator for this stop
2643
+ * (`replace` | `add` | `accumulate`), captured by the adapter and threaded
2644
+ * here so the engine HONORS it (K.W7 — the fidelity floor). Genuine
2645
+ * omission means `replace` (the default composite). value.js lifts it onto
2646
+ * `rule.composition`; `resolveKeyframes` captures it on
2647
+ * `ResolvedKeyframes.composition`; `fromString` reads that Map into this
2648
+ * field. The compiled {@link AnimationFrame.composition} inherits it.
2649
+ */
2650
+ composition?: CompositeOperator;
2651
+ }
2652
+
2653
+ declare const textFocusBlur: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
2654
+
2655
+ /**
2656
+ * A dt-driven stepper the {@link RAFPlayback.drive} loop can own:
2657
+ * `SmoothProgress` and `SpringProgress` implement it directly. The driver
2658
+ * steps `tickDt(dt)` once per frame until `settled` flips true.
2659
+ */
2660
+ declare interface Tickable {
2661
+ /** Advance the stepper by `dt` milliseconds; returns the new value. */
2662
+ tickDt(dt: number): number;
2663
+ /** True when the stepper has converged — the driver stops the loop. */
2664
+ readonly settled: boolean;
2665
+ }
2666
+
2667
+ declare abstract class Timeline {
2668
+ private smoother;
2669
+ private _easingFn;
2670
+ private currentProgress;
2671
+ private boundaryEpsilon;
2672
+ constructor(options?: TimelineOptions);
2673
+ /** Subclass returns raw [0,1] progress from its source. */
2674
+ protected abstract sample(): number;
2675
+ /**
2676
+ * Shared progress pipeline: sample → clamp → easing → boundary snap.
2677
+ * Returns the processed raw value. Does NOT advance the smoother —
2678
+ * `_advance` drives it.
2679
+ */
2680
+ private applyPipeline;
2681
+ /**
2682
+ * Shared advance step: pipeline → ONE `setTarget` → ONE branch. At a
2683
+ * boundary ([0,1]) the smoother snaps for instant convergence; in the
2684
+ * interior it steps `tickDt(dt)` (the canonical ms step). Returns the
2685
+ * resulting progress.
2686
+ */
2687
+ private _advance;
2688
+ /**
2689
+ * Advance one frame at a nominal 60fps step. Applies
2690
+ * easing → boundary snap → smoothing. Use {@link tickDt} when you own
2691
+ * a real frame clock.
2692
+ */
2693
+ tick(): number;
2694
+ /** Frame-rate independent variant. `dt` in milliseconds. */
2695
+ tickDt(dt: number): number;
2696
+ get progress(): number;
2697
+ /** True if no smoother or smoother is settled. */
2698
+ get settled(): boolean;
2699
+ /** Immediately converge smoother to current target. */
2700
+ snap(): void;
2701
+ /** Reset progress to a specific value (default 0). */
2702
+ reset(value?: number): void;
2703
+ }
2704
+
2705
+ declare interface TimelineOptions {
2706
+ /**
2707
+ * Easing as a callable `TimingFunction` or a typed `Easing` — both
2708
+ * synchronous and value.js-free, so the `Timeline` family never touches
2709
+ * the dynamic boundary.
2710
+ *
2711
+ * A string easing *name* is NOT accepted here (fail-explicit: it
2712
+ * throws). Resolve a name once, up front, through the async factory:
2713
+ *
2714
+ * ```ts
2715
+ * const easing = await resolveEasing("ease-out-cubic");
2716
+ * new ScrollTimeline({ easing });
2717
+ * ```
2718
+ */
2719
+ easing?: TimingFunction | Easing | undefined;
2720
+ /** SmoothProgress config. `false` disables smoothing. Default: enabled. */
2721
+ smoothing?: Partial<SmoothProgressOptions> | false | undefined;
2722
+ /**
2723
+ * Boundary snap zone. When the eased progress is within this distance of
2724
+ * 0 or 1, the smoother snaps instantly instead of lerping. Prevents
2725
+ * oscillation at scroll endpoints where micro-jitter alternates between
2726
+ * boundary and non-boundary values each frame.
2727
+ * Default 0.005.
2728
+ */
2729
+ boundaryEpsilon?: number | undefined;
2730
+ }
2731
+
2732
+ declare type TimingFunction = (t: number) => number;
2733
+
2734
+ declare type TimingFunctionNames = keyof typeof timingFunctions;
2735
+
2736
+ declare type TransformFunction<V extends Vars> = (v: V, t: number) => void;
2737
+
2738
+ /**
2739
+ * Default DOM-style renderer used by `Animation.transform` when no
2740
+ * user-supplied transform is provided. "Is this the default renderer?"
2741
+ * is decided by reference comparison against the Animation instance's
2742
+ * one `_defaultTransform` (`usesDefaultRenderer`) — typed and
2743
+ * bind-proof, not a Symbol tag a wrapper would silently drop.
2744
+ */
2745
+ export declare function transformTargetsStyle<V extends Vars>(vars: V, targets: HTMLElement[], flat?: boolean): void;
2746
+
2747
+ declare const typewriter: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
2748
+
2749
+ declare const typingCursor: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
2750
+
2751
+ /**
2752
+ * `validate(css, opts?)` — the READ-ONLY projection over the three typed channels
2753
+ * onto one {@link ValidateResult} envelope. Async because `compileToCSS` is (its
2754
+ * Prettier pass).
2755
+ *
2756
+ * The pipeline:
2757
+ * 1. `parseCSSStylesheet(css)` → the AST; `parseable` is true when value.js
2758
+ * surfaced at least one recognized item and the resolve raised no
2759
+ * `PARSE_ERROR` (the spec-faithful reality — a dropped `!important` decl is
2760
+ * not a parse failure).
2761
+ * 2. `CSSKeyframesAnimation.fromString(css)` → the parsed animation +
2762
+ * `anim.diagnostics` (the adapter's silent-fallback channel).
2763
+ * 3. `compileToCSS([anim], opts.compile)` → `{ eligible, refusals }`.
2764
+ * 4. `isWAAPIEligible(anim)` → the compositor-thread verdict.
2765
+ */
2766
+ export declare function validate(css: string, opts?: ValidateOptions): Promise<ValidateResult>;
2767
+
2768
+ /**
2769
+ * Options for {@link validate} / {@link explain}. A thin pass-through to the
2770
+ * underlying channels — NOT a new option surface. `compile` forwards verbatim to
2771
+ * `compileToCSS` (the ΔE-ε / densify-stop knobs the refusal arm reads).
2772
+ */
2773
+ export declare interface ValidateOptions {
2774
+ /**
2775
+ * Forwarded verbatim to `compileToCSS` — the CC-2 densify-stop count + the
2776
+ * ΔE-ε ship-vs-refuse threshold the perceptual-oklab refusal arm reads. Omit
2777
+ * for the compiler defaults.
2778
+ */
2779
+ compile?: CompileOptions;
2780
+ }
2781
+
2782
+ /**
2783
+ * The flat, agent-shaped envelope `validate` returns — the JOIN over the three
2784
+ * typed channels. An LLM agent branches on these fields WITHOUT scraping a
2785
+ * message string. Every constituent type (`CompileRefusal`, `Diagnostic`,
2786
+ * `WAAPIEligibility`) is already exported from the barrel — the ONLY new type is
2787
+ * this envelope.
2788
+ */
2789
+ export declare interface ValidateResult {
2790
+ /**
2791
+ * True iff value.js parsed the CSS without a `PARSE_ERROR` diagnostic — the
2792
+ * block surfaced at least one recognized stylesheet item (a `@keyframes` /
2793
+ * `@property` / style rule). A spec-invalid keyframe `!important` declaration
2794
+ * is SILENTLY dropped at the AST by value.js (the L.W1 S1 reality) — that drop
2795
+ * is NOT a parse failure, so a block carrying it stays `parseable:true`.
2796
+ */
2797
+ parseable: boolean;
2798
+ /**
2799
+ * True iff `compileToCSS` produced an artifact for every child — the compile
2800
+ * surface's own `eligible` flag. False when any child refused (see
2801
+ * {@link refusals}). Separate from {@link waapi}: a block can be compile-
2802
+ * eligible (the CSS round-trips faithfully) yet WAAPI-ineligible (color
2803
+ * interpolation, computed units) and vice versa.
2804
+ */
2805
+ eligible: boolean;
2806
+ /**
2807
+ * The CC-3 refusals — one per child that could not compile faithfully (the
2808
+ * `{ name, reason, message }` trust surface). Empty on a clean compile.
2809
+ */
2810
+ refusals: CompileRefusal[];
2811
+ /**
2812
+ * All parse/honoring diagnostics from `resolveKeyframes` — every SILENT
2813
+ * fallback the adapter used to swallow, now a citable row with a stable
2814
+ * {@link Diagnostic.code}. Empty on a clean parse.
2815
+ */
2816
+ diagnostics: Diagnostic[];
2817
+ /**
2818
+ * The WAAPI eligibility verdict — `{ eligible: true }` or
2819
+ * `{ eligible: false; reason: string }`. Separate from {@link eligible}: the
2820
+ * compositor-thread delegation has its own, narrower bar (no color interp, no
2821
+ * computed units, a uniform CSS-twinned easing).
2822
+ */
2823
+ waapi: WAAPIEligibility;
2824
+ }
2825
+
2826
+ declare type Vars<T = any> = {
2827
+ [arg: string]: number | string | T;
2828
+ };
2829
+
2830
+ declare type WAAPIEligibility = {
2831
+ eligible: true;
2832
+ } | {
2833
+ eligible: false;
2834
+ reason: string;
2835
+ };
2836
+
2837
+ declare const warpLeft: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
2838
+
2839
+ declare const warpRight: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
2840
+
2841
+ /**
2842
+ * The minimal stepper surface a spring-driven blend weight reads (K.W11
2843
+ * PHYS-C). A `SpringProgress` satisfies it structurally (`value` getter +
2844
+ * `tickDt` + `settled`); typing it as this narrow shape — NOT importing
2845
+ * `SpringProgress` — keeps `constants.ts` from gaining a class edge and lets
2846
+ * a consumer drive a layer's weight with ANY analytic stepper (a decay glide,
2847
+ * a custom `Tickable`). The read is one nullish access in the `weighted` blend
2848
+ * leaf; the group's managed loop advances it per frame via `tickDt`.
2849
+ */
2850
+ declare interface WeightStepper {
2851
+ /** The stepper's current scalar — read in place of the constant `weight`. */
2852
+ readonly value: number;
2853
+ /** Advance the stepper by `dt` milliseconds (the group's managed tick). */
2854
+ tickDt(dt: number): number;
2855
+ /** True once the stepper has converged — the group clears it then. */
2856
+ readonly settled: boolean;
2857
+ }
2858
+
2859
+ /**
2860
+ * `yieldToMain()` — break a long main-thread task so the browser can service
2861
+ * input/render between slices (INP relief). Used by `AnimationGroup.advanceTo()`
2862
+ * to keep a large group's per-frame composite from monopolizing the main
2863
+ * thread as one long task.
2864
+ *
2865
+ * Baseline-Newly: prefers the native `scheduler.yield()` (continuation runs
2866
+ * at the FRONT of the task queue, so yielding stays cheap); falls back to a
2867
+ * `MessageChannel` macrotask, then `setTimeout(0)` — a ≤20 LOC progressive
2868
+ * fallback per the Baseline browser policy. SSR-safe: resolves immediately
2869
+ * off-DOM (no event loop to yield to that matters for a headless render).
2870
+ */
2871
+ export declare function yieldToMain(): Promise<void>;
2872
+
2873
+ export { }