@mkbabb/keyframes.js 5.3.5 → 6.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.
@@ -1,21 +1,22 @@
1
- import { AnimationRangeValue } from '@mkbabb/value.js/parsing';
2
- import { AnimationTimelineValue } from '@mkbabb/value.js/parsing';
3
- import { AnimationTriggerValue } from '@mkbabb/value.js/parsing';
4
- import { ColorSpace } from '@mkbabb/value.js/color';
5
- import { CSSTimelineOptions } from '@mkbabb/value.js/parsing';
6
- import { CustomFunctionDescriptor } from '@mkbabb/value.js/parsing';
7
- import { extractAnimationOptions } from '@mkbabb/value.js/parsing';
1
+ import { AnimationRangeValue } from '@mkbabb/value.js/css';
2
+ import { AnimationTimelineValue } from '@mkbabb/value.js/css';
3
+ import { AnimationTriggerValue } from '@mkbabb/value.js/css';
4
+ import { BezierPresetName } from '@mkbabb/value.js/easing';
5
+ import { CSSAnimationOptions } from '@mkbabb/value.js/css';
6
+ import { CSSPropertyDescriptor } from '@mkbabb/value.js/css';
7
+ import { CSSTimelineOptions } from '@mkbabb/value.js/css';
8
+ import { CssTimeUnit } from '@mkbabb/value.js/css';
9
+ import { CssValue } from '@mkbabb/value.js/value';
10
+ import { CustomFunctionDescriptor } from '@mkbabb/value.js/css';
11
+ import { EasingFunction } from '@mkbabb/value.js/easing';
8
12
  import { HueInterpolationMethod } from '@mkbabb/value.js/color';
9
- import { InterpolatedVar } from '@mkbabb/value.js/units';
10
- import { ParseDiagnostic } from '@mkbabb/value.js/parsing';
11
- import { PropertyDescriptor as PropertyDescriptor_2 } from '@mkbabb/value.js/parsing';
12
- import { RangeBoundary } from '@mkbabb/value.js/parsing';
13
- import { RangePhase } from '@mkbabb/value.js/parsing';
14
- import { Stylesheet } from '@mkbabb/value.js/parsing';
15
- import { timingFunctions } from '@mkbabb/value.js/easing';
16
- import { TriggerType } from '@mkbabb/value.js/parsing';
17
- import { ValueArray } from '@mkbabb/value.js/units';
18
- import { ValueUnit } from '@mkbabb/value.js/units';
13
+ import { KeyframeSelector } from '@mkbabb/value.js/css';
14
+ import { ParseIssue } from '@mkbabb/value.js/css';
15
+ import { RangeBoundary } from '@mkbabb/value.js/css';
16
+ import { RangePhase } from '@mkbabb/value.js/css';
17
+ import { SpaceId } from '@mkbabb/value.js/color';
18
+ import { Stylesheet } from '@mkbabb/value.js/css';
19
+ import { TriggerType } from '@mkbabb/value.js/css';
19
20
 
20
21
  declare const accordionExpand: PresetFactory;
21
22
 
@@ -87,7 +88,6 @@ export declare interface AnimationEngine {
87
88
  CSSKeyframesAnimation: typeof CSSKeyframesAnimation;
88
89
  AnimationGroup: typeof AnimationGroup;
89
90
  getAnimationId: typeof getAnimationId;
90
- getTimingFunction: typeof getTimingFunction;
91
91
  resolveKeyframes: typeof resolveKeyframes;
92
92
  MotionPath: typeof MotionPath;
93
93
  fromMotionPath: typeof fromMotionPath;
@@ -128,11 +128,22 @@ export declare interface AnimationEngine {
128
128
  formatCSSKeyframeString: typeof formatCSSKeyframeString;
129
129
  transformTargetsStyle: typeof transformTargetsStyle;
130
130
  yieldToMain: typeof yieldToMain;
131
+ /** The CSS-ident normalizer — ONE derivation for every emitted name. */
132
+ cssIdent: typeof cssIdent;
133
+ /** ms → the CSS time literal the emitters write. */
134
+ reverseCSSTime: typeof reverseCSSTime;
135
+ /** A parsed timing function → its CSS literal. */
136
+ serializeTimingFunction: typeof serializeTimingFunction;
137
+ /** SYNCHRONOUS name→fn easing resolution (KF-ET-32). */
138
+ resolveTimingFunction: typeof resolveTimingFunction;
139
+ /** The registry roster behind it — `[name, fn]`, stable, not injective. */
140
+ timingFunctionEntries: typeof timingFunctionEntries;
131
141
  }
132
142
 
143
+ /** Consumer-observable data for one compiled keyframe segment. */
133
144
  export declare interface AnimationFrame<V extends Vars> {
134
145
  id: number;
135
- start: ValueUnit;
146
+ start: KeyframeSelector;
136
147
  ixs: {
137
148
  start: number;
138
149
  stop: number;
@@ -141,39 +152,8 @@ export declare interface AnimationFrame<V extends Vars> {
141
152
  start: number;
142
153
  stop: number;
143
154
  };
144
- flatVars: V;
155
+ flatVars: FlatAuthoredValues;
145
156
  vars: V;
146
- interpVars: {
147
- [arg: string]: Array<InterpolatedVar<V>>;
148
- };
149
- /**
150
- * Pre-flattened array of all interpolation variables across all properties.
151
- * Built once during parse() to avoid Object.values().flat() allocation
152
- * on every interpFrames() call in the hot path.
153
- */
154
- allInterpVars: Array<InterpolatedVar<V>>;
155
- /**
156
- * Q.WB3 S2 — the precomputed numeric SoA fold layout (built ONCE at `parse`
157
- * over the stable `allInterpVars` set). `processFrame` folds the numeric subset
158
- * through ONE `lerpArray` over the packed `Float64Array` buffers and strides
159
- * the result back into the numeric leaves' `.value` slots; the boxed residual
160
- * (color/computed/mixed) keeps the per-element `lerpValue`. Absent (undefined)
161
- * for a frame with no numeric ivs, or before `parse` runs — `processFrame`
162
- * falls back to the all-boxed walk. Bit-identical to the boxed path.
163
- */
164
- _numericPlan?: NumericFoldPlan<V>;
165
- /**
166
- * T.A6 — the nested PLAIN authored-shape projection a custom `transform`
167
- * consumes (numbers where the author wrote numbers, strings where a unit or
168
- * color demands one). Built lazily on the first apply — `undefined` for a
169
- * DOM-style default-renderer frame (which consumes `flatVars` directly) and
170
- * before the first `interpFrames(..., true)`. Invalidated at
171
- * `finalizeFrameVars` so a color-space renormalize rebuilds it against the
172
- * fresh interp carriers.
173
- */
174
- plainVars?: V;
175
- /** T.A6 — the per-leaf refresh-writer plan backing {@link plainVars}. */
176
- _plainProj?: PlainProjection | undefined;
177
157
  transform: TransformFunction<V>;
178
158
  timingFunction: Easing;
179
159
  /**
@@ -201,8 +181,17 @@ export declare class AnimationGroup<V extends Vars> {
201
181
  paused: boolean;
202
182
  started: boolean;
203
183
  done: boolean;
204
- /** When true, `play()` honors `prefers-reduced-motion: reduce` by snapping
205
- * every child to its final frame in one composite, no rAF loop. Default false. */
184
+ /**
185
+ * When true, `play()` honors `prefers-reduced-motion: reduce` by snapping
186
+ * every child to its final frame in one composite, no rAF loop.
187
+ *
188
+ * **Default `true`** — X.KF.W5 ruling KF-W5R4(3) (COHESION §0j.C): the PRM
189
+ * default is INVERTED to honouring the preference, one honest default in one
190
+ * engine. Until that ruling the group defaulted `false` while its sibling
191
+ * organ `startViewTransition` defaulted `true`, so two organs of one engine
192
+ * disagreed and the honest default *"existed in-house and was used nowhere"*
193
+ * (KF-KC-27). Set `false` for the explicit opt-out.
194
+ */
206
195
  respectReducedMotion: boolean;
207
196
  /** Children-per-slice before `advanceTo()` yields to the main thread; larger
208
197
  * groups batch with a `scheduler.yield()` between slices (INP relief). */
@@ -211,13 +200,42 @@ export declare class AnimationGroup<V extends Vars> {
211
200
  * genuine-ownership replacement for the excised `KeyframesAnimation.group()`
212
201
  * service locator; each input is a bare animation or `{ animation, layer }`). */
213
202
  static of<V extends Vars>(first: KeyframesAnimation<V> | AnimationGroupInput<V>, ...rest: (KeyframesAnimation<V> | AnimationGroupInput<V>)[]): AnimationGroup<V>;
214
- singleTarget: boolean;
203
+ /** The pre-ruling field default, unchanged; `_singleTargetDeclared` is set
204
+ * once a caller ASSIGNS the property (the supported opt-out). */
205
+ private _singleTarget;
206
+ private _singleTargetDeclared;
207
+ /**
208
+ * True when every child animates the SAME first target, so the group can
209
+ * composite one shared element per frame (the SoA blend + the group-WAAPI
210
+ * fast lane both gate on it).
211
+ *
212
+ * **Assigning it DECLARES it** — X.KF.W5 ruling KF-W5R4(4) (COHESION §0j.C):
213
+ * `singleTarget` gains a SUPPORTED opt-out. Before it, `group.singleTarget =
214
+ * false` was a raw poke the post-mount recompute in {@link setTargets}
215
+ * silently reverted (LP-1's rider; the demo's `CopyButton`/`SquareScene`
216
+ * pokes are the live witnesses), so the group disagreed with its own caller
217
+ * and the KF-CB-15 target-less derivation (`undefined === undefined → true`)
218
+ * could not be opted out of at all. Every recompute honours a declaration;
219
+ * {@link deriveSingleTarget} gives the derived mode back.
220
+ */
221
+ get singleTarget(): boolean;
222
+ set singleTarget(value: boolean);
223
+ /**
224
+ * Drop a {@link singleTarget} declaration and return to derivation — the
225
+ * inverse of the supported opt-out, so a declaration is reversible without
226
+ * reconstructing the group. Re-derives immediately from the current entries.
227
+ */
228
+ deriveSingleTarget(): this;
229
+ /** The ONE derivation of `singleTarget` — shared by the constructor and the
230
+ * `setTargets` recompute so they can never drift apart, and a NO-OP while a
231
+ * caller's declaration stands (KF-W5R4(4)). */
232
+ private _deriveSingleTarget;
215
233
  /**
216
234
  * T.A6 — true when the group's composite `transform` is a CUSTOM (non-DOM)
217
235
  * consumer that expects the nested PLAIN authored-shape projection (the
218
236
  * "animate any object" seam), inherited from the first child's own
219
237
  * `unflatten` flag alongside its transform. False (the default) keeps the
220
- * DOM-style default renderer's FLAT `_grouped` map, byte-unchanged.
238
+ * DOM-style default renderer's flat composite map, byte-unchanged.
221
239
  */
222
240
  unflatten: boolean;
223
241
  lastTickTime: number;
@@ -238,35 +256,13 @@ export declare class AnimationGroup<V extends Vars> {
238
256
  /** Pre-bound frame callback — allocated once to avoid a per-loop closure.
239
257
  * INTERNAL (S.B5) — read by `./lifecycle`'s `play`/`resume` loop start. */
240
258
  _boundFrame: (t: number) => boolean | Promise<boolean>;
259
+ /** The `onRender` observers (KFA-31). */
260
+ private readonly _renders;
241
261
  /** Cached entries sorted by layer zIndex (see `getEntries`). */
242
262
  private _entries;
243
263
  private _entriesDirty;
244
- /** Long-lived composite buffer, cleared in place each frame (zero-alloc).
245
- * INTERNAL (R.W2) — read/written by `./compositor`. */
246
- readonly _compositeState: CompositeState;
247
- _grouped: Record<string, unknown>;
248
- /** The compile-stable union of every child's contributed keys — what `_grouped`
249
- * is null-filled to each frame so the composite clears WITHOUT `delete` (F.W4
250
- * S2; fold in `./entries`). INTERNAL (R.W2) — the `./compositor` null-fill. */
251
- _groupedKeys: string[];
252
- _groupedKeysDirty: boolean;
253
- /** P.W2 — the SoA composite layout for the `add`/`weighted` blend arms (the
254
- * validated 3.7×, bit-identical): one {@link SoALayerPlan} per entry, the FLAT
255
- * pure-numeric pairs hoisted into a {@link Float64Array} fold (built by
256
- * `buildSoAPlans` in `./soa`, rebuilt ONLY on a structural change). INTERNAL
257
- * (R.W2) — read/written by `./compositor`. */
258
- _soaPlans: SoALayerPlan[] | null;
259
- /**
260
- * T.A6 — the group's PLAIN authored-shape projection (built from the
261
- * composite `_grouped` leaf map when `unflatten` is set), rebuilt lazily on a
262
- * structural change (the SAME `_groupedKeysDirty` seam that drops the SoA
263
- * plan). Null until the first composited frame populates `_grouped`. INTERNAL
264
- * — read/written by `./compositor`. */
265
- _plainProj: PlainProjection | null;
266
- /** The long-lived SoA fold scratch — the contiguous numeric accumulate buffer,
267
- * sized to the WIDEST single-layer pair count once per structural change
268
- * (reused, zero per-frame alloc). INTERNAL (R.W2) — read by `./compositor`. */
269
- _compositeBuf: Float64Array | null;
264
+ /** Long-lived zero-allocation compositor state, absent from the public API. */
265
+ private readonly _composite;
270
266
  /** K.W11 PHYS-C — true iff ANY layer carries a `weightSpring`; when false (the
271
267
  * universal case) `advanceTo` skips the per-frame spring scan (ZERO new work).
272
268
  * INTERNAL (R.W2) — set by `./layer-api`'s `transitionLayer`. */
@@ -274,7 +270,7 @@ export declare class AnimationGroup<V extends Vars> {
274
270
  constructor(...inputs: (KeyframesAnimation<V> | AnimationGroupInput<V>)[]);
275
271
  /** The animation entries sorted by layer zIndex, dirty-flag cached — rebuilt
276
272
  * only on a mutation. INTERNAL (R.W2): read by the colocated `./compositor`/
277
- * `./entries`/`./scheduler`/`./springs` helpers + all hot-path iteration. */
273
+ * `./entries`/`./yield-batch`/`./springs` helpers + all hot-path iteration. */
278
274
  getEntries(): AnimationGroupEntry<V>[];
279
275
  /** Mark entries cache stale. Called at all mutation boundaries.
280
276
  * INTERNAL (R.W2) — also called by `./layer-api`. */
@@ -294,17 +290,26 @@ export declare class AnimationGroup<V extends Vars> {
294
290
  * (0 for a never-ticked group), never a fabricated wall-clock.
295
291
  */
296
292
  render(t?: number): void;
293
+ /** Observe every frame the group paints (each draw-loop tick, `render()`,
294
+ * `reset()`) with its clock; returns the unsubscribe. A paused group
295
+ * notifies nothing. See `./render-observers` (KFA-31 · KFA-85). */
296
+ onRender(listener: (t: number) => void): () => void;
297
297
  /** Set a child's current time without touching its siblings (updates
298
298
  * `pausedTime` for a jump-free resume). Chainable; `render()` to reflect it. */
299
299
  setChildTime(nameOrAnim: string | KeyframesAnimation<V>, t: number): this;
300
+ /** KFA-69 — the group-level seek: seat EVERY child at the group's one
301
+ * master elapsed time (ms since its start), each at its own phase of it
302
+ * (modulo its duration, within its iteration count), so phase-locked
303
+ * children stay locked under a scrub. Chainable; `render()` to reflect it.
304
+ * Body in `./seek`. */
305
+ seek(elapsed: number): this;
306
+ /** The master elapsed time a child's current position sits at (its delay +
307
+ * its completed iterations + its `t`) — the read `seek` inverts. */
308
+ elapsedOf(nameOrAnim: string | KeyframesAnimation<V>): number;
300
309
  /** Advance all child animations to absolute clock `t`. SYNC on the steady path
301
310
  * (J.W6 S1): all-synchronous children advance with no per-frame microtask hop;
302
311
  * a thenable only on an async child or the over-`YIELD_BATCH` yield path. */
303
312
  advanceTo(t: number): this | Promise<this>;
304
- /** One frame of the group's draw loop: tick all children, then render. */
305
- private _frame;
306
- /** The post-advance render half of `_frame` — composite, or settle on done. */
307
- private _renderFrame;
308
313
  /** The completion front-door (G.W13) — `await group.finished` resolves once
309
314
  * the in-flight composite play settles. Exposes the ONE held `_playingPromise`
310
315
  * (a settled/never-played group resolves immediately). */
@@ -358,7 +363,7 @@ export declare class AnimationGroup<V extends Vars> {
358
363
 
359
364
  export declare interface AnimationGroupEntry<V extends Vars> {
360
365
  animation: KeyframesAnimation<V>;
361
- values: Record<string, unknown>;
366
+ values: FlatAuthoredValues;
362
367
  layer: AnimationLayerConfig;
363
368
  }
364
369
 
@@ -397,15 +402,15 @@ declare interface AnimationIdentity {
397
402
  export declare interface AnimationLayerConfig {
398
403
  /** Higher wins. Default: 0 */
399
404
  zIndex: number;
400
- /** 0–1 for 'weighted' blend mode. Default: 1 */
405
+ /** 0–1 replacement weight. Default: 1 */
401
406
  weight: number;
402
407
  /**
403
408
  * Optional spring (or any {@link WeightStepper}) DRIVING this layer's
404
409
  * blend `weight` (K.W11 PHYS-C — the spring-driven crossfade). When
405
- * present the `weighted` blend leaf reads `weightSpring.value` in place of
410
+ * present the weight blend reads `weightSpring.value` in place of
406
411
  * the constant `weight` (one nullish read; the per-frame lerp untouched),
407
412
  * so a layer transition follows a PHYSICAL trajectory that can overshoot
408
- * and settle — the flagship demo moment only kf's weighted-blend substrate
413
+ * and settle — the flagship demo moment only kf's weight-blend substrate
409
414
  * can hold. Constructed + advanced by `AnimationGroup.transitionLayer` /
410
415
  * `crossfade`; cleared on settle, when the read falls back to the
411
416
  * now-updated constant `weight`. Absent on a static-weight layer (the
@@ -413,14 +418,12 @@ export declare interface AnimationLayerConfig {
413
418
  */
414
419
  weightSpring?: WeightStepper;
415
420
  /**
416
- * Default: 'replace'. Defaulting on a genuinely-omitted blend mode is
421
+ * Default: 'replace'. Defaulting on a genuinely-omitted operation is
417
422
  * the sanctioned contract (the fail-explicit seam throws only on
418
423
  * malformed PRESENT input, never on omission) — an unspecified layer
419
424
  * blends by replacement, the least-surprising composite.
420
425
  */
421
- blendMode: BlendMode;
422
- /** Canonical composition operation. Omission preserves `blendMode` callers. */
423
- op?: CompositeOperator;
426
+ op: CompositeOperator;
424
427
  /** Layer toggle. Default: true */
425
428
  enabled: boolean;
426
429
  /** Optional property whitelist — only these properties will be output from this layer */
@@ -477,7 +480,16 @@ declare type AnimationOptionErrorCode = "EMPTY_PARSE" | "UNKNOWN_TIMING_FN" | "N
477
480
 
478
481
  export declare type AnimationOptions = {
479
482
  duration: number;
483
+ /**
484
+ * The `<time>` unit the author wrote for `duration` (UIA-KF-177): set from
485
+ * value.js's `CSSAnimationOptions.durationUnit` at ingest, so every emit
486
+ * writes the number back in it. Absent for a programmatic number, which
487
+ * emits in its shortest exact spelling.
488
+ */
489
+ durationUnit?: CssTimeUnit;
480
490
  delay: number;
491
+ /** The `<time>` unit the author wrote for `delay` (UIA-KF-177); see `durationUnit`. */
492
+ delayUnit?: CssTimeUnit;
481
493
  iterationCount: number;
482
494
  direction: (typeof DIRECTIONS)[number];
483
495
  fillMode: (typeof FILL_MODES)[number];
@@ -490,7 +502,7 @@ export declare type AnimationOptions = {
490
502
  * off-DOM. Default false (consumers opt in).
491
503
  */
492
504
  respectReducedMotion: boolean;
493
- colorSpace: ColorSpace;
505
+ colorSpace: SpaceId;
494
506
  hueMethod?: HueInterpolationMethod;
495
507
  /**
496
508
  * The LAYER-level `animation-composition` operator (L.W1 S5, Band A) — the
@@ -498,8 +510,8 @@ export declare type AnimationOptions = {
498
510
  * through a sibling `.class { animation: … }` shorthand/longhand ingest.
499
511
  * Distinct from the per-KEYFRAME {@link TemplateAnimationFrame.composition}
500
512
  * (the per-stop operator); this is the whole-animation composite the engine
501
- * carries off `extractAnimationOptions`'s `composition` field. Omission means
502
- * `replace` (the CSS default — the serializer omits it). value.js 0.13.0's
513
+ * carries off `collectAnimationOptions`'s `composition` field. Omission means
514
+ * `replace` (the CSS default — the serializer omits it). Value 4's
503
515
  * `CSSAnimationOptions.composition` surfaces it; `fromString` reads it here.
504
516
  */
505
517
  composite?: CompositeOperator;
@@ -569,12 +581,7 @@ export { AnimationTimelineValue }
569
581
 
570
582
  declare const attentionPresets: Readonly<Record<string, PresetFactory>>;
571
583
 
572
- /**
573
- * Public layer vocabulary. `weighted` is retained as a compatibility alias;
574
- * the canonical operation axis is {@link CompositeOperator}. `accumulate` is
575
- * additive and maps to the same un-clamped fold as `add` at group scope.
576
- */
577
- export declare type BlendMode = CompositeOperator | "weighted";
584
+ declare type AuthoredValue = number | string;
578
585
 
579
586
  declare const blurIn: PresetFactory;
580
587
 
@@ -656,8 +663,6 @@ export declare interface CompileOptions {
656
663
  * honest refusal).
657
664
  */
658
665
  deltaEEpsilon?: number;
659
- /** Prettier print-width for the emitted artifact. Omit for the default. */
660
- printWidth?: number;
661
666
  }
662
667
 
663
668
  export declare interface CompileRefusal {
@@ -666,7 +671,7 @@ export declare interface CompileRefusal {
666
671
  message: string;
667
672
  }
668
673
 
669
- export declare type CompileRefusalReason = "weighted-blend" | "custom-renderer" | "perceptual-oklab" | "computed-unit-drift";
674
+ export declare type CompileRefusalReason = "weight-blend" | "custom-renderer" | "perceptual-oklab" | "computed-unit-drift";
670
675
 
671
676
  /**
672
677
  * THE compiler (CC-1/CC-2/CC-3) — compile an orchestration graph to zero-runtime
@@ -676,7 +681,7 @@ export declare type CompileRefusalReason = "weighted-blend" | "custom-renderer"
676
681
  * materialized, computed units verbatim, color tracks densified into perceptual
677
682
  * `oklab()` stops under the ΔE-ε proof), and REFUSES with a NAMED reason what
678
683
  * cannot compile faithfully (CC-3 — the replay-equality invariant's honest
679
- * refusal). The result is async because `formatCSS` (Prettier) is.
684
+ * refusal). The Promise signature is retained across deterministic serialization.
680
685
  *
681
686
  * @returns `{ css, eligible, refusals }` — the artifact + the trust surface.
682
687
  */
@@ -710,29 +715,14 @@ export declare function compileToEntry<V extends Vars>(spec: Record<string, Entr
710
715
  export declare function compileToViewTransition<V extends Vars>(spec: Record<string, VTRoleSpec<V>>, opts?: ViewTransitionCompileOptions): Promise<CompiledViewTransitionCSS>;
711
716
 
712
717
  /**
713
- * The CSS `animation-composition` operator (K.W7). Distinct from
714
- * {@link BlendMode} (the GROUP's per-LAYER blend tier — `replace`/`add`/
715
- * `weighted`): this is the per-KEYFRAME composite operator the author declares
716
- * on a single animation, matching the CSS grammar exactly (`weighted` is not a
717
- * CSS composite; `accumulate` is the repeat-aware one CSS adds). The engine
718
- * routes `add`/`accumulate` onto the SAME un-clamped numeric leaf the group's
719
- * `add` layer runs (`group.ts`), so the two tiers share one accumulation
720
- * semantic without sharing a type.
718
+ * The CSS `animation-composition` operator (K.W7). A group layer uses this same
719
+ * grammar through `AnimationLayerConfig.op`; its orthogonal `weight` scalar can
720
+ * turn a replacement layer into a crossfade. The engine routes
721
+ * `add`/`accumulate` onto the SAME un-clamped numeric leaf the group layer runs,
722
+ * so keyframe and group composition share one accumulation semantic.
721
723
  */
722
724
  declare type CompositeOperator = "replace" | "add" | "accumulate";
723
725
 
724
- /** Stable, compositor-owned leaves. Foreign frame arrays are copied, never retained. */
725
- declare class CompositeState {
726
- readonly values: Record<string, unknown>;
727
- private keys;
728
- private readonly epochs;
729
- private epoch;
730
- configure(keys: string[]): void;
731
- clear(): void;
732
- copy(key: string, incoming: unknown): unknown;
733
- pruneInactive(): void;
734
- }
735
-
736
726
  /**
737
727
  * Feature-detect (`"ScrollTimeline" in window` / `"ViewTimeline" in window`)
738
728
  * and construct a NATIVE `AnimationTimeline` for the additive WAAPI scroll
@@ -780,32 +770,70 @@ export declare function createScrollScene(spec?: ScrollSceneOptions | CSSTimelin
780
770
  */
781
771
  export declare function createTriggerScene(spec?: AnimationTriggerValue | CSSTimelineOptions): TriggerScene;
782
772
 
773
+ /**
774
+ * A CSS `<easing-function>` written as TEXT — the second legitimate spelling of
775
+ * an easing at the option surface, beside a registry {@link TimingFunctionNames}
776
+ * name (X.KF.W4 KF-CB-29, COHESION §0m.1 candidate (ii)).
777
+ *
778
+ * This type exists because the arm it replaces — a bare `| string` on
779
+ * `InputAnimationOptions["timingFunction"]` — made `tsc` green on EVERY string,
780
+ * so the name union beside it was decorative at the only surface a consumer
781
+ * actually writes through. That arm is the mechanism by which a renamed easing
782
+ * shipped with a green typecheck over a name that had ceased to exist. Deleting
783
+ * it outright is the WRONG cure and the tree says so by measurement: at
784
+ * `3e81f500` a bare deletion reddens **14 library diagnostics** — 13 in the
785
+ * SHIPPED preset catalogue (`presets/catalog.ts`, every one a `cubic-bezier()`
786
+ * or `steps()` literal the library authors itself) and one at
787
+ * `engine/css/metadata.ts:63`. Those literals are not sloppiness; they are the
788
+ * grammar. So the arm is NARROWED to that grammar rather than removed.
789
+ *
790
+ * The members are CSS Easing L1/L2's own: the seven keywords, and the three
791
+ * functional forms. The functional arms are deliberately `${string}`-bodied — a
792
+ * template literal type cannot validate a numeric argument list, and pretending
793
+ * otherwise would trade one false claim for another. What it DOES buy is total:
794
+ * a string that is neither a registry name nor shaped like a CSS easing function
795
+ * no longer typechecks, which is the whole of KF-CB-29.
796
+ *
797
+ * `compile/emit/css-text.ts`'s `serializeTimingFunction` returns this type, so
798
+ * the library's own serializer output flows back into the option surface
799
+ * without widening it.
800
+ */
801
+ declare type CssEasingLiteral = "linear" | "ease" | "ease-in" | "ease-out" | "ease-in-out" | "step-start" | "step-end" | `cubic-bezier(${string})` | `steps(${string})` | `linear(${string})`;
802
+
803
+ /**
804
+ * Normalize a child name to a CSS-safe ident (the `@keyframes`/class name). A
805
+ * bare numeric id (`getAnimationId` falls back to `String(id)`) gets an `a`
806
+ * prefix so the `@keyframes` name is a valid CSS identifier; collisions are
807
+ * de-duped by the walker via a `-2`/`-3` suffix.
808
+ */
809
+ export declare function cssIdent(name: string): string;
810
+
783
811
  export declare class CSSKeyframesAnimation<V extends Vars> extends KeyframesAnimation<V> {
784
- /**
785
- * Q.WD1-bind S2 (DM-22) — the timeline a scroll-range named selector resolves
786
- * its phase against. Stored by {@link bindTimeline} for the no-timeline guard's
787
- * check; `undefined` until a timeline is bound. A scroll-context operation
788
- * specific to CSS keyframes with named selectors (the base `Animation` class is
789
- * value.js-/scroll-agnostic), so the field + method live here.
790
- */
791
- private _boundTimeline?;
792
812
  constructor(options?: Partial<InputAnimationOptions>, ...targets: HTMLElement[]);
793
813
  /**
794
814
  * Q.WD1-bind S2 (DM-22) — the attach-time deferred-resolution seam. A
795
815
  * scroll-range named keyframe selector (`entry`/`exit`/`cover`/`contain`)
796
816
  * ingests OPAQUELY (the L.W1 S4 floor) and is RESOLVABLE only under a timeline;
797
817
  * `bindTimeline` is where that resolution happens. It walks `templateFrames`,
798
- * resolves each named-selector start to a numeric `%` `ValueUnit` via
799
- * {@link namedSelectorToFraction}, CLEARS the `NAMED_SELECTOR_SUPERTYPE` tag (so
800
- * the resolved frame is indistinguishable from an author-written `%` at the sort
801
- * step — no NaN), and re-compiles. The play-time guard
802
- * (`assertNoUnresolvedNamedSelector`) then finds zero unresolved frames and
818
+ * resolves each named selector to a normalized percent {@link KeyframeSelector}
819
+ * via {@link namedSelectorToFraction}, and re-compiles. The resolved selector is
820
+ * indistinguishable from an author-written percentage at the sort step, so
821
+ * the play-time guard (`assertNoUnresolvedNamedSelector`) finds zero unresolved frames and
803
822
  * passes silently — so this MUST land before the guard fires (the gate-enforced
804
823
  * sub-wave ordering: the guard over-throws on a bound animation if the resolver
805
824
  * is absent).
806
825
  *
807
826
  * Idempotent + safe to call before `fromString`: with no named frames the walk
808
827
  * is a no-op; calling it after a NaN-producing `parse()` purges the NaN frames.
828
+ *
829
+ * `timeline` is the BINDING the caller declares, and the resolution below does
830
+ * not read it: `namedSelectorToFraction` maps a phase NAME to a fraction, which
831
+ * is timeline-independent. It was formerly stashed on a private
832
+ * `_boundTimeline` field described as feeding "the no-timeline guard's check" —
833
+ * a consumer that does not exist (the guard is `engine/interpolate.ts` and
834
+ * reads the frames' own resolved state, never the field). The field and that
835
+ * prose are deleted together at X.KF.W4 K3 / R-9's else-branch; the parameter
836
+ * stays because it is this method's public contract.
809
837
  */
810
838
  bindTimeline(timeline: Timeline): this;
811
839
  /**
@@ -814,6 +842,16 @@ export declare class CSSKeyframesAnimation<V extends Vars> extends KeyframesAnim
814
842
  * unflattened); genuine omission resolves to the instance's ONE
815
843
  * default DOM-style renderer, which keeps WAAPI eligibility a
816
844
  * reference comparison (`usesDefaultRenderer`).
845
+ *
846
+ * That reference comparison is per-INSTANCE, so it only survives a seam
847
+ * that respects instance ownership. `engine/compile-bridge.ts`'s
848
+ * `adoptCompiled` is the one seam that moves compiled frames between
849
+ * animations, and it upholds this contract there (X.KF.W5 C-1 /
850
+ * G-RENDERER): the renderer stays the RECEIVER's unless the source
851
+ * declared one of its own. Before that, adopting a throwaway compiled
852
+ * with no transform — the editor's own recompile — replaced a consumer's
853
+ * renderer with a foreign instance's default, and every frame then
854
+ * answered `usesDefaultRenderer` FALSE for a renderer nobody supplied.
817
855
  */
818
856
  private resolveTransform;
819
857
  fromVars(vars: V[], transform?: TransformFunction<V>): this;
@@ -825,7 +863,7 @@ export declare class CSSKeyframesAnimation<V extends Vars> extends KeyframesAnim
825
863
  * custom properties (syntax string, initial value, inheritance
826
864
  * flag) without re-parsing the source CSS.
827
865
  */
828
- propertyRegistry: Map<string, PropertyDescriptor_2>;
866
+ propertyRegistry: Map<string, CSSPropertyDescriptor>;
829
867
  /**
830
868
  * Parsed scroll-grammar (`animation-timeline` / `animation-range` /
831
869
  * `timeline-scope` / `animation-trigger`) recovered from a sibling style rule
@@ -840,7 +878,7 @@ export declare class CSSKeyframesAnimation<V extends Vars> extends KeyframesAnim
840
878
  fromString(keyframes: string, transform?: TransformFunction<V>): this;
841
879
  }
842
880
 
843
- export declare function CSSKeyframesToString<V extends Vars>(animation: KeyframesAnimation<V>, name?: string, printWidth?: number | undefined): Promise<string>;
881
+ export declare function CSSKeyframesToString<V extends Vars>(animation: KeyframesAnimation<V>, name?: string): Promise<string>;
844
882
 
845
883
  /**
846
884
  * Per-stop card serializer for the editor pane — ONE formatted keyframe
@@ -928,8 +966,8 @@ export declare const defaultLayerConfig: AnimationLayerConfig;
928
966
  export declare const defaultOptions: AnimationOptions;
929
967
 
930
968
  /**
931
- * A structured parse/honoring diagnostic (K.W7 S4). Extends the value.js
932
- * parser diagnostic shape (the consumed shape — `message`/`offset`/`line`/
969
+ * A structured parse/honoring diagnostic (K.W7 S4). Extends the Value 4
970
+ * `ParseIssue` shape (the consumed shape — `message`/`offset`/`line`/
933
971
  * `column`/`expected`/`input`) with a stable kf-side {@link DiagnosticCode} and
934
972
  * an optional `property` (the leaf a `COMPOSITION_FALLBACK` names). The
935
973
  * value.js half (`message`/`offset`/…) is `Partial` because the engine-internal
@@ -938,13 +976,15 @@ export declare const defaultOptions: AnimationOptions;
938
976
  * ingest callers that attach source locations.
939
977
  * widens it with the stable code (inv-16 published-only consumption holds).
940
978
  */
941
- declare interface Diagnostic extends Partial<ParseDiagnostic> {
979
+ declare interface Diagnostic extends Omit<Partial<ParseIssue>, "code"> {
942
980
  /** A stable, branch-on-able code — never scrape `message`. */
943
981
  code: DiagnosticCode;
944
982
  /** The human-readable summary (always present; the producer's or kf's). */
945
983
  message: string;
946
984
  /** The CSS property a `COMPOSITION_FALLBACK` refuses to composite. */
947
985
  property?: string;
986
+ /** Original source for a parser issue, when available. */
987
+ input?: string;
948
988
  }
949
989
 
950
990
  /**
@@ -1010,7 +1050,7 @@ export declare function drag2D(element: HTMLElement, options?: {
1010
1050
  * as additive sugar: the engine stays one-dimensional (KISS); this module is
1011
1051
  * the front door that spares every 2-D consumer the two-`Draggable`
1012
1052
  * boilerplate. LIGHT — it imports only `Draggable` + `DragOptions` from
1013
- * `./draggable`, so it carries zero static `@mkbabb/value.js` edge.
1053
+ * `./draggable`, so it carries only the same rootless Value `/math` leaf.
1014
1054
  *
1015
1055
  * The `drag/index.ts` barrel re-exports `drag2D` + `Drag2DHandle` (R.W1 — the
1016
1056
  * barrel owns the unified surface; no flat-sibling relay through `draggable.ts`).
@@ -1226,8 +1266,8 @@ export declare interface DragOptions {
1226
1266
  * spring's re-seat (`SpringProgress` re-seats the closed-form solution from
1227
1267
  * `(x, v)` so the fling trajectory is continuous with the gesture).
1228
1268
  *
1229
- * LIGHT module: zero static `@mkbabb/value.js` edge. The physics is
1230
- * keyframes-local (the spring solver); this file is pure input plumbing.
1269
+ * LIGHT module: the physics is Keyframes-local, sharing only Value's `/math`
1270
+ * leaf through the spring solver; this file is pure input plumbing.
1231
1271
  *
1232
1272
  * Framework-free by design — plain `addEventListener` + Pointer Capture
1233
1273
  * with explicit teardown. This is library code, not a Vue demo: a consumer
@@ -1328,8 +1368,8 @@ export declare class ElementMorph {
1328
1368
  export declare interface ElementMorphOptions {
1329
1369
  /**
1330
1370
  * Easing as a callable `TimingFunction` or a typed `Easing` —
1331
- * synchronous and value.js-free (`ElementMorph` composes
1332
- * `NumericAnimation`, which enforces the same contract). Resolve a
1371
+ * synchronous and parser-free (`ElementMorph` composes `NumericAnimation`,
1372
+ * which shares only Value's `/math` leaf). Resolve a
1333
1373
  * string name first via `await resolveEasing(name)`.
1334
1374
  */
1335
1375
  timingFunction?: TimingFunction | Easing;
@@ -1352,8 +1392,6 @@ export declare interface EntryCompileOptions {
1352
1392
  * dialog), inert-but-harmless elsewhere, so a caller rarely turns it off.
1353
1393
  */
1354
1394
  overlay?: boolean;
1355
- /** Prettier print-width for the emitted artifact. Omit for the default. */
1356
- printWidth?: number;
1357
1395
  }
1358
1396
 
1359
1397
  /** A single entry refusal — the selector + a typed reason + a human message. */
@@ -1365,7 +1403,7 @@ export declare interface EntryRefusal {
1365
1403
  }
1366
1404
 
1367
1405
  /** The refusal taxonomy — 3 inherited + 6 entry-specific (P2-2.3). */
1368
- export declare type EntryRefusalReason = "custom-renderer" | "weighted-blend" | "computed-unit-drift" | "entry-multi-keyframe" | "entry-iteration" | "entry-composition" | "entry-scroll-grammar" | "entry-color-space" | "entry-easing-twin";
1406
+ export declare type EntryRefusalReason = "custom-renderer" | "weight-blend" | "computed-unit-drift" | "entry-multi-keyframe" | "entry-iteration" | "entry-composition" | "entry-scroll-grammar" | "entry-color-space" | "entry-easing-twin";
1369
1407
 
1370
1408
  /** The per-selector entry/exit role. Each animation is 2-stop (a transition endpoint pair). */
1371
1409
  export declare interface EntryRoleSpec<V extends Vars = Vars> {
@@ -1405,16 +1443,36 @@ declare const fadeOut: PresetFactory;
1405
1443
 
1406
1444
  export declare const FILL_MODES: readonly ["none", "forwards", "backwards", "both"];
1407
1445
 
1446
+ declare type FlatAuthoredValues = Record<string, AuthoredValue | undefined>;
1447
+
1408
1448
  /**
1409
1449
  * Animate a layout change on `element`: measure (First), run `mutate` (Last),
1410
1450
  * measure again, then invert + play the transform between them via
1411
- * {@link ElementMorph}. Returns the play promise.
1451
+ * {@link ElementMorph}. Returns a {@link FlipHandle} — the play promise with a
1452
+ * `cancel()`.
1453
+ *
1454
+ * Interruptible: called on an element whose previous flip is still playing,
1455
+ * First is the element's CURRENT interpolated rect (the live visual box), the
1456
+ * previous play is halted (its handle settles), and the new play glides on
1457
+ * from that frame toward the new Last — no snap, no queue.
1412
1458
  *
1413
1459
  * @param element — the element whose layout `mutate` changes.
1414
1460
  * @param mutate — a synchronous DOM mutation (class toggle, reparent, …).
1415
1461
  * @param options — `{ duration, timingFunction, transformOrigin }`.
1416
1462
  */
1417
- export declare function flip(element: HTMLElement, mutate: () => void, options?: FlipOptions): Promise<void>;
1463
+ export declare function flip(element: HTMLElement, mutate: () => void, options?: FlipOptions): FlipHandle;
1464
+
1465
+ /**
1466
+ * The handle `flip` / `flipShared` return: the play promise (it resolves when
1467
+ * the play completes, or as soon as it is cancelled or re-targeted), extended
1468
+ * with `cancel()`. `cancel()` halts the play at its current frame — the
1469
+ * element keeps that frame's inline transform, so a following `flip` on it
1470
+ * glides on from exactly there.
1471
+ */
1472
+ export declare type FlipHandle = Promise<void> & {
1473
+ /** Halt the play at its current frame and settle the promise. */
1474
+ cancel(): void;
1475
+ };
1418
1476
 
1419
1477
  export declare interface FlipOptions {
1420
1478
  /** Playback duration in milliseconds. Defaults to `300`. */
@@ -1434,101 +1492,44 @@ declare const flipPreset: PresetFactory;
1434
1492
  * Shared-element FLIP: animate element `a` onto the rect of element `b`
1435
1493
  * (Motion's `layoutId` / GSAP Flip shared-element style). Unlike `flip`, `a`
1436
1494
  * does NOT move in the DOM — it stays at its own rect (First) and the morph
1437
- * carries it FORWARD onto `b`'s rect (Last). So this is a plain forward
1438
- * {@link ElementMorph} play (identity at t=0 → full delta at t=1), not the
1439
- * inversion `flip` runs.
1495
+ * carries it FORWARD onto `b`'s rect (Last): identity at t=0 → full delta at
1496
+ * t=1. Returns a {@link FlipHandle}.
1440
1497
  *
1441
- * The two reads are batched — one forced layout each, before any write.
1498
+ * Interruptible like `flip`: re-targeting `a` (onto a new `b`) mid-flight
1499
+ * starts from `a`'s current interpolated rect and halts the previous play.
1500
+ *
1501
+ * The reads are batched — one forced layout each, before any play write.
1442
1502
  *
1443
1503
  * @param a — the element to animate.
1444
1504
  * @param b — the element whose rect `a` morphs onto.
1445
1505
  * @param options — `{ duration, timingFunction, transformOrigin }`.
1446
1506
  */
1447
- export declare function flipShared(a: HTMLElement, b: HTMLElement, options?: FlipOptions): Promise<void>;
1507
+ export declare function flipShared(a: HTMLElement, b: HTMLElement, options?: FlipOptions): FlipHandle;
1448
1508
 
1509
+ /**
1510
+ * The editor card's presentation trim: given ONE per-stop string from
1511
+ * {@link CSSKeyframesToStrings} (`"0%\n{\n opacity: 0;\n}\n"`), return the
1512
+ * declarations alone, un-indented — the `<pre>` the card renders.
1513
+ *
1514
+ * X.KF.W2 (G-W2-3) — RE-IMPLEMENTED, not deleted. The symbol is published on
1515
+ * four barrels (`emit/format/index.ts`, `emit/index.ts`, `compile/index.ts`,
1516
+ * `public.ts`), declared on the lazy engine surface (`load-engine.ts`), and held
1517
+ * live by the demo (`KeyframeCardList.vue` binds this function by reference), so
1518
+ * the export, the signature and every one of those sites stand. What died is the
1519
+ * BODY: four anonymous regexes (`/^[^{]*{/`, `/^ /gm`, `/}\s*$/`, `/^ /`) that
1520
+ * re-read kf's own emission as if it were unknown text.
1521
+ *
1522
+ * This stays a pure string trim and adds NO grammar edge — deliberately. It is
1523
+ * FORMATTING, not parsing: the card's own comment declares it "a value.js-free
1524
+ * pure-string trim" and routing a presentation helper through the CSS grammar
1525
+ * would falsify that at a call site this wave does not own. The cut points are
1526
+ * therefore named as positions and the indent is stripped per line, which is
1527
+ * what the regexes meant; measured byte-identical to the old body across the
1528
+ * card shapes and the degenerate ones (no brace, empty, trailing text, an inner
1529
+ * `{` inside a `url()`).
1530
+ */
1449
1531
  export declare function formatCSSKeyframeString(keyframe: string): string;
1450
1532
 
1451
- declare class FrameCompiler<V extends Vars = Vars> {
1452
- private readonly _options;
1453
- templateFrames: TemplateAnimationFrame<V>[];
1454
- parsedVars: ParsedVarMap[];
1455
- frames: AnimationFrame<V>[];
1456
- /**
1457
- * Next TEMPLATE frame id — a monotonic handle assigned in `addFrame`
1458
- * (stable across re-parse, since `parse` does not re-add templates).
1459
- * Compiled-frame ids are content-derived from `(startIx, stopIx)`
1460
- * (see `createFrame`), NOT this counter, so `parse()` is idempotent.
1461
- */
1462
- frameId: number;
1463
- /**
1464
- * The compile inputs live on the owning `Animation`'s `options` object.
1465
- * The compiler holds a REFERENCE to it (the setters mutate it in place,
1466
- * never replace it), so the NEXT compile always reads the current
1467
- * `duration`/`easing`/`colorSpace` without re-linking. For values baked
1468
- * into already-compiled frames, the setter triggers a targeted re-derive:
1469
- * `setDuration` rescales `frame.time` in place; `setColorSpace`/
1470
- * `setHueMethod` call {@link renormalizeColors} (the color resolution is
1471
- * the only baked state that depends on them). No setter silently no-ops a
1472
- * change to compiled state.
1473
- */
1474
- constructor(_options: AnimationOptions);
1475
- /**
1476
- * The live options object the compiler reads (a REFERENCE to the owning
1477
- * `Animation`'s `options` — the setters mutate it in place). Read-only:
1478
- * the compiler never replaces it. Exposed so `Animation.adoptCompiled`
1479
- * can re-bind `Animation.options` to the adopted compiler's options object
1480
- * BY CONSTRUCTION (`this.options === this.compiler.options`, the live-options
1481
- * invariant — G.W19 / the `6e29236` lock), without poking a private field.
1482
- */
1483
- get options(): AnimationOptions;
1484
- addFrame<K extends V>(start: number | string | ValueUnit<number>, vars: Partial<K>, transform?: TransformFunction<K>, timingFunction?: InputAnimationOptions["timingFunction"], composition?: CompositeOperator): void;
1485
- createFrame(startIx: number, endIx: number): AnimationFrame<V>;
1486
- /**
1487
- * Build an index mapping each variable name to the frame indices where
1488
- * it appears. Used by reconcileVars() for O(1) "next occurrence" lookups
1489
- * instead of O(N) findIndex scans per variable.
1490
- */
1491
- private buildVarIndex;
1492
- /**
1493
- * Reconcile interpolation variables across non-adjacent keyframes.
1494
- * For each variable at frame `ix`, find the next frame that also
1495
- * defines that variable and create an interpolation segment between them.
1496
- *
1497
- * Uses a pre-built variable index (from buildVarIndex) to avoid
1498
- * O(frames²) findIndex scans.
1499
- */
1500
- reconcileVars(ix: number, varIndex: Map<string, number[]>): void;
1501
- /**
1502
- * Compile `templateFrames` into the sampled `frames[]`. `targets` is the
1503
- * one DOM input — each parsed var is bound to it so computed-unit
1504
- * resolution can read the live box. Pure otherwise.
1505
- */
1506
- parse(targets: HTMLElement[]): void;
1507
- /**
1508
- * Derive a frame's `flatVars`/`vars`/`allInterpVars` from its
1509
- * `interpVars` — the pre-flattened forms the hot path
1510
- * (`interpFrames`) iterates without re-walking. Called once per frame
1511
- * at the tail of `parse`, and again by `renormalizeColors` after a
1512
- * color-space change re-derives the interp carriers in place.
1513
- */
1514
- private finalizeFrameVars;
1515
- /**
1516
- * Re-derive the color-resolved interpolation carriers in place after a
1517
- * `colorSpace`/`hueMethod` change on already-compiled frames. Only the
1518
- * per-`InterpolatedVar` color resolution depends on the color space —
1519
- * the flatten/sort/reconcile structure does not — so this re-runs
1520
- * `createInterpVarValue` over the existing `frames`/`parsedVars` and
1521
- * rebuilds the hot-path arrays, with NO re-flatten and NO re-sort. The
1522
- * new carriers derive from the already-target-bound `parsedVars`, the
1523
- * same provenance `parse` gives them, so DOM binding is preserved.
1524
- *
1525
- * The owning `Animation`'s `setColorSpace`/`setHueMethod` call this when
1526
- * frames already exist; before `parse`, the option is simply read by the
1527
- * next compile.
1528
- */
1529
- renormalizeColors(): void;
1530
- }
1531
-
1532
1533
  /**
1533
1534
  * Build a CSS-native SVG line-drawing animation: read the target's path length
1534
1535
  * ONCE, set `stroke-dasharray` to that length (one solid full-length dash), and
@@ -1653,24 +1654,6 @@ export declare const fromStyleSheets: <V extends Vars = Vars>(source?: Document
1653
1654
  */
1654
1655
  export declare const getAnimationId: (animation: AnimationIdentity | string) => string;
1655
1656
 
1656
- /**
1657
- * Resolve a timing-function input to a callable `TimingFunction`.
1658
- *
1659
- * Accepts:
1660
- * - a `TimingFunction` — returned as-is
1661
- * - a named entry in `timingFunctions` (`ease-out-cubic`,
1662
- * `easeOutCubic`, `linear`, etc.) — looked up in the registry
1663
- * - a CSS `cubic-bezier(x1, y1, x2, y2)` literal string —
1664
- * parsed to control points and resolved via `CSSCubicBezier`
1665
- * - a CSS `steps(n[, position])` literal plus the `step-start` /
1666
- * `step-end` keywords — resolved via `steppedEase`, so the full
1667
- * CSS Easing Level 1 vocabulary round-trips through `fromString`
1668
- * - `undefined` or a name/literal the registry can't find —
1669
- * returns `undefined` so callers can decide (the option setters
1670
- * throw a typed `AnimationOptionError`, fail-explicit)
1671
- */
1672
- export declare const getTimingFunction: (timingFunction: TimingFunction | TimingFunctionNames | string | undefined) => TimingFunction | undefined;
1673
-
1674
1657
  declare const glow: PresetFactory;
1675
1658
 
1676
1659
  declare const gradientBackground: PresetFactory;
@@ -1732,25 +1715,35 @@ export declare interface IngestResult<V extends Vars = Vars> {
1732
1715
  diagnostics: Diagnostic[];
1733
1716
  }
1734
1717
 
1718
+ /**
1719
+ * The AUTHORED option bag — every field already optional, because the type IS a
1720
+ * `Partial<…>`. **Never write `Partial<InputAnimationOptions>`**: it is a
1721
+ * tautology (X.KF.W5 B-20 ≡ KF-CB-35). The wrapper spread from the library's own
1722
+ * signatures into consumer code, where a reader reasonably concluded the bare
1723
+ * type must be required-by-default; the library's four in-bounds signatures drop
1724
+ * it at source so there is nothing left to copy.
1725
+ */
1735
1726
  export declare type InputAnimationOptions = Partial<{
1736
1727
  duration: number | string;
1728
+ /** The authored unit of `duration`; it pairs with the number it rides with. */
1729
+ durationUnit: CssTimeUnit;
1737
1730
  delay: number | string;
1731
+ /** The authored unit of `delay`; it pairs with the number it rides with. */
1732
+ delayUnit: CssTimeUnit;
1738
1733
  iterationCount: number | string | "infinite" | undefined;
1739
1734
  direction: (typeof DIRECTIONS)[number];
1740
1735
  fillMode: (typeof FILL_MODES)[number];
1741
- timingFunction: TimingFunction | Easing | TimingFunctionNames | string | undefined;
1736
+ timingFunction: TimingFunction | Easing | TimingFunctionNames | CssEasingLiteral | undefined;
1742
1737
  /** When true (default), eligible animations may use the Web Animations API for compositor-thread execution. Set to false to force rAF. */
1743
1738
  useWAAPI: boolean;
1744
1739
  /** When true, snap `play()` to the final frame under `prefers-reduced-motion: reduce`. Default false. */
1745
1740
  respectReducedMotion: boolean;
1746
- colorSpace?: ColorSpace;
1741
+ colorSpace?: SpaceId;
1747
1742
  hueMethod?: HueInterpolationMethod;
1748
1743
  /** The LAYER-level `animation-composition` operator (L.W1 S5). Omission ⇒ `replace`. */
1749
1744
  composite?: CompositeOperator;
1750
1745
  }>;
1751
1746
 
1752
- export { InterpolatedVar }
1753
-
1754
1747
  declare const jumpDown: PresetFactory;
1755
1748
 
1756
1749
  declare const jumpUp: PresetFactory;
@@ -1769,14 +1762,6 @@ export declare class KeyframesAnimation<V extends Vars = Vars> {
1769
1762
  superKey: string | undefined;
1770
1763
  targets: HTMLElement[];
1771
1764
  options: AnimationOptions;
1772
- /** The frame-compilation half — template frames → sampled `frames[]`. The
1773
- * class composes one and delegates `addFrame`/`parse` + the frame accessors
1774
- * to it. READ-ONLY surface (G.W19): the backing `_compiler` is written ONLY
1775
- * by the constructor + `adoptCompiled` (via `_setCompiler`); an external
1776
- * `animation.compiler = …` reach-in is a COMPILE error (the live-options
1777
- * desync lock). */
1778
- private _compiler;
1779
- get compiler(): FrameCompiler<V>;
1780
1765
  /** THE rAF owner for this animation — the standalone play loop and the WAAPI
1781
1766
  * shadow tick both ride it, so `stop()` halts either uniformly. */
1782
1767
  readonly playback: RAFPlayback;
@@ -1838,7 +1823,7 @@ export declare class KeyframesAnimation<V extends Vars = Vars> {
1838
1823
  /** The consumer's EXPLICIT constructor options (NOT merged with defaults) —
1839
1824
  * retained so `fromString` can layer a parsed style-rule `animation`
1840
1825
  * shorthand UNDER them (constructor-explicit wins, F.W8). */
1841
- protected _ctorOptions: Partial<InputAnimationOptions>;
1826
+ protected _ctorOptions: InputAnimationOptions;
1842
1827
  /** The compile-stable union of this animation's interpolated keys. */
1843
1828
  get flatKeys(): readonly string[];
1844
1829
  /**
@@ -1856,14 +1841,24 @@ export declare class KeyframesAnimation<V extends Vars = Vars> {
1856
1841
  * access (the old `PlaybackHost` re-publication + cast are excised).
1857
1842
  */
1858
1843
  dispatchAnimationEvent(type: string): void;
1859
- constructor(options?: Partial<InputAnimationOptions>, targets?: HTMLElement[] | HTMLElement | undefined, name?: string | undefined, superKey?: string | undefined);
1844
+ constructor(options?: InputAnimationOptions, targets?: HTMLElement[] | HTMLElement | undefined, name?: string | undefined, superKey?: string | undefined);
1860
1845
  get templateFrames(): TemplateAnimationFrame<V>[];
1861
1846
  set templateFrames(value: TemplateAnimationFrame<V>[]);
1862
1847
  get parsedVars(): ParsedVarMap[];
1863
1848
  get frames(): AnimationFrame<V>[];
1849
+ private _compiled;
1850
+ /**
1851
+ * True once `parse()` has compiled the CURRENT template set; false again the
1852
+ * moment that set changes. X.KF.W5 B-13 (KF-TFP-27, G-OPTSET): `frames`
1853
+ * yields `[]` both BEFORE a parse and for an animation with no segments, and
1854
+ * those are not the same fact — so a per-frame write could silently no-op
1855
+ * while REPORTING SUCCESS, on a precondition the caller *"neither asserts
1856
+ * nor can observe"*. It can observe it here.
1857
+ */
1858
+ get compiled(): boolean;
1864
1859
  get frameId(): number;
1865
1860
  /** Append a template frame (delegated to the compiler). Chainable. */
1866
- addFrame<K extends V>(start: number | string | ValueUnit<number>, vars: Partial<K>, transform?: TransformFunction<K>, timingFunction?: InputAnimationOptions["timingFunction"], composition?: CompositeOperator): KeyframesAnimation<K>;
1861
+ addFrame<K extends V>(start: number | string | KeyframeSelector, vars: Partial<K>, transform?: TransformFunction<K>, timingFunction?: InputAnimationOptions["timingFunction"], composition?: CompositeOperator): KeyframesAnimation<K>;
1867
1862
  /** Compile the template frames into the sampled `frames[]` (R.W2 body in
1868
1863
  * `./compile-bridge`). Chainable. */
1869
1864
  parse(): this;
@@ -1874,11 +1869,6 @@ export declare class KeyframesAnimation<V extends Vars = Vars> {
1874
1869
  * (`proof:adopt-compiled`). Chainable.
1875
1870
  */
1876
1871
  adoptCompiled(source: KeyframesAnimation<V>): this;
1877
- /** INTERNAL (R.W2): the sanctioned backing-field write for `_compiler` (used
1878
- * ONLY by `./compile-bridge`'s `adoptCompiled`). The `compiler` accessor
1879
- * stays get-only — an external `animation.compiler = …` reach-in is a COMPILE
1880
- * error (the G.W19 live-options-desync lock). */
1881
- _setCompiler(compiler: FrameCompiler<V>): void;
1882
1872
  setTimingFunction(timingFunction: InputAnimationOptions["timingFunction"]): this;
1883
1873
  setIterationCount(iterationCount: InputAnimationOptions["iterationCount"]): this;
1884
1874
  setDuration(duration: InputAnimationOptions["duration"]): this;
@@ -1890,7 +1880,7 @@ export declare class KeyframesAnimation<V extends Vars = Vars> {
1890
1880
  setColorSpace(colorSpace: InputAnimationOptions["colorSpace"]): this;
1891
1881
  setHueMethod(hueMethod: InputAnimationOptions["hueMethod"]): this;
1892
1882
  setComposite(composite: InputAnimationOptions["composite"]): this;
1893
- setOptions(options: Partial<InputAnimationOptions>): this;
1883
+ setOptions(options: InputAnimationOptions): this;
1894
1884
  reverse(): this;
1895
1885
  fillForwards(): void;
1896
1886
  fillBackwards(): void;
@@ -1902,18 +1892,29 @@ export declare class KeyframesAnimation<V extends Vars = Vars> {
1902
1892
  /** The named-selector PLAY-TIME guard (Q.WD1 S3 — body in `./interpolate`).
1903
1893
  * INTERNAL (R.W2): the play machine + `at()` call it; NOT `private`. */
1904
1894
  assertNoUnresolvedNamedSelector(): void;
1905
- /** Stateless progress query — maps [0,1] from first to last keyframe,
1906
- * direction-agnostic (`apply=true` invokes transforms). Body in
1907
- * `./interpolate`. */
1908
- at(progress: number, apply?: boolean): Record<string, ValueUnit[]>;
1895
+ /**
1896
+ * Sample normalized progress from the first to last keyframe, independent
1897
+ * of playback direction. `apply=true` also invokes transforms.
1898
+ *
1899
+ * The returned map is a borrowed interpolation view, not a snapshot. On
1900
+ * the common single-segment path the engine reuses the frame's authored
1901
+ * value buffer, so a later sample may mutate an earlier reference. Copy the
1902
+ * result (`{ ...animation.at(p) }`) when retaining a historical value.
1903
+ */
1904
+ at(progress: number, apply?: boolean): FlatAuthoredValues;
1909
1905
  /**
1910
1906
  * Interpolate all active frames at time `t` — the hot path (once per rAF
1911
1907
  * frame). R.W2 body in `./interpolate`; this is the thin public sampling
1912
- * delegate the group, sequence, WAAPI build, and `at()` all drive. Zero-alloc
1913
- * + fast-properties contract preserved (proof:standalone-zero-alloc /
1914
- * proof:interp-fastprops).
1915
- */
1916
- interpFrames(t: number, transformFrames?: boolean, out?: Record<string, ValueUnit[]>): Record<string, ValueUnit[]>;
1908
+ * delegate the group, sequence, WAAPI build, and `at()` all drive.
1909
+ *
1910
+ * When `out` is supplied, it is cleared and rewritten in place and returned
1911
+ * by identity; callers own that buffer but must snapshot it before the next
1912
+ * write if they need history. Without `out`, the common single-segment path
1913
+ * may return the engine's borrowed frame buffer, which subsequent samples
1914
+ * mutate. This borrowed-buffer contract is what keeps steady-state sampling
1915
+ * allocation-free.
1916
+ */
1917
+ interpFrames(t: number, transformFrames?: boolean, out?: FlatAuthoredValues): FlatAuthoredValues;
1917
1918
  onStart(): Promise<void> | undefined;
1918
1919
  onEnd(): void;
1919
1920
  advanceTo(t: number): number | Promise<number>;
@@ -1975,6 +1976,20 @@ export declare interface KeyframesScrollTimelineOptions extends TimelineOptions
1975
1976
  */
1976
1977
  declare type LayerTransitionSpring = Partial<Omit<SpringProgressOptions, "initial" | "initialVelocity">>;
1977
1978
 
1979
+ /**
1980
+ * KF-3 — serialize evenly spaced curve samples to a CSS `linear()` easing:
1981
+ * `samples[i]` becomes the stop `value (i / (n - 1) · 100)%`, values and
1982
+ * percentages quantized to 5 decimals. Positions are explicit and strictly
1983
+ * monotone, so the string is always grammar-valid, and overshoot values outside
1984
+ * `[0, 1]` ride through (CSS `linear()` permits them). The ONE `linear()`
1985
+ * densify serializer: {@link springTimingLUT}'s table and the compile tier's
1986
+ * universal `TimingFunction` CSS twin both emit through it.
1987
+ *
1988
+ * @example
1989
+ * linearFromSamples(springTimingLUT({ response: 0.5, dampingFraction: 0.45 }));
1990
+ */
1991
+ export declare function linearFromSamples(samples: ArrayLike<number>): string;
1992
+
1978
1993
  /**
1979
1994
  * Resolve the heavy CSS-keyframe engine and its companion front doors.
1980
1995
  *
@@ -1986,15 +2001,6 @@ export declare const loadAnimationEngine: () => Promise<AnimationEngine>;
1986
2001
 
1987
2002
  declare const loopPresets: Readonly<Record<string, PresetFactory>>;
1988
2003
 
1989
- declare interface ManagedStepper<Callback> extends Tickable {
1990
- readonly _playback: RAFPlayback;
1991
- _onFrame: Callback | undefined;
1992
- readonly respectReducedMotion: ReducedMotionPolicy;
1993
- readonly disposed?: boolean;
1994
- snap(): void;
1995
- _emitManagedFrame(): void;
1996
- }
1997
-
1998
2004
  export declare class ManualTimeline extends Timeline {
1999
2005
  private value;
2000
2006
  constructor(options?: TimelineOptions);
@@ -2223,8 +2229,8 @@ export declare class NumericAnimation<T extends Record<string, number>> {
2223
2229
  export declare interface NumericAnimationOptions {
2224
2230
  /**
2225
2231
  * Easing as a callable `TimingFunction` or a typed `Easing` — both
2226
- * synchronous and value.js-free, so this engine never touches the
2227
- * dynamic boundary.
2232
+ * synchronous; this engine shares only Value's `/math` leaf and never
2233
+ * touches the parser/color dynamic boundary.
2228
2234
  *
2229
2235
  * A string easing *name* is NOT accepted here (fail-explicit: it
2230
2236
  * throws). Resolve a name once, up front, through the async factory:
@@ -2251,31 +2257,6 @@ export declare interface NumericAnimationOptions {
2251
2257
  respectReducedMotion?: boolean | undefined;
2252
2258
  }
2253
2259
 
2254
- /**
2255
- * Q.WB3 S2 — the precomputed SoA fold layout for ONE compiled frame's NUMERIC
2256
- * interp subset (the single-animation `processFrame` analog of the compositor's
2257
- * `SoALayerPlan`). Built ONCE at `parse` over the STABLE iv set (the F.W4
2258
- * zero-alloc discipline — NO per-frame allocation):
2259
- * - `numeric` — the numeric ivs (numeric start+stop, NOT computed, NOT color),
2260
- * in slot order. Each iv's interp-carrier `value` is the `ValueUnit` slot the
2261
- * strided write-back fills (the SAME slot `lerpValue` writes today).
2262
- * - `from` / `to` — the packed endpoint `Float64Array`s (`start.value` /
2263
- * `stop.value`), one slot per `numeric[s]`.
2264
- * - `out` — the per-frame scratch the `lerpArray` fold writes into (reused
2265
- * across every frame — zero per-frame alloc).
2266
- * - `boxed` — the residual ivs (color / computed / mixed) the fold CANNOT cover
2267
- * — walked by the existing per-element `lerpValue`, UNCHANGED.
2268
- * The boxed-color tail is the GATED `ColorChannelPlan` consume's frontier (S4,
2269
- * value.js 1.2.0) — NOT this NOW numeric arm.
2270
- */
2271
- declare interface NumericFoldPlan<V extends Vars> {
2272
- numeric: Array<InterpolatedVar<V>>;
2273
- from: Float64Array;
2274
- to: Float64Array;
2275
- out: Float64Array;
2276
- boxed: Array<InterpolatedVar<V>>;
2277
- }
2278
-
2279
2260
  /** Callback invoked each frame during `.play()` with the interpolated values. */
2280
2261
  export declare type NumericFrameCallback<T extends Record<string, number>> = (values: T) => void;
2281
2262
 
@@ -2387,13 +2368,13 @@ export declare type OscillatorWaveform = "sine" | "triangle" | "square" | "sawto
2387
2368
 
2388
2369
  declare const parallaxScroll: PresetFactory;
2389
2370
 
2390
- declare type ParsedVarMap = Record<string, ValueArray>;
2371
+ declare type ParsedVarMap = Record<string, CssValue>;
2391
2372
 
2392
2373
  /**
2393
2374
  * SO-1 PARSE — extract the full scroll-grammar (`animation-timeline` /
2394
2375
  * `animation-range` / `timeline-scope` / `animation-trigger`) from a scroll-
2395
2376
  * driven stylesheet (string OR a pre-parsed `Stylesheet`) into a typed
2396
- * `CSSTimelineOptions`. Consumes value.js 0.13.0's `extractTimelineOptions` over
2377
+ * `CSSTimelineOptions`. Consumes Value 4's `extractTimelineOptions` over
2397
2378
  * the parsed stylesheet — the acyclic-spine consume edge (the grammar lives in
2398
2379
  * value.js, where the `animation-*` parsing already lives; kf re-derives no
2399
2380
  * parallel name table).
@@ -2440,28 +2421,6 @@ export declare function pinCSS(opts?: {
2440
2421
  bottom?: number;
2441
2422
  }): string;
2442
2423
 
2443
- declare interface PlainLeafWriter {
2444
- /** The nested parent object the leaf lives on. */
2445
- obj: Record<string, unknown>;
2446
- /** The leaf's own (last dot-segment) key on `obj`. */
2447
- key: string;
2448
- /** The live `ValueUnit[]` whose `.value`(s) the interp stride mutates in place. */
2449
- units: ValueUnit[];
2450
- /**
2451
- * True iff the leaf is a single unitless numeric unit → write `.value` (a
2452
- * bare `number`, zero-alloc). False → a units/color/multi-component leaf,
2453
- * projected to its authored STRING each refresh (the units/color residual).
2454
- */
2455
- numeric: boolean;
2456
- }
2457
-
2458
- declare interface PlainProjection {
2459
- /** The nested plain object a custom `transform` consumes (`plainVars`). */
2460
- root: Record<string, unknown>;
2461
- /** The per-leaf refresh writers, in flat-key order. */
2462
- writers: PlainLeafWriter[];
2463
- }
2464
-
2465
2424
  /**
2466
2425
  * `engine/playback-state.ts` — the `PlaybackState` run-state STORE, carved off
2467
2426
  * `engine/play-lifecycle.ts` at S.B2 on the STATE↔BEHAVIOR cohesion seam (the
@@ -2503,6 +2462,15 @@ declare class PlaybackState {
2503
2462
  readonly _boundFrame: (t: number) => boolean | Promise<boolean>;
2504
2463
  readonly _interpOut: Record<string, unknown>;
2505
2464
  startTime: number | undefined;
2465
+ /** KFA-181 — the NEXT iteration's start on the absolute clock, carried
2466
+ * across a non-final wrap (`previous start + duration`) so the overshoot
2467
+ * past the boundary is kept, never re-based at the next frame's clock.
2468
+ * Any external `startTime` write (the class setter) clears it. */
2469
+ carriedStartTime: number | undefined;
2470
+ /** KFA-70 — the rAF clock of the tick that took a FRESH anchor, until the
2471
+ * next rAF tick re-anchors the play to the first presented frame
2472
+ * (`presentAnchor`). Any external `startTime` write clears it. */
2473
+ anchorTick: number | undefined;
2506
2474
  pausedTime: number;
2507
2475
  t: number;
2508
2476
  iteration: number;
@@ -2650,6 +2618,18 @@ export declare class RAFPlayback {
2650
2618
  * restart's freshly-repopulated `_rafId`. On `false` (or a stale
2651
2619
  * generation that finishes) the loop cleans up. `play`/`drive`/`loop`
2652
2620
  * are the three thin entry shapes over this one core.
2621
+ *
2622
+ * A FRAME MAY FAIL, AND FAILING IS NOT WEDGING (X.KF.W5 C-2 / G-RAF).
2623
+ * `step` had no failure path at all: a synchronous throw skipped
2624
+ * `reschedule` outright and a rejected async result met a `.then` with no
2625
+ * rejection arm, so in both shapes `_cleanup` never ran, `_rafId` stayed
2626
+ * populated, `running` stayed TRUE for the lifetime of the driver, and a
2627
+ * pending `play()` promise never settled — every consumer guarding on
2628
+ * `!playback.running` was then a permanent no-op. A failed frame now winds
2629
+ * the loop down through the SAME generation-guarded path a finished one
2630
+ * takes, and then RE-RAISES the failure unchanged: loud (the host's
2631
+ * uncaught-error channel sees the original error, nothing is absorbed) and
2632
+ * recoverable (the next `play`/`drive`/`loop` re-arms).
2653
2633
  */
2654
2634
  private _run;
2655
2635
  /**
@@ -2712,8 +2692,14 @@ export { RangePhase }
2712
2692
  * takes a SCALE, not just a boolean — WCAG 2.3.3-aligned ("shorten the
2713
2693
  * travel, keep the meaning"):
2714
2694
  *
2715
- * - `false` / `undefined` — do not honor reduced motion (the conservative
2716
- * default; the animation runs at full amplitude regardless of the OS query).
2695
+ * - `false` / `undefined` — do not honor reduced motion: the animation runs at
2696
+ * full amplitude regardless of the OS query. This is the policy VALUE's
2697
+ * meaning, NOT the engine's default — X.KF.W5 ruling KF-W5R4(3) (COHESION
2698
+ * §0j.C) INVERTED the orchestrator defaults to `respectReducedMotion: true`
2699
+ * (`AnimationGroup`, `Sequence`, `startViewTransition`), so honouring the
2700
+ * preference is what a caller gets by omission and `false` is the explicit
2701
+ * opt-out. A surface that still seeds `false` by default is named in the
2702
+ * wave record's residual list, not described as "conservative" here.
2717
2703
  * - `true` — the classic binary snap: under an active `prefers-reduced-motion:
2718
2704
  * reduce` the surface jumps to its terminal state (amplitude scale `0`).
2719
2705
  * - a `number` ∈ [0, 1] — the INTENSITY: under an active query the surface
@@ -2798,11 +2784,11 @@ export declare interface ResolvedKeyframes {
2798
2784
  */
2799
2785
  composition: Map<string, string>;
2800
2786
  /** `@property --foo { ... }` registry */
2801
- properties: Map<string, PropertyDescriptor_2>;
2787
+ properties: Map<string, CSSPropertyDescriptor>;
2802
2788
  /**
2803
2789
  * `@function --foo(...) { ... }` descriptor registry (P.W13 — the emerging-CSS
2804
- * resolve seam). Collected via value.js `extractFunctions` exactly as
2805
- * `properties` is collected via `extractProperties`. Threaded into the
2790
+ * resolve seam). Collected via Value's `collectCustomFunctions` exactly as
2791
+ * `properties` is collected via `collectPropertyDescriptors`. Threaded into the
2806
2792
  * {@link resolveValues} pass's {@link ResolveContext} so the dashed-function
2807
2793
  * `@function` CALL-inlining lands greenable the moment value.js-P publishes
2808
2794
  * the call-parse arm; the descriptor is captured NOW (a read-only registry —
@@ -2815,12 +2801,12 @@ export declare interface ResolvedKeyframes {
2815
2801
  * `animation` shorthand or longhand declarations (if any). Empty
2816
2802
  * when the input has no matching style rule.
2817
2803
  */
2818
- options: ReturnType<typeof extractAnimationOptions>;
2804
+ options: CSSAnimationOptions;
2819
2805
  /**
2820
2806
  * Structured parse/honoring diagnostics (K.W7 S4) — every SILENT fallback
2821
2807
  * the resolve path used to swallow, now a citable row. CONSUMES the value.js
2822
- * 0.12.0 `ParseDiagnostic`/`OnParseError` producer (N2 row 10): a failed
2823
- * parse surfaced through `OnParseError` lands here as a `PARSE_ERROR` row,
2808
+ * Value 4 `ParseIssue` producer: a failed parse lands here as a
2809
+ * `PARSE_ERROR` row,
2824
2810
  * and the kf-side fallbacks (`EMPTY_PARSE`, and the engine's
2825
2811
  * `COMPOSITION_FALLBACK`) join it. A FLAT additive array with stable
2826
2812
  * {@link DiagnosticCode}s, NOT a logging framework. Empty on a clean parse.
@@ -2830,7 +2816,7 @@ export declare interface ResolvedKeyframes {
2830
2816
  /**
2831
2817
  * The parsed CSS `Stylesheet` AST the resolve walked (L.W2 S1). Surfaced so a
2832
2818
  * caller can recover scroll-grammar (`animation-timeline`/`animation-range`)
2833
- * from the SAME parse via `extractTimelineOptions(resolved.stylesheet)` —
2819
+ * from the SAME parse via `collectTimelineOptions(resolved.stylesheet)` —
2834
2820
  * `CSSKeyframesAnimation.fromString` threads it onto `scrollOptions` so the
2835
2821
  * compiler's EMIT half (CC-6) can serialize the scroll longhands back out. A
2836
2822
  * read-only metadata field; the keyframe/option resolution is unchanged.
@@ -2853,7 +2839,7 @@ export declare interface ResolvedRange {
2853
2839
  * `"ease-out-cubic"`, … — or a CSS `cubic-bezier()` literal) to a typed
2854
2840
  * {@link Easing}.
2855
2841
  *
2856
- * The lookup rides the dynamic boundary: `import("./compile/easing/easing-registry")`
2842
+ * The lookup rides the dynamic boundary: `import("./compile/easing/registry")`
2857
2843
  * loads ONLY the value.js-bearing timing-function registry (R.W1 narrow — not the
2858
2844
  * full engine chunk; lib-support F7) when a named easing is actually used, so a
2859
2845
  * light-only consumer that never calls this stays value.js-free.
@@ -2896,8 +2882,7 @@ declare interface ResolveEnv {
2896
2882
  /**
2897
2883
  * Normalise a CSS string (or pre-parsed Stylesheet) into the shape
2898
2884
  * `CSSKeyframesAnimation.fromString` consumes. The single entry
2899
- * point: replaces the legacy `parseCSSKeyframes` /
2900
- * `parseCSSStyleBlock` / `parseCSSAnimationKeyframes` fork.
2885
+ * point, replacing the former multi-parser fork.
2901
2886
  *
2902
2887
  * Bare keyframe-stop lists (`from { … } to { … }`) historically work even
2903
2888
  * though they are not valid top-level CSS. F.W8 decides that on the parsed
@@ -2939,6 +2924,22 @@ export declare const resolveLiveKeyframes: <V extends Vars = Vars>(source?: Docu
2939
2924
  */
2940
2925
  export declare function resolveRange(range: AnimationRangeValue | undefined): ResolvedRange;
2941
2926
 
2927
+ /** Resolve a callable, canonical Value name, or CSS timing-function literal. */
2928
+ export declare const resolveTimingFunction: (timingFunction: TimingFunction | string) => TimingFunction;
2929
+
2930
+ /**
2931
+ * ms → a CSS time literal, in the unit the author wrote (UIA-KF-177).
2932
+ *
2933
+ * value.js 4.1.0's `CSSAnimationOptions` carries the authored `<time>` unit
2934
+ * beside the number (`durationUnit` / `delayUnit`), and kf's options keep it
2935
+ * from ingest, so an authored `500ms` emits `500ms` and an authored `0.05s`
2936
+ * emits `0.05s`. A time with no authored unit (a programmatic number, an
2937
+ * external stagger offset) has no spelling to keep, so it takes the shortest
2938
+ * exact literal, seconds on a tie (the CSSOM's canonical unit;
2939
+ * X.KF.W13X.r4lib). Every spelling parses back to the same milliseconds.
2940
+ */
2941
+ export declare const reverseCSSTime: (milliseconds: number, unit?: CssTimeUnit) => string;
2942
+
2942
2943
  declare const rotateIn: PresetFactory;
2943
2944
 
2944
2945
  declare const rotateScale: PresetFactory;
@@ -3284,7 +3285,9 @@ export declare class Sequence<V extends Vars = Vars> implements SequencePlayCont
3284
3285
  pause(): this;
3285
3286
  /** Resume a paused sequence — restart the rAF loop with the origin
3286
3287
  * re-anchored so the first resumed frame's master clock equals the retained
3287
- * `_time` (no forward jump). No-op when not paused. Body in `./lifecycle`. */
3288
+ * `_time` (no forward jump). A seeked-only sequence (no play in flight)
3289
+ * begins a play from its playhead (KFA-17); a live unpaused play is left
3290
+ * alone. Body in `./lifecycle`. */
3288
3291
  resume(): this;
3289
3292
  /** Set the scalar playback rate — slow-mo (`< 1`), real-time (`1`),
3290
3293
  * fast-forward (`> 1`), or backward (`< 0`, the {@link reverse} form); the
@@ -3391,8 +3394,9 @@ export declare interface SequenceOptions {
3391
3394
  /**
3392
3395
  * When true, `play()` honors `prefers-reduced-motion: reduce` by snapping
3393
3396
  * every child to its rest frame in a single paint (delegated to each
3394
- * child's own reduced-motion contract via a terminal `seek`). Default
3395
- * false. SSR-safe off-DOM.
3397
+ * child's own reduced-motion contract via a terminal `seek`). **Default
3398
+ * `true`** — X.KF.W5 ruling KF-W5R4(3) (COHESION §0j.C), the engine-wide PRM
3399
+ * default inversion; `false` is the explicit opt-out. SSR-safe off-DOM.
3396
3400
  */
3397
3401
  respectReducedMotion?: boolean;
3398
3402
  }
@@ -3461,6 +3465,8 @@ export declare function serializeScrollOptions(opts: CSSTimelineOptions): {
3461
3465
  "animation-trigger"?: string;
3462
3466
  };
3463
3467
 
3468
+ export declare const serializeTimingFunction: (value: NonNullable<CSSAnimationOptions["timingFunction"]>) => CssEasingLiteral;
3469
+
3464
3470
  declare const shake: PresetFactory;
3465
3471
 
3466
3472
  declare const skeletonLoading: PresetFactory;
@@ -3528,12 +3534,6 @@ export declare class SmoothProgress {
3528
3534
  * Pairs with `.play()`. Does not touch current/target/settled state.
3529
3535
  */
3530
3536
  stop(): void;
3531
- /**
3532
- * Arm the shared driver: it steps `tickDt(dt)` once per frame until
3533
- * `settled` flips true, emitting `onFrame` per step. Idempotent —
3534
- * the driver no-ops while already running.
3535
- */
3536
- private _startLoop;
3537
3537
  }
3538
3538
 
3539
3539
  export declare interface SmoothProgressOptions {
@@ -3567,57 +3567,6 @@ export declare interface SmoothProgressOptions {
3567
3567
  /** A `.snap()` snap point — a local progress in [0,1] the scene settles to. */
3568
3568
  export declare type SnapPoints = readonly number[];
3569
3569
 
3570
- /**
3571
- * P.W2 — the precomputed SoA fold layout for ONE `add`/`weighted` blend layer.
3572
- * `carriers[s]`/`incomings[s]` are the stable `ValueUnit<number>` refs the boxed
3573
- * inner loop would have touched at slot `s` (the carrier is the leaf a lower
3574
- * layer parked in `_grouped`; the incoming is this layer's `entry.values` leaf —
3575
- * both alias `frame.flatVars` units whose `.value` `interpFrames` mutates in
3576
- * place, so the refs are frame-stable). The per-frame fold seeds the composite
3577
- * buffer from each carrier, applies the layer's op (`+=` for `add`, `lerp(...,w)`
3578
- * for `weighted`) against the incoming, and writes back — replacing the
3579
- * per-frame `for..in` + `Array.isArray` + per-element `isNumericUnit` dispatch
3580
- * with a contiguous numeric loop. The `entry` is carried for the `weighted`
3581
- * arm's per-LAYER `w = layer.weightSpring?.value ?? layer.weight` read (K.W11
3582
- * PHYS-C).
3583
- */
3584
- declare interface SoALayerPlan {
3585
- /**
3586
- * The layer config — the `weighted` fold re-reads its per-frame `w =
3587
- * weightSpring?.value ?? weight` LIVE (K.W11 PHYS-C, so a spring still drives
3588
- * the blend), and the config is generic-independent so the plan holds it
3589
- * without binding the group's `V`.
3590
- */
3591
- layer: AnimationLayerConfig;
3592
- weighted: boolean;
3593
- /** The pure-numeric carrier units the fold seeds the composite buffer from + writes back to. */
3594
- carriers: ValueUnit<number>[];
3595
- /** The incoming numeric units folded against each carrier (parallel to `carriers`). */
3596
- incomingSlots: Array<{
3597
- values: Record<string, unknown>;
3598
- key: string;
3599
- index: number;
3600
- }>;
3601
- /**
3602
- * The keys this layer touches that the SoA fold does NOT cover — a non-array
3603
- * carrier (first-touch of a key, or a scalar that a lower layer left
3604
- * `undefined`), or a leaf with ANY non-numeric / mixed element. These keep
3605
- * the boxed per-element path (the `Array.isArray` guard + the
3606
- * `Math.min(existing.length, incoming.length)` element loop), so the
3607
- * `add`/`weighted` blend stays byte-identical on the non-numeric tail. EMPTY
3608
- * for the dominant all-numeric transform shape (every leaf a numeric
3609
- * `ValueUnit[]`), so the whole `for..in` collapses to the SoA fold.
3610
- *
3611
- * S.F5a S1 — a precomputed `Set`, built ONCE here at `buildSoAPlans`
3612
- * (structural-change time). The compositor's boxed residual (`boxedBlendArm`)
3613
- * takes it DIRECTLY as its `only` membership test — killing the per-frame
3614
- * `new Set(only)` the boxed arm rebuilt every frame on the mixed-leaf shape
3615
- * (the allocation is hoisted to plan-build time, `proof:zero-alloc`
3616
- * mixed-leaf clause).
3617
- */
3618
- boxedKeys: Set<string>;
3619
- }
3620
-
3621
3570
  declare const spinner: PresetFactory;
3622
3571
 
3623
3572
  /** The split granularity. `"word"`/`"grapheme"` are layout-independent; `"line"`
@@ -3648,12 +3597,20 @@ export declare interface SplitTextOptions {
3648
3597
  a11y?: boolean;
3649
3598
  /**
3650
3599
  * The container role applied under `a11y` **only when the element has no
3651
- * role of its own** — a plain `<div>`/`<span>` maps to `role="generic"`,
3652
- * which PROHIBITS an author name, so a bare `aria-label` would not compute.
3600
+ * role of its own — explicit OR implicit** — a plain `<div>`/`<span>` maps
3601
+ * to `role="generic"` and a `<p>` to `role="paragraph"`, both of which
3602
+ * PROHIBIT an author name, so a bare `aria-label` would not compute.
3653
3603
  * Defaults to `"img"` (the canonical "graphical composite whose text
3654
- * alternative is …" role). Pass a naming-capable role to override.
3604
+ * alternative is …" role). Pass a naming-capable role to override, or
3605
+ * `null` to opt out of the role write entirely (the caller owns the role).
3606
+ *
3607
+ * An element whose IMPLICIT role already accepts a name — `<h1>`…`<h6>`,
3608
+ * `<button>`, `<a href>`, the landmarks — keeps it: stamping `role="img"`
3609
+ * over an `<h1>` deletes that heading from the document's heading
3610
+ * hierarchy, which is a bigger a11y loss than the one this option exists
3611
+ * to prevent (X.KF.W5 B-1/G-ROLE).
3655
3612
  */
3656
- role?: string;
3613
+ role?: string | null;
3657
3614
  /** Locale for `Intl.Segmenter` (word/grapheme boundaries). */
3658
3615
  locale?: string;
3659
3616
  /** Options for the ready {@link StaggerFn} built over the cohort. */
@@ -3812,30 +3769,6 @@ export declare interface SpringLinearStopsOptions {
3812
3769
  maxDuration?: number;
3813
3770
  }
3814
3771
 
3815
- /**
3816
- * The managed-playback surface a `SpringProgress` exposes to the colocated
3817
- * `./managed-play` loop helpers (S.B5 — the progress.ts ceiling carve). Declared
3818
- * HERE (the spring family's ring-break home) so `managed-play.ts` drives the
3819
- * spring's rAF loop through a structural contract WITHOUT importing the
3820
- * `SpringProgress` class module — keeping the progress→managed-play edge
3821
- * one-directional (no import cycle under `tsPreCompilationDeps`). The stepper is
3822
- * a `Tickable` (the `RAFPlayback.drive` loop steps `tickDt` until `settled`); the
3823
- * helpers additionally read its current `(value, velocity)` for the per-frame
3824
- * callback and route the reduced-motion snap through `snap()`.
3825
- */
3826
- declare interface SpringPlayback extends ManagedStepper<SpringFrameCallback> {
3827
- /** True once `dispose()` has torn the spring down (a disposed spring never plays). */
3828
- readonly disposed: boolean;
3829
- /** Current position — passed to the per-frame callback. */
3830
- readonly value: number;
3831
- /** Current velocity — passed to the per-frame callback. */
3832
- readonly velocity: number;
3833
- /** The reduced-motion policy routing `play` to snap vs. run. */
3834
- readonly respectReducedMotion: ReducedMotionPolicy;
3835
- /** The reduced-motion snap (jump to target at zero velocity, settle, emit). */
3836
- snap(): void;
3837
- }
3838
-
3839
3772
  declare const springPop: PresetFactory;
3840
3773
 
3841
3774
  /**
@@ -3856,10 +3789,10 @@ declare const springPop: PresetFactory;
3856
3789
  *
3857
3790
  * API mirrors SwiftUI's `.spring(response:dampingFraction:)`.
3858
3791
  */
3859
- export declare class SpringProgress implements SpringPlayback {
3792
+ export declare class SpringProgress {
3860
3793
  private options;
3861
3794
  /** The reduced-motion policy — read by `./managed-play`'s `springPlay` to
3862
- * route the snap vs. run branch (the {@link SpringPlayback} contract). */
3795
+ * route the snap vs. run branch. */
3863
3796
  get respectReducedMotion(): ReducedMotionPolicy;
3864
3797
  private targetValue;
3865
3798
  private currentValue;
@@ -3913,7 +3846,12 @@ export declare class SpringProgress implements SpringPlayback {
3913
3846
  /**
3914
3847
  * Set the target. The closed-form solution is re-seated from the
3915
3848
  * current `(value, velocity)` so the trajectory is continuous.
3916
- * Idempotent if the target is unchanged.
3849
+ * Idempotent if the target is unchanged AND the spring carries no live
3850
+ * velocity. An equal target with nonzero velocity (e.g. right after
3851
+ * `reset(x, v)`, which seats `target = x` and stops the managed loop)
3852
+ * still re-seats — the trajectory is identical (the closed form re-seats
3853
+ * from the current `(x, v)`), and the re-seat re-arms the managed loop so
3854
+ * the spring runs to rest and commits (K-1).
3917
3855
  */
3918
3856
  set target(value: number);
3919
3857
  private reseatTarget;
@@ -3947,6 +3885,15 @@ export declare class SpringProgress implements SpringPlayback {
3947
3885
  * overdamped: x(t) = A e^(r₁ t) + B e^(r₂ t)
3948
3886
  */
3949
3887
  private evaluateAt;
3888
+ /**
3889
+ * The rest the spring travels toward: `origin + s·(target − origin)`.
3890
+ * R-K1-a — at full amplitude (s = 1) that expression is NOT `target` in
3891
+ * floating point for every origin (origin −0.0069, target 1 →
3892
+ * 0.9999999999999999), so a settled spring would rest a float short and a
3893
+ * consumer's `value >= target` never fires. At s = 1 the rest IS the
3894
+ * target, exactly; every other s is the scaled form, unchanged.
3895
+ */
3896
+ private scaledTarget;
3950
3897
  private checkSettled;
3951
3898
  /** Immediately set value = target, zero velocity. */
3952
3899
  snap(): void;
@@ -4120,6 +4067,22 @@ export declare interface SpringTimingFunctionOptions {
4120
4067
  maxDuration?: number;
4121
4068
  }
4122
4069
 
4070
+ /**
4071
+ * KF-3 (atlas A2(b)) — the sampled look-up-table form of
4072
+ * {@link springTimingFunction}: `sampleCount + 1` spring positions at the evenly
4073
+ * spaced normalized times `t = i / sampleCount`, with `lut[0] = 0` and
4074
+ * `lut[sampleCount] = 1` exactly. Built for per-frame and many-mark consumers
4075
+ * (an ECharts series, a canvas of marks, a CSS `linear()` via
4076
+ * {@link linearFromSamples}) that want the samples themselves rather than a
4077
+ * callable. This IS the table `springTimingFunction` interpolates — one sampler,
4078
+ * one solver — so `springTimingFunction(opts).fn(i / n) === lut[i]`.
4079
+ *
4080
+ * @example
4081
+ * const lut = springTimingLUT({ response: 0.5, dampingFraction: 0.45, sampleCount: 120 });
4082
+ * const css = linearFromSamples(lut); // "linear(0 0%, … , 1 100%)"
4083
+ */
4084
+ export declare function springTimingLUT(opts: SpringTimingFunctionOptions): Float64Array;
4085
+
4123
4086
  declare const springWobble: PresetFactory;
4124
4087
 
4125
4088
  /**
@@ -4218,7 +4181,7 @@ export declare type SVGDrawTarget = SVGElement & {
4218
4181
 
4219
4182
  export declare interface TemplateAnimationFrame<V extends Vars> {
4220
4183
  id: number;
4221
- start: ValueUnit;
4184
+ start: KeyframeSelector;
4222
4185
  vars: V;
4223
4186
  transform?: TransformFunction<V>;
4224
4187
  timingFunction?: Easing;
@@ -4248,8 +4211,10 @@ declare const textFocusBlur: PresetFactory;
4248
4211
  * `"unit"` (a word or grapheme — an animatable fragment) or `"space"` (inter-unit
4249
4212
  * whitespace — kept as a live text node so the browser can still wrap the run at
4250
4213
  * real break opportunities; the per-glyph inline-blocks otherwise defeat
4251
- * `text-wrap: balance`, the AnimatedText X-5 lesson). Punctuation rides as its
4252
- * own `"unit"` under word granularity (`isWordLike === false` but non-blank).
4214
+ * `text-wrap: balance`, the AnimatedText X-5 lesson). Under word granularity
4215
+ * punctuation rides WITH the word it abuts (KF-1): `Intl.Segmenter` emits `,`
4216
+ * `.` `!` `"` as their own non-word-like segments, and splitting on those made
4217
+ * "Hello," two fragments, so the comma could stagger in late or wrap alone.
4253
4218
  */
4254
4219
  /** One ordered piece of the source text. */
4255
4220
  export declare interface TextSegment {
@@ -4315,8 +4280,8 @@ export declare abstract class Timeline {
4315
4280
  export declare interface TimelineOptions {
4316
4281
  /**
4317
4282
  * Easing as a callable `TimingFunction` or a typed `Easing` — both
4318
- * synchronous and value.js-free, so the `Timeline` family never touches
4319
- * the dynamic boundary.
4283
+ * synchronous and parser-free, so the `Timeline` family never touches the
4284
+ * heavy boundary; its only Value runtime edge is the shared `/math` leaf.
4320
4285
  *
4321
4286
  * A string easing *name* is NOT accepted here (fail-explicit: it
4322
4287
  * throws). Resolve a name once, up front, through the async factory:
@@ -4341,7 +4306,41 @@ export declare interface TimelineOptions {
4341
4306
 
4342
4307
  export declare type TimingFunction = (t: number) => number;
4343
4308
 
4344
- export declare type TimingFunctionNames = keyof typeof timingFunctions;
4309
+ /**
4310
+ * The registry roster with each name's curve, evaluated at module top level —
4311
+ * THE BOOT FENCE (G-KF3-6): a `bezierPresets` key value stops accepting is a kf
4312
+ * boot `throw` here, and a key it adds silently widens this public roster.
4313
+ *
4314
+ * The references are value.js's memoised ones, so they are stable but NOT
4315
+ * injective: the 40 names resolve onto **31** distinct references, because nine
4316
+ * hyphen/camel twin pairs (`ease-out-cubic` ≡ `easeOutCubic`, `smooth-step-3` ≡
4317
+ * `smoothStep3`, …) share one value.js function. A reference therefore
4318
+ * identifies the CURVE and never the name that produced it — which is why
4319
+ * `easing-serialize.ts`'s reverse lookup can tell a registry curve from a
4320
+ * closure but cannot recover WHICH name was written, and why G-KFW4-5 proves
4321
+ * identity by sampled value-identity on the 33-point grid rather than by name
4322
+ * equality (COHESION §0j.C KF-SS3). `test/compile/easing-identity.test.ts`
4323
+ * asserts all three facts.
4324
+ */
4325
+ export declare const timingFunctionEntries: readonly (readonly [
4326
+ string,
4327
+ EasingFunction
4328
+ ])[];
4329
+
4330
+ /**
4331
+ * The registry's easing NAMES — exactly the roster
4332
+ * `compile/easing/registry.ts` builds at module evaluation (value.js's
4333
+ * `bezierPresets` keys + `"ease-in-bounce"` + the camel `DIRECT_NAMES`), and
4334
+ * nothing else.
4335
+ *
4336
+ * `"steps"` is NOT a member (X.KF.W4 KF-CB-24): bare `steps` carries no count
4337
+ * and no jump term, so it fails the CSS Easing L1 parse and is absent from
4338
+ * `registryNames` — `resolveTimingFunction("steps")` THROWS on it. The
4339
+ * parametric `steps(4, jump-end)` is a CSS LITERAL, resolved through the parser
4340
+ * branch, never a name. `test/compile/timing-function-names.test.ts`
4341
+ * (G-KFW4-13) asserts this union and the runtime roster are the same set.
4342
+ */
4343
+ export declare type TimingFunctionNames = BezierPresetName | "ease-in-bounce" | "easeOutCubic" | "easeInOutSine" | "easeInOutCubic" | "easeInOutQuad" | "easeInOutExpo" | "easeInOutCirc" | "easeOutExpo" | "smoothStep3" | "easeInBounce";
4345
4344
 
4346
4345
  /**
4347
4346
  * Normalize a callable or typed easing to {@link Easing}. Synchronous and
@@ -4351,14 +4350,7 @@ export declare const toEasing: (input: TimingFunction | Easing) => Easing;
4351
4350
 
4352
4351
  export declare type TransformFunction<V extends Vars> = (v: V, t: number) => void;
4353
4352
 
4354
- /**
4355
- * Default DOM-style renderer used by `Animation.transform` when no
4356
- * user-supplied transform is provided. "Is this the default renderer?"
4357
- * is decided by reference comparison against the Animation instance's
4358
- * one `_defaultTransform` (`usesDefaultRenderer`) — typed and
4359
- * bind-proof, not a Symbol tag a wrapper would silently drop.
4360
- */
4361
- export declare function transformTargetsStyle<V extends Vars>(vars: V, targets: HTMLElement[], flat?: boolean): void;
4353
+ export declare function transformTargetsStyle<V extends Vars>(vars: V, targets: HTMLElement[]): void;
4362
4354
 
4363
4355
  /** The play direction a trigger cycle runs — `alternate` flips it each entry. */
4364
4356
  export declare type TriggerDirection = "forward" | "backward";
@@ -4455,11 +4447,11 @@ export declare class UnknownEasingError extends Error {
4455
4447
 
4456
4448
  /**
4457
4449
  * `validate(css, opts?)` — the READ-ONLY projection over the three typed channels
4458
- * onto one {@link ValidateResult} envelope. Async because `compileToCSS` is (its
4459
- * Prettier pass).
4450
+ * onto one {@link ValidateResult} envelope. Async because `compileToCSS` retains
4451
+ * its Promise contract while producing deterministic CSS directly.
4460
4452
  *
4461
4453
  * The pipeline:
4462
- * 1. `parseCSSStylesheet(css)` → the AST; `parseable` is true when value.js
4454
+ * 1. `parseStylesheet(css)` → the AST; `parseable` is true when Value
4463
4455
  * surfaced at least one recognized item and the resolve raised no
4464
4456
  * `PARSE_ERROR` (the spec-faithful reality — a dropped `!important` decl is
4465
4457
  * not a parse failure).
@@ -4709,7 +4701,7 @@ export declare function waveformValue(phase: number, waveform: OscillatorWavefor
4709
4701
  * `tickDt` + `settled`); typing it as this narrow shape — NOT importing
4710
4702
  * `SpringProgress` — keeps `constants.ts` from gaining a class edge and lets
4711
4703
  * a consumer drive a layer's weight with ANY analytic stepper (a decay glide,
4712
- * a custom `Tickable`). The read is one nullish access in the `weighted` blend
4704
+ * a custom `Tickable`). The read is one nullish access in the weight blend
4713
4705
  * leaf; the group's managed loop advances it per frame via `tickDt`.
4714
4706
  */
4715
4707
  export declare interface WeightStepper {