@mkbabb/keyframes.js 5.0.0 → 5.2.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.
- package/README.md +112 -217
- package/dist/backward-color-BtbRcnna.js +108 -0
- package/dist/compile-BHCTPerD.js +30 -0
- package/dist/{waapi-D0ssxKy1.js → delegation-BQYCrP2p.js} +117 -99
- package/dist/{draw-svg-Dat9mHgi.js → draw-svg-CK9Qrly8.js} +18 -26
- package/dist/easing-registry-DHV2-5gA.js +27 -0
- package/dist/easing-registry-y1p9McFy.js +2 -0
- package/dist/easing-serialize-D4LZCB6i.js +21 -0
- package/dist/engine/index.d.ts +3139 -0
- package/dist/engine/index.js +16 -0
- package/dist/engine-CPK_udUQ.js +1172 -0
- package/dist/engine-DlpimZtM.js +3 -0
- package/dist/entry-D82NKUhP.js +148 -0
- package/dist/format-BdIvdLzG.js +114 -0
- package/dist/group-HM7N4uOE.js +390 -0
- package/dist/handle-D4xrf_ya.js +21 -0
- package/dist/{ingest-CU-kdYcM.js → ingest-_g6tfk2e.js} +62 -56
- package/dist/keyframes.d.ts +1156 -1099
- package/dist/keyframes.js +412 -132
- package/dist/morph-svg-KUrH9KnK.js +79 -0
- package/dist/motion-path-wM5tPfrY.js +26 -0
- package/dist/parse-flatten-DRMHFytp.js +2 -0
- package/dist/parse-flatten-ZZUSEQEL.js +63 -0
- package/dist/presets-DeDJYL4G.js +275 -0
- package/dist/{scheduler-7eIr_q1g.js → scheduler-CfGIC3GX.js} +1 -1
- package/dist/scroll-BEyCx0b_.js +287 -0
- package/dist/sequence-s0bL7Uul.js +736 -0
- package/dist/{validate-B1pE-Y_T.js → validate-xFZ_Ld1k.js} +17 -13
- package/dist/view-transition-BPJQxUTC.js +305 -0
- package/package.json +123 -84
- package/dist/animate-CTWr6K7j.js +0 -26
- package/dist/animations-CZxf0rep.js +0 -224
- package/dist/compile-YRJRdpKF.js +0 -251
- package/dist/decay-BvNmFk51.js +0 -25
- package/dist/engine-DQcb7CLW.js +0 -1349
- package/dist/errors-W8zkvPw4.js +0 -21
- package/dist/format-BUgCTjmr.js +0 -123
- package/dist/morph-svg-83uyYxoW.js +0 -84
- package/dist/motion-path-C0OHqcA3.js +0 -31
- package/dist/rolldown-runtime-Dy4uBu1J.js +0 -11
- package/dist/scroll-grammar-B4kPvGh5.js +0 -23
- package/dist/scroll-scene-DQxhxn9I.js +0 -176
- package/dist/sequence-cBr7thU8.js +0 -198
- package/dist/springTimingFunction-D26gPkAy.js +0 -63
- package/dist/timeline-vY3eD3Ax.js +0 -430
- package/dist/utils-BPRImVl5.js +0 -100
package/dist/keyframes.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { AnimationRangeValue } from '@mkbabb/value.js';
|
|
2
2
|
import { AnimationTimelineValue } from '@mkbabb/value.js';
|
|
3
|
+
import { AnimationTriggerValue } from '@mkbabb/value.js';
|
|
3
4
|
import { ColorSpace } from '@mkbabb/value.js';
|
|
4
5
|
import { CSSTimelineOptions } from '@mkbabb/value.js';
|
|
5
6
|
import { CustomFunctionDescriptor } from '@mkbabb/value.js';
|
|
@@ -12,6 +13,7 @@ import { RangeBoundary } from '@mkbabb/value.js';
|
|
|
12
13
|
import { RangePhase } from '@mkbabb/value.js';
|
|
13
14
|
import { Stylesheet } from '@mkbabb/value.js';
|
|
14
15
|
import { timingFunctions } from '@mkbabb/value.js';
|
|
16
|
+
import { TriggerType } from '@mkbabb/value.js';
|
|
15
17
|
import { ValueArray } from '@mkbabb/value.js';
|
|
16
18
|
import { ValueUnit } from '@mkbabb/value.js';
|
|
17
19
|
|
|
@@ -24,7 +26,7 @@ declare const accordionExpand: (options?: InputAnimationOptions) => CSSKeyframes
|
|
|
24
26
|
* carries any honest refusal (no running animation by that name → a row, never
|
|
25
27
|
* a silent no-op).
|
|
26
28
|
*/
|
|
27
|
-
export declare interface AdoptResult<V extends Vars =
|
|
29
|
+
export declare interface AdoptResult<V extends Vars = Vars> {
|
|
28
30
|
/** The kf animation now driving the element (null on a refused adopt). */
|
|
29
31
|
animation: CSSKeyframesAnimation<V> | null;
|
|
30
32
|
/** The captured native `currentTime` (ms) the kf playhead seeded from. */
|
|
@@ -60,7 +62,7 @@ export declare interface AdoptResult<V extends Vars = any> {
|
|
|
60
62
|
* // the kf object now drives `el` from the exact playhead — no visible seam.
|
|
61
63
|
* animation?.pause(); // ...now scrub / spring-ify / re-color it.
|
|
62
64
|
*/
|
|
63
|
-
declare const adoptRunning: <V extends Vars =
|
|
65
|
+
declare const adoptRunning: <V extends Vars = Vars>(el: Element, options: AdoptRunningOptions) => Promise<AdoptResult<V>>;
|
|
64
66
|
|
|
65
67
|
/** Options for {@link adoptRunning}. */
|
|
66
68
|
export declare interface AdoptRunningOptions extends IngestOptions {
|
|
@@ -80,62 +82,6 @@ export declare interface AdoptRunningOptions extends IngestOptions {
|
|
|
80
82
|
commit?: boolean;
|
|
81
83
|
}
|
|
82
84
|
|
|
83
|
-
/**
|
|
84
|
-
* Construct, target, and play an animation in one call. Returns the
|
|
85
|
-
* `CSSKeyframesAnimation` as the control handle — `await animate(...)` is NOT
|
|
86
|
-
* the pattern (it would await the *construction*, which is synchronous); await
|
|
87
|
-
* the returned handle's play promise via the `.play()` it already kicked off,
|
|
88
|
-
* or pass `autoPlay: false` and drive it yourself.
|
|
89
|
-
*
|
|
90
|
-
* @param target one or more DOM elements (or a single element) to animate.
|
|
91
|
-
* @param input a CSS string, a keyframe map, a vars array, or a MotionPath
|
|
92
|
-
* spec (`{ path }`) — dispatched on its shape.
|
|
93
|
-
* @param options animation options + optional `transform` / `autoPlay`.
|
|
94
|
-
*
|
|
95
|
-
* @example
|
|
96
|
-
* // CSS string → fromString
|
|
97
|
-
* animate(box, `from { opacity: 0 } to { opacity: 1 }`, { duration: 400 });
|
|
98
|
-
* // keyframe map → fromKeyframes
|
|
99
|
-
* animate(box, { "0%": { opacity: 0 }, "100%": { opacity: 1 } });
|
|
100
|
-
* // vars array → fromVars
|
|
101
|
-
* animate(box, [{ opacity: 0 }, { opacity: 1 }], { duration: 400 });
|
|
102
|
-
* // MotionPath spec → fromMotionPath (F.W12 §S2)
|
|
103
|
-
* animate(box, { path: "path('M 0 0 Q 100 -100 200 0')", rotate: "auto" }, { duration: 2000 });
|
|
104
|
-
*/
|
|
105
|
-
declare function animate<V extends Vars = any>(target: HTMLElement | HTMLElement[], input: AnimateInput<V>, options?: AnimateOptions): CSSKeyframesAnimation<V> | AnimationGroup<V> | Sequence<V>;
|
|
106
|
-
|
|
107
|
-
/**
|
|
108
|
-
* The declarative input to {@link animate} — one of the six dispatch shapes:
|
|
109
|
-
*
|
|
110
|
-
* • `string` — a CSS `@keyframes` (or bare keyframe-block) source.
|
|
111
|
-
* • `KeyframeMap` — `{ "0%": {...}, "100%": {...} }` or the `Map` form.
|
|
112
|
-
* • `V[]` — an ordered vars array (the simplest `[from, to]`
|
|
113
|
-
* pair, or more stops), distributed evenly 0→100%.
|
|
114
|
-
* • `MotionPathInput` — `{ path, from?, to?, rotate? }` — an `offset-distance`
|
|
115
|
-
* sweep over an author `offset-path` (F.W12 §S2).
|
|
116
|
-
* • `AnimationGroup` — the SPATIAL per-frame blender (L.W8 §S3) — routed to
|
|
117
|
-
* its own `.play()`, NOT wrapped in a new animation.
|
|
118
|
-
* • `Sequence` — the TEMPORAL master-playhead orchestrator (L.W8 §S3)
|
|
119
|
-
* — routed to its own `.play()`.
|
|
120
|
-
*/
|
|
121
|
-
export declare type AnimateInput<V extends Vars> = string | KeyframeMap<V> | V[] | MotionPathInput | AnimationGroup<V> | Sequence<V>;
|
|
122
|
-
|
|
123
|
-
/**
|
|
124
|
-
* Options accepted by {@link animate}. The animation-options surface, plus an
|
|
125
|
-
* optional custom `transform` renderer (forwarded to the chosen `from*`
|
|
126
|
-
* factory) and `autoPlay` (default true — set false to construct + target
|
|
127
|
-
* without starting, when the caller wants to drive the returned handle).
|
|
128
|
-
*/
|
|
129
|
-
export declare interface AnimateOptions extends Partial<InputAnimationOptions> {
|
|
130
|
-
/** Custom renderer forwarded to the `from*` factory. */
|
|
131
|
-
transform?: TransformFunction<any>;
|
|
132
|
-
/**
|
|
133
|
-
* Auto-start the animation after construction + targeting. Default true.
|
|
134
|
-
* `false` returns a constructed, targeted, NOT-yet-playing handle.
|
|
135
|
-
*/
|
|
136
|
-
autoPlay?: boolean;
|
|
137
|
-
}
|
|
138
|
-
|
|
139
85
|
/**
|
|
140
86
|
* The value.js-bearing engine surface, resolved through `loadAnimationEngine()`.
|
|
141
87
|
*
|
|
@@ -145,120 +91,93 @@ export declare interface AnimateOptions extends Partial<InputAnimationOptions> {
|
|
|
145
91
|
* with `./engine`'s runtime exports.
|
|
146
92
|
*/
|
|
147
93
|
export declare interface AnimationEngine {
|
|
148
|
-
/**
|
|
149
|
-
* The core engine constructor (PKG-3, L.W8 §S4) — renamed from `Animation`
|
|
150
|
-
* to clear the `globalThis.Animation` d.ts collision. The legacy `Animation`
|
|
151
|
-
* backward-compat alias was DROPPED in 5.0.0 (Q.WE1 — NO-LEGACY).
|
|
152
|
-
*/
|
|
94
|
+
/** The core engine base class (CSS-keyframe parsing + playback). */
|
|
153
95
|
KeyframesAnimation: typeof KeyframesAnimation;
|
|
96
|
+
/** The CSS-parsing `CSSKeyframesAnimation` subclass — the primary "in". */
|
|
154
97
|
CSSKeyframesAnimation: typeof CSSKeyframesAnimation;
|
|
98
|
+
/** Multi-animation compositor (replace/add/weighted layer blending). */
|
|
155
99
|
AnimationGroup: typeof AnimationGroup;
|
|
100
|
+
/** Stable string id for an animation (or string passthrough). */
|
|
156
101
|
getAnimationId: (animation: KeyframesAnimation | string) => string;
|
|
102
|
+
/** Easing name/literal → a typed `TimingFunction` (value.js registry). */
|
|
157
103
|
getTimingFunction: (timingFunction: TimingFunction | TimingFunctionNames | string | undefined) => TimingFunction | undefined;
|
|
104
|
+
/** CSS `@keyframes` text/stylesheet → resolved keyframes. */
|
|
158
105
|
resolveKeyframes: (input: string | Stylesheet) => ResolvedKeyframes;
|
|
159
|
-
/**
|
|
160
|
-
animate: typeof animate;
|
|
161
|
-
/** CSS-native MotionPath (F.W12) — offset-distance over an author offset-path. */
|
|
106
|
+
/** CSS-native MotionPath — offset-distance over an author offset-path. */
|
|
162
107
|
MotionPath: typeof MotionPath;
|
|
108
|
+
/** Construct a MotionPath sweep over a target. */
|
|
163
109
|
fromMotionPath: typeof fromMotionPath;
|
|
164
|
-
/** CSS-native DrawSVG
|
|
110
|
+
/** CSS-native DrawSVG — stroke-dashoffset sweep over the path length. */
|
|
165
111
|
DrawSVG: typeof DrawSVG;
|
|
112
|
+
/** Construct a DrawSVG line-draw over an SVG geometry target. */
|
|
166
113
|
fromDrawSVG: typeof fromDrawSVG;
|
|
167
|
-
/**
|
|
168
|
-
* MorphSVG (O.W6, the DM-3 7-tranche chronic terminal) — SVG path-shape
|
|
169
|
-
* morphing over value.js's `PathGeometry`. Samples two `d` strings at
|
|
170
|
-
* `samples` uniform arc-length steps, pairs the points, and interpolates the
|
|
171
|
-
* `(x, y)` pairs across `t`; `MorphSVG.sampleD(t)` reads the morphed `d`.
|
|
172
|
-
*/
|
|
114
|
+
/** SVG path-shape morphing over value.js's `PathGeometry`. */
|
|
173
115
|
MorphSVG: typeof MorphSVG;
|
|
116
|
+
/** Construct a MorphSVG between two `d` strings. */
|
|
174
117
|
fromMorphSVG: typeof fromMorphSVG;
|
|
175
|
-
/**
|
|
176
|
-
* The preset library (`fadeIn`, `bounce`, `shake`, …) — heavy (each returns
|
|
177
|
-
* a `CSSKeyframesAnimation`), so it rides the dynamic boundary as a namespace
|
|
178
|
-
* instead of the light static barrel: `const { presets } = await
|
|
179
|
-
* loadAnimationEngine(); presets.fadeIn({ duration: 500 })` (F.W11).
|
|
180
|
-
*/
|
|
118
|
+
/** The preset library (`fadeIn`, `bounce`, `shake`, …) as a namespace. */
|
|
181
119
|
presets: typeof AnimationPresets;
|
|
120
|
+
/** The valid `direction` values, as a const tuple. */
|
|
182
121
|
DIRECTIONS: readonly AnimationOptions["direction"][];
|
|
122
|
+
/** The valid `fillMode` values, as a const tuple. */
|
|
183
123
|
FILL_MODES: readonly AnimationOptions["fillMode"][];
|
|
124
|
+
/** The `AnimationOptions` defaults. */
|
|
184
125
|
defaultOptions: AnimationOptions;
|
|
126
|
+
/** The per-layer blend-config defaults. */
|
|
185
127
|
defaultLayerConfig: AnimationLayerConfig;
|
|
186
|
-
/**
|
|
187
|
-
* K.W8 INGEST (FLAGGED ADDITIVE) — the round-trip pointed FORWARD at the
|
|
188
|
-
* live web. `fromStyleSheets`/`fromLiveAnimations`/`resolveLiveKeyframes`
|
|
189
|
-
* walk the CSSOM into kf `CSSKeyframesAnimation` objects (per-sheet CORS
|
|
190
|
-
* `try/catch` → a `CORS_SKIP` diagnostic, never a silent drop); `adoptRunning`
|
|
191
|
-
* takes over a RUNNING CSS animation mid-flight via `getAnimations()`
|
|
192
|
-
* currentTime handoff (the continuity seed, NOT seed-at-zero). HEAVY (the
|
|
193
|
-
* ingest needs the value.js parser) — reached only here, never the LIGHT
|
|
194
|
-
* barrel. Named `adoptRunning` to disambiguate from `engine.adoptCompiled`.
|
|
195
|
-
*/
|
|
128
|
+
/** Walk the document's stylesheets → reconstructed kf animations + CORS diagnostics. */
|
|
196
129
|
fromStyleSheets: typeof fromStyleSheets;
|
|
130
|
+
/** Narrow to the names currently RUNNING via `getAnimations()`. */
|
|
197
131
|
fromLiveAnimations: typeof fromLiveAnimations;
|
|
132
|
+
/** The lowest-level live-CSSOM walk (live analogue of `resolveKeyframes`). */
|
|
198
133
|
resolveLiveKeyframes: typeof resolveLiveKeyframes;
|
|
134
|
+
/** Mid-flight takeover of a running CSS animation (currentTime handoff). */
|
|
199
135
|
adoptRunning: typeof adoptRunning;
|
|
200
|
-
/**
|
|
201
|
-
* K.W9 SCROLL-AS-CSS (FLAGGED ADDITIVE) — the scroll-grammar round-trip
|
|
202
|
-
* (`parseScrollCSS` / `serializeScrollOptions` / `roundTripScrollCSS`,
|
|
203
|
-
* consuming value.js 0.13.0's typed `CSSTimelineOptions` extractor +
|
|
204
|
-
* inverse serializer), the `ScrollScene` JS driver (`createScrollScene`),
|
|
205
|
-
* the conservative-correct backend dispatch (`dispatchScrollBackend`), and
|
|
206
|
-
* the `position:sticky` pin synthesis (`pinCSS`). HEAVY (static value.js
|
|
207
|
-
* edge) — reached only here, never the LIGHT barrel.
|
|
208
|
-
*/
|
|
136
|
+
/** Scroll-driven animation as CSS — the JS driver over a parsed scroll grammar. */
|
|
209
137
|
ScrollScene: typeof ScrollScene;
|
|
138
|
+
/** Construct a `ScrollScene` driver. */
|
|
210
139
|
createScrollScene: typeof createScrollScene;
|
|
140
|
+
/** Parse a scroll-as-CSS rule → typed scroll options. */
|
|
211
141
|
parseScrollCSS: typeof parseScrollCSS;
|
|
142
|
+
/** Parse an `animation-timeline` value. */
|
|
212
143
|
parseScrollTimeline: typeof parseScrollTimeline;
|
|
144
|
+
/** Parse an `animation-range` value. */
|
|
213
145
|
parseScrollRange: typeof parseScrollRange;
|
|
146
|
+
/** Serialize scroll options back to valid CSS. */
|
|
214
147
|
serializeScrollOptions: typeof serializeScrollOptions;
|
|
148
|
+
/** Round-trip scroll CSS (parse → serialize). */
|
|
215
149
|
roundTripScrollCSS: typeof roundTripScrollCSS;
|
|
150
|
+
/** Conservative-correct scroll backend dispatch. */
|
|
216
151
|
dispatchScrollBackend: typeof dispatchScrollBackend;
|
|
152
|
+
/** Resolve a scroll `animation-range` to concrete boundaries. */
|
|
217
153
|
resolveRange: typeof resolveRange;
|
|
154
|
+
/** `position:sticky` pin synthesis. */
|
|
218
155
|
pinCSS: typeof pinCSS;
|
|
219
|
-
/**
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
* computed-unit drift). The compiler is the parser run BACKWARD over the SAME
|
|
227
|
-
* data model (`format.ts` is `keyframes.ts` run backward); a human pastes the
|
|
228
|
-
* result and ships with ZERO kf bytes on the page. HEAVY (value.js-bearing) —
|
|
229
|
-
* reached only here, never the LIGHT barrel.
|
|
230
|
-
*/
|
|
156
|
+
/** The discrete `animation-trigger` lifecycle driver (idle→active→done). */
|
|
157
|
+
TriggerScene: typeof TriggerScene;
|
|
158
|
+
/** Construct a `TriggerScene` from a parsed trigger / scroll options. */
|
|
159
|
+
createTriggerScene: typeof createTriggerScene;
|
|
160
|
+
/** Feature-detect native `animation-trigger` (Chrome 145+; never UA-sniffed). */
|
|
161
|
+
supportsNativeTrigger: typeof supportsNativeTrigger;
|
|
162
|
+
/** The round-trip's BACKWARD half: orchestration graph → zero-runtime CSS. */
|
|
231
163
|
compileToCSS: typeof compileToCSS;
|
|
232
|
-
/**
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
* already-typed channels (the adapter `diagnostics`, the compile
|
|
238
|
-
* `{ eligible, refusals }`, the WAAPI `eligibility`) onto ONE agent-shaped
|
|
239
|
-
* `ValidateResult` envelope an LLM branches on WITHOUT scraping a message;
|
|
240
|
-
* `explain(css, opts?)` formats the SAME verdict deterministic human/LLM-
|
|
241
|
-
* readable. NO new engine code — a pure JOIN over the channels L.W1/L.W2 made
|
|
242
|
-
* honest. HEAVY (validate.ts imports the engine + compile + waapi) — reached
|
|
243
|
-
* only here, never the LIGHT barrel.
|
|
244
|
-
*/
|
|
164
|
+
/** S.F1 — compile a name-keyed VT role spec → zero-runtime `::view-transition-*` CSS. */
|
|
165
|
+
compileToViewTransition: typeof compileToViewTransition;
|
|
166
|
+
/** S.F3 — compile a selector-keyed entry/exit spec → zero-runtime `@starting-style` CSS. */
|
|
167
|
+
compileToEntry: typeof compileToEntry;
|
|
168
|
+
/** Read-only validation envelope over the compile/adapter/WAAPI channels. */
|
|
245
169
|
validate: typeof validate;
|
|
170
|
+
/** Format the `validate` verdict as deterministic human/LLM-readable text. */
|
|
246
171
|
explain: typeof explain;
|
|
247
|
-
/**
|
|
248
|
-
* L.W8 S1 ED-3 DOGFOOD INVERSION (FLAGGED ADDITIVE) — the heavy
|
|
249
|
-
* serialization/painting/scheduler helpers over a parsed `Animation`.
|
|
250
|
-
* `CSSKeyframesToString`/`CSSKeyframesToStrings` re-serialize the parsed
|
|
251
|
-
* keyframes back to CSS (the FORWARD half of `fromString`, value.js-bearing);
|
|
252
|
-
* `formatCSSKeyframeString` trims one keyframe body for display;
|
|
253
|
-
* `transformTargetsStyle` paints a `Vars` snapshot onto DOM targets (the
|
|
254
|
-
* same painter the run loop drives); `yieldToMain` is the engine's ONE
|
|
255
|
-
* INP-relief yield ladder. HEAVY (they ride the engine chunk) — reached only
|
|
256
|
-
* here, never the LIGHT barrel.
|
|
257
|
-
*/
|
|
172
|
+
/** Re-serialize parsed keyframes back to a CSS string. */
|
|
258
173
|
CSSKeyframesToString: typeof CSSKeyframesToString;
|
|
174
|
+
/** Re-serialize parsed keyframes back to per-rule CSS strings. */
|
|
259
175
|
CSSKeyframesToStrings: typeof CSSKeyframesToStrings;
|
|
176
|
+
/** Trim one keyframe body for display. */
|
|
260
177
|
formatCSSKeyframeString: typeof formatCSSKeyframeString;
|
|
178
|
+
/** Paint a `Vars` snapshot onto DOM targets (the run-loop painter). */
|
|
261
179
|
transformTargetsStyle: typeof transformTargetsStyle;
|
|
180
|
+
/** The engine's INP-relief yield ladder. */
|
|
262
181
|
yieldToMain: typeof yieldToMain;
|
|
263
182
|
}
|
|
264
183
|
|
|
@@ -294,6 +213,18 @@ export declare interface AnimationFrame<V extends Vars> {
|
|
|
294
213
|
* falls back to the all-boxed walk. Bit-identical to the boxed path.
|
|
295
214
|
*/
|
|
296
215
|
_numericPlan?: NumericFoldPlan<V>;
|
|
216
|
+
/**
|
|
217
|
+
* T.A6 — the nested PLAIN authored-shape projection a custom `transform`
|
|
218
|
+
* consumes (numbers where the author wrote numbers, strings where a unit or
|
|
219
|
+
* color demands one). Built lazily on the first apply — `undefined` for a
|
|
220
|
+
* DOM-style default-renderer frame (which consumes `flatVars` directly) and
|
|
221
|
+
* before the first `interpFrames(..., true)`. Invalidated at
|
|
222
|
+
* `finalizeFrameVars` so a color-space renormalize rebuilds it against the
|
|
223
|
+
* fresh interp carriers.
|
|
224
|
+
*/
|
|
225
|
+
plainVars?: V;
|
|
226
|
+
/** T.A6 — the per-leaf refresh-writer plan backing {@link plainVars}. */
|
|
227
|
+
_plainProj?: PlainProjection | undefined;
|
|
297
228
|
transform: TransformFunction<V>;
|
|
298
229
|
timingFunction: Easing;
|
|
299
230
|
/**
|
|
@@ -313,264 +244,157 @@ export declare interface AnimationFrame<V extends Vars> {
|
|
|
313
244
|
|
|
314
245
|
export declare class AnimationGroup<V extends Vars> {
|
|
315
246
|
animations: AnimationGroupObject<V>;
|
|
316
|
-
/**
|
|
317
|
-
*
|
|
318
|
-
*
|
|
319
|
-
* pre-`parse()` group composites nothing via a harmless no-op instead of
|
|
320
|
-
* throwing `this.transform is not a function`. The constructor overrides it
|
|
321
|
-
* with the first child's transform when one exists.
|
|
322
|
-
*/
|
|
247
|
+
/** The group's composite transform. Defaults to a real no-op at the FIELD
|
|
248
|
+
* (I.W0 S3) — a childless/pre-`parse()` group composites nothing instead of
|
|
249
|
+
* throwing; the constructor overrides it with the first child's transform. */
|
|
323
250
|
transform: TransformFunction<V>;
|
|
324
251
|
superKey: string | undefined;
|
|
325
252
|
paused: boolean;
|
|
326
253
|
started: boolean;
|
|
327
254
|
done: boolean;
|
|
328
|
-
/**
|
|
329
|
-
*
|
|
330
|
-
* every child to its final frame in a single composite instead of running
|
|
331
|
-
* the rAF draw loop. SSR-safe off-DOM. Default false.
|
|
332
|
-
*/
|
|
255
|
+
/** When true, `play()` honors `prefers-reduced-motion: reduce` by snapping
|
|
256
|
+
* every child to its final frame in one composite, no rAF loop. Default false. */
|
|
333
257
|
respectReducedMotion: boolean;
|
|
334
|
-
/**
|
|
335
|
-
*
|
|
336
|
-
* at or under this size tick in one slice (fast path); larger groups tick in
|
|
337
|
-
* batches with a `scheduler.yield()` between them (INP relief).
|
|
338
|
-
*/
|
|
258
|
+
/** Children-per-slice before `advanceTo()` yields to the main thread; larger
|
|
259
|
+
* groups batch with a `scheduler.yield()` between slices (INP relief). */
|
|
339
260
|
static readonly YIELD_BATCH = 32;
|
|
261
|
+
/** Construct a group from a first animation + rest (S.B4 / a06 F1/F2 — the
|
|
262
|
+
* genuine-ownership replacement for the excised `KeyframesAnimation.group()`
|
|
263
|
+
* service locator; each input is a bare animation or `{ animation, layer }`). */
|
|
264
|
+
static of<V extends Vars>(first: KeyframesAnimation<V> | AnimationGroupInput<V>, ...rest: (KeyframesAnimation<V> | AnimationGroupInput<V>)[]): AnimationGroup<V>;
|
|
340
265
|
singleTarget: boolean;
|
|
266
|
+
/**
|
|
267
|
+
* T.A6 — true when the group's composite `transform` is a CUSTOM (non-DOM)
|
|
268
|
+
* consumer that expects the nested PLAIN authored-shape projection (the
|
|
269
|
+
* "animate any object" seam), inherited from the first child's own
|
|
270
|
+
* `unflatten` flag alongside its transform. False (the default) keeps the
|
|
271
|
+
* DOM-style default renderer's FLAT `_grouped` map, byte-unchanged.
|
|
272
|
+
*/
|
|
273
|
+
unflatten: boolean;
|
|
341
274
|
lastTickTime: number;
|
|
342
275
|
/** THE rAF owner for the group's draw loop. */
|
|
343
276
|
readonly playback: RAFPlayback;
|
|
344
277
|
resolvePromise: ((value: void | PromiseLike<void>) => void) | null;
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
278
|
+
/** The ONE held play promise the `finished` front-door exposes. INTERNAL
|
|
279
|
+
* (S.B5) — read/written by the transport free functions in `./lifecycle`. */
|
|
280
|
+
_playingPromise: Promise<void> | null;
|
|
281
|
+
/** Pre-bound frame callback — allocated once to avoid a per-loop closure.
|
|
282
|
+
* INTERNAL (S.B5) — read by `./lifecycle`'s `play`/`resume` loop start. */
|
|
283
|
+
_boundFrame: (t: number) => boolean | Promise<boolean>;
|
|
348
284
|
/** Cached entries sorted by layer zIndex (see `getEntries`). */
|
|
349
285
|
private _entries;
|
|
350
286
|
private _entriesDirty;
|
|
351
|
-
/**
|
|
352
|
-
*
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
*
|
|
361
|
-
*
|
|
362
|
-
* `
|
|
363
|
-
*/
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
*
|
|
368
|
-
*
|
|
369
|
-
*
|
|
370
|
-
*
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
*
|
|
374
|
-
*
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
*
|
|
378
|
-
*
|
|
379
|
-
|
|
380
|
-
* mode changes (every such mutation routes through `invalidateEntries`).
|
|
381
|
-
*/
|
|
382
|
-
private _soaPlans;
|
|
383
|
-
/**
|
|
384
|
-
* The long-lived SoA fold scratch — the contiguous numeric accumulate buffer
|
|
385
|
-
* the `add`/`weighted` fold seeds, folds, and writes back through. Sized to
|
|
386
|
-
* the WIDEST single-layer numeric pair count once per structural change
|
|
387
|
-
* (reused across layers AND frames — zero per-frame alloc, the F.W4 zero-alloc
|
|
388
|
-
* discipline). `null` until the first plan with numeric pairs is built.
|
|
389
|
-
*/
|
|
390
|
-
private _compositeBuf;
|
|
391
|
-
/**
|
|
392
|
-
* K.W11 PHYS-C — true iff ANY layer currently carries a `weightSpring`. The
|
|
393
|
-
* fast-path guard: when false (the universal case) `advanceTo` skips the
|
|
394
|
-
* per-frame spring scan entirely, so the constant-weight blend hot path takes
|
|
395
|
-
* ZERO new work. Set true by `transitionLayer`; recomputed false once every
|
|
396
|
-
* driving spring has settled.
|
|
397
|
-
*/
|
|
398
|
-
private _hasLayerSprings;
|
|
287
|
+
/** Long-lived composite buffer, cleared in place each frame (zero-alloc).
|
|
288
|
+
* INTERNAL (R.W2) — read/written by `./compositor`. */
|
|
289
|
+
_grouped: Record<string, unknown>;
|
|
290
|
+
/** The compile-stable union of every child's contributed keys — what `_grouped`
|
|
291
|
+
* is null-filled to each frame so the composite clears WITHOUT `delete` (F.W4
|
|
292
|
+
* S2; fold in `./entries`). INTERNAL (R.W2) — the `./compositor` null-fill. */
|
|
293
|
+
_groupedKeys: string[];
|
|
294
|
+
_groupedKeysDirty: boolean;
|
|
295
|
+
/** P.W2 — the SoA composite layout for the `add`/`weighted` blend arms (the
|
|
296
|
+
* validated 3.7×, bit-identical): one {@link SoALayerPlan} per entry, the FLAT
|
|
297
|
+
* pure-numeric pairs hoisted into a {@link Float64Array} fold (built by
|
|
298
|
+
* `buildSoAPlans` in `./soa`, rebuilt ONLY on a structural change). INTERNAL
|
|
299
|
+
* (R.W2) — read/written by `./compositor`. */
|
|
300
|
+
_soaPlans: SoALayerPlan[] | null;
|
|
301
|
+
/**
|
|
302
|
+
* T.A6 — the group's PLAIN authored-shape projection (built from the
|
|
303
|
+
* composite `_grouped` leaf map when `unflatten` is set), rebuilt lazily on a
|
|
304
|
+
* structural change (the SAME `_groupedKeysDirty` seam that drops the SoA
|
|
305
|
+
* plan). Null until the first composited frame populates `_grouped`. INTERNAL
|
|
306
|
+
* — read/written by `./compositor`. */
|
|
307
|
+
_plainProj: PlainProjection | null;
|
|
308
|
+
/** The long-lived SoA fold scratch — the contiguous numeric accumulate buffer,
|
|
309
|
+
* sized to the WIDEST single-layer pair count once per structural change
|
|
310
|
+
* (reused, zero per-frame alloc). INTERNAL (R.W2) — read by `./compositor`. */
|
|
311
|
+
_compositeBuf: Float64Array | null;
|
|
312
|
+
/** K.W11 PHYS-C — true iff ANY layer carries a `weightSpring`; when false (the
|
|
313
|
+
* universal case) `advanceTo` skips the per-frame spring scan (ZERO new work).
|
|
314
|
+
* INTERNAL (R.W2) — set by `./layer-api`'s `transitionLayer`. */
|
|
315
|
+
_hasLayerSprings: boolean;
|
|
399
316
|
constructor(...inputs: (KeyframesAnimation<V> | AnimationGroupInput<V>)[]);
|
|
400
|
-
/**
|
|
401
|
-
*
|
|
402
|
-
*
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
private invalidateEntries;
|
|
317
|
+
/** The animation entries sorted by layer zIndex, dirty-flag cached — rebuilt
|
|
318
|
+
* only on a mutation. INTERNAL (R.W2): read by the colocated `./compositor`/
|
|
319
|
+
* `./entries`/`./scheduler`/`./springs` helpers + all hot-path iteration. */
|
|
320
|
+
getEntries(): AnimationGroupEntry<V>[];
|
|
321
|
+
/** Mark entries cache stale. Called at all mutation boundaries.
|
|
322
|
+
* INTERNAL (R.W2) — also called by `./layer-api`. */
|
|
323
|
+
invalidateEntries(): void;
|
|
408
324
|
setSuperKey(superKey: string): this;
|
|
409
325
|
setTargets(...targets: HTMLElement[]): this;
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
*
|
|
416
|
-
*
|
|
417
|
-
*
|
|
418
|
-
* is
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
*
|
|
425
|
-
* `only === undefined`) — it establishes the carriers `buildSoAPlans` then
|
|
426
|
-
* captures; (2) the per-frame residual (the plan's `boxedKeys` — non-numeric /
|
|
427
|
-
* mixed / first-touch leaves the fold cannot cover, typically empty). Both
|
|
428
|
-
* arms guard on `Array.isArray(existing) && Array.isArray(incoming)` and loop
|
|
429
|
-
* `Math.min(existing.length, incoming.length)` elements with a per-element
|
|
430
|
-
* `isNumericUnit` guard — the byte-exact G.W17 leaf contract (proof:blend),
|
|
431
|
-
* un-clamped `add` (`+=`), spring-weighted `lerp`. A non-array carrier (or a
|
|
432
|
-
* skipped key) falls through to `groupedValues[key] = incoming`.
|
|
433
|
-
*/
|
|
434
|
-
private boxedBlendArm;
|
|
435
|
-
/**
|
|
436
|
-
* P.W2 — the SoA fold for ONE `add`/`weighted` layer (the validated 3.7×,
|
|
437
|
-
* `scripts/soa-composite-decision.json`, bit-identical `maxErr=0`). A thin
|
|
438
|
-
* delegating wrapper over {@link groupSoABlendLayer} (the fold body lives in
|
|
439
|
-
* `./group-soa`, Q.WF2): the wrapper forwards the group's `_compositeBuf`
|
|
440
|
-
* scratch + the plan. The instance METHOD is kept (not inlined at the call
|
|
441
|
-
* site) so `proof:soa-composite`'s `soa-path-taken` clause can monkey-patch
|
|
442
|
-
* `group.soaBlendLayer` on the instance to count fold invocations.
|
|
443
|
-
*/
|
|
444
|
-
private soaBlendLayer;
|
|
445
|
-
/**
|
|
446
|
-
* Render the current composition as a static frame at each child's current
|
|
447
|
-
* `t`. Single-target groups go through the blended transform; multi-target
|
|
448
|
-
* groups apply each child's interpolated vars to its own targets. The public
|
|
449
|
-
* entry point for state mutated outside the rAF loop (scrubbing, state
|
|
450
|
-
* restore, pause snapshots) that needs the visual to update immediately.
|
|
451
|
-
*/
|
|
452
|
-
render(): void;
|
|
453
|
-
/**
|
|
454
|
-
* Set a child animation's current time without touching its siblings.
|
|
455
|
-
* Updates `pausedTime` so the child resumes correctly from the scrub
|
|
456
|
-
* position. Chainable; call `render()` afterwards to reflect it visually.
|
|
457
|
-
*/
|
|
326
|
+
/** Composite all values into a single grouped transform (single-target,
|
|
327
|
+
* per-frame). R.W2 — `private` (lib-group F8): the PUBLIC single-frame-paint
|
|
328
|
+
* entry is `render(t?)`; the body lives in `./compositor`. Thin delegate. */
|
|
329
|
+
private transformFramesGrouped;
|
|
330
|
+
/**
|
|
331
|
+
* Render the current composition as a static frame — the public entry for
|
|
332
|
+
* state mutated outside the rAF loop (scrubbing, restore, pause snapshots).
|
|
333
|
+
* R.W2 — the silent `|| performance.now()` fabrication is EXCISED: the
|
|
334
|
+
* composite `t` is non-normative for a pure-CSS transform, so a caller with a
|
|
335
|
+
* clock passes it (`render(now)`); a scrub uses the group's REAL `lastTickTime`
|
|
336
|
+
* (0 for a never-ticked group), never a fabricated wall-clock.
|
|
337
|
+
*/
|
|
338
|
+
render(t?: number): void;
|
|
339
|
+
/** Set a child's current time without touching its siblings (updates
|
|
340
|
+
* `pausedTime` for a jump-free resume). Chainable; `render()` to reflect it. */
|
|
458
341
|
setChildTime(nameOrAnim: string | KeyframesAnimation<V>, t: number): this;
|
|
459
|
-
/**
|
|
460
|
-
*
|
|
461
|
-
*
|
|
462
|
-
* with no per-frame `Promise.all`/microtask hop; a thenable only on a
|
|
463
|
-
* genuinely-async child or the over-`YIELD_BATCH` yield path.
|
|
464
|
-
*/
|
|
342
|
+
/** Advance all child animations to absolute clock `t`. SYNC on the steady path
|
|
343
|
+
* (J.W6 S1): all-synchronous children advance with no per-frame microtask hop;
|
|
344
|
+
* a thenable only on an async child or the over-`YIELD_BATCH` yield path. */
|
|
465
345
|
advanceTo(t: number): this | Promise<this>;
|
|
466
|
-
/**
|
|
467
|
-
private _endAdvance;
|
|
468
|
-
/**
|
|
469
|
-
* One frame of the group's draw loop (driven by `RAFPlayback.loop`): ticks
|
|
470
|
-
* all children, then renders (single-target: grouped blending; multi-target:
|
|
471
|
-
* per-child). Returns whether the loop should continue.
|
|
472
|
-
*/
|
|
346
|
+
/** One frame of the group's draw loop: tick all children, then render. */
|
|
473
347
|
private _frame;
|
|
474
|
-
/** The post-advance render half of `_frame` — composite, or settle. */
|
|
348
|
+
/** The post-advance render half of `_frame` — composite, or settle on done. */
|
|
475
349
|
private _renderFrame;
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
*
|
|
479
|
-
* the in-flight composite play settles. Exposes the ONE held
|
|
480
|
-
* `_playingPromise` `play()` constructs (the re-entrant guard returns it;
|
|
481
|
-
* the `finally`-clear nulls it on settle) — NOT a second completion
|
|
482
|
-
* lifecycle. A settled (or never-played) group resolves immediately.
|
|
483
|
-
*/
|
|
350
|
+
/** The completion front-door (G.W13) — `await group.finished` resolves once
|
|
351
|
+
* the in-flight composite play settles. Exposes the ONE held `_playingPromise`
|
|
352
|
+
* (a settled/never-played group resolves immediately). */
|
|
484
353
|
get finished(): Promise<void>;
|
|
485
|
-
/**
|
|
486
|
-
*
|
|
487
|
-
* explicit stop/reset). Re-entrant: a `play()` while one is in flight
|
|
488
|
-
* returns the same promise rather than leaking a second draw loop. Under
|
|
489
|
-
* `respectReducedMotion` + an active query, snaps every child to its final
|
|
490
|
-
* frame in a single composite (no rAF loop), then settles as a completed
|
|
491
|
-
* play would.
|
|
492
|
-
*/
|
|
354
|
+
/** Start the group. Resolves when all children complete (or on stop/reset).
|
|
355
|
+
* Re-entrant, and PRM-aware — body in `./lifecycle` (S.B5 / a19 F1). */
|
|
493
356
|
play(): Promise<void>;
|
|
494
|
-
/**
|
|
495
|
-
*
|
|
496
|
-
*
|
|
497
|
-
* to its final frame, one composite paints, `settle()` readies the group for
|
|
498
|
-
* replay (final frame stays on the target(s), matching `Animation`'s snap).
|
|
499
|
-
*/
|
|
500
|
-
private _playReducedMotion;
|
|
501
|
-
/**
|
|
502
|
-
* Pause the group — idempotent. Pausing an already-paused (or
|
|
503
|
-
* not-yet-started) group is a no-op, NOT a resume (use {@link toggle} for
|
|
504
|
-
* the explicit flip). Cancels the rAF loop immediately and renders a
|
|
505
|
-
* final-frame snapshot so the visual matches the exact pause moment.
|
|
506
|
-
*/
|
|
357
|
+
/** Pause the group — idempotent. Cancels the rAF loop + renders a final-frame
|
|
358
|
+
* snapshot so the visual matches the pause moment; records each child's
|
|
359
|
+
* jump-free `pausedTime`. Body in `./lifecycle` (S.B5). */
|
|
507
360
|
pause(): this;
|
|
508
|
-
/**
|
|
509
|
-
*
|
|
510
|
-
* `child.resume()`, which would start each child's own rAF loop — the
|
|
511
|
-
* group's draw loop owns the ticking) and re-registers that loop.
|
|
512
|
-
*/
|
|
361
|
+
/** Resume the group — idempotent. Unpauses every child DIRECTLY (the group's
|
|
362
|
+
* draw loop owns the ticking). Body in `./lifecycle` (S.B5). */
|
|
513
363
|
resume(): this;
|
|
514
364
|
/** The explicit flip: pauses if playing, resumes if paused. */
|
|
515
365
|
toggle(): this;
|
|
516
|
-
/**
|
|
517
|
-
*
|
|
518
|
-
* (`managed = false`, `child.settle()`) and clears the group's playback
|
|
519
|
-
* flags. Completion and the reduced-motion snap both end here, leaving the
|
|
520
|
-
* rest frame on the target(s).
|
|
521
|
-
*/
|
|
366
|
+
/** Pure state teardown — never paints. Releases every child (`managed = false`,
|
|
367
|
+
* `child.settle()`) and clears the group flags. Body in `./lifecycle` (S.B5). */
|
|
522
368
|
settle(): this;
|
|
523
|
-
/**
|
|
524
|
-
*
|
|
525
|
-
* settle — the user-facing "return to start". Completion does NOT come here
|
|
526
|
-
* (it settles where the fill contract rested the pixels).
|
|
527
|
-
*/
|
|
369
|
+
/** Explicit rewind: paint every started child back to its INITIAL frame, then
|
|
370
|
+
* settle — the user-facing "return to start". Body in `./lifecycle` (S.B5). */
|
|
528
371
|
reset(): this;
|
|
529
|
-
/**
|
|
530
|
-
* Halt the draw loop, rewind to the initial frame (the transport-stop
|
|
372
|
+
/** Halt the draw loop, rewind to the initial frame (the transport-stop
|
|
531
373
|
* semantic the demo's controls expect), and resolve any pending `play()`.
|
|
532
|
-
*/
|
|
374
|
+
* Body in `./lifecycle` (S.B5). */
|
|
533
375
|
stop(): this;
|
|
534
376
|
playing(): boolean;
|
|
535
|
-
|
|
536
|
-
forcePlay(): void;
|
|
537
|
-
/**
|
|
538
|
-
* Set layer config for an animation by name or reference. Chainable; throws
|
|
539
|
-
* on an unregistered key (silent no-ops were hiding consumer bugs).
|
|
540
|
-
*/
|
|
377
|
+
/** Set layer config for an animation by name or reference. Chainable. */
|
|
541
378
|
setLayerConfig(nameOrAnim: string | KeyframesAnimation<V>, config: Partial<AnimationLayerConfig>): this;
|
|
542
379
|
/** Convenience toggle for enabling/disabling a layer. Chainable. */
|
|
543
380
|
setLayerEnabled(nameOrAnim: string | KeyframesAnimation<V>, enabled: boolean): this;
|
|
544
381
|
/** Read the layer config for an animation by name or reference. */
|
|
545
382
|
getLayerConfig(nameOrAnim: string | KeyframesAnimation<V>): AnimationLayerConfig | undefined;
|
|
546
|
-
/**
|
|
547
|
-
*
|
|
548
|
-
* PHYS-C — the spring-driven crossfade). Seeds a `SpringProgress` (via
|
|
549
|
-
* `seedLayerSpring`), parks it on `layer.weightSpring`, and forces
|
|
550
|
-
* `blendMode` to `weighted`. A re-target mid-flight RE-SEATS the in-flight
|
|
551
|
-
* spring from its live `(value, velocity)` (`set target`) — no kink. Full
|
|
552
|
-
* trajectory documentation in `./group-layer-springs`. Chainable.
|
|
553
|
-
*/
|
|
383
|
+
/** Spring a layer's blend `weight` to `weight` (K.W11 PHYS-C — body in
|
|
384
|
+
* `./layer-api`; a mid-flight re-target re-seats velocity-continuously). */
|
|
554
385
|
transitionLayer(nameOrAnim: string | KeyframesAnimation<V>, target: {
|
|
555
386
|
weight: number;
|
|
556
387
|
spring?: LayerTransitionSpring;
|
|
557
388
|
}): this;
|
|
558
|
-
/**
|
|
559
|
-
*
|
|
560
|
-
* down to weight `0` and layer `b` up to weight `1`, each over its own
|
|
561
|
-
* `SpringProgress`. Two `transitionLayer` calls — the flagship demo moment, a
|
|
562
|
-
* crossfade that overshoots and settles. Chainable.
|
|
563
|
-
*/
|
|
389
|
+
/** Crossfade two layers (K.W11 PHYS-C — body in `./layer-api`): two spring
|
|
390
|
+
* `transitionLayer` calls, a→0 and b→1. Chainable. */
|
|
564
391
|
crossfade(a: string | KeyframesAnimation<V>, b: string | KeyframesAnimation<V>, options?: {
|
|
565
392
|
spring?: LayerTransitionSpring;
|
|
566
393
|
}): this;
|
|
567
|
-
/**
|
|
568
|
-
*
|
|
569
|
-
*
|
|
570
|
-
*
|
|
571
|
-
* commits to the constant `layer.weight` and the spring is CLEARED — the
|
|
572
|
-
* `weighted` leaf's `?? layer.weight` read then serves the constant.
|
|
573
|
-
*/
|
|
394
|
+
/** Advance every spring-driven layer weight by `dt` ms (K.W11 PHYS-C). Called
|
|
395
|
+
* from `advanceTo` ONLY when `_hasLayerSprings` is true. R.W2 (lib-group C2):
|
|
396
|
+
* the integrate BODY moved to `./springs`; this thin delegate updates
|
|
397
|
+
* `_hasLayerSprings` from its "any still active?" return. */
|
|
574
398
|
private advanceLayerSprings;
|
|
575
399
|
}
|
|
576
400
|
|
|
@@ -580,7 +404,7 @@ export declare interface AnimationGroupEntry<V extends Vars> {
|
|
|
580
404
|
layer: AnimationLayerConfig;
|
|
581
405
|
}
|
|
582
406
|
|
|
583
|
-
/** Input
|
|
407
|
+
/** Input — a bare Animation or one with a layer config. */
|
|
584
408
|
declare type AnimationGroupInput<V extends Vars> = KeyframesAnimation<V> | {
|
|
585
409
|
animation: KeyframesAnimation<V>;
|
|
586
410
|
layer?: Partial<AnimationLayerConfig>;
|
|
@@ -738,10 +562,8 @@ declare namespace AnimationPresets {
|
|
|
738
562
|
notificationBounce,
|
|
739
563
|
spinner,
|
|
740
564
|
parallaxScroll,
|
|
741
|
-
slideInLeftKeyframes,
|
|
742
565
|
slideInLeft,
|
|
743
566
|
slideOutLeft,
|
|
744
|
-
slideInRightKeyframes,
|
|
745
567
|
slideInRight,
|
|
746
568
|
slideOutRight,
|
|
747
569
|
hover,
|
|
@@ -765,13 +587,13 @@ export { AnimationTimelineValue }
|
|
|
765
587
|
|
|
766
588
|
/** Attention animations — a one-shot nudge to draw the eye. */
|
|
767
589
|
declare const attentionPresets: {
|
|
768
|
-
readonly pulse: (options?: InputAnimationOptions) => CSSKeyframesAnimation<
|
|
769
|
-
readonly shake: (options?: InputAnimationOptions) => CSSKeyframesAnimation<
|
|
770
|
-
readonly bounce: (options?: InputAnimationOptions) => CSSKeyframesAnimation<
|
|
771
|
-
readonly flip: (options?: InputAnimationOptions) => CSSKeyframesAnimation<
|
|
772
|
-
readonly notificationBounce: (options?: InputAnimationOptions) => CSSKeyframesAnimation<
|
|
773
|
-
readonly springPop: (options?: InputAnimationOptions) => CSSKeyframesAnimation<
|
|
774
|
-
readonly springWobble: (options?: InputAnimationOptions) => CSSKeyframesAnimation<
|
|
590
|
+
readonly pulse: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
591
|
+
readonly shake: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
592
|
+
readonly bounce: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
593
|
+
readonly flip: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
594
|
+
readonly notificationBounce: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
595
|
+
readonly springPop: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
596
|
+
readonly springWobble: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
775
597
|
};
|
|
776
598
|
|
|
777
599
|
export declare type BlendMode = "replace" | "add" | "weighted";
|
|
@@ -802,8 +624,26 @@ export declare interface CompiledCSS {
|
|
|
802
624
|
refusals: CompileRefusal[];
|
|
803
625
|
}
|
|
804
626
|
|
|
627
|
+
/** The entry compile result — the artifact + the refusal report. */
|
|
628
|
+
export declare interface CompiledEntryCSS {
|
|
629
|
+
/** The zero-runtime CSS: base rule + open rule + `@starting-style` per selector. */
|
|
630
|
+
css: string;
|
|
631
|
+
/** True iff EVERY selector compiled faithfully. */
|
|
632
|
+
eligible: boolean;
|
|
633
|
+
/** One refusal per selector that could not compile as a two-endpoint transition. */
|
|
634
|
+
refusals: EntryRefusal[];
|
|
635
|
+
}
|
|
636
|
+
|
|
637
|
+
/** The VT compile result — the artifact + the widened refusal report + the names. */
|
|
638
|
+
export declare interface CompiledViewTransitionCSS extends Omit<CompiledCSS, "refusals"> {
|
|
639
|
+
/** One refusal per role that could not compile faithfully (CC-3 ∪ the VT four). */
|
|
640
|
+
refusals: VTCompileRefusal[];
|
|
641
|
+
/** The `view-transition-name` set the consumer assigns to its elements. */
|
|
642
|
+
names: string[];
|
|
643
|
+
}
|
|
644
|
+
|
|
805
645
|
/** The input shapes `compileToCSS` accepts. */
|
|
806
|
-
export declare type CompileInput<V extends Vars =
|
|
646
|
+
export declare type CompileInput<V extends Vars = Vars> = AnimationGroup<V> | Sequence<V> | ReadonlyArray<KeyframesAnimation<V> | {
|
|
807
647
|
animation: KeyframesAnimation<V>;
|
|
808
648
|
}>;
|
|
809
649
|
|
|
@@ -853,16 +693,6 @@ export declare interface CompileRefusal {
|
|
|
853
693
|
*/
|
|
854
694
|
export declare type CompileRefusalReason = "weighted-blend" | "custom-renderer" | "perceptual-oklab" | "computed-unit-drift";
|
|
855
695
|
|
|
856
|
-
/**
|
|
857
|
-
* The COMPILER surface (L.W7 S3 `loadCompiler()`) — the engine core PLUS the
|
|
858
|
-
* round-trip's BACKWARD half, `compileToCSS`. A consumer compiling an
|
|
859
|
-
* orchestration graph to zero-runtime CSS pays for `engine` + `compile`, not
|
|
860
|
-
* the ingest / motion / draw / preset weight.
|
|
861
|
-
*/
|
|
862
|
-
export declare interface CompilerSurface extends EngineCore {
|
|
863
|
-
compileToCSS: typeof compileToCSS;
|
|
864
|
-
}
|
|
865
|
-
|
|
866
696
|
/**
|
|
867
697
|
* THE compiler (CC-1/CC-2/CC-3) — compile an orchestration graph to zero-runtime
|
|
868
698
|
* CSS. Walks the input (`AnimationGroup` / `Sequence` / child list), emits one
|
|
@@ -877,6 +707,33 @@ export declare interface CompilerSurface extends EngineCore {
|
|
|
877
707
|
*/
|
|
878
708
|
declare function compileToCSS<V extends Vars>(input: CompileInput<V>, opts?: CompileOptions): Promise<CompiledCSS>;
|
|
879
709
|
|
|
710
|
+
/**
|
|
711
|
+
* THE ENTRY/EXIT EMITTER (C-22 revised, P2-2) — compile a selector-keyed
|
|
712
|
+
* entry/exit spec to zero-runtime `@starting-style` + `allow-discrete` CSS. Emits
|
|
713
|
+
* per selector: the base/closed rule (exit endpoint + `display:none` + the exit
|
|
714
|
+
* transition list), the open rule (enter endpoint + `display` + the entry list),
|
|
715
|
+
* and the `@starting-style` block (enter's FIRST frame). Asymmetric entry/exit
|
|
716
|
+
* timing rides the two lists; `linear()` springs ride verbatim; color endpoints
|
|
717
|
+
* canonicalize to `oklab()`. REFUSES with a NAMED reason (3 inherited + 6
|
|
718
|
+
* entry-specific) what cannot compile as a two-endpoint transition.
|
|
719
|
+
*
|
|
720
|
+
* @returns `{ css, eligible, refusals }`.
|
|
721
|
+
*/
|
|
722
|
+
declare function compileToEntry<V extends Vars>(spec: Record<string, EntryRoleSpec<V>>, opts?: EntryCompileOptions): Promise<CompiledEntryCSS>;
|
|
723
|
+
|
|
724
|
+
/**
|
|
725
|
+
* THE VIEW-TRANSITIONS EMITTER (SF-1/SF-2/SF-3) — compile a name-keyed role spec
|
|
726
|
+
* to a zero-runtime `::view-transition-*` CSS artifact. Emits per name: the
|
|
727
|
+
* old/new `@keyframes` + shorthand, the MANDATORY timing-only group override, an
|
|
728
|
+
* optional class-cohort rule, wrapped in `:active-view-transition-type(...)` when
|
|
729
|
+
* `types` are given; prepends the cross-doc preamble under `crossDocument`; and
|
|
730
|
+
* appends the PRM `animation: none` degrade by default. REFUSES with a NAMED
|
|
731
|
+
* reason (the CC-3 four ∪ the VT four) what cannot round-trip faithfully.
|
|
732
|
+
*
|
|
733
|
+
* @returns `{ css, eligible, refusals, names }` — the artifact + the trust surface.
|
|
734
|
+
*/
|
|
735
|
+
declare function compileToViewTransition<V extends Vars>(spec: Record<string, VTRoleSpec<V>>, opts?: ViewTransitionCompileOptions): Promise<CompiledViewTransitionCSS>;
|
|
736
|
+
|
|
880
737
|
/**
|
|
881
738
|
* The CSS `animation-composition` operator (K.W7). Distinct from
|
|
882
739
|
* {@link BlendMode} (the GROUP's per-LAYER blend tier — `replace`/`add`/
|
|
@@ -893,9 +750,8 @@ declare type CompositeOperator = "replace" | "add" | "accumulate";
|
|
|
893
750
|
* Feature-detect (`"ScrollTimeline" in window` / `"ViewTimeline" in window`)
|
|
894
751
|
* and construct a NATIVE `AnimationTimeline` for the additive WAAPI scroll
|
|
895
752
|
* bridge (D-LIB-2 / F-5). Returns `null` where the platform lacks the API
|
|
896
|
-
* (Firefox today, SSR, jsdom) — the caller then keeps the JS
|
|
897
|
-
*
|
|
898
|
-
* non-DOM targets.
|
|
753
|
+
* (Firefox today, SSR, jsdom) — the caller then keeps the JS Timeline sampler,
|
|
754
|
+
* which is the proven fallback AND the only general driver over non-DOM targets.
|
|
899
755
|
*
|
|
900
756
|
* CRITICAL — the ARCH-kill HOLDS: this does NOT replace the JS sampler. Native
|
|
901
757
|
* scroll-driven is Chromium-only / not-Baseline, and the JS `Timeline` is a
|
|
@@ -904,7 +760,7 @@ declare type CompositeOperator = "replace" | "add" | "accumulate";
|
|
|
904
760
|
* bridge is a pure additive fast lane where supported + eligible. No polyfill.
|
|
905
761
|
*
|
|
906
762
|
* Light: a runtime `in`-detect over the `window` globals — zero static
|
|
907
|
-
* value.js / engine edge, so importing this keeps
|
|
763
|
+
* value.js / engine edge, so importing this keeps the timeline zone light.
|
|
908
764
|
*/
|
|
909
765
|
export declare function createNativeTimeline(spec: NativeTimelineSpec): AnimationTimeline | null;
|
|
910
766
|
|
|
@@ -923,6 +779,20 @@ export declare function createNativeTimeline(spec: NativeTimelineSpec): Animatio
|
|
|
923
779
|
*/
|
|
924
780
|
declare function createScrollScene(spec?: ScrollSceneOptions | CSSTimelineOptions): ScrollScene;
|
|
925
781
|
|
|
782
|
+
/**
|
|
783
|
+
* Construct a `TriggerScene` from a parsed `AnimationTriggerValue` OR a full
|
|
784
|
+
* `CSSTimelineOptions` (the {@link parseScrollCSS} output — the `.trigger` field
|
|
785
|
+
* is used). The CSS-fed construction is the round-trip's driving half (parse →
|
|
786
|
+
* behavior); the value-fed construction is value.js-INDEPENDENT.
|
|
787
|
+
*
|
|
788
|
+
* @example
|
|
789
|
+
* // grammar → behavior (the round-trip):
|
|
790
|
+
* const opts = parseScrollCSS(stylesheet); // { …, trigger: { type: "repeat", range } }
|
|
791
|
+
* const scene = createTriggerScene(opts);
|
|
792
|
+
* scene.triggerProgress(0.5); // → "active"
|
|
793
|
+
*/
|
|
794
|
+
declare function createTriggerScene(spec?: AnimationTriggerValue | CSSTimelineOptions): TriggerScene;
|
|
795
|
+
|
|
926
796
|
export declare class CSSKeyframesAnimation<V extends Vars> extends KeyframesAnimation<V> {
|
|
927
797
|
/**
|
|
928
798
|
* Q.WD1-bind S2 (DM-22) — the timeline a scroll-range named selector resolves
|
|
@@ -981,7 +851,6 @@ export declare class CSSKeyframesAnimation<V extends Vars> extends KeyframesAnim
|
|
|
981
851
|
*/
|
|
982
852
|
scrollOptions?: CSSTimelineOptions;
|
|
983
853
|
fromString(keyframes: string, transform?: TransformFunction<V>): this;
|
|
984
|
-
transform(vars: V): void;
|
|
985
854
|
}
|
|
986
855
|
|
|
987
856
|
declare function CSSKeyframesToString<V extends Vars>(animation: KeyframesAnimation<V>, name?: string, printWidth?: number | undefined): Promise<string>;
|
|
@@ -1100,7 +969,7 @@ declare interface Diagnostic extends Partial<ParseDiagnostic> {
|
|
|
1100
969
|
* WAAPI-reason rows are AUTHORED here but POPULATED by K.W8 (which owns the
|
|
1101
970
|
* CSSOM walk that produces them).
|
|
1102
971
|
*/
|
|
1103
|
-
declare type DiagnosticCode = "EMPTY_PARSE" | "UNKNOWN_TIMING_FN" | "COMPOSITION_FALLBACK" | "PARSE_ERROR" | "CORS_SKIP" | "WAAPI_INELIGIBLE" | "ADOPT_REFUSE";
|
|
972
|
+
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";
|
|
1104
973
|
|
|
1105
974
|
declare const DIRECTIONS: readonly ["normal", "reverse", "alternate", "alternate-reverse"];
|
|
1106
975
|
|
|
@@ -1148,14 +1017,14 @@ export declare function drag2D(element: HTMLElement, options?: {
|
|
|
1148
1017
|
|
|
1149
1018
|
/**
|
|
1150
1019
|
* The 2-D drag sugar — two one-axis {@link Draggable}s composed behind a
|
|
1151
|
-
* single `(x, y, vx, vy)` surface. Split out of `
|
|
1020
|
+
* single `(x, y, vx, vy)` surface. Split out of `draggable.ts` (the 1-D engine)
|
|
1152
1021
|
* as additive sugar: the engine stays one-dimensional (KISS); this module is
|
|
1153
1022
|
* the front door that spares every 2-D consumer the two-`Draggable`
|
|
1154
1023
|
* boilerplate. LIGHT — it imports only `Draggable` + `DragOptions` from
|
|
1155
|
-
* `./
|
|
1024
|
+
* `./draggable`, so it carries zero static `@mkbabb/value.js` edge.
|
|
1156
1025
|
*
|
|
1157
|
-
*
|
|
1158
|
-
*
|
|
1026
|
+
* The `drag/index.ts` barrel re-exports `drag2D` + `Drag2DHandle` (R.W1 — the
|
|
1027
|
+
* barrel owns the unified surface; no flat-sibling relay through `draggable.ts`).
|
|
1159
1028
|
*/
|
|
1160
1029
|
/**
|
|
1161
1030
|
* The composite handle a {@link drag2D} returns — two one-axis `Draggable`s
|
|
@@ -1386,18 +1255,8 @@ export declare type DragSubscriber = (value: number, velocity: number) => void;
|
|
|
1386
1255
|
* is the factory: `new DrawSVG(target).animation` is the control handle. The
|
|
1387
1256
|
* factory is the canonical entry; this is a thin ergonomic wrapper.
|
|
1388
1257
|
*/
|
|
1389
|
-
declare class DrawSVG<V extends
|
|
1390
|
-
/** The underlying stroke-dashoffset animation — the control handle. */
|
|
1391
|
-
readonly animation: CSSKeyframesAnimation<V>;
|
|
1258
|
+
declare class DrawSVG<V extends Vars = Vars> extends SVGAnimationHandle<V> {
|
|
1392
1259
|
constructor(target: SVGDrawTarget, options?: DrawSVGOptions);
|
|
1393
|
-
/** Start (or re-enter) the line-drawing play loop. */
|
|
1394
|
-
play(): Promise<void>;
|
|
1395
|
-
/** Pause the play loop, retaining the playhead. */
|
|
1396
|
-
pause(): this;
|
|
1397
|
-
/** Halt and rewind the play loop. */
|
|
1398
|
-
stop(): this;
|
|
1399
|
-
/** Resolve once the draw completes — the {@link Animation.finished} front-door. */
|
|
1400
|
-
get finished(): Promise<void>;
|
|
1401
1260
|
}
|
|
1402
1261
|
|
|
1403
1262
|
export declare interface DrawSVGOptions extends Partial<InputAnimationOptions> {
|
|
@@ -1482,51 +1341,63 @@ export declare interface ElementMorphOptions {
|
|
|
1482
1341
|
transformOrigin?: string;
|
|
1483
1342
|
}
|
|
1484
1343
|
|
|
1485
|
-
/**
|
|
1486
|
-
* The engine CORE surface — `Animation` / `CSSKeyframesAnimation` /
|
|
1487
|
-
* `AnimationGroup` + the timing/keyframe helpers + the option constants. This
|
|
1488
|
-
* is `./engine`'s own runtime exports: parse + interpolate WITHOUT the
|
|
1489
|
-
* ingest / compile / motion-path / draw-svg / animate / preset front doors. The
|
|
1490
|
-
* granular `loadEngine()` (L.W7 S3) resolves exactly this — a consumer that
|
|
1491
|
-
* needs only `new CSSKeyframesAnimation(opts).fromString(css)` pays for the
|
|
1492
|
-
* `engine` chunk alone, not the eight-chunk full surface.
|
|
1493
|
-
*/
|
|
1494
|
-
export declare interface EngineCore {
|
|
1495
|
-
/** The core engine constructor (PKG-3, L.W8 §S4 — renamed from `Animation`). */
|
|
1496
|
-
KeyframesAnimation: typeof KeyframesAnimation;
|
|
1497
|
-
CSSKeyframesAnimation: typeof CSSKeyframesAnimation;
|
|
1498
|
-
AnimationGroup: typeof AnimationGroup;
|
|
1499
|
-
getAnimationId: (animation: KeyframesAnimation | string) => string;
|
|
1500
|
-
getTimingFunction: (timingFunction: TimingFunction | TimingFunctionNames | string | undefined) => TimingFunction | undefined;
|
|
1501
|
-
resolveKeyframes: (input: string | Stylesheet) => ResolvedKeyframes;
|
|
1502
|
-
DIRECTIONS: readonly AnimationOptions["direction"][];
|
|
1503
|
-
FILL_MODES: readonly AnimationOptions["fillMode"][];
|
|
1504
|
-
defaultOptions: AnimationOptions;
|
|
1505
|
-
defaultLayerConfig: AnimationLayerConfig;
|
|
1506
|
-
}
|
|
1507
|
-
|
|
1508
1344
|
/** Entrance animations — bring an element INTO view. */
|
|
1509
1345
|
declare const enterPresets: {
|
|
1510
|
-
readonly fadeIn: (options?: InputAnimationOptions) => CSSKeyframesAnimation<
|
|
1511
|
-
readonly slideIn: (options?: InputAnimationOptions) => CSSKeyframesAnimation<
|
|
1512
|
-
readonly slideInLeft: (options?: InputAnimationOptions) => CSSKeyframesAnimation<
|
|
1513
|
-
readonly slideInRight: (options?: InputAnimationOptions) => CSSKeyframesAnimation<
|
|
1514
|
-
readonly rotateIn: (options?: InputAnimationOptions) => CSSKeyframesAnimation<
|
|
1515
|
-
readonly blurIn: (options?: InputAnimationOptions) => CSSKeyframesAnimation<
|
|
1516
|
-
readonly springScaleIn: (options?: InputAnimationOptions) => CSSKeyframesAnimation<
|
|
1517
|
-
readonly springSlideIn: (options?: InputAnimationOptions) => CSSKeyframesAnimation<
|
|
1518
|
-
readonly jumpUp: (options?: InputAnimationOptions) => CSSKeyframesAnimation<
|
|
1346
|
+
readonly fadeIn: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
1347
|
+
readonly slideIn: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
1348
|
+
readonly slideInLeft: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
1349
|
+
readonly slideInRight: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
1350
|
+
readonly rotateIn: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
1351
|
+
readonly blurIn: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
1352
|
+
readonly springScaleIn: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
1353
|
+
readonly springSlideIn: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
1354
|
+
readonly jumpUp: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
1519
1355
|
};
|
|
1520
1356
|
|
|
1357
|
+
/** Options for {@link compileToEntry}. */
|
|
1358
|
+
export declare interface EntryCompileOptions {
|
|
1359
|
+
/** The open-state selector suffix, concatenated onto the base selector. Default `".open"`. */
|
|
1360
|
+
openSelector?: ".open" | "[data-open]" | ":popover-open" | "[open]" | (string & {});
|
|
1361
|
+
/** The open `display` value (the base rule is always `display: none`). Default `"block"`. */
|
|
1362
|
+
display?: string;
|
|
1363
|
+
/**
|
|
1364
|
+
* Emit `overlay <dur> allow-discrete` on both lists (default `true`). Emitted
|
|
1365
|
+
* UNCONDITIONALLY — it materializes only for top-layer elements (popover/
|
|
1366
|
+
* dialog), inert-but-harmless elsewhere, so a caller rarely turns it off.
|
|
1367
|
+
*/
|
|
1368
|
+
overlay?: boolean;
|
|
1369
|
+
/** Prettier print-width for the emitted artifact. Omit for the default. */
|
|
1370
|
+
printWidth?: number;
|
|
1371
|
+
}
|
|
1372
|
+
|
|
1373
|
+
/** A single entry refusal — the selector + a typed reason + a human message. */
|
|
1374
|
+
export declare interface EntryRefusal {
|
|
1375
|
+
/** The refused selector (spec key). */
|
|
1376
|
+
name: string;
|
|
1377
|
+
reason: EntryRefusalReason;
|
|
1378
|
+
message: string;
|
|
1379
|
+
}
|
|
1380
|
+
|
|
1381
|
+
/** The refusal taxonomy — 3 inherited + 6 entry-specific (P2-2.3). */
|
|
1382
|
+
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";
|
|
1383
|
+
|
|
1384
|
+
/** The per-selector entry/exit role. Each animation is 2-stop (a transition endpoint pair). */
|
|
1385
|
+
export declare interface EntryRoleSpec<V extends Vars = Vars> {
|
|
1386
|
+
/** The ENTER animation: first frame → `@starting-style`, last frame → the open rule. */
|
|
1387
|
+
enter?: KeyframesAnimation<V>;
|
|
1388
|
+
/** The EXIT animation: last frame → the closed rule. Defaults to `enter` REVERSED. */
|
|
1389
|
+
exit?: KeyframesAnimation<V>;
|
|
1390
|
+
}
|
|
1391
|
+
|
|
1521
1392
|
/** Exit animations — take an element OUT of view. */
|
|
1522
1393
|
declare const exitPresets: {
|
|
1523
|
-
readonly fadeOut: (options?: InputAnimationOptions) => CSSKeyframesAnimation<
|
|
1524
|
-
readonly slideOutLeft: (options?: InputAnimationOptions) => CSSKeyframesAnimation<
|
|
1525
|
-
readonly slideOutRight: (options?: InputAnimationOptions) => CSSKeyframesAnimation<
|
|
1526
|
-
readonly blurOut: (options?: InputAnimationOptions) => CSSKeyframesAnimation<
|
|
1527
|
-
readonly warpLeft: (options?: InputAnimationOptions) => CSSKeyframesAnimation<
|
|
1528
|
-
readonly warpRight: (options?: InputAnimationOptions) => CSSKeyframesAnimation<
|
|
1529
|
-
readonly jumpDown: (options?: InputAnimationOptions) => CSSKeyframesAnimation<
|
|
1394
|
+
readonly fadeOut: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
1395
|
+
readonly slideOutLeft: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
1396
|
+
readonly slideOutRight: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
1397
|
+
readonly blurOut: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
1398
|
+
readonly warpLeft: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
1399
|
+
readonly warpRight: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
1400
|
+
readonly jumpDown: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
1530
1401
|
};
|
|
1531
1402
|
|
|
1532
1403
|
/**
|
|
@@ -1580,20 +1451,6 @@ export declare interface FlipOptions {
|
|
|
1580
1451
|
transformOrigin?: string;
|
|
1581
1452
|
}
|
|
1582
1453
|
|
|
1583
|
-
/**
|
|
1584
|
-
* The card-flip attention preset.
|
|
1585
|
-
*
|
|
1586
|
-
* ── PKG-3 RENAME (L.W8 §S4 · audit W126). Formerly the preset `flip`. Renamed
|
|
1587
|
-
* `flip` → `flipPreset` because the rolled-up `dist/keyframes.d.ts` placed this
|
|
1588
|
-
* preset (reachable as `presets.flip`) and the LIGHT top-level `flip` export
|
|
1589
|
-
* (the FLIP-layout helper in `flip.ts`) under the same name `flip`, so API
|
|
1590
|
-
* Extractor renamed this one with a numeric suffix and re-exported it under the
|
|
1591
|
-
* `flip` name inside the `AnimationPresets` namespace — a numeric-suffixed alias
|
|
1592
|
-
* `proof:pkg3-clean` greps for. Naming the preset `flipPreset` (distinct from the
|
|
1593
|
-
* light `flip`) clears the collision. BREAKING (5.0.0): the access path is now
|
|
1594
|
-
* `presets.flipPreset`; the nested taxonomy key `attentionPresets.flip` is
|
|
1595
|
-
* unchanged (a property name, not a top-level declaration — no collision).
|
|
1596
|
-
*/
|
|
1597
1454
|
declare const flipPreset: (options?: InputAnimationOptions) => CSSKeyframesAnimation< Vars>;
|
|
1598
1455
|
|
|
1599
1456
|
/**
|
|
@@ -1614,7 +1471,7 @@ export declare function flipShared(a: HTMLElement, b: HTMLElement, options?: Fli
|
|
|
1614
1471
|
|
|
1615
1472
|
declare function formatCSSKeyframeString(keyframe: string): string;
|
|
1616
1473
|
|
|
1617
|
-
declare class FrameCompiler<V extends Vars =
|
|
1474
|
+
declare class FrameCompiler<V extends Vars = Vars> {
|
|
1618
1475
|
private readonly _options;
|
|
1619
1476
|
templateFrames: TemplateAnimationFrame<V>[];
|
|
1620
1477
|
parsedVars: ParsedVarMap[];
|
|
@@ -1700,7 +1557,7 @@ declare class FrameCompiler<V extends Vars = any> {
|
|
|
1700
1557
|
* ONCE, set `stroke-dasharray` to that length (one solid full-length dash), and
|
|
1701
1558
|
* sweep `stroke-dashoffset` from → to (default `0% → 100%` ⇒ offset `L → 0`,
|
|
1702
1559
|
* the line draws in). Returns the constructed {@link CSSKeyframesAnimation} as
|
|
1703
|
-
* the control handle (the
|
|
1560
|
+
* the control handle (the control-handle contract — `.play()` / `.pause()` /
|
|
1704
1561
|
* `.stop()` / `.finished`), consistent with the `from*` factory family.
|
|
1705
1562
|
*
|
|
1706
1563
|
* The returned animation passes the EXISTING WAAPI eligibility gate
|
|
@@ -1719,7 +1576,7 @@ declare class FrameCompiler<V extends Vars = any> {
|
|
|
1719
1576
|
* // Draw a path stroke in over 2s:
|
|
1720
1577
|
* fromDrawSVG(pathEl, { duration: 2000 });
|
|
1721
1578
|
*/
|
|
1722
|
-
declare function fromDrawSVG<V extends
|
|
1579
|
+
declare function fromDrawSVG<V extends Vars = Vars>(target: SVGDrawTarget, options?: DrawSVGOptions): CSSKeyframesAnimation<V>;
|
|
1723
1580
|
|
|
1724
1581
|
/**
|
|
1725
1582
|
* K1 — `fromLiveAnimations`: adopt every RUNNING CSS animation on the document
|
|
@@ -1734,14 +1591,14 @@ declare function fromDrawSVG<V extends Record<string, any> = any>(target: SVGDra
|
|
|
1734
1591
|
* rule, running or not): `fromLiveAnimations` narrows to the names currently
|
|
1735
1592
|
* RUNNING on the page — the animations a user actually sees in motion.
|
|
1736
1593
|
*/
|
|
1737
|
-
declare const fromLiveAnimations: <V extends Vars =
|
|
1594
|
+
declare const fromLiveAnimations: <V extends Vars = Vars>(target?: Document | Element, options?: IngestOptions) => IngestResult<V>;
|
|
1738
1595
|
|
|
1739
1596
|
/**
|
|
1740
1597
|
* Build an SVG path-shape morph: sample two `d` strings at `samples` uniform
|
|
1741
1598
|
* arc-length steps each, pair the point sets, and interpolate the `(x, y)`
|
|
1742
1599
|
* pairs from the `from`-polyline (`0%`) to the `to`-polyline (`100%`). Returns
|
|
1743
1600
|
* the constructed {@link CSSKeyframesAnimation} as the control handle (the
|
|
1744
|
-
*
|
|
1601
|
+
* control-handle contract — `.play()` / `.pause()` / `.stop()` / `.finished`),
|
|
1745
1602
|
* consistent with the `from*` factory family.
|
|
1746
1603
|
*
|
|
1747
1604
|
* value.js's `PathGeometry` owns the geometry (the `d`-parse + arc-length
|
|
@@ -1771,13 +1628,13 @@ declare const fromLiveAnimations: <V extends Vars = any>(target?: Document | Ele
|
|
|
1771
1628
|
* // morphing shape paints directly (no author-side reader needed on Chromium/
|
|
1772
1629
|
* // Safari; `<path style="d: var(--morph-d)">` is the Firefox-lags fallback).
|
|
1773
1630
|
*/
|
|
1774
|
-
declare function fromMorphSVG<V extends
|
|
1631
|
+
declare function fromMorphSVG<V extends Vars = Vars>(from: string, to: string, options?: MorphSVGOptions): CSSKeyframesAnimation<V>;
|
|
1775
1632
|
|
|
1776
1633
|
/**
|
|
1777
1634
|
* Build a CSS-native path-motion animation: set the author `offset-path` (and
|
|
1778
1635
|
* optional `offset-rotate`) on the target(s), and sweep `offset-distance` from
|
|
1779
1636
|
* → to. Returns the constructed {@link CSSKeyframesAnimation} as the control
|
|
1780
|
-
* handle (the
|
|
1637
|
+
* handle (the control-handle contract — `.play()` / `.pause()` / `.stop()` / the
|
|
1781
1638
|
* awaitable play promise), consistent with the `from*` factory family.
|
|
1782
1639
|
*
|
|
1783
1640
|
* The returned animation passes the EXISTING WAAPI eligibility gate
|
|
@@ -1795,7 +1652,7 @@ declare function fromMorphSVG<V extends Record<string, any> = any>(from: string,
|
|
|
1795
1652
|
* duration: 2000,
|
|
1796
1653
|
* });
|
|
1797
1654
|
*/
|
|
1798
|
-
declare function fromMotionPath<V extends
|
|
1655
|
+
declare function fromMotionPath<V extends Vars = Vars>(target: HTMLElement | HTMLElement[], options: MotionPathOptions): CSSKeyframesAnimation<V>;
|
|
1799
1656
|
|
|
1800
1657
|
/**
|
|
1801
1658
|
* K1 — `fromStyleSheets`: the consumer-facing front door over
|
|
@@ -1810,7 +1667,7 @@ declare function fromMotionPath<V extends Record<string, any> = any>(target: HTM
|
|
|
1810
1667
|
* pulse?.setTargets(el).play(); // re-drive the page's OWN animation
|
|
1811
1668
|
* for (const d of diagnostics) console.warn(d.code, d.message); // honest skips
|
|
1812
1669
|
*/
|
|
1813
|
-
declare const fromStyleSheets: <V extends Vars =
|
|
1670
|
+
declare const fromStyleSheets: <V extends Vars = Vars>(source?: Document | ShadowRoot | CSSStyleSheet[] | CSSStyleSheet, options?: IngestOptions) => IngestResult<V>;
|
|
1814
1671
|
|
|
1815
1672
|
declare const glow: (options?: InputAnimationOptions) => CSSKeyframesAnimation< Vars>;
|
|
1816
1673
|
|
|
@@ -1828,7 +1685,7 @@ declare const hover: (options?: InputAnimationOptions) => CSSKeyframesAnimation<
|
|
|
1828
1685
|
* rows for THIS rule (a malformed body → `PARSE_ERROR`, etc.); the walk-level
|
|
1829
1686
|
* rows (`CORS_SKIP`) ride {@link IngestResult.diagnostics}.
|
|
1830
1687
|
*/
|
|
1831
|
-
export declare interface IngestedAnimation<V extends Vars =
|
|
1688
|
+
export declare interface IngestedAnimation<V extends Vars = Vars> {
|
|
1832
1689
|
/** The `@keyframes` identifier (CSSOM `CSSKeyframesRule.name`). */
|
|
1833
1690
|
name: string;
|
|
1834
1691
|
/** The reconstructed kf animation — replay-equal to the source CSS. */
|
|
@@ -1861,7 +1718,7 @@ export declare interface IngestOptions {
|
|
|
1861
1718
|
* `animations` for the recovered objects and `diagnostics` for the citable
|
|
1862
1719
|
* reasons the walk could not complete a step faithfully — NEVER a silent drop.
|
|
1863
1720
|
*/
|
|
1864
|
-
export declare interface IngestResult<V extends Vars =
|
|
1721
|
+
export declare interface IngestResult<V extends Vars = Vars> {
|
|
1865
1722
|
/** Every `@keyframes` rule reconstructed, keyed by its CSS name. */
|
|
1866
1723
|
animations: Map<string, IngestedAnimation<V>>;
|
|
1867
1724
|
/**
|
|
@@ -1873,32 +1730,6 @@ export declare interface IngestResult<V extends Vars = any> {
|
|
|
1873
1730
|
diagnostics: Diagnostic[];
|
|
1874
1731
|
}
|
|
1875
1732
|
|
|
1876
|
-
/**
|
|
1877
|
-
* The INGEST surface (L.W7 S3 `loadIngest()`) — the engine core PLUS the
|
|
1878
|
-
* forward-pointed live-web walk (`fromStyleSheets` / `fromLiveAnimations` /
|
|
1879
|
-
* `resolveLiveKeyframes` / `adoptRunning`) and the scroll-grammar round-trip
|
|
1880
|
-
* (`ScrollScene` + `parseScrollCSS` / `serializeScrollOptions` / …). A
|
|
1881
|
-
* consumer ingesting CSSOM / adopting a running animation / driving a scroll
|
|
1882
|
-
* scene pays for `engine` + `ingest` + `scroll-scene`, not the compile /
|
|
1883
|
-
* motion / draw / preset weight.
|
|
1884
|
-
*/
|
|
1885
|
-
export declare interface IngestSurface extends EngineCore {
|
|
1886
|
-
fromStyleSheets: typeof fromStyleSheets;
|
|
1887
|
-
fromLiveAnimations: typeof fromLiveAnimations;
|
|
1888
|
-
resolveLiveKeyframes: typeof resolveLiveKeyframes;
|
|
1889
|
-
adoptRunning: typeof adoptRunning;
|
|
1890
|
-
ScrollScene: typeof ScrollScene;
|
|
1891
|
-
createScrollScene: typeof createScrollScene;
|
|
1892
|
-
parseScrollCSS: typeof parseScrollCSS;
|
|
1893
|
-
parseScrollTimeline: typeof parseScrollTimeline;
|
|
1894
|
-
parseScrollRange: typeof parseScrollRange;
|
|
1895
|
-
serializeScrollOptions: typeof serializeScrollOptions;
|
|
1896
|
-
roundTripScrollCSS: typeof roundTripScrollCSS;
|
|
1897
|
-
dispatchScrollBackend: typeof dispatchScrollBackend;
|
|
1898
|
-
resolveRange: typeof resolveRange;
|
|
1899
|
-
pinCSS: typeof pinCSS;
|
|
1900
|
-
}
|
|
1901
|
-
|
|
1902
1733
|
export declare type InputAnimationOptions = Partial<{
|
|
1903
1734
|
duration: number | string;
|
|
1904
1735
|
delay: number | string;
|
|
@@ -1922,149 +1753,105 @@ declare const jumpDown: (options?: InputAnimationOptions) => CSSKeyframesAnimati
|
|
|
1922
1753
|
|
|
1923
1754
|
declare const jumpUp: (options?: InputAnimationOptions) => CSSKeyframesAnimation< Vars>;
|
|
1924
1755
|
|
|
1925
|
-
/** A keyframe map: percent/keyword stops → partial var frames. */
|
|
1926
|
-
export declare type KeyframeMap<V extends Vars> = Map<string, Partial<V>> | Record<string, Partial<V>>;
|
|
1927
|
-
|
|
1928
1756
|
/**
|
|
1929
1757
|
* The core animation engine — keyframes, timing, interpolation, playback.
|
|
1930
1758
|
*
|
|
1931
|
-
*
|
|
1932
|
-
*
|
|
1933
|
-
*
|
|
1934
|
-
*
|
|
1935
|
-
* backward-compat RE-EXPORT alias was DROPPED in 5.0.0 (Q.WE1 — NO-LEGACY).
|
|
1936
|
-
* Gated by `proof:pkg3-clean`. The runtime constructor is `KeyframesAnimation`.
|
|
1759
|
+
* PKG-3 RENAME (L.W8): formerly `Animation`; renamed to `KeyframesAnimation`
|
|
1760
|
+
* because the old name collided with the ambient `globalThis.Animation` (WAAPI),
|
|
1761
|
+
* leaking a suffixed collision alias into the d.ts. The legacy `Animation`
|
|
1762
|
+
* re-export alias was DROPPED in 5.0.0 (Q.WE1 — NO-LEGACY).
|
|
1937
1763
|
*/
|
|
1938
|
-
export declare class KeyframesAnimation<V extends Vars =
|
|
1764
|
+
export declare class KeyframesAnimation<V extends Vars = Vars> {
|
|
1939
1765
|
id: number;
|
|
1940
1766
|
name: string | undefined;
|
|
1941
1767
|
superKey: string | undefined;
|
|
1942
1768
|
targets: HTMLElement[];
|
|
1943
1769
|
options: AnimationOptions;
|
|
1944
|
-
/**
|
|
1945
|
-
*
|
|
1946
|
-
*
|
|
1947
|
-
*
|
|
1948
|
-
*
|
|
1949
|
-
*
|
|
1950
|
-
*
|
|
1951
|
-
* READ-ONLY surface (G.W19): the backing `_compiler` is written ONLY by the
|
|
1952
|
-
* constructor and {@link adoptCompiled}. An external `animation.compiler = …`
|
|
1953
|
-
* write was the one cross-boundary reach-in vector that could desync the
|
|
1954
|
-
* live-options reference (`this.options !== this.compiler.options`); making
|
|
1955
|
-
* `compiler` a get-only accessor makes that reach-in a COMPILE error, not a
|
|
1956
|
-
* convention. Adopt a compiled state via `adoptCompiled(source)`.
|
|
1957
|
-
*/
|
|
1770
|
+
/** The frame-compilation half — template frames → sampled `frames[]`. The
|
|
1771
|
+
* class composes one and delegates `addFrame`/`parse` + the frame accessors
|
|
1772
|
+
* to it. READ-ONLY surface (G.W19): the backing `_compiler` is written ONLY
|
|
1773
|
+
* by the constructor + `adoptCompiled` (via `_setCompiler`); an external
|
|
1774
|
+
* `animation.compiler = …` reach-in is a COMPILE error (the live-options
|
|
1775
|
+
* desync lock). */
|
|
1958
1776
|
private _compiler;
|
|
1959
1777
|
get compiler(): FrameCompiler<V>;
|
|
1960
|
-
/**
|
|
1961
|
-
*
|
|
1962
|
-
* the WAAPI shadow tick both ride it, so `stop()` halts either
|
|
1963
|
-
* uniformly and no raw rAF handle leaks onto the instance.
|
|
1964
|
-
*/
|
|
1778
|
+
/** THE rAF owner for this animation — the standalone play loop and the WAAPI
|
|
1779
|
+
* shadow tick both ride it, so `stop()` halts either uniformly. */
|
|
1965
1780
|
readonly playback: RAFPlayback;
|
|
1966
|
-
/**
|
|
1967
|
-
*
|
|
1968
|
-
*
|
|
1969
|
-
*
|
|
1970
|
-
*
|
|
1971
|
-
*
|
|
1972
|
-
|
|
1973
|
-
|
|
1974
|
-
startTime: number | undefined;
|
|
1975
|
-
pausedTime: number;
|
|
1976
|
-
|
|
1977
|
-
|
|
1978
|
-
|
|
1979
|
-
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
|
|
1983
|
-
|
|
1984
|
-
|
|
1985
|
-
|
|
1781
|
+
/** The standalone-play machine's OWN run-state (R.W2 — DI by composition):
|
|
1782
|
+
* the deferred play resolver, the held play promise, the live WAAPI handles,
|
|
1783
|
+
* the bound frame callback, the hoisted zero-alloc interp buffer. The five
|
|
1784
|
+
* fields formerly privacy-inverted onto the class body + re-published through
|
|
1785
|
+
* the excised `PlaybackHost` interface; the `./playback` free functions now
|
|
1786
|
+
* own them via `this._playback` directly (no cast, no re-publication). */
|
|
1787
|
+
readonly _playback: PlaybackState;
|
|
1788
|
+
get startTime(): number | undefined;
|
|
1789
|
+
set startTime(v: number | undefined);
|
|
1790
|
+
get pausedTime(): number;
|
|
1791
|
+
set pausedTime(v: number);
|
|
1792
|
+
get t(): number;
|
|
1793
|
+
set t(v: number);
|
|
1794
|
+
get iteration(): number;
|
|
1795
|
+
set iteration(v: number);
|
|
1796
|
+
get started(): boolean;
|
|
1797
|
+
set started(v: boolean);
|
|
1798
|
+
get done(): boolean;
|
|
1799
|
+
set done(v: boolean);
|
|
1800
|
+
get reversed(): boolean;
|
|
1801
|
+
set reversed(v: boolean);
|
|
1802
|
+
get paused(): boolean;
|
|
1803
|
+
set paused(v: boolean);
|
|
1804
|
+
/** Structured parse/honoring diagnostics (K.W7 S4) — a FLAT additive array
|
|
1805
|
+
* of stable-coded {@link Diagnostic} rows surfaced from `resolveKeyframes` +
|
|
1806
|
+
* the engine's composition-fallback rows; empty on a clean parse. Every
|
|
1807
|
+
* SILENT fallback site is mirrored here (`proof:diagnostics-channel`). */
|
|
1986
1808
|
diagnostics: Diagnostic[];
|
|
1987
|
-
/**
|
|
1988
|
-
*
|
|
1989
|
-
*
|
|
1990
|
-
|
|
1991
|
-
* composited leaf is applied). Empty for a pure-`replace` animation (the
|
|
1992
|
-
* zero-overhead path). The capture/accumulate logic lives in
|
|
1993
|
-
* `./engine-composition` ({@link applyComposition}/`captureUnderlyingBase`).
|
|
1994
|
-
*/
|
|
1995
|
-
private _compositionBase;
|
|
1809
|
+
/** The captured UNDERLYING base value per composited leaf (K.W7 S1) — the
|
|
1810
|
+
* per-element numeric base `add`/`accumulate` accumulates ONTO; empty for a
|
|
1811
|
+
* pure-`replace` animation. INTERNAL — read by `./interpolate` (R.W2). */
|
|
1812
|
+
_compositionBase: Map<string, number[]>;
|
|
1996
1813
|
/** Properties whose non-numeric composite already emitted its
|
|
1997
|
-
* `COMPOSITION_FALLBACK` row
|
|
1998
|
-
*
|
|
1999
|
-
|
|
2000
|
-
/** True once
|
|
2001
|
-
*
|
|
2002
|
-
|
|
2003
|
-
|
|
2004
|
-
|
|
2005
|
-
|
|
2006
|
-
reversed: boolean;
|
|
2007
|
-
paused: boolean;
|
|
2008
|
-
/**
|
|
2009
|
-
* True when an `AnimationGroup` is driving this animation's
|
|
2010
|
-
* `advanceTo()` and `interpFrames()` from its own rAF loop. Set by
|
|
2011
|
-
* the group at construction; standalone `.play()` / `.draw()`
|
|
2012
|
-
* throw when this is true rather than racing the group.
|
|
2013
|
-
*/
|
|
1814
|
+
* `COMPOSITION_FALLBACK` row (once per property, not per frame). INTERNAL —
|
|
1815
|
+
* read by `./interpolate` (R.W2). */
|
|
1816
|
+
_compositionFallbackSeen: Set<string>;
|
|
1817
|
+
/** True once a non-`replace` operator was seen — the hot path skips ALL
|
|
1818
|
+
* composition work when false. INTERNAL — read by `./interpolate` (R.W2). */
|
|
1819
|
+
_hasComposition: boolean;
|
|
1820
|
+
/** True when an `AnimationGroup` drives this animation's `advanceTo()`/
|
|
1821
|
+
* `interpFrames()` from its own rAF loop. Standalone `.play()` throws when
|
|
1822
|
+
* set rather than racing the group. */
|
|
2014
1823
|
managed: boolean;
|
|
2015
|
-
/**
|
|
2016
|
-
*
|
|
2017
|
-
* but `useWAAPI: true` was requested, this records the reason.
|
|
2018
|
-
* Queryable by debug builds — no console output is produced.
|
|
2019
|
-
*/
|
|
1824
|
+
/** If the most recent `play()` fell back from WAAPI to rAF despite
|
|
1825
|
+
* `useWAAPI: true`, this records the reason. Queryable; no console output. */
|
|
2020
1826
|
waapiIneligibleReason: string | undefined;
|
|
2021
1827
|
unflatten: boolean;
|
|
2022
|
-
|
|
2023
|
-
|
|
2024
|
-
|
|
2025
|
-
*
|
|
2026
|
-
*
|
|
2027
|
-
|
|
2028
|
-
|
|
2029
|
-
/**
|
|
2030
|
-
* The ONE output buffer for the standalone play loop's `interpFrames`
|
|
2031
|
-
* calls — reused every frame so steady-state playback allocates no
|
|
2032
|
-
* per-frame result object (the primitive-level analogue of the group's
|
|
2033
|
-
* hoisted `_grouped` buffer, gated by `proof:standalone-zero-alloc`).
|
|
2034
|
-
* The play path (`_frame`) never returns this object to a consumer, so
|
|
2035
|
-
* reuse is safe; `at()` (a query whose result the caller keeps) still
|
|
2036
|
-
* allocates a fresh object.
|
|
2037
|
-
*/
|
|
2038
|
-
private _interpOut;
|
|
2039
|
-
/**
|
|
2040
|
-
* The compile-stable union of every frame's `flatVars` keys — the maximal
|
|
2041
|
-
* key-set any `interpFrames` call can write. Fixed at `parse` (the keys
|
|
2042
|
-
* never change across frames; a color-space renormalize re-derives the same
|
|
2043
|
-
* carriers under the same keys). It is what `clearBuffer` null-fills to keep
|
|
2044
|
-
* a reused buffer stale-free WITHOUT `delete` (F.W4 S1 — the V8 dictionary-
|
|
2045
|
-
* mode trap the delete-loop fell into). Exposed (read-only) as `flatKeys`
|
|
2046
|
-
* so the `AnimationGroup` can size its own composite buffer the same way.
|
|
2047
|
-
*/
|
|
2048
|
-
private _stableKeys;
|
|
2049
|
-
/**
|
|
2050
|
-
* The consumer's EXPLICIT constructor options (NOT merged with defaults) —
|
|
1828
|
+
/** The compile-stable union of every frame's `flatVars` keys, fixed at
|
|
1829
|
+
* `parse` — what `clearBuffer` null-fills to keep a reused buffer stale-free
|
|
1830
|
+
* WITHOUT `delete` (F.W4 S1, the V8 dictionary-mode trap). Exposed read-only
|
|
1831
|
+
* as `flatKeys` so the group sizes its composite buffer the same way.
|
|
1832
|
+
* INTERNAL — read by `./interpolate` (R.W2). */
|
|
1833
|
+
_stableKeys: string[];
|
|
1834
|
+
/** The consumer's EXPLICIT constructor options (NOT merged with defaults) —
|
|
2051
1835
|
* retained so `fromString` can layer a parsed style-rule `animation`
|
|
2052
|
-
* shorthand UNDER them (constructor-explicit wins
|
|
2053
|
-
*/
|
|
1836
|
+
* shorthand UNDER them (constructor-explicit wins, F.W8). */
|
|
2054
1837
|
protected _ctorOptions: Partial<InputAnimationOptions>;
|
|
2055
1838
|
/** The compile-stable union of this animation's interpolated keys. */
|
|
2056
1839
|
get flatKeys(): readonly string[];
|
|
2057
1840
|
/**
|
|
2058
|
-
* The instance's ONE default DOM-style renderer, allocated once.
|
|
2059
|
-
*
|
|
2060
|
-
*
|
|
2061
|
-
* typed and bind-proof, unlike a Symbol tag on a closure, which
|
|
2062
|
-
* `Function.prototype.bind` silently drops.
|
|
1841
|
+
* The instance's ONE default DOM-style renderer, allocated once. "Did the
|
|
1842
|
+
* consumer supply a custom transform?" is a reference comparison against this
|
|
1843
|
+
* single value ({@link usesDefaultRenderer}) — typed and bind-proof.
|
|
2063
1844
|
*/
|
|
2064
1845
|
protected readonly _defaultTransform: TransformFunction<V>;
|
|
2065
1846
|
/** True when `fn` is this instance's default DOM-style renderer. */
|
|
2066
1847
|
usesDefaultRenderer(fn: TransformFunction<V> | undefined): boolean;
|
|
2067
|
-
|
|
1848
|
+
/**
|
|
1849
|
+
* Fire a lifecycle `AnimationEvent` on each bound target (R.W2 — F-6, body in
|
|
1850
|
+
* `./playback`). INTERNAL: the play machine calls it on the concrete
|
|
1851
|
+
* animation — kept ON the class but NOT `private`, reached by direct field
|
|
1852
|
+
* access (the old `PlaybackHost` re-publication + cast are excised).
|
|
1853
|
+
*/
|
|
1854
|
+
dispatchAnimationEvent(type: string): void;
|
|
2068
1855
|
constructor(options?: Partial<InputAnimationOptions>, targets?: HTMLElement[] | HTMLElement | undefined, name?: string | undefined, superKey?: string | undefined);
|
|
2069
1856
|
get templateFrames(): TemplateAnimationFrame<V>[];
|
|
2070
1857
|
set templateFrames(value: TemplateAnimationFrame<V>[]);
|
|
@@ -2073,56 +1860,21 @@ export declare class KeyframesAnimation<V extends Vars = any> {
|
|
|
2073
1860
|
get frameId(): number;
|
|
2074
1861
|
/** Append a template frame (delegated to the compiler). Chainable. */
|
|
2075
1862
|
addFrame<K extends V>(start: number | string | ValueUnit<number>, vars: Partial<K>, transform?: TransformFunction<K>, timingFunction?: InputAnimationOptions["timingFunction"], composition?: CompositeOperator): KeyframesAnimation<K>;
|
|
2076
|
-
/** Compile the template frames into the sampled `frames[]
|
|
1863
|
+
/** Compile the template frames into the sampled `frames[]` (R.W2 body in
|
|
1864
|
+
* `./compile-bridge`). Chainable. */
|
|
2077
1865
|
parse(): this;
|
|
2078
|
-
/**
|
|
2079
|
-
* Set `_hasComposition` (K.W7 S1) — true iff ANY compiled frame carries a
|
|
2080
|
-
* non-`replace` `animation-composition` operator (the hot-path branch reads
|
|
2081
|
-
* this ONE per-animation constant; a pure-`replace` animation never pays for
|
|
2082
|
-
* the composition work) — and reset the per-run base/fallback caches so a
|
|
2083
|
-
* re-parse re-snapshots the underlying base. See `./engine-composition`.
|
|
2084
|
-
*/
|
|
2085
|
-
private computeHasComposition;
|
|
2086
1866
|
/**
|
|
2087
1867
|
* Adopt another animation's ALREADY-COMPILED state as ONE atomic motion
|
|
2088
|
-
* (G.W19
|
|
2089
|
-
*
|
|
2090
|
-
*
|
|
2091
|
-
* second compile.
|
|
2092
|
-
*
|
|
2093
|
-
* The transplant moves the `{ compiler, options, unflatten }` triad together
|
|
2094
|
-
* and re-binds the live-options reference BY CONSTRUCTION — `this.options` is
|
|
2095
|
-
* read OFF the adopted compiler, so `this.options === this.compiler.options`
|
|
2096
|
-
* holds without relying on the caller's assignment order. This is the
|
|
2097
|
-
* invariant the demo formerly held by a comment + three ordered field writes;
|
|
2098
|
-
* here it is the method's contract, enforced by `proof:adopt-compiled`. A
|
|
2099
|
-
* `compiler` adopted WITHOUT re-binding `options` would leave the setters
|
|
2100
|
-
* mutating one object while the compiler reads another — the exact desync
|
|
2101
|
-
* the `6e29236` live-options lock guards against.
|
|
2102
|
-
*
|
|
2103
|
-
* Recomputes `_stableKeys` so `flatKeys` (the buffer-sizing contract)
|
|
2104
|
-
* reflects the adopted compiled frames, not the pre-adopt key-set. Chainable.
|
|
2105
|
-
*
|
|
2106
|
-
* @param source an animation whose `compiler` is already compiled.
|
|
1868
|
+
* (G.W19 — body in `./compile-bridge`): moves the `{ compiler, options,
|
|
1869
|
+
* unflatten }` triad + re-binds the live-options reference BY CONSTRUCTION
|
|
1870
|
+
* (`proof:adopt-compiled`). Chainable.
|
|
2107
1871
|
*/
|
|
2108
1872
|
adoptCompiled(source: KeyframesAnimation<V>): this;
|
|
2109
|
-
/**
|
|
2110
|
-
*
|
|
2111
|
-
*
|
|
2112
|
-
*
|
|
2113
|
-
|
|
2114
|
-
*/
|
|
2115
|
-
private computeStableKeys;
|
|
2116
|
-
/**
|
|
2117
|
-
* Option setters — the fail-explicit contract.
|
|
2118
|
-
*
|
|
2119
|
-
* Genuine omission (`undefined`/`null`) means "use the default" and is
|
|
2120
|
-
* always accepted; present-but-malformed input THROWS a typed
|
|
2121
|
-
* `AnimationOptionError` naming the option and the offending value.
|
|
2122
|
-
* This is the same posture the layer API chose ("silent no-ops were
|
|
2123
|
-
* hiding consumer bugs") applied to the whole options surface — no
|
|
2124
|
-
* silent fallback, no silently-preserved previous value.
|
|
2125
|
-
*/
|
|
1873
|
+
/** INTERNAL (R.W2): the sanctioned backing-field write for `_compiler` (used
|
|
1874
|
+
* ONLY by `./compile-bridge`'s `adoptCompiled`). The `compiler` accessor
|
|
1875
|
+
* stays get-only — an external `animation.compiler = …` reach-in is a COMPILE
|
|
1876
|
+
* error (the G.W19 live-options-desync lock). */
|
|
1877
|
+
_setCompiler(compiler: FrameCompiler<V>): void;
|
|
2126
1878
|
setTimingFunction(timingFunction: InputAnimationOptions["timingFunction"]): this;
|
|
2127
1879
|
setIterationCount(iterationCount: InputAnimationOptions["iterationCount"]): this;
|
|
2128
1880
|
setDuration(duration: InputAnimationOptions["duration"]): this;
|
|
@@ -2133,198 +1885,51 @@ export declare class KeyframesAnimation<V extends Vars = any> {
|
|
|
2133
1885
|
setRespectReducedMotion(respectReducedMotion: InputAnimationOptions["respectReducedMotion"]): this;
|
|
2134
1886
|
setColorSpace(colorSpace: InputAnimationOptions["colorSpace"]): this;
|
|
2135
1887
|
setHueMethod(hueMethod: InputAnimationOptions["hueMethod"]): this;
|
|
2136
|
-
/**
|
|
2137
|
-
* Set the LAYER-level `animation-composition` operator (L.W1 S5, Band A).
|
|
2138
|
-
* Genuine omission (`undefined`) leaves the field unset — the serializer
|
|
2139
|
-
* treats it as the CSS default `replace` and omits the longhand. A present
|
|
2140
|
-
* value is stored verbatim (`replace` | `add` | `accumulate`), so a sibling
|
|
2141
|
-
* `.class { animation-composition: add }` ingested by `fromString`
|
|
2142
|
-
* round-trips on re-serialize.
|
|
2143
|
-
*/
|
|
2144
1888
|
setComposite(composite: InputAnimationOptions["composite"]): this;
|
|
2145
1889
|
setOptions(options: Partial<InputAnimationOptions>): this;
|
|
2146
1890
|
reverse(): this;
|
|
2147
1891
|
fillForwards(): void;
|
|
2148
1892
|
fillBackwards(): void;
|
|
2149
|
-
/**
|
|
2150
|
-
*
|
|
2151
|
-
* `fillMode` (forwards/both → final; none/backwards → initial). This is
|
|
2152
|
-
* the explicit rest-position contract: completion paints the rest frame
|
|
2153
|
-
* per this derivation, and the reduced-motion snap is "rest = final,
|
|
2154
|
-
* paint it, settle" — the same path a `fillMode: forwards` completion
|
|
2155
|
-
* takes, not a separate code path.
|
|
2156
|
-
*/
|
|
1893
|
+
/** Where the playhead rests after a completed play (forwards/both → final;
|
|
1894
|
+
* none/backwards → initial) — body in `./interpolate`. */
|
|
2157
1895
|
get restPosition(): "initial" | "final";
|
|
2158
|
-
/** Paint the rest frame per the fill contract. */
|
|
1896
|
+
/** Paint the rest frame per the fill contract (body in `./interpolate`). */
|
|
2159
1897
|
paintRest(): void;
|
|
2160
|
-
/**
|
|
2161
|
-
*
|
|
2162
|
-
|
|
2163
|
-
|
|
2164
|
-
*
|
|
2165
|
-
*
|
|
2166
|
-
* while a template frame still carries `NAMED_SELECTOR_SUPERTYPE` (unresolved —
|
|
2167
|
-
* `bindTimeline` was never called), refuse with the TYPED
|
|
2168
|
-
* `NAMED_SELECTOR_NO_TIMELINE` rather than silently producing NaN frames that
|
|
2169
|
-
* `binarySearchRange` treats as ALWAYS-ACTIVE. Fired ONLY at the genuinely-
|
|
2170
|
-
* demanded point — NEVER at parse/ingest (the reverted Path-A trap). A resolved
|
|
2171
|
-
* frame (the superType tag CLEARED by `bindTimeline`) passes silently — this is
|
|
2172
|
-
* a zero-cost `Array.find` over `templateFrames` whose starts are `%`/`from`/
|
|
2173
|
-
* `to` (no `superType`) on a non-named animation.
|
|
2174
|
-
*/
|
|
2175
|
-
private assertNoUnresolvedNamedSelector;
|
|
2176
|
-
/**
|
|
2177
|
-
* Stateless progress query. Maps [0,1] from first keyframe to last,
|
|
2178
|
-
* regardless of playback direction. `apply=true` invokes transform callbacks.
|
|
2179
|
-
*/
|
|
1898
|
+
/** The named-selector PLAY-TIME guard (Q.WD1 S3 — body in `./interpolate`).
|
|
1899
|
+
* INTERNAL (R.W2): the play machine + `at()` call it; NOT `private`. */
|
|
1900
|
+
assertNoUnresolvedNamedSelector(): void;
|
|
1901
|
+
/** Stateless progress query — maps [0,1] from first to last keyframe,
|
|
1902
|
+
* direction-agnostic (`apply=true` invokes transforms). Body in
|
|
1903
|
+
* `./interpolate`. */
|
|
2180
1904
|
at(progress: number, apply?: boolean): Record<string, ValueUnit[]>;
|
|
2181
1905
|
/**
|
|
2182
|
-
* Interpolate all active frames at time `t
|
|
2183
|
-
*
|
|
2184
|
-
*
|
|
2185
|
-
*
|
|
2186
|
-
*
|
|
2187
|
-
* (multiple properties may share the same time range).
|
|
2188
|
-
*
|
|
2189
|
-
* @param t - Current animation time in milliseconds
|
|
2190
|
-
* @param transformFrames - If true, applies each frame's transform function to targets
|
|
2191
|
-
* @param out - Optional output object to write results into. When
|
|
2192
|
-
* provided, its keys are cleared first so no stale keys from a
|
|
2193
|
-
* previous call leak through. Pass this per-animation to achieve
|
|
2194
|
-
* zero-allocation steady-state playback.
|
|
2195
|
-
* @returns Merged flat vars from all active frames
|
|
1906
|
+
* Interpolate all active frames at time `t` — the hot path (once per rAF
|
|
1907
|
+
* frame). R.W2 body in `./interpolate`; this is the thin public sampling
|
|
1908
|
+
* delegate the group, sequence, WAAPI build, and `at()` all drive. Zero-alloc
|
|
1909
|
+
* + fast-properties contract preserved (proof:standalone-zero-alloc /
|
|
1910
|
+
* proof:interp-fastprops).
|
|
2196
1911
|
*/
|
|
2197
1912
|
interpFrames(t: number, transformFrames?: boolean, out?: Record<string, ValueUnit[]>): Record<string, ValueUnit[]>;
|
|
2198
|
-
/**
|
|
2199
|
-
* Clear a reused interpolation buffer to a stale-free state WITHOUT
|
|
2200
|
-
* `delete` — the V8-correct stable-key null-fill (F.W4 S1). The key-set is
|
|
2201
|
-
* compile-stable (`_stableKeys` is the union of every frame's `flatVars`
|
|
2202
|
-
* keys, fixed at `parse`), so null-filling it keeps the buffer in
|
|
2203
|
-
* fast-properties mode AND zero-alloc. Inactive keys read back `undefined`;
|
|
2204
|
-
* every consumer of a reused buffer (the group blend, the unused play-loop
|
|
2205
|
-
* `_interpOut`) skips them — only the standalone return path (which never
|
|
2206
|
-
* reuses a buffer) must be `undefined`-free, and it takes the alias / fresh
|
|
2207
|
-
* merge above.
|
|
2208
|
-
*/
|
|
2209
|
-
private clearBuffer;
|
|
2210
|
-
/**
|
|
2211
|
-
* Interpolate ONE active frame at time `t` in place (lerp + optional
|
|
2212
|
-
* transform). Lifted off the `interpFrames` hot loop so playback allocates
|
|
2213
|
-
* no per-frame closure. A zero-width frame (`start === stop`, a degenerate
|
|
2214
|
-
* keyframe pair) snaps to the endpoint instead of dividing by zero in
|
|
2215
|
-
* `scale` (E-RT-5). The merge into the result buffer is done by the caller
|
|
2216
|
-
* (F.W4 S3 — so the single-frame path can alias `flatVars` with no copy).
|
|
2217
|
-
*/
|
|
2218
|
-
private processFrame;
|
|
2219
|
-
/**
|
|
2220
|
-
* Composite ONE frame's lerped numeric leaves onto the captured underlying
|
|
2221
|
-
* base per its `animation-composition` operator (K.W7 S1) — the thin engine
|
|
2222
|
-
* seam threading the live per-run state into the pure `./engine-composition`
|
|
2223
|
-
* honoring (where the un-clamped add, repeat-aware accumulate, captured base,
|
|
2224
|
-
* and non-numeric `replace`-fallback + `COMPOSITION_FALLBACK` row live).
|
|
2225
|
-
*/
|
|
2226
|
-
private applyComposition;
|
|
2227
|
-
/** SYNC unless `delay > 0` — then a thenable resolving after the sleep. */
|
|
2228
1913
|
onStart(): Promise<void> | undefined;
|
|
2229
1914
|
onEnd(): void;
|
|
2230
|
-
/**
|
|
2231
|
-
* Advance the playhead to absolute clock `t` (a rAF timestamp, NOT a
|
|
2232
|
-
* delta). Lazily runs `onStart` on the first call, reconciles the
|
|
2233
|
-
* pause/resume clock, and ends the iteration once `t` reaches the
|
|
2234
|
-
* duration. This is the DRIVER-layer advance — the one meaning of the
|
|
2235
|
-
* absolute-clock step, distinct from the `tickDt(dt)` stepper surface
|
|
2236
|
-
* the rest of the engine canonicalized to.
|
|
2237
|
-
*
|
|
2238
|
-
* SYNC on the steady path (J.W6 S1 — the F.W5 held half, landed): every
|
|
2239
|
-
* post-start frame returns a plain number (no per-frame promise+microtask
|
|
2240
|
-
* hop); a thenable ONLY when the FIRST tick awaits the genuinely-async
|
|
2241
|
-
* delay sleep. Ordering locked by proof:event-ordering.
|
|
2242
|
-
*/
|
|
2243
1915
|
advanceTo(t: number): number | Promise<number>;
|
|
2244
|
-
|
|
2245
|
-
/**
|
|
2246
|
-
* One frame of the standalone rAF play path, driven by the shared
|
|
2247
|
-
* `RAFPlayback.loop`. Returns whether the loop should continue.
|
|
2248
|
-
*/
|
|
1916
|
+
/** One frame of the standalone rAF play path (driven by `RAFPlayback.loop`). */
|
|
2249
1917
|
private _frame;
|
|
2250
|
-
/**
|
|
2251
|
-
*
|
|
2252
|
-
* the
|
|
2253
|
-
* `play()` already constructs (the re-entrant guard returns it; the
|
|
2254
|
-
* `finally`-clear nulls it on settle) — NOT a second completion lifecycle.
|
|
2255
|
-
* Two reads mid-play return the SAME promise. A settled (or never-played)
|
|
2256
|
-
* animation reads `null` and resolves immediately: "not running" = "nothing
|
|
2257
|
-
* to await" — the honest semantics for a getter that reports current
|
|
2258
|
-
* settledness, not a pre-armed future run.
|
|
2259
|
-
*/
|
|
1918
|
+
/** The completion front-door (G.W13) — `await anim.finished` resolves once
|
|
1919
|
+
* the in-flight play settles (a settled/never-played animation resolves
|
|
1920
|
+
* immediately). Reads the ONE held promise off the composed `_playback`. */
|
|
2260
1921
|
get finished(): Promise<void>;
|
|
2261
1922
|
play(): Promise<void>;
|
|
2262
|
-
/**
|
|
2263
|
-
* Pause playback — idempotent. Pausing an already-paused (or
|
|
2264
|
-
* not-yet-started) animation is a no-op, never a resume: a method named
|
|
2265
|
-
* `pause` pauses. Use {@link resume} for the explicit resume.
|
|
2266
|
-
*/
|
|
2267
1923
|
pause(): this;
|
|
2268
1924
|
resume(): this;
|
|
2269
1925
|
/** The explicit flip: pauses if playing, resumes if paused. */
|
|
2270
1926
|
toggle(): this;
|
|
2271
|
-
/**
|
|
2272
|
-
* Halt playback where it stands: cancel the loop AND the WAAPI
|
|
2273
|
-
* compositor animations, settle state, and resolve any pending `play()`
|
|
2274
|
-
* promise. Never paints — `reset()` is the explicit rewind.
|
|
2275
|
-
*/
|
|
2276
1927
|
stop(): void;
|
|
2277
1928
|
playing(): boolean;
|
|
2278
|
-
/** Returns the effective time accounting for direction reversal. */
|
|
2279
1929
|
get effectiveT(): number;
|
|
2280
|
-
/**
|
|
2281
|
-
* Pure state teardown — flags, clocks, iteration. NEVER paints. This is
|
|
2282
|
-
* the terminal half of the rest-position contract: completion paints
|
|
2283
|
-
* the rest frame (via `onEnd` → `paintRest`) and then settles; the
|
|
2284
|
-
* reduced-motion snap paints final and then settles. Settling is
|
|
2285
|
-
* orthogonal to where the pixels rest.
|
|
2286
|
-
*/
|
|
2287
1930
|
settle(): this;
|
|
2288
|
-
/**
|
|
2289
|
-
* Explicit rewind: paint the INITIAL frame, then settle. This is the
|
|
2290
|
-
* user-facing "return to start" — rest position `initial`, painted
|
|
2291
|
-
* deliberately — distinct from `settle()`, which tears down state and
|
|
2292
|
-
* leaves the pixels where they rest.
|
|
2293
|
-
*/
|
|
2294
1931
|
reset(): this;
|
|
2295
1932
|
setTargets(...targets: HTMLElement[]): this;
|
|
2296
|
-
/**
|
|
2297
|
-
* Q.WB1 — the emerging-CSS Phase-2 SECOND resolution pass (the gestalt P.W13
|
|
2298
|
-
* designed: ONE rewriter, a SECOND lifecycle point — element-populated env,
|
|
2299
|
-
* SAME `ResolveContext` shape). Runs over the PRE-FLATTEN
|
|
2300
|
-
* `compiler.templateFrames[i].vars` snapshot (the Phase-1-resolved, unflattened
|
|
2301
|
-
* `Record<string, ValueArray>` `parse()` re-flattens via
|
|
2302
|
-
* `parseAndFlattenObject`), so a Phase-1-resolved leaf — already a concrete
|
|
2303
|
-
* `ValueUnit` — is returned as-is by `resolveNode`, making the pass idempotent
|
|
2304
|
-
* over the Phase-1 result. Gated by `hasPhase2Node`: a declaration with NO
|
|
2305
|
-
* element-aware node is never re-resolved (zero second-pass cost).
|
|
2306
|
-
*
|
|
2307
|
-
* SSR-safe: with no bound target (or a target with no `parentElement`) the env
|
|
2308
|
-
* fields are OMITTED, so a residual node stays unresolved (never a throw on
|
|
2309
|
-
* `getComputedStyle(undefined)`) — the same posture Phase 1 holds for
|
|
2310
|
-
* `style(--p)` today.
|
|
2311
|
-
*
|
|
2312
|
-
* @returns `true` iff at least one template carried a Phase-2 node and the
|
|
2313
|
-
* compiler was re-`parse()`d (so `setTargets` skips its fast propagate).
|
|
2314
|
-
*/
|
|
2315
|
-
private _resolveElementAwareValues;
|
|
2316
|
-
/**
|
|
2317
|
-
* Q.WB1 — build the element-AWARE {@link ResolveEnv} from the bound target (the
|
|
2318
|
-
* precondition for the Phase-2 second pass). SSR-safe: with no target / no
|
|
2319
|
-
* `parentElement`, the relevant field is OMITTED (not assigned), so the residual
|
|
2320
|
-
* node stays unresolved rather than throwing. Built ONCE per `setTargets` — the
|
|
2321
|
-
* pass is a compile-time lowering, never on the hot path.
|
|
2322
|
-
*
|
|
2323
|
-
* @returns the populated env, or `undefined` when no target is bound at all
|
|
2324
|
-
* (the whole pass is skipped — nothing element-aware can resolve).
|
|
2325
|
-
*/
|
|
2326
|
-
private _buildElementAwareEnv;
|
|
2327
|
-
group(...animations: KeyframesAnimation<V>[]): AnimationGroup<V>;
|
|
2328
1933
|
}
|
|
2329
1934
|
|
|
2330
1935
|
/**
|
|
@@ -2368,23 +1973,17 @@ declare type LayerTransitionSpring = Partial<Omit<SpringProgressOptions, "initia
|
|
|
2368
1973
|
|
|
2369
1974
|
export declare const loadAnimationEngine: () => Promise<AnimationEngine>;
|
|
2370
1975
|
|
|
2371
|
-
export declare const loadCompiler: () => Promise<CompilerSurface>;
|
|
2372
|
-
|
|
2373
|
-
export declare const loadEngine: () => Promise<EngineCore>;
|
|
2374
|
-
|
|
2375
|
-
export declare const loadIngest: () => Promise<IngestSurface>;
|
|
2376
|
-
|
|
2377
1976
|
/** Looping animations — run continuously (`iterationCount: Infinity`). */
|
|
2378
1977
|
declare const loopPresets: {
|
|
2379
|
-
readonly heartbeat: (options?: InputAnimationOptions) => CSSKeyframesAnimation<
|
|
2380
|
-
readonly glow: (options?: InputAnimationOptions) => CSSKeyframesAnimation<
|
|
2381
|
-
readonly spinner: (options?: InputAnimationOptions) => CSSKeyframesAnimation<
|
|
2382
|
-
readonly rainbowText: (options?: InputAnimationOptions) => CSSKeyframesAnimation<
|
|
2383
|
-
readonly skeletonLoading: (options?: InputAnimationOptions) => CSSKeyframesAnimation<
|
|
2384
|
-
readonly gradientBackground: (options?: InputAnimationOptions) => CSSKeyframesAnimation<
|
|
2385
|
-
readonly parallaxScroll: (options?: InputAnimationOptions) => CSSKeyframesAnimation<
|
|
2386
|
-
readonly hover: (options?: InputAnimationOptions) => CSSKeyframesAnimation<
|
|
2387
|
-
readonly typingCursor: (options?: InputAnimationOptions) => CSSKeyframesAnimation<
|
|
1978
|
+
readonly heartbeat: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
1979
|
+
readonly glow: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
1980
|
+
readonly spinner: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
1981
|
+
readonly rainbowText: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
1982
|
+
readonly skeletonLoading: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
1983
|
+
readonly gradientBackground: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
1984
|
+
readonly parallaxScroll: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
1985
|
+
readonly hover: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
1986
|
+
readonly typingCursor: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
2388
1987
|
};
|
|
2389
1988
|
|
|
2390
1989
|
export declare class ManualTimeline extends Timeline {
|
|
@@ -2423,9 +2022,7 @@ export declare interface MorphRect {
|
|
|
2423
2022
|
* that ALSO exposes {@link sampleD} — the morphed `d` string at a normalized
|
|
2424
2023
|
* `t`, reassembled from the interpolated point coordinates.
|
|
2425
2024
|
*/
|
|
2426
|
-
declare class MorphSVG<V extends
|
|
2427
|
-
/** The underlying coordinate-interpolating animation — the control handle. */
|
|
2428
|
-
readonly animation: CSSKeyframesAnimation<V>;
|
|
2025
|
+
declare class MorphSVG<V extends Vars = Vars> extends SVGAnimationHandle<V> {
|
|
2429
2026
|
/** The uniform-sample count (point pairs = samples + 1). */
|
|
2430
2027
|
readonly samples: number;
|
|
2431
2028
|
constructor(from: string, to: string, options?: MorphSVGOptions);
|
|
@@ -2437,14 +2034,6 @@ declare class MorphSVG<V extends Record<string, any> = any> {
|
|
|
2437
2034
|
* from BOTH endpoint polylines at any interior `t`.
|
|
2438
2035
|
*/
|
|
2439
2036
|
sampleD(t: number): string;
|
|
2440
|
-
/** Start (or re-enter) the morph play loop. */
|
|
2441
|
-
play(): Promise<void>;
|
|
2442
|
-
/** Pause the play loop, retaining the playhead. */
|
|
2443
|
-
pause(): this;
|
|
2444
|
-
/** Halt and rewind the play loop. */
|
|
2445
|
-
stop(): this;
|
|
2446
|
-
/** Resolve once the morph completes — the {@link Animation.finished} front-door. */
|
|
2447
|
-
get finished(): Promise<void>;
|
|
2448
2037
|
}
|
|
2449
2038
|
|
|
2450
2039
|
export declare interface MorphSVGOptions extends Partial<InputAnimationOptions> {
|
|
@@ -2511,28 +2100,10 @@ declare interface MorphValues {
|
|
|
2511
2100
|
* the factory: `new MotionPath(target, { path }).animation` is the control
|
|
2512
2101
|
* handle. The factory is the canonical entry; this is a thin ergonomic wrapper.
|
|
2513
2102
|
*/
|
|
2514
|
-
declare class MotionPath<V extends
|
|
2515
|
-
/** The underlying offset-distance animation — the control handle. */
|
|
2516
|
-
readonly animation: CSSKeyframesAnimation<V>;
|
|
2103
|
+
declare class MotionPath<V extends Vars = Vars> extends SVGAnimationHandle<V> {
|
|
2517
2104
|
constructor(target: HTMLElement | HTMLElement[], options: MotionPathOptions);
|
|
2518
|
-
/** Start (or re-enter) the path-motion play loop. */
|
|
2519
|
-
play(): Promise<void>;
|
|
2520
|
-
/** Pause the play loop, retaining the playhead. */
|
|
2521
|
-
pause(): this;
|
|
2522
|
-
/** Halt and rewind the play loop. */
|
|
2523
|
-
stop(): this;
|
|
2524
2105
|
}
|
|
2525
2106
|
|
|
2526
|
-
/**
|
|
2527
|
-
* A MotionPath spec — the `{ path, ... }` shape that routes to
|
|
2528
|
-
* {@link fromMotionPath} (F.W12 §S2). It carries the author `offset-path`
|
|
2529
|
-
* (`path`) plus the optional `from`/`to`/`rotate` MotionPath knobs; the
|
|
2530
|
-
* animation-options + `autoPlay` ride {@link AnimateOptions} on the third
|
|
2531
|
-
* argument, exactly as every other `animate()` shape. The discriminating field
|
|
2532
|
-
* is `path` — a `string` no keyframe map / vars array carries.
|
|
2533
|
-
*/
|
|
2534
|
-
declare type MotionPathInput = Pick<MotionPathOptions, "path" | "from" | "to" | "rotate">;
|
|
2535
|
-
|
|
2536
2107
|
export declare interface MotionPathOptions extends Partial<InputAnimationOptions> {
|
|
2537
2108
|
/**
|
|
2538
2109
|
* The author `offset-path` (required) — set on the target so the browser
|
|
@@ -2579,11 +2150,11 @@ declare type NativeScrollAttachment = {
|
|
|
2579
2150
|
export declare type NativeTimelineSpec = {
|
|
2580
2151
|
kind: "scroll";
|
|
2581
2152
|
source?: Element | null;
|
|
2582
|
-
axis?:
|
|
2153
|
+
axis?: ScrollTimelineAxis;
|
|
2583
2154
|
} | {
|
|
2584
2155
|
kind: "view";
|
|
2585
2156
|
subject: Element;
|
|
2586
|
-
axis?:
|
|
2157
|
+
axis?: ScrollTimelineAxis;
|
|
2587
2158
|
inset?: string;
|
|
2588
2159
|
};
|
|
2589
2160
|
|
|
@@ -2782,10 +2353,16 @@ export declare interface OscillatorConfig {
|
|
|
2782
2353
|
* phase clock, NOT a CSS value parser, so it carries ZERO static edge to
|
|
2783
2354
|
* `@mkbabb/value.js` (proof:boundary gates it as a value.js-free LIGHT entry).
|
|
2784
2355
|
*
|
|
2785
|
-
*
|
|
2786
|
-
*
|
|
2787
|
-
*
|
|
2788
|
-
*
|
|
2356
|
+
* ── C-13 (S.G2 S12, fold row 56) — INTENTIONAL PUBLIC LEAF ─────────────────────
|
|
2357
|
+
* `Oscillator` is an intentional public LIGHT leaf: the phase math IS the product,
|
|
2358
|
+
* consumed EXTERNALLY (glass-ui BB's `W-EASING-PRIMITIVE` wave — its speedtest
|
|
2359
|
+
* idle-breath reads the phase to drive a looping motion; glass-ui co-schedules, kf
|
|
2360
|
+
* owns the phase math — `docs/tranches/L/waves/L.W9.md §S5`). It carries NO internal
|
|
2361
|
+
* demo scene: the former header claim of a "demo `KF-OSCILLATOR` scene" was fictional
|
|
2362
|
+
* (no such scene exists on disk), so the C-13 decision STRIPPED the claim rather than
|
|
2363
|
+
* build a scene disproportionate to a periodic phase clock — a published primitive
|
|
2364
|
+
* that stands on its own beside `SmoothProgress`/`SpringProgress`, gated LIGHT by
|
|
2365
|
+
* proof:boundary, needs no in-repo demo to justify its export.
|
|
2789
2366
|
*
|
|
2790
2367
|
* NO rAF ownership — the caller drives the loop. `tick(dt)` advances the phase
|
|
2791
2368
|
* by `frequency × dt` (with `dt` in SECONDS from the caller's `RAFPlayback`
|
|
@@ -2852,6 +2429,79 @@ declare function pinCSS(opts?: {
|
|
|
2852
2429
|
bottom?: number;
|
|
2853
2430
|
}): string;
|
|
2854
2431
|
|
|
2432
|
+
declare interface PlainLeafWriter {
|
|
2433
|
+
/** The nested parent object the leaf lives on. */
|
|
2434
|
+
obj: Record<string, unknown>;
|
|
2435
|
+
/** The leaf's own (last dot-segment) key on `obj`. */
|
|
2436
|
+
key: string;
|
|
2437
|
+
/** The live `ValueUnit[]` whose `.value`(s) the interp stride mutates in place. */
|
|
2438
|
+
units: ValueUnit[];
|
|
2439
|
+
/**
|
|
2440
|
+
* True iff the leaf is a single unitless numeric unit → write `.value` (a
|
|
2441
|
+
* bare `number`, zero-alloc). False → a units/color/multi-component leaf,
|
|
2442
|
+
* projected to its authored STRING each refresh (the units/color residual).
|
|
2443
|
+
*/
|
|
2444
|
+
numeric: boolean;
|
|
2445
|
+
}
|
|
2446
|
+
|
|
2447
|
+
declare interface PlainProjection {
|
|
2448
|
+
/** The nested plain object a custom `transform` consumes (`plainVars`). */
|
|
2449
|
+
root: Record<string, unknown>;
|
|
2450
|
+
/** The per-leaf refresh writers, in flat-key order. */
|
|
2451
|
+
writers: PlainLeafWriter[];
|
|
2452
|
+
}
|
|
2453
|
+
|
|
2454
|
+
/**
|
|
2455
|
+
* `engine/playback-state.ts` — the `PlaybackState` run-state STORE, carved off
|
|
2456
|
+
* `engine/play-lifecycle.ts` at S.B2 on the STATE↔BEHAVIOR cohesion seam (the
|
|
2457
|
+
* play machine's free functions live in `./play-lifecycle`; the state they mutate lives
|
|
2458
|
+
* HERE). A value.js-free leaf struct: it owns the standalone-play machine's OWN
|
|
2459
|
+
* run-state so the state has a SINGLE owner instead of being scattered as
|
|
2460
|
+
* privates the class re-published through a cast (R.W2 dissolved the
|
|
2461
|
+
* `PlaybackHost` privacy-inversion).
|
|
2462
|
+
*
|
|
2463
|
+
* - `resolvePromise` — the standalone-loop deferred resolver (`playRAF`
|
|
2464
|
+
* arms it, `resolvePlay` fires it).
|
|
2465
|
+
* - `_playingPromise` — the held in-flight play promise (`get finished`
|
|
2466
|
+
* exposes it; `play` arms it; the `finally` clears it).
|
|
2467
|
+
* - `_waAnimations` — the live WAAPI compositor animations during a WAAPI
|
|
2468
|
+
* delegation (one per target); cancelled on teardown.
|
|
2469
|
+
* - `_boundFrame` — the frame callback bound ONCE at construction, never
|
|
2470
|
+
* re-bound per loop (the per-loop-closure-free idiom).
|
|
2471
|
+
* - `_interpOut` — the ONE hoisted interp buffer the play loop reuses
|
|
2472
|
+
* every frame (zero-alloc steady state).
|
|
2473
|
+
*
|
|
2474
|
+
* ── S.B2 (C-15) — PlaybackState is the SOLE STORAGE for the run-state FSM.
|
|
2475
|
+
* The eight transition fields (`started`/`done`/`paused`/`reversed`/`iteration`/
|
|
2476
|
+
* `t`/`startTime`/`pausedTime`) fold OFF the `KeyframesAnimation` class body and
|
|
2477
|
+
* live HERE as the single backing store; the class exposes them as accessor
|
|
2478
|
+
* delegates over `this._playback.*` (so the FSM stays a public, externally-written
|
|
2479
|
+
* surface — `group/`, `sequence/`, `ingest/`, `waapi/`, the tests, and the demo's
|
|
2480
|
+
* `contractAnim.t =` writes all keep working through the accessors). The
|
|
2481
|
+
* engine-INTERNAL hot path reads/writes `anim._playback.*` DIRECTLY (one extra
|
|
2482
|
+
* monomorphic load — a shape cost, not an allocation; proof:standalone-zero-alloc
|
|
2483
|
+
* / proof:interp-fastprops stay green). `managed` is deliberately NOT here — it is
|
|
2484
|
+
* loop-OWNERSHIP, not run-state, and never resets in `settle`. The literal
|
|
2485
|
+
* single-WRITER hard fold (a public `seek(ms)` verb + MIGRATION) is a future
|
|
2486
|
+
* BREAKING wave (§8-3), out of S scope.
|
|
2487
|
+
*/
|
|
2488
|
+
declare class PlaybackState {
|
|
2489
|
+
resolvePromise: ((value: void | PromiseLike<void>) => void) | null;
|
|
2490
|
+
_playingPromise: Promise<void> | null;
|
|
2491
|
+
_waAnimations: globalThis.Animation[];
|
|
2492
|
+
readonly _boundFrame: (t: number) => boolean | Promise<boolean>;
|
|
2493
|
+
readonly _interpOut: Record<string, unknown>;
|
|
2494
|
+
startTime: number | undefined;
|
|
2495
|
+
pausedTime: number;
|
|
2496
|
+
t: number;
|
|
2497
|
+
iteration: number;
|
|
2498
|
+
started: boolean;
|
|
2499
|
+
done: boolean;
|
|
2500
|
+
reversed: boolean;
|
|
2501
|
+
paused: boolean;
|
|
2502
|
+
constructor(frameCb: (t: number) => boolean | Promise<boolean>);
|
|
2503
|
+
}
|
|
2504
|
+
|
|
2855
2505
|
/**
|
|
2856
2506
|
* The full preset taxonomy, grouped by intent. Each leaf is one of the
|
|
2857
2507
|
* existing exported factory functions — the taxonomy is a discovery index over
|
|
@@ -2859,44 +2509,44 @@ declare function pinCSS(opts?: {
|
|
|
2859
2509
|
*/
|
|
2860
2510
|
declare const presetTaxonomy: {
|
|
2861
2511
|
readonly enter: {
|
|
2862
|
-
readonly fadeIn: (options?: InputAnimationOptions) => CSSKeyframesAnimation<
|
|
2863
|
-
readonly slideIn: (options?: InputAnimationOptions) => CSSKeyframesAnimation<
|
|
2864
|
-
readonly slideInLeft: (options?: InputAnimationOptions) => CSSKeyframesAnimation<
|
|
2865
|
-
readonly slideInRight: (options?: InputAnimationOptions) => CSSKeyframesAnimation<
|
|
2866
|
-
readonly rotateIn: (options?: InputAnimationOptions) => CSSKeyframesAnimation<
|
|
2867
|
-
readonly blurIn: (options?: InputAnimationOptions) => CSSKeyframesAnimation<
|
|
2868
|
-
readonly springScaleIn: (options?: InputAnimationOptions) => CSSKeyframesAnimation<
|
|
2869
|
-
readonly springSlideIn: (options?: InputAnimationOptions) => CSSKeyframesAnimation<
|
|
2870
|
-
readonly jumpUp: (options?: InputAnimationOptions) => CSSKeyframesAnimation<
|
|
2512
|
+
readonly fadeIn: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
2513
|
+
readonly slideIn: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
2514
|
+
readonly slideInLeft: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
2515
|
+
readonly slideInRight: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
2516
|
+
readonly rotateIn: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
2517
|
+
readonly blurIn: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
2518
|
+
readonly springScaleIn: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
2519
|
+
readonly springSlideIn: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
2520
|
+
readonly jumpUp: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
2871
2521
|
};
|
|
2872
2522
|
readonly exit: {
|
|
2873
|
-
readonly fadeOut: (options?: InputAnimationOptions) => CSSKeyframesAnimation<
|
|
2874
|
-
readonly slideOutLeft: (options?: InputAnimationOptions) => CSSKeyframesAnimation<
|
|
2875
|
-
readonly slideOutRight: (options?: InputAnimationOptions) => CSSKeyframesAnimation<
|
|
2876
|
-
readonly blurOut: (options?: InputAnimationOptions) => CSSKeyframesAnimation<
|
|
2877
|
-
readonly warpLeft: (options?: InputAnimationOptions) => CSSKeyframesAnimation<
|
|
2878
|
-
readonly warpRight: (options?: InputAnimationOptions) => CSSKeyframesAnimation<
|
|
2879
|
-
readonly jumpDown: (options?: InputAnimationOptions) => CSSKeyframesAnimation<
|
|
2523
|
+
readonly fadeOut: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
2524
|
+
readonly slideOutLeft: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
2525
|
+
readonly slideOutRight: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
2526
|
+
readonly blurOut: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
2527
|
+
readonly warpLeft: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
2528
|
+
readonly warpRight: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
2529
|
+
readonly jumpDown: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
2880
2530
|
};
|
|
2881
2531
|
readonly attention: {
|
|
2882
|
-
readonly pulse: (options?: InputAnimationOptions) => CSSKeyframesAnimation<
|
|
2883
|
-
readonly shake: (options?: InputAnimationOptions) => CSSKeyframesAnimation<
|
|
2884
|
-
readonly bounce: (options?: InputAnimationOptions) => CSSKeyframesAnimation<
|
|
2885
|
-
readonly flip: (options?: InputAnimationOptions) => CSSKeyframesAnimation<
|
|
2886
|
-
readonly notificationBounce: (options?: InputAnimationOptions) => CSSKeyframesAnimation<
|
|
2887
|
-
readonly springPop: (options?: InputAnimationOptions) => CSSKeyframesAnimation<
|
|
2888
|
-
readonly springWobble: (options?: InputAnimationOptions) => CSSKeyframesAnimation<
|
|
2532
|
+
readonly pulse: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
2533
|
+
readonly shake: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
2534
|
+
readonly bounce: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
2535
|
+
readonly flip: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
2536
|
+
readonly notificationBounce: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
2537
|
+
readonly springPop: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
2538
|
+
readonly springWobble: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
2889
2539
|
};
|
|
2890
2540
|
readonly loop: {
|
|
2891
|
-
readonly heartbeat: (options?: InputAnimationOptions) => CSSKeyframesAnimation<
|
|
2892
|
-
readonly glow: (options?: InputAnimationOptions) => CSSKeyframesAnimation<
|
|
2893
|
-
readonly spinner: (options?: InputAnimationOptions) => CSSKeyframesAnimation<
|
|
2894
|
-
readonly rainbowText: (options?: InputAnimationOptions) => CSSKeyframesAnimation<
|
|
2895
|
-
readonly skeletonLoading: (options?: InputAnimationOptions) => CSSKeyframesAnimation<
|
|
2896
|
-
readonly gradientBackground: (options?: InputAnimationOptions) => CSSKeyframesAnimation<
|
|
2897
|
-
readonly parallaxScroll: (options?: InputAnimationOptions) => CSSKeyframesAnimation<
|
|
2898
|
-
readonly hover: (options?: InputAnimationOptions) => CSSKeyframesAnimation<
|
|
2899
|
-
readonly typingCursor: (options?: InputAnimationOptions) => CSSKeyframesAnimation<
|
|
2541
|
+
readonly heartbeat: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
2542
|
+
readonly glow: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
2543
|
+
readonly spinner: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
2544
|
+
readonly rainbowText: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
2545
|
+
readonly skeletonLoading: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
2546
|
+
readonly gradientBackground: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
2547
|
+
readonly parallaxScroll: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
2548
|
+
readonly hover: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
2549
|
+
readonly typingCursor: (options?: InputAnimationOptions) => CSSKeyframesAnimation<Vars>;
|
|
2900
2550
|
};
|
|
2901
2551
|
};
|
|
2902
2552
|
|
|
@@ -3183,12 +2833,13 @@ export declare interface ResolvedRange {
|
|
|
3183
2833
|
* `"ease-out-cubic"`, … — or a CSS `cubic-bezier()` literal) to a typed
|
|
3184
2834
|
* {@link Easing}.
|
|
3185
2835
|
*
|
|
3186
|
-
* The lookup rides the dynamic
|
|
3187
|
-
* the value.js-bearing
|
|
3188
|
-
*
|
|
2836
|
+
* The lookup rides the dynamic boundary: `import("./compile/easing-registry")`
|
|
2837
|
+
* loads ONLY the value.js-bearing timing-function registry (R.W1 narrow — not the
|
|
2838
|
+
* full engine chunk; lib-support F7) when a named easing is actually used, so a
|
|
2839
|
+
* light-only consumer that never calls this stays value.js-free.
|
|
3189
2840
|
*
|
|
3190
2841
|
* Fail-explicit: an unresolvable name throws {@link UnknownEasingError};
|
|
3191
|
-
*
|
|
2842
|
+
* a chunk-load failure rethrows with the failing easing named —
|
|
3192
2843
|
* never an unhandled rejection, never a silent identity fallback.
|
|
3193
2844
|
*
|
|
3194
2845
|
* ```ts
|
|
@@ -3210,7 +2861,7 @@ export declare function resolveEasing(name: string): Promise<Easing>;
|
|
|
3210
2861
|
* normalises a STRING of CSS, `resolveLiveKeyframes` normalises the LIVE CSSOM —
|
|
3211
2862
|
* the parser pointed forward at the web the page already ships.
|
|
3212
2863
|
*/
|
|
3213
|
-
declare const resolveLiveKeyframes: <V extends Vars =
|
|
2864
|
+
declare const resolveLiveKeyframes: <V extends Vars = Vars>(source?: Document | ShadowRoot | CSSStyleSheet[] | CSSStyleSheet, options?: IngestOptions) => IngestResult<V>;
|
|
3214
2865
|
|
|
3215
2866
|
/**
|
|
3216
2867
|
* Resolve a parsed `AnimationRangeValue` (or `undefined` → the whole [0,1]
|
|
@@ -3374,23 +3025,41 @@ export declare interface ScrollSceneOptions {
|
|
|
3374
3025
|
/** A `.on(event, cb)` subscriber. Receives the local progress at the crossing. */
|
|
3375
3026
|
export declare type ScrollSceneSubscriber = (progress: number) => void;
|
|
3376
3027
|
|
|
3028
|
+
/**
|
|
3029
|
+
* orchestration/timeline/native.ts — the platform native-timeline feature-detect
|
|
3030
|
+
* (R.W1; lib-light F-9). Split off the JS sampler family (`./index`) by the
|
|
3031
|
+
* consumer seam: `native.ts` is consumed by `waapi/` (the HEAVY native scroll
|
|
3032
|
+
* bridge) while the JS `Timeline` family is the general caller-polled sampler.
|
|
3033
|
+
* Both stay LIGHT (value.js-free — these are DOM globals + an `in`-detect).
|
|
3034
|
+
*/
|
|
3035
|
+
/**
|
|
3036
|
+
* The scroll/view timeline axis — the `block|inline|x|y` keyword set. A LOCAL
|
|
3037
|
+
* structural alias of the DOM lib's ambient `ScrollAxis` global (R.W4b): it is
|
|
3038
|
+
* byte-identical to `lib.dom.d.ts`'s `type ScrollAxis = "block" | "inline" | "x"
|
|
3039
|
+
* | "y"`, but as a NAMED module export it is FOLLOWABLE by the `./engine` subpath
|
|
3040
|
+
* dts roll-up (API Extractor cannot follow a bare ambient-global reference reached
|
|
3041
|
+
* transitively through `ScrollScene` — it throws "Unable to follow symbol for
|
|
3042
|
+
* ScrollAxis"). value.js-free (a string-literal union — these are DOM keywords).
|
|
3043
|
+
*/
|
|
3044
|
+
declare type ScrollTimelineAxis = "block" | "inline" | "x" | "y";
|
|
3045
|
+
|
|
3377
3046
|
/**
|
|
3378
3047
|
* The master-playhead orchestrator. Positions child animations along one clock
|
|
3379
3048
|
* and drives them via `Animation.advanceTo`. See the module docstring for the
|
|
3380
3049
|
* booked name + subsumption decision.
|
|
3381
3050
|
*/
|
|
3382
|
-
export declare class Sequence<V extends Vars =
|
|
3051
|
+
export declare class Sequence<V extends Vars = Vars> implements SequencePlayContext<V> {
|
|
3383
3052
|
/** Resolved segments, in insertion order. */
|
|
3384
3053
|
readonly entries: SequenceEntry<V>[];
|
|
3385
3054
|
/** Named positions on the master clock, registered via {@link label}. */
|
|
3386
|
-
|
|
3055
|
+
readonly labels: Map<string, number>;
|
|
3387
3056
|
/**
|
|
3388
3057
|
* The transport-events bus — the per-event subscriber registry + the
|
|
3389
3058
|
* crossing detector (segment-lifecycle + label straddle). `on(...)` forwards
|
|
3390
|
-
* to `
|
|
3391
|
-
* `./
|
|
3059
|
+
* to `events.subscribe`; the transport's `fireSequenceCrossings` to
|
|
3060
|
+
* `events.fire`. See `./events` for the channel + detector body.
|
|
3392
3061
|
*/
|
|
3393
|
-
|
|
3062
|
+
readonly events: SequenceEventBus<V>;
|
|
3394
3063
|
/**
|
|
3395
3064
|
* The running insertion cursor (ms) — the end of the last-inserted
|
|
3396
3065
|
* segment. Relative `"+="`/`"-="` positions and auto-append (`at` omitted)
|
|
@@ -3398,14 +3067,14 @@ export declare class Sequence<V extends Vars = any> {
|
|
|
3398
3067
|
*/
|
|
3399
3068
|
private cursor;
|
|
3400
3069
|
/** Master clock (ms) of the current playhead. */
|
|
3401
|
-
|
|
3402
|
-
|
|
3070
|
+
_time: number;
|
|
3071
|
+
/* Excluded from this release type: respectReducedMotion */
|
|
3403
3072
|
/** THE rAF owner for the sequence's play loop. */
|
|
3404
3073
|
readonly playback: RAFPlayback;
|
|
3405
|
-
|
|
3406
|
-
|
|
3407
|
-
|
|
3408
|
-
|
|
3074
|
+
/* Excluded from this release type: _boundFrame */
|
|
3075
|
+
_resolvePlay: (() => void) | null;
|
|
3076
|
+
_playOrigin: number | undefined;
|
|
3077
|
+
/* Excluded from this release type: _playingPromise */
|
|
3409
3078
|
/**
|
|
3410
3079
|
* The scalar playback rate — the single field that drives `timeScale`
|
|
3411
3080
|
* and `reverse`. `_rate = 1` is real-time forward (the existing
|
|
@@ -3414,21 +3083,21 @@ export declare class Sequence<V extends Vars = any> {
|
|
|
3414
3083
|
* backward (`reverse`). It scales the master clock in {@link _frame}:
|
|
3415
3084
|
* `masterClock = (clock − _playOrigin) * _rate`.
|
|
3416
3085
|
*/
|
|
3417
|
-
|
|
3086
|
+
_rate: number;
|
|
3418
3087
|
/**
|
|
3419
3088
|
* How many master-clock cycles `play()` runs before settling. `1` is the
|
|
3420
3089
|
* existing single-play; `Infinity` never settles (the loop case);
|
|
3421
3090
|
* `n` runs `n` cycles. The master clock folds modulo `duration`
|
|
3422
3091
|
* (see {@link _fold}).
|
|
3423
3092
|
*/
|
|
3424
|
-
|
|
3093
|
+
_repeatCount: number;
|
|
3425
3094
|
/**
|
|
3426
3095
|
* When true, odd cycles reflect the folded phase (`duration − phase`) —
|
|
3427
3096
|
* the GSAP `yoyo` ping-pong. Default off (every cycle runs forward).
|
|
3428
3097
|
*/
|
|
3429
|
-
|
|
3098
|
+
_yoyoOn: boolean;
|
|
3430
3099
|
/** Whether `pause()` has halted the loop with the playhead retained. */
|
|
3431
|
-
|
|
3100
|
+
_paused: boolean;
|
|
3432
3101
|
/**
|
|
3433
3102
|
* The loop's last rAF timestamp — the re-anchor reference. The
|
|
3434
3103
|
* `RAFPlayback`/`AnimationGroup` managed-pause records the loop's LAST rAF
|
|
@@ -3436,7 +3105,7 @@ export declare class Sequence<V extends Vars = any> {
|
|
|
3436
3105
|
* the SAME clock the loop reads, with no forward jump. `Sequence` records
|
|
3437
3106
|
* it here per frame (the driver does not expose it) for that one re-anchor.
|
|
3438
3107
|
*/
|
|
3439
|
-
|
|
3108
|
+
_lastClock: number | undefined;
|
|
3440
3109
|
constructor(options?: SequenceOptions);
|
|
3441
3110
|
/** The full span of the sequence (ms): the latest segment end. */
|
|
3442
3111
|
get duration(): number;
|
|
@@ -3480,16 +3149,6 @@ export declare class Sequence<V extends Vars = any> {
|
|
|
3480
3149
|
* Chainable.
|
|
3481
3150
|
*/
|
|
3482
3151
|
add(animation: KeyframesAnimation<V>, at?: SequencePosition): this;
|
|
3483
|
-
/**
|
|
3484
|
-
* Resolve a {@link SequencePosition} to an absolute ms offset.
|
|
3485
|
-
*
|
|
3486
|
-
* - omitted → the running cursor (auto-append after the previous segment).
|
|
3487
|
-
* - `number` → itself.
|
|
3488
|
-
* - `"+=n"` / `"-=n"` → cursor ± n.
|
|
3489
|
-
* - any other string → the registered label (throws if unknown — labels
|
|
3490
|
-
* are an explicit contract, a typo is a bug, not a silent 0).
|
|
3491
|
-
*/
|
|
3492
|
-
private resolvePosition;
|
|
3493
3152
|
/**
|
|
3494
3153
|
* Map the master playhead to each child's LOCAL clock and paint it. This is
|
|
3495
3154
|
* the synchronous scrub form: for every segment, the local clock is
|
|
@@ -3499,57 +3158,12 @@ export declare class Sequence<V extends Vars = any> {
|
|
|
3499
3158
|
* Chainable.
|
|
3500
3159
|
*/
|
|
3501
3160
|
seek(masterClock: number): this;
|
|
3502
|
-
/**
|
|
3503
|
-
* THE master-playhead → child-clock map, applied as a pure synchronous
|
|
3504
|
-
* scrub. For every segment the local clock is `clamp(masterClock − at, 0,
|
|
3505
|
-
* duration)`, painted via `interpFrames(local, true)`. This is the ONE map
|
|
3506
|
-
* both `seek` (the public scrub) and `_frame` (the rAF play loop) drive —
|
|
3507
|
-
* so play is pixel-identical to seek BY CONSTRUCTION, forward AND reverse
|
|
3508
|
-
* (the C⁰-continuity the F.W9 parity gate locks). It carries no `onEnd`/
|
|
3509
|
-
* `startTime` machinery, so re-entering a finished segment under a negative
|
|
3510
|
-
* `rate` paints the same final-frame value `seek` would — there is no
|
|
3511
|
-
* forward-monotone re-anchor window to break (F.W9 §S3 MEASURE-FIRST).
|
|
3512
|
-
*/
|
|
3513
|
-
private _applyAt;
|
|
3514
|
-
/**
|
|
3515
|
-
* Detect and fire segment-lifecycle + label crossings between the previous
|
|
3516
|
-
* painted phase and `phase` — the ONE detector both `seek` (scrub) and
|
|
3517
|
-
* `_frame` (the rAF play loop) drive, so play fires the identical crossings a
|
|
3518
|
-
* scrub would. The detector + the per-event subscriber state live on the
|
|
3519
|
-
* `_events` bus (`./sequence-events`); this thin wrapper threads the segments
|
|
3520
|
-
* and labels the bus reads. The bus updates its own `_prevPhase` on EVERY
|
|
3521
|
-
* call (even the early-exit) so a subscriber registered mid-transport
|
|
3522
|
-
* straddles from the true prior playhead.
|
|
3523
|
-
*/
|
|
3524
|
-
private _fireCrossings;
|
|
3525
|
-
/**
|
|
3526
|
-
* Fold a raw, repeat-extended master clock down to an effective phase in
|
|
3527
|
-
* `[0, duration]` per the `repeat`/`yoyo` transport. With `repeat(1)` +
|
|
3528
|
-
* `yoyo(false)` (the defaults) this is the identity on `[0, duration]`
|
|
3529
|
-
* (the existing single-play). For `repeat`, the phase is `raw mod
|
|
3530
|
-
* duration`; for `yoyo`, odd cycles reflect (`duration − phase`) so the
|
|
3531
|
-
* playhead ping-pongs. The terminal clock of the LAST cycle resolves to
|
|
3532
|
-
* the rest phase (`duration` forward, `0` reflected) rather than wrapping
|
|
3533
|
-
* to `0` — so a settled `repeat`/`yoyo` run lands on its true end frame.
|
|
3534
|
-
*/
|
|
3535
|
-
private _fold;
|
|
3536
3161
|
/**
|
|
3537
3162
|
* Set targets on every child segment. Convenience for the common case
|
|
3538
3163
|
* where one target receives the whole sequence; per-segment targets can be
|
|
3539
3164
|
* set on each `animation` directly before `.add`. Chainable.
|
|
3540
3165
|
*/
|
|
3541
3166
|
setTargets(...targets: HTMLElement[]): this;
|
|
3542
|
-
/**
|
|
3543
|
-
* Drive the sequence over real time via `RAFPlayback`. Each child is driven
|
|
3544
|
-
* through the published `Animation.advanceTo(absoluteClock)` map: its
|
|
3545
|
-
* `startTime` is seeded to its resolved `at`, so `advanceTo(masterClock)`
|
|
3546
|
-
* yields the child's local clock as `masterClock − at` exactly. Resolves
|
|
3547
|
-
* when the master playhead passes the sequence `duration`.
|
|
3548
|
-
*
|
|
3549
|
-
* Re-entrant: a `play()` while one is in flight returns the same promise.
|
|
3550
|
-
* Under `respectReducedMotion` + an active query, snaps to the rest frame
|
|
3551
|
-
* in one paint (a terminal `seek(duration)`), no draw loop.
|
|
3552
|
-
*/
|
|
3553
3167
|
/**
|
|
3554
3168
|
* The completion front-door (G.W13) — `await sequence.finished` resolves
|
|
3555
3169
|
* once the in-flight transport settles. Exposes the ONE held
|
|
@@ -3559,79 +3173,34 @@ export declare class Sequence<V extends Vars = any> {
|
|
|
3559
3173
|
* sequence resolves immediately.
|
|
3560
3174
|
*/
|
|
3561
3175
|
get finished(): Promise<void>;
|
|
3176
|
+
/** Drive the sequence over real time via `RAFPlayback` — re-entrant, and
|
|
3177
|
+
* PRM-aware. Body in `./lifecycle` (S.B5). */
|
|
3562
3178
|
play(): Promise<void>;
|
|
3563
|
-
|
|
3564
|
-
/**
|
|
3565
|
-
*
|
|
3566
|
-
* cycle, no yoyo. The event-dispatch path runs ONLY here, so an existing
|
|
3567
|
-
* caller's `play()` fires the same `animationstart`/`animationend` it
|
|
3568
|
-
* always did; any transport modifier opts into the scrub-paint authority.
|
|
3569
|
-
*/
|
|
3570
|
-
private _isForwardMonotone;
|
|
3571
|
-
/**
|
|
3572
|
-
* The terminal rest phase of a `repeat`/`yoyo` run — where the playhead
|
|
3573
|
-
* lands when the final cycle closes. A forward run rests at `duration`;
|
|
3574
|
-
* an odd-cycle yoyo run that closes reflected rests at `0`. Mirrors the
|
|
3575
|
-
* boundary `_fold` resolves at the terminal clock.
|
|
3576
|
-
*/
|
|
3577
|
-
private _restPhase;
|
|
3578
|
-
/**
|
|
3579
|
-
* Re-anchor `_playOrigin` against the loop's last rAF timestamp so the
|
|
3580
|
-
* master clock is CONTINUOUS across a transport edit — the
|
|
3581
|
-
* `RAFPlayback`/`AnimationGroup` managed-pause re-anchor (no forward jump).
|
|
3582
|
-
* The invariant restored: `(clock − _playOrigin) * rate === _time` at the
|
|
3583
|
-
* edit instant. Solving for the origin: `_playOrigin = clock − _time /
|
|
3584
|
-
* rate`. With `rate = 0` the playhead is frozen, so the origin collapses
|
|
3585
|
-
* to the bare timestamp (the next non-zero rate re-anchors again).
|
|
3586
|
-
*/
|
|
3587
|
-
private _reanchor;
|
|
3588
|
-
/** Release every child back to standalone ownership and clear play flags. */
|
|
3589
|
-
private _settle;
|
|
3590
|
-
/** Halt the play loop where it stands and resolve any pending `play()`. */
|
|
3179
|
+
_frame(clock: number): Promise<boolean>;
|
|
3180
|
+
/** Halt the play loop where it stands and resolve any pending `play()`.
|
|
3181
|
+
* Body in `./lifecycle` (S.B5). */
|
|
3591
3182
|
stop(): this;
|
|
3592
|
-
/**
|
|
3593
|
-
*
|
|
3594
|
-
*
|
|
3595
|
-
* are RETAINED (children stay `managed`, unlike `stop()`/`_settle`), so a
|
|
3596
|
-
* later {@link resume} continues from exactly here. No-op when not playing
|
|
3597
|
-
* or already paused. Chainable.
|
|
3598
|
-
*/
|
|
3183
|
+
/** Halt the play loop WITHOUT releasing the playhead — the managed-pause
|
|
3184
|
+
* contract (`_time` + the play promise are retained for `resume`). No-op when
|
|
3185
|
+
* not playing or already paused. Body in `./lifecycle` (S.B5). */
|
|
3599
3186
|
pause(): this;
|
|
3600
|
-
/**
|
|
3601
|
-
*
|
|
3602
|
-
*
|
|
3603
|
-
* retained `_time` (the no-forward-jump re-anchor, the same `RAFPlayback`/
|
|
3604
|
-
* `AnimationGroup` managed-pause contract — `src/animation/CLAUDE.md`
|
|
3605
|
-
* §Managed-child lifecycle). No-op when not paused. Chainable.
|
|
3606
|
-
*/
|
|
3187
|
+
/** Resume a paused sequence — restart the rAF loop with the origin
|
|
3188
|
+
* re-anchored so the first resumed frame's master clock equals the retained
|
|
3189
|
+
* `_time` (no forward jump). No-op when not paused. Body in `./lifecycle`. */
|
|
3607
3190
|
resume(): this;
|
|
3608
|
-
/**
|
|
3609
|
-
*
|
|
3610
|
-
*
|
|
3611
|
-
*
|
|
3612
|
-
* rate-change instant (no jump) — the same re-anchor as {@link resume}.
|
|
3613
|
-
* Takes effect immediately whether or not the sequence is playing.
|
|
3614
|
-
* Chainable.
|
|
3615
|
-
*/
|
|
3191
|
+
/** Set the scalar playback rate — slow-mo (`< 1`), real-time (`1`),
|
|
3192
|
+
* fast-forward (`> 1`), or backward (`< 0`, the {@link reverse} form); the
|
|
3193
|
+
* master clock is re-anchored so the playhead is C⁰-continuous at the flip.
|
|
3194
|
+
* Body in `./lifecycle` (S.B5). */
|
|
3616
3195
|
timeScale(n: number): this;
|
|
3617
|
-
/**
|
|
3618
|
-
*
|
|
3619
|
-
* stands (a negative rate) or forward again, preserving `|rate|`. C⁰-
|
|
3620
|
-
* continuous: the re-anchor keeps the playhead exactly where it is at the
|
|
3621
|
-
* flip instant (locked by the F.W9 seek↔play parity gate). Chainable.
|
|
3622
|
-
*/
|
|
3196
|
+
/** Flip the playback direction — the playhead walks backward (negative rate)
|
|
3197
|
+
* or forward again, preserving `|rate|`, C⁰-continuous. Body in `./lifecycle`. */
|
|
3623
3198
|
reverse(): this;
|
|
3624
|
-
/**
|
|
3625
|
-
*
|
|
3626
|
-
* `n` runs `n` cycles, `Infinity` loops forever (until `stop()`). The
|
|
3627
|
-
* master clock folds modulo `duration` per cycle. Chainable.
|
|
3628
|
-
*/
|
|
3199
|
+
/** Set how many cycles `play()` runs before settling — `1` single-play, `n`
|
|
3200
|
+
* cycles, `Infinity` loops forever. Body in `./lifecycle` (S.B5). */
|
|
3629
3201
|
repeat(count: number): this;
|
|
3630
|
-
/**
|
|
3631
|
-
*
|
|
3632
|
-
* (`duration − phase`) so the playhead bounces back and forth across the
|
|
3633
|
-
* `repeat` cycles. Chainable.
|
|
3634
|
-
*/
|
|
3202
|
+
/** Toggle yoyo (ping-pong) — odd cycles run reflected across the `repeat`
|
|
3203
|
+
* cycles. Body in `./lifecycle` (S.B5). */
|
|
3635
3204
|
yoyo(on?: boolean): this;
|
|
3636
3205
|
}
|
|
3637
3206
|
|
|
@@ -3662,6 +3231,58 @@ export declare interface SequenceEntry<V extends Vars> {
|
|
|
3662
3231
|
*/
|
|
3663
3232
|
export declare type SequenceEvent = "segment:enter" | "segment:leave" | "label";
|
|
3664
3233
|
|
|
3234
|
+
/**
|
|
3235
|
+
* The Sequence transport-events BUS — the per-event subscriber registry + the
|
|
3236
|
+
* crossing DETECTOR, owned beside `Sequence` (`sequence.ts`). `Sequence`
|
|
3237
|
+
* constructs ONE bus and forwards `.on(...)` to {@link subscribe} and every
|
|
3238
|
+
* paint to {@link fire}; the three event fields (`subscribers`,
|
|
3239
|
+
* `_activeSegments`, `_prevPhase`) live here, not on the class.
|
|
3240
|
+
*/
|
|
3241
|
+
declare class SequenceEventBus<V extends Vars> {
|
|
3242
|
+
/**
|
|
3243
|
+
* The per-event subscriber sets — the {@link subscribe} channel (three Sets
|
|
3244
|
+
* keyed by {@link SequenceEvent}). Empty by construction; {@link fire}
|
|
3245
|
+
* early-exits while all three stay empty (zero overhead for the common
|
|
3246
|
+
* no-subscriber transport). Mirror of `ScrollScene.subscribers`
|
|
3247
|
+
* (`scroll-scene.ts:360-366`).
|
|
3248
|
+
*/
|
|
3249
|
+
private readonly subscribers;
|
|
3250
|
+
/**
|
|
3251
|
+
* The `segment:enter`/`segment:leave` edge memory: the segments whose
|
|
3252
|
+
* `[at, at + duration)` span held the PREVIOUS painted phase. A segment in
|
|
3253
|
+
* the current active set but not here ENTERED; one here but not in the
|
|
3254
|
+
* current set LEFT. Maintained only while a segment subscriber is registered
|
|
3255
|
+
* (the detector early-exits otherwise).
|
|
3256
|
+
*/
|
|
3257
|
+
private readonly _activeSegments;
|
|
3258
|
+
/**
|
|
3259
|
+
* The previous painted phase (ms) — the `from` end of every crossing
|
|
3260
|
+
* straddle (`label`, and the directional `segment` edges). `undefined`
|
|
3261
|
+
* before the first paint; updated on EVERY {@link fire} so a subscriber
|
|
3262
|
+
* registered mid-transport straddles from the true prior playhead (not a
|
|
3263
|
+
* stale or zeroed origin).
|
|
3264
|
+
*/
|
|
3265
|
+
private _prevPhase;
|
|
3266
|
+
/**
|
|
3267
|
+
* Register a subscriber for `event`; returns an unsubscribe handle — the
|
|
3268
|
+
* `ScrollScene.on` idiom (`scroll-scene.ts:506-514`). The class's overloaded
|
|
3269
|
+
* `on(...)` forwards here.
|
|
3270
|
+
*/
|
|
3271
|
+
subscribe(event: SequenceEvent, cb: SequenceSubscriber): () => void;
|
|
3272
|
+
/**
|
|
3273
|
+
* Detect and fire segment-lifecycle + label crossings between the previous
|
|
3274
|
+
* painted phase (`_prevPhase`) and `phase` — the ONE detector both `seek`
|
|
3275
|
+
* (scrub) and `_frame` (the rAF play loop) drive, so play fires the identical
|
|
3276
|
+
* crossings a scrub would. Mirror of `ScrollScene.fire` (`scroll-scene.ts:513`).
|
|
3277
|
+
*
|
|
3278
|
+
* `_prevPhase` is updated on EVERY call (even the early-exit) so a subscriber
|
|
3279
|
+
* registered mid-transport straddles from the true prior playhead. The firing
|
|
3280
|
+
* loops run ONLY while at least one subscriber set is non-empty — the
|
|
3281
|
+
* zero-overhead path for the common no-subscriber transport.
|
|
3282
|
+
*/
|
|
3283
|
+
fire(entries: readonly SequenceEntry<V>[], labels: ReadonlyMap<string, number>, phase: number): void;
|
|
3284
|
+
}
|
|
3285
|
+
|
|
3665
3286
|
/**
|
|
3666
3287
|
* A `label` subscriber. Receives the crossed label's `name` and the
|
|
3667
3288
|
* master-clock position (ms) at the crossing.
|
|
@@ -3678,6 +3299,28 @@ export declare interface SequenceOptions {
|
|
|
3678
3299
|
respectReducedMotion?: boolean;
|
|
3679
3300
|
}
|
|
3680
3301
|
|
|
3302
|
+
/**
|
|
3303
|
+
* The play-machine view the rAF-loop driver reads + writes. `Sequence` IS this
|
|
3304
|
+
* shape (its fields), so the loop body lives here without copying state — the
|
|
3305
|
+
* class's `_frame`/`_settle` are thin delegates that pass `this`. Keeping the
|
|
3306
|
+
* fields on `Sequence` preserves the seek↔play parity test's direct reaches
|
|
3307
|
+
* (`seq._time` / `seq._rate` / `seq._frame(...)`); only the loop BODY moved.
|
|
3308
|
+
*/
|
|
3309
|
+
declare interface SequencePlayContext<V extends Vars> {
|
|
3310
|
+
readonly entries: SequenceEntry<V>[];
|
|
3311
|
+
readonly labels: ReadonlyMap<string, number>;
|
|
3312
|
+
readonly events: SequenceEventBus<V>;
|
|
3313
|
+
readonly duration: number;
|
|
3314
|
+
_time: number;
|
|
3315
|
+
_rate: number;
|
|
3316
|
+
_repeatCount: number;
|
|
3317
|
+
_yoyoOn: boolean;
|
|
3318
|
+
_paused: boolean;
|
|
3319
|
+
_playOrigin: number | undefined;
|
|
3320
|
+
_lastClock: number | undefined;
|
|
3321
|
+
_resolvePlay: (() => void) | null;
|
|
3322
|
+
}
|
|
3323
|
+
|
|
3681
3324
|
/**
|
|
3682
3325
|
* A position on the master clock for a sequence entry.
|
|
3683
3326
|
*
|
|
@@ -3685,7 +3328,7 @@ export declare interface SequenceOptions {
|
|
|
3685
3328
|
* - `` `+=${n}` `` / `` `-=${n}` `` — relative to the running insertion cursor
|
|
3686
3329
|
* (the end of the previously-inserted segment): `"+=200"` starts 200ms after
|
|
3687
3330
|
* the cursor, `"-=200"` overlaps the previous segment by 200ms.
|
|
3688
|
-
* - any other string — a label registered via
|
|
3331
|
+
* - any other string — a label registered via `Sequence.label`.
|
|
3689
3332
|
*/
|
|
3690
3333
|
export declare type SequencePosition = number | `+=${number}` | `-=${number}` | string;
|
|
3691
3334
|
|
|
@@ -3728,12 +3371,8 @@ declare const slideIn: (options?: InputAnimationOptions) => CSSKeyframesAnimatio
|
|
|
3728
3371
|
|
|
3729
3372
|
declare const slideInLeft: (options?: InputAnimationOptions) => CSSKeyframesAnimation< Vars>;
|
|
3730
3373
|
|
|
3731
|
-
declare const slideInLeftKeyframes = "\n0% {\n transform: translateX(-100%);\n opacity: 0;\n}\n100% {\n transform: translateX(0);\n opacity: 1;\n}\n";
|
|
3732
|
-
|
|
3733
3374
|
declare const slideInRight: (options?: InputAnimationOptions) => CSSKeyframesAnimation< Vars>;
|
|
3734
3375
|
|
|
3735
|
-
declare const slideInRightKeyframes = "\n0% {\n transform: translateX(100%);\n opacity: 0;\n}\n100% {\n transform: translateX(0);\n opacity: 1;\n}\n";
|
|
3736
|
-
|
|
3737
3376
|
declare const slideOutLeft: (options?: InputAnimationOptions) => CSSKeyframesAnimation< Vars>;
|
|
3738
3377
|
|
|
3739
3378
|
declare const slideOutRight: (options?: InputAnimationOptions) => CSSKeyframesAnimation< Vars>;
|
|
@@ -3828,8 +3467,165 @@ export declare interface SmoothProgressOptions {
|
|
|
3828
3467
|
/** A `.snap()` snap point — a local progress in [0,1] the scene settles to. */
|
|
3829
3468
|
export declare type SnapPoints = readonly number[];
|
|
3830
3469
|
|
|
3470
|
+
/**
|
|
3471
|
+
* P.W2 — the precomputed SoA fold layout for ONE `add`/`weighted` blend layer.
|
|
3472
|
+
* `carriers[s]`/`incomings[s]` are the stable `ValueUnit<number>` refs the boxed
|
|
3473
|
+
* inner loop would have touched at slot `s` (the carrier is the leaf a lower
|
|
3474
|
+
* layer parked in `_grouped`; the incoming is this layer's `entry.values` leaf —
|
|
3475
|
+
* both alias `frame.flatVars` units whose `.value` `interpFrames` mutates in
|
|
3476
|
+
* place, so the refs are frame-stable). The per-frame fold seeds the composite
|
|
3477
|
+
* buffer from each carrier, applies the layer's op (`+=` for `add`, `lerp(...,w)`
|
|
3478
|
+
* for `weighted`) against the incoming, and writes back — replacing the
|
|
3479
|
+
* per-frame `for..in` + `Array.isArray` + per-element `isNumericUnit` dispatch
|
|
3480
|
+
* with a contiguous numeric loop. The `entry` is carried for the `weighted`
|
|
3481
|
+
* arm's per-LAYER `w = layer.weightSpring?.value ?? layer.weight` read (K.W11
|
|
3482
|
+
* PHYS-C).
|
|
3483
|
+
*/
|
|
3484
|
+
declare interface SoALayerPlan {
|
|
3485
|
+
/**
|
|
3486
|
+
* The layer config — the `weighted` fold re-reads its per-frame `w =
|
|
3487
|
+
* weightSpring?.value ?? weight` LIVE (K.W11 PHYS-C, so a spring still drives
|
|
3488
|
+
* the blend), and the config is generic-independent so the plan holds it
|
|
3489
|
+
* without binding the group's `V`.
|
|
3490
|
+
*/
|
|
3491
|
+
layer: AnimationLayerConfig;
|
|
3492
|
+
weighted: boolean;
|
|
3493
|
+
/** The pure-numeric carrier units the fold seeds the composite buffer from + writes back to. */
|
|
3494
|
+
carriers: ValueUnit<number>[];
|
|
3495
|
+
/** The incoming numeric units folded against each carrier (parallel to `carriers`). */
|
|
3496
|
+
incomings: ValueUnit<number>[];
|
|
3497
|
+
/**
|
|
3498
|
+
* The keys this layer touches that the SoA fold does NOT cover — a non-array
|
|
3499
|
+
* carrier (first-touch of a key, or a scalar that a lower layer left
|
|
3500
|
+
* `undefined`), or a leaf with ANY non-numeric / mixed element. These keep
|
|
3501
|
+
* the boxed per-element path (the `Array.isArray` guard + the
|
|
3502
|
+
* `Math.min(existing.length, incoming.length)` element loop), so the
|
|
3503
|
+
* `add`/`weighted` blend stays byte-identical on the non-numeric tail. EMPTY
|
|
3504
|
+
* for the dominant all-numeric transform shape (every leaf a numeric
|
|
3505
|
+
* `ValueUnit[]`), so the whole `for..in` collapses to the SoA fold.
|
|
3506
|
+
*
|
|
3507
|
+
* S.F5a S1 — a precomputed `Set`, built ONCE here at `buildSoAPlans`
|
|
3508
|
+
* (structural-change time). The compositor's boxed residual (`boxedBlendArm`)
|
|
3509
|
+
* takes it DIRECTLY as its `only` membership test — killing the per-frame
|
|
3510
|
+
* `new Set(only)` the boxed arm rebuilt every frame on the mixed-leaf shape
|
|
3511
|
+
* (the allocation is hoisted to plan-build time, `proof:zero-alloc`
|
|
3512
|
+
* mixed-leaf clause).
|
|
3513
|
+
*/
|
|
3514
|
+
boxedKeys: Set<string>;
|
|
3515
|
+
}
|
|
3516
|
+
|
|
3831
3517
|
declare const spinner: (options?: InputAnimationOptions) => CSSKeyframesAnimation< Vars>;
|
|
3832
3518
|
|
|
3519
|
+
/** The split granularity. `"word"`/`"grapheme"` are layout-independent; `"line"`
|
|
3520
|
+
* is measure-or-refuse (SF-10). */
|
|
3521
|
+
export declare type SplitBy = "word" | "grapheme" | "line";
|
|
3522
|
+
|
|
3523
|
+
/**
|
|
3524
|
+
* Split a text element into an animatable fragment cohort + a ready stagger,
|
|
3525
|
+
* a11y-first. See {@link SplitTextOptions} / {@link SplitTextResult}.
|
|
3526
|
+
*
|
|
3527
|
+
* @param el — the text element to split (its `textContent` is the pre-split
|
|
3528
|
+
* string). For `by: "line"` it must be laid out, else the split refuses.
|
|
3529
|
+
* @param options — `{ by, a11y, role, locale, stagger, fragmentClass, onRefuse }`.
|
|
3530
|
+
* @throws {SplitTextRefusalError} `by: "line"` on an unmeasurable container.
|
|
3531
|
+
*/
|
|
3532
|
+
export declare function splitText(el: HTMLElement, options?: SplitTextOptions): SplitTextResult;
|
|
3533
|
+
|
|
3534
|
+
export declare interface SplitTextOptions {
|
|
3535
|
+
/** Granularity — `"word"` (default), `"grapheme"`, or `"line"`. */
|
|
3536
|
+
by?: SplitBy;
|
|
3537
|
+
/**
|
|
3538
|
+
* A11Y-FIRST (default `true`): consolidate the accessible name onto the
|
|
3539
|
+
* container (`aria-label` = the pre-split string, over a naming role) and
|
|
3540
|
+
* mark every fragment `aria-hidden`, so AT reads the whole text as one label.
|
|
3541
|
+
* `false` leaves the split fragments in the a11y tree (opt-out for callers
|
|
3542
|
+
* that own their own AT handling).
|
|
3543
|
+
*/
|
|
3544
|
+
a11y?: boolean;
|
|
3545
|
+
/**
|
|
3546
|
+
* The container role applied under `a11y` **only when the element has no
|
|
3547
|
+
* role of its own** — a plain `<div>`/`<span>` maps to `role="generic"`,
|
|
3548
|
+
* which PROHIBITS an author name, so a bare `aria-label` would not compute.
|
|
3549
|
+
* Defaults to `"img"` (the canonical "graphical composite whose text
|
|
3550
|
+
* alternative is …" role). Pass a naming-capable role to override.
|
|
3551
|
+
*/
|
|
3552
|
+
role?: string;
|
|
3553
|
+
/** Locale for `Intl.Segmenter` (word/grapheme boundaries). */
|
|
3554
|
+
locale?: string;
|
|
3555
|
+
/** Options for the ready {@link StaggerFn} built over the cohort. */
|
|
3556
|
+
stagger?: StaggerOptions;
|
|
3557
|
+
/** Class set on each fragment element. Defaults to `"kf-split"`. */
|
|
3558
|
+
fragmentClass?: string;
|
|
3559
|
+
/**
|
|
3560
|
+
* `by: "line"` only — invoked when a resize-driven RE-measure cannot hold
|
|
3561
|
+
* (the container became unmeasurable or a container-query loop kept the line
|
|
3562
|
+
* map from converging). The observer disconnects and the last good map is
|
|
3563
|
+
* left in place; the caller decides whether to fall back to `by: "word"`.
|
|
3564
|
+
*/
|
|
3565
|
+
onRefuse?: (error: SplitTextRefusalError) => void;
|
|
3566
|
+
}
|
|
3567
|
+
|
|
3568
|
+
/**
|
|
3569
|
+
* Thrown by `splitText(el, { by: "line" })` when the line measurement cannot be
|
|
3570
|
+
* taken (or held) — the typed half of the measure-or-refuse posture. Never
|
|
3571
|
+
* thrown for `by: "word"`/`"grapheme"` (those are layout-independent).
|
|
3572
|
+
*/
|
|
3573
|
+
export declare class SplitTextRefusalError extends Error {
|
|
3574
|
+
readonly name = "SplitTextRefusalError";
|
|
3575
|
+
/** The machine-readable refusal cause. */
|
|
3576
|
+
readonly reason: SplitTextRefusalReason;
|
|
3577
|
+
constructor(reason: SplitTextRefusalReason, detail?: string);
|
|
3578
|
+
}
|
|
3579
|
+
|
|
3580
|
+
/**
|
|
3581
|
+
* The typed REFUSAL for `splitText`'s `by: "line"` measure-or-refuse posture
|
|
3582
|
+
* (SF-10 / S.F2 §S2). A line-split is layout-DEPENDENT: it groups fragments by
|
|
3583
|
+
* their measured `getClientRects` line box. When the container is not laid out
|
|
3584
|
+
* (detached, `display:none`, zero-width), or when a container-query/resize
|
|
3585
|
+
* feedback loop makes the measurement unable to converge, the ONLY honest
|
|
3586
|
+
* outcome is to REFUSE — never to emit a stale line map that silently goes wrong
|
|
3587
|
+
* on the next reflow (the exact failure mode this posture forbids).
|
|
3588
|
+
*
|
|
3589
|
+
* It is a distinct named error (mirroring `AnimationOptionError`) so a caller can
|
|
3590
|
+
* `instanceof`-narrow the refusal and fall back to `by: "word"` (layout-
|
|
3591
|
+
* independent) rather than swallow a generic throw.
|
|
3592
|
+
*/
|
|
3593
|
+
/**
|
|
3594
|
+
* Why a `by: "line"` split refused to produce a line map:
|
|
3595
|
+
*
|
|
3596
|
+
* - `"unmeasurable"` — the container yielded no usable client rects at split
|
|
3597
|
+
* time (detached / `display:none` / zero-area). Lines cannot be grouped
|
|
3598
|
+
* without a laid-out box, and emitting an ungrouped (or all-collapsed) map
|
|
3599
|
+
* would be the silent-stale failure the posture forbids.
|
|
3600
|
+
* - `"unstable"` — a re-measure (driven by the resize observer) could not
|
|
3601
|
+
* hold: the container's own size depends on its content flow (a
|
|
3602
|
+
* container-query / intrinsic-size feedback loop), so the line grouping
|
|
3603
|
+
* oscillates and never converges. Refused rather than latched to a stale map.
|
|
3604
|
+
* - `"empty"` — there is no text to split into lines.
|
|
3605
|
+
*/
|
|
3606
|
+
export declare type SplitTextRefusalReason = "unmeasurable" | "unstable" | "empty";
|
|
3607
|
+
|
|
3608
|
+
export declare interface SplitTextResult {
|
|
3609
|
+
/** The split container (the element passed in). */
|
|
3610
|
+
container: HTMLElement;
|
|
3611
|
+
/** The animatable fragment cohort, in source order. */
|
|
3612
|
+
fragments: HTMLElement[];
|
|
3613
|
+
/** The granularity that produced {@link fragments}. */
|
|
3614
|
+
by: SplitBy;
|
|
3615
|
+
/** The pre-split string — the container's consolidated accessible name. */
|
|
3616
|
+
text: string;
|
|
3617
|
+
/** A ready per-index delay generator over the cohort (the ready stagger). */
|
|
3618
|
+
stagger: StaggerFn;
|
|
3619
|
+
/** The materialized stagger delays, one per fragment (convenience). */
|
|
3620
|
+
delays: number[];
|
|
3621
|
+
/** Restore the container's original markup + a11y attributes. */
|
|
3622
|
+
revert(): void;
|
|
3623
|
+
/** `by: "line"` — re-measure + re-group the lines now (no-op otherwise). */
|
|
3624
|
+
remeasure(): void;
|
|
3625
|
+
/** Tear down the resize observer (does not revert the DOM). */
|
|
3626
|
+
dispose(): void;
|
|
3627
|
+
}
|
|
3628
|
+
|
|
3833
3629
|
/**
|
|
3834
3630
|
* The modern, time-based spring surface — the idiom Motion now leads its
|
|
3835
3631
|
* docs with, treating `(response, dampingFraction)` as the advanced
|
|
@@ -3845,7 +3641,7 @@ declare const spinner: (options?: InputAnimationOptions) => CSSKeyframesAnimatio
|
|
|
3845
3641
|
* (`initial`, `initialVelocity`, thresholds, `respectReducedMotion`)
|
|
3846
3642
|
* carry through unchanged.
|
|
3847
3643
|
*/
|
|
3848
|
-
declare interface SpringDurationOptions extends Partial<Pick<SpringProgressOptions, "initial" | "initialVelocity" | "settleThreshold" | "velocitySettleThreshold" | "respectReducedMotion">> {
|
|
3644
|
+
export declare interface SpringDurationOptions extends Partial<Pick<SpringProgressOptions, "initial" | "initialVelocity" | "settleThreshold" | "velocitySettleThreshold" | "respectReducedMotion">> {
|
|
3849
3645
|
/**
|
|
3850
3646
|
* The perceptual settle duration in seconds — mapped directly onto
|
|
3851
3647
|
* `response`. The designer-facing name for the same quantity.
|
|
@@ -3912,6 +3708,34 @@ export declare interface SpringLinearStopsOptions {
|
|
|
3912
3708
|
maxDuration?: number;
|
|
3913
3709
|
}
|
|
3914
3710
|
|
|
3711
|
+
/**
|
|
3712
|
+
* The managed-playback surface a `SpringProgress` exposes to the colocated
|
|
3713
|
+
* `./managed-play` loop helpers (S.B5 — the progress.ts ceiling carve). Declared
|
|
3714
|
+
* HERE (the spring family's ring-break home) so `managed-play.ts` drives the
|
|
3715
|
+
* spring's rAF loop through a structural contract WITHOUT importing the
|
|
3716
|
+
* `SpringProgress` class module — keeping the progress→managed-play edge
|
|
3717
|
+
* one-directional (no import cycle under `tsPreCompilationDeps`). The stepper is
|
|
3718
|
+
* a `Tickable` (the `RAFPlayback.drive` loop steps `tickDt` until `settled`); the
|
|
3719
|
+
* helpers additionally read its current `(value, velocity)` for the per-frame
|
|
3720
|
+
* callback and route the reduced-motion snap through `snap()`.
|
|
3721
|
+
*/
|
|
3722
|
+
declare interface SpringPlayback extends Tickable {
|
|
3723
|
+
/** THE managed rAF driver the loop rides. */
|
|
3724
|
+
readonly _playback: RAFPlayback;
|
|
3725
|
+
/** The bound per-frame callback (`play` sets it; `stop` clears it). */
|
|
3726
|
+
_onFrame: SpringFrameCallback | undefined;
|
|
3727
|
+
/** True once `dispose()` has torn the spring down (a disposed spring never plays). */
|
|
3728
|
+
readonly disposed: boolean;
|
|
3729
|
+
/** Current position — passed to the per-frame callback. */
|
|
3730
|
+
readonly value: number;
|
|
3731
|
+
/** Current velocity — passed to the per-frame callback. */
|
|
3732
|
+
readonly velocity: number;
|
|
3733
|
+
/** The reduced-motion policy routing `play` to snap vs. run. */
|
|
3734
|
+
readonly respectReducedMotion: ReducedMotionPolicy;
|
|
3735
|
+
/** The reduced-motion snap (jump to target at zero velocity, settle, emit). */
|
|
3736
|
+
snap(): void;
|
|
3737
|
+
}
|
|
3738
|
+
|
|
3915
3739
|
/** Spring-eased attention "pop" — the bouncy spring drives the scale pulse. */
|
|
3916
3740
|
declare const springPop: (options?: InputAnimationOptions) => CSSKeyframesAnimation< Vars>;
|
|
3917
3741
|
|
|
@@ -3933,8 +3757,11 @@ declare const springPop: (options?: InputAnimationOptions) => CSSKeyframesAnimat
|
|
|
3933
3757
|
*
|
|
3934
3758
|
* API mirrors SwiftUI's `.spring(response:dampingFraction:)`.
|
|
3935
3759
|
*/
|
|
3936
|
-
export declare class SpringProgress {
|
|
3760
|
+
export declare class SpringProgress implements SpringPlayback {
|
|
3937
3761
|
private options;
|
|
3762
|
+
/** The reduced-motion policy — read by `./managed-play`'s `springPlay` to
|
|
3763
|
+
* route the snap vs. run branch (the {@link SpringPlayback} contract). */
|
|
3764
|
+
get respectReducedMotion(): ReducedMotionPolicy;
|
|
3938
3765
|
private targetValue;
|
|
3939
3766
|
private currentValue;
|
|
3940
3767
|
private currentVelocity;
|
|
@@ -3961,15 +3788,10 @@ export declare class SpringProgress {
|
|
|
3961
3788
|
private zeta;
|
|
3962
3789
|
private omegaD;
|
|
3963
3790
|
private subscribers;
|
|
3964
|
-
|
|
3965
|
-
private
|
|
3966
|
-
|
|
3967
|
-
|
|
3968
|
-
private vecCurrent;
|
|
3969
|
-
private vecVelocity;
|
|
3970
|
-
private vecElapsed;
|
|
3971
|
-
private _playback;
|
|
3972
|
-
private _onFrame;
|
|
3791
|
+
/* Excluded from this release type: disposed */
|
|
3792
|
+
private vectorLanes;
|
|
3793
|
+
readonly _playback: RAFPlayback;
|
|
3794
|
+
/* Excluded from this release type: _onFrame */
|
|
3973
3795
|
constructor(options?: Partial<SpringProgressOptions>);
|
|
3974
3796
|
/**
|
|
3975
3797
|
* Construct a spring from the modern time-based surface
|
|
@@ -4068,11 +3890,12 @@ export declare class SpringProgress {
|
|
|
4068
3890
|
get velocities(): Float64Array;
|
|
4069
3891
|
/**
|
|
4070
3892
|
* Advance EVERY lane by `dt` MILLISECONDS — one call, K channels, one buffer
|
|
4071
|
-
* write
|
|
4072
|
-
*
|
|
4073
|
-
* (`exp`/`cos`/`sin`)
|
|
4074
|
-
* amortization the W122 probe measured. No-op
|
|
4075
|
-
* before the first {@link setTargets}, when
|
|
3893
|
+
* write, delegated to the SoA {@link SpringVectorLanes} under this spring's
|
|
3894
|
+
* `(omega, zeta, omegaD)`. The analytic per-channel step is the same closed
|
|
3895
|
+
* form `evaluateAt` uses, with the transcendentals (`exp`/`cos`/`sin`)
|
|
3896
|
+
* hoisted once per tick — the amortization the W122 probe measured. No-op
|
|
3897
|
+
* (returns the same buffer) before the first {@link setTargets}, when
|
|
3898
|
+
* disposed, or for `dt <= 0`.
|
|
4076
3899
|
*/
|
|
4077
3900
|
tickVector(dt: number): Float64Array;
|
|
4078
3901
|
/**
|
|
@@ -4085,21 +3908,15 @@ export declare class SpringProgress {
|
|
|
4085
3908
|
/** Tear down the spring. Cancels the rAF loop and clears subscribers. */
|
|
4086
3909
|
dispose(): void;
|
|
4087
3910
|
/**
|
|
4088
|
-
* Start a managed rAF loop that calls `
|
|
4089
|
-
* `settled`, invoking `onFrame(value, velocity)` per tick. Idempotent
|
|
4090
|
-
*
|
|
4091
|
-
*
|
|
4092
|
-
* is bound auto-resumes the loop without needing another `.play()`.
|
|
3911
|
+
* Start a managed rAF loop that calls `tickDt(dt)` each frame until
|
|
3912
|
+
* `settled`, invoking `onFrame(value, velocity)` per tick. Idempotent;
|
|
3913
|
+
* PRM-aware (snaps under an active reduced-motion query). Body in
|
|
3914
|
+
* `./managed-play` (S.B5).
|
|
4093
3915
|
*/
|
|
4094
3916
|
play(onFrame?: SpringFrameCallback): void;
|
|
4095
|
-
/** Cancel the managed rAF loop and detach the per-frame callback.
|
|
3917
|
+
/** Cancel the managed rAF loop and detach the per-frame callback. Body in
|
|
3918
|
+
* `./managed-play` (S.B5). */
|
|
4096
3919
|
stop(): void;
|
|
4097
|
-
/**
|
|
4098
|
-
* Arm the shared driver: it steps `tickDt(dt)` once per frame until
|
|
4099
|
-
* `settled` flips true, emitting `onFrame` per step. Idempotent —
|
|
4100
|
-
* the driver no-ops while already running.
|
|
4101
|
-
*/
|
|
4102
|
-
private _startLoop;
|
|
4103
3920
|
}
|
|
4104
3921
|
|
|
4105
3922
|
/**
|
|
@@ -4243,14 +4060,20 @@ declare const springWobble: (options?: InputAnimationOptions) => CSSKeyframesAni
|
|
|
4243
4060
|
export declare function stagger(countOrItems: number | ArrayLike<unknown>, options?: StaggerOptions): StaggerFn;
|
|
4244
4061
|
|
|
4245
4062
|
/**
|
|
4246
|
-
* A per-index delay function: `(i, total) => delayMs`. Carries a
|
|
4247
|
-
* `.delays(total)` helper that materializes the whole distribution as an
|
|
4248
|
-
* array — convenient when the count is known up front.
|
|
4063
|
+
* A per-index delay function: `(i, total?) => delayMs`. Carries a
|
|
4064
|
+
* `.delays(total?)` helper that materializes the whole distribution as an
|
|
4065
|
+
* array — convenient when the count is known up front. Both `total` args are
|
|
4066
|
+
* OPTIONAL: the implementation defaults them to the construction-time count
|
|
4067
|
+
* (`stagger(items, …)` / `stagger(count, …)`), so `fn(i)` and `fn.delays()`
|
|
4068
|
+
* are valid — the type must mirror that (it did not before S.B7, which is why
|
|
4069
|
+
* `test/stagger.test.ts`'s defaulting assertions RED'd once `test/` joined the
|
|
4070
|
+
* typecheck).
|
|
4249
4071
|
*/
|
|
4250
4072
|
export declare interface StaggerFn {
|
|
4251
|
-
(index: number, total
|
|
4252
|
-
/** Materialize the delays for a run of `total` indices
|
|
4253
|
-
|
|
4073
|
+
(index: number, total?: number): number;
|
|
4074
|
+
/** Materialize the delays for a run of `total` indices (defaults to the
|
|
4075
|
+
* construction-time count). */
|
|
4076
|
+
delays(total?: number): number[];
|
|
4254
4077
|
}
|
|
4255
4078
|
|
|
4256
4079
|
export declare interface StaggerOptions {
|
|
@@ -4284,6 +4107,32 @@ export declare interface StaggerOptions {
|
|
|
4284
4107
|
*/
|
|
4285
4108
|
export declare type StaggerOrigin = "first" | "last" | "center" | "edges" | number;
|
|
4286
4109
|
|
|
4110
|
+
/**
|
|
4111
|
+
* Feature-detect native `animation-trigger` — Chrome 145+ ships it; nothing else
|
|
4112
|
+
* (yet) does. `CSS.supports` is the FEATURE probe (never a UA sniff — r5 / the
|
|
4113
|
+
* CE-1.0 precedent). Returns `false` where `CSS`/`CSS.supports` is absent (SSR,
|
|
4114
|
+
* jsdom) OR the property/keyword is unknown, so the caller keeps the kf driver.
|
|
4115
|
+
*/
|
|
4116
|
+
declare function supportsNativeTrigger(): boolean;
|
|
4117
|
+
|
|
4118
|
+
declare abstract class SVGAnimationHandle<V extends Vars = Vars> {
|
|
4119
|
+
readonly animation: CSSKeyframesAnimation<V>;
|
|
4120
|
+
/**
|
|
4121
|
+
* The underlying animation — the control handle. Set by the subclass through
|
|
4122
|
+
* `super(fromX(...))` (the `fromX` factory is the canonical construction).
|
|
4123
|
+
*/
|
|
4124
|
+
constructor(animation: CSSKeyframesAnimation<V>);
|
|
4125
|
+
/** Start (or re-enter) the play loop. Resolves when the animation completes. */
|
|
4126
|
+
play(): Promise<void>;
|
|
4127
|
+
/** Pause the play loop, retaining the playhead. Chainable. */
|
|
4128
|
+
pause(): this;
|
|
4129
|
+
/** Halt and rewind the play loop. Chainable. */
|
|
4130
|
+
stop(): this;
|
|
4131
|
+
/** Resolve once the animation completes — the {@link Animation.finished}
|
|
4132
|
+
* completion front-door, uniform across every SVG handle. */
|
|
4133
|
+
get finished(): Promise<void>;
|
|
4134
|
+
}
|
|
4135
|
+
|
|
4287
4136
|
/**
|
|
4288
4137
|
* The minimal geometry contract DrawSVG needs: any SVG element that exposes
|
|
4289
4138
|
* `getTotalLength()` (`SVGGeometryElement` — `<path>`, `<line>`, `<circle>`,
|
|
@@ -4315,6 +4164,32 @@ export declare interface TemplateAnimationFrame<V extends Vars> {
|
|
|
4315
4164
|
|
|
4316
4165
|
declare const textFocusBlur: (options?: InputAnimationOptions) => CSSKeyframesAnimation< Vars>;
|
|
4317
4166
|
|
|
4167
|
+
/**
|
|
4168
|
+
* The layout-INDEPENDENT segmenters for `splitText` — `by: "word"` and
|
|
4169
|
+
* `by: "grapheme"` (S.F2 §S2). Both ride the platform `Intl.Segmenter` (the SOTA
|
|
4170
|
+
* bar GSAP's 2025 rewrite set: grapheme-correct splitting handles emoji,
|
|
4171
|
+
* combining marks, and ZWJ sequences that a naive `text.split("")` shreds into
|
|
4172
|
+
* mojibake). A conservative regex fallback covers the (rare) no-`Intl.Segmenter`
|
|
4173
|
+
* runtime so the primitive never throws on capability alone.
|
|
4174
|
+
*
|
|
4175
|
+
* A segmenter emits an ordered run of {@link TextSegment}s: each is either a
|
|
4176
|
+
* `"unit"` (a word or grapheme — an animatable fragment) or `"space"` (inter-unit
|
|
4177
|
+
* whitespace — kept as a live text node so the browser can still wrap the run at
|
|
4178
|
+
* real break opportunities; the per-glyph inline-blocks otherwise defeat
|
|
4179
|
+
* `text-wrap: balance`, the AnimatedText X-5 lesson). Punctuation rides as its
|
|
4180
|
+
* own `"unit"` under word granularity (`isWordLike === false` but non-blank).
|
|
4181
|
+
*/
|
|
4182
|
+
/** One ordered piece of the source text. */
|
|
4183
|
+
export declare interface TextSegment {
|
|
4184
|
+
/** The literal substring. */
|
|
4185
|
+
text: string;
|
|
4186
|
+
/**
|
|
4187
|
+
* `"unit"` — an animatable fragment (word or grapheme). `"space"` — inter-
|
|
4188
|
+
* unit whitespace, preserved as a text node (not wrapped, not in the cohort).
|
|
4189
|
+
*/
|
|
4190
|
+
kind: "unit" | "space";
|
|
4191
|
+
}
|
|
4192
|
+
|
|
4318
4193
|
/**
|
|
4319
4194
|
* A dt-driven stepper the {@link RAFPlayback.drive} loop can own:
|
|
4320
4195
|
* `SmoothProgress` and `SpringProgress` implement it directly. The driver
|
|
@@ -4376,7 +4251,7 @@ export declare interface TimelineOptions {
|
|
|
4376
4251
|
*
|
|
4377
4252
|
* ```ts
|
|
4378
4253
|
* const easing = await resolveEasing("ease-out-cubic");
|
|
4379
|
-
* new
|
|
4254
|
+
* new KeyframesScrollTimeline({ easing });
|
|
4380
4255
|
* ```
|
|
4381
4256
|
*/
|
|
4382
4257
|
easing?: TimingFunction | Easing | undefined;
|
|
@@ -4413,6 +4288,89 @@ export declare type TransformFunction<V extends Vars> = (v: V, t: number) => voi
|
|
|
4413
4288
|
*/
|
|
4414
4289
|
declare function transformTargetsStyle<V extends Vars>(vars: V, targets: HTMLElement[], flat?: boolean): void;
|
|
4415
4290
|
|
|
4291
|
+
/** The play direction a trigger cycle runs — `alternate` flips it each entry. */
|
|
4292
|
+
declare type TriggerDirection = "forward" | "backward";
|
|
4293
|
+
|
|
4294
|
+
/**
|
|
4295
|
+
* The kf `TriggerScene` — realizes a parsed `AnimationTriggerValue` as the
|
|
4296
|
+
* idle→active→done lifecycle over a raw scroll position. The caller drives the
|
|
4297
|
+
* loop (`triggerProgress(p)` per scroll event); the scene owns no rAF and no
|
|
4298
|
+
* DOM. The four `<trigger-type>`s differ ONLY in their crossing semantics:
|
|
4299
|
+
*
|
|
4300
|
+
* • `once` — fires once. `idle →enter→ active →exit→ done`; `done` LATCHES
|
|
4301
|
+
* (a re-entry never re-fires). The one-shot reveal.
|
|
4302
|
+
* • `repeat` — re-fires. `idle →enter→ active →exit→ idle` (RESET — the exit
|
|
4303
|
+
* returns to the pre-animation state); each re-entry re-plays
|
|
4304
|
+
* forward, `cycles` incrementing. Never permanently `done`.
|
|
4305
|
+
* • `alternate` — re-fires with a FLIPPED direction. `idle →enter→
|
|
4306
|
+
* active(forward) →exit→ done →enter→ active(backward) → …`;
|
|
4307
|
+
* `direction` alternates each entry (the backward semantics).
|
|
4308
|
+
* • `state` — the play state FOLLOWS presence. `inside ⇒ active`,
|
|
4309
|
+
* `outside ⇒ done` (after the first entry) — the playhead is
|
|
4310
|
+
* HELD across the boundary (pause/resume, NOT reset).
|
|
4311
|
+
*
|
|
4312
|
+
* The `playhead` (0..1) is the animation's own progress the consumer writes to
|
|
4313
|
+
* an engine; it advances with the within-range fraction while `active`. The gate
|
|
4314
|
+
* asserts the STATE sequence (scrub-based, C-10 — never a frame/ms threshold).
|
|
4315
|
+
*/
|
|
4316
|
+
declare class TriggerScene {
|
|
4317
|
+
/** The parsed `<trigger-type>` (CSS initial value is `once`). */
|
|
4318
|
+
readonly type: TriggerType;
|
|
4319
|
+
private readonly triggerRange;
|
|
4320
|
+
private _state;
|
|
4321
|
+
private _direction;
|
|
4322
|
+
private _playhead;
|
|
4323
|
+
private _cycles;
|
|
4324
|
+
private wasInside;
|
|
4325
|
+
private everEntered;
|
|
4326
|
+
constructor(trigger?: AnimationTriggerValue);
|
|
4327
|
+
/** The current lifecycle state. */
|
|
4328
|
+
get state(): TriggerState;
|
|
4329
|
+
/** The current play direction (`alternate` flips it each entry). */
|
|
4330
|
+
get direction(): TriggerDirection;
|
|
4331
|
+
/** The animation's own progress (0..1) — the engine-write the driver tracks. */
|
|
4332
|
+
get playhead(): number;
|
|
4333
|
+
/** How many times the trigger has fired (entered `active` from idle/done). */
|
|
4334
|
+
get cycles(): number;
|
|
4335
|
+
/** The resolved [start,end] scroll-extent fractions of the trigger range. */
|
|
4336
|
+
get range(): ResolvedRange;
|
|
4337
|
+
/**
|
|
4338
|
+
* True when the platform will run this trigger NATIVELY (Chrome 145+). The
|
|
4339
|
+
* dispatch is the caller's: `usesNative` ⇒ author a native `animation-trigger`
|
|
4340
|
+
* declaration; else drive THIS scene. Feature-detected, never UA-sniffed.
|
|
4341
|
+
*/
|
|
4342
|
+
get usesNative(): boolean;
|
|
4343
|
+
/**
|
|
4344
|
+
* Drive the trigger from a raw scroll position `p ∈ [0,1]` (the caller
|
|
4345
|
+
* resolves the live scroller; kf maps it over the trigger range). Advances
|
|
4346
|
+
* the idle→active→done state machine per the `<trigger-type>` semantics and
|
|
4347
|
+
* returns the new state.
|
|
4348
|
+
*/
|
|
4349
|
+
triggerProgress(p: number): TriggerState;
|
|
4350
|
+
/** Rewind the lifecycle to `idle` (re-arm a `once`/`state` scene). */
|
|
4351
|
+
reset(): void;
|
|
4352
|
+
/** `once` — fire once, then LATCH `done` (a re-entry never re-fires). */
|
|
4353
|
+
private stepOnce;
|
|
4354
|
+
/** `repeat` — RESET to `idle` on exit; each re-entry re-plays forward. */
|
|
4355
|
+
private stepRepeat;
|
|
4356
|
+
/** `alternate` — exit `done`; each re-entry FLIPS the play direction. */
|
|
4357
|
+
private stepAlternate;
|
|
4358
|
+
/** `state` — play state FOLLOWS presence; the playhead is HELD across exits. */
|
|
4359
|
+
private stepState;
|
|
4360
|
+
private directedPlayhead;
|
|
4361
|
+
}
|
|
4362
|
+
|
|
4363
|
+
/**
|
|
4364
|
+
* The three lifecycle states a `<single-animation-trigger>` traverses:
|
|
4365
|
+
* • `idle` — the timeline has not (yet) triggered the animation.
|
|
4366
|
+
* • `active` — the trigger fired; the animation is playing.
|
|
4367
|
+
* • `done` — the trigger cycle completed (latched for `once`; transient for
|
|
4368
|
+
* the re-firing types).
|
|
4369
|
+
* The canonical `once` lifecycle is `idle → active → done`; the other three
|
|
4370
|
+
* types are variations over the SAME vocabulary (§`triggerProgress`).
|
|
4371
|
+
*/
|
|
4372
|
+
declare type TriggerState = "idle" | "active" | "done";
|
|
4373
|
+
|
|
4416
4374
|
declare const typewriter: (options?: InputAnimationOptions) => CSSKeyframesAnimation< Vars>;
|
|
4417
4375
|
|
|
4418
4376
|
declare const typingCursor: (options?: InputAnimationOptions) => CSSKeyframesAnimation< Vars>;
|
|
@@ -4524,6 +4482,127 @@ export declare interface VelocityProbe {
|
|
|
4524
4482
|
};
|
|
4525
4483
|
}
|
|
4526
4484
|
|
|
4485
|
+
/**
|
|
4486
|
+
* Mutate the DOM behind a View Transition where the platform supports one, else
|
|
4487
|
+
* fall back to a `flipShared` shared-element morph (or a bare immediate
|
|
4488
|
+
* mutation). Returns a normalized {@link ViewTransitionHandle} whose `backend`
|
|
4489
|
+
* is queryable and whose promises never reject.
|
|
4490
|
+
*
|
|
4491
|
+
* @param mutate — the synchronous (or async) DOM mutation the transition captures.
|
|
4492
|
+
* @param opts — `{ types, duration, timingFunction, shared, fallback, respectReducedMotion }`.
|
|
4493
|
+
*/
|
|
4494
|
+
export declare function viewTransition(mutate: ViewTransitionMutate, opts?: ViewTransitionOptions): ViewTransitionHandle;
|
|
4495
|
+
|
|
4496
|
+
/** Options for {@link compileToViewTransition}, extending {@link CompileOptions}. */
|
|
4497
|
+
export declare interface ViewTransitionCompileOptions extends CompileOptions {
|
|
4498
|
+
/** Typed same-doc VT — wraps every rule in `:root:active-view-transition-type(...)`. */
|
|
4499
|
+
types?: readonly string[];
|
|
4500
|
+
/** Prepend the cross-doc `@view-transition { navigation: auto }` preamble (opt-in). */
|
|
4501
|
+
crossDocument?: boolean;
|
|
4502
|
+
/** Append the PRM `animation: none` degrade block (default `true`). */
|
|
4503
|
+
reducedMotion?: boolean;
|
|
4504
|
+
/**
|
|
4505
|
+
* Emit the MANDATORY timing-only group pseudo (default `true`). Turning it
|
|
4506
|
+
* OFF ships the 250ms/ease temporal incoherence p09 observed — exposed only
|
|
4507
|
+
* so the born-RED gate's falsifiability clause can prove the omission REDs.
|
|
4508
|
+
*/
|
|
4509
|
+
emitGroup?: boolean;
|
|
4510
|
+
}
|
|
4511
|
+
|
|
4512
|
+
/**
|
|
4513
|
+
* The normalized transition handle — settles cleanly whether a native View
|
|
4514
|
+
* Transition, a `flipShared` fallback, or a bare immediate mutation ran. Its
|
|
4515
|
+
* promises NEVER reject (a skipped/aborted transition settles), so a consumer's
|
|
4516
|
+
* `await handle.finished` is always safe.
|
|
4517
|
+
*/
|
|
4518
|
+
export declare interface ViewTransitionHandle {
|
|
4519
|
+
/** Resolves once the transition's pseudo-tree is ready to animate (or immediately off-platform). */
|
|
4520
|
+
ready: Promise<void>;
|
|
4521
|
+
/** Resolves when the transition (or fallback) has fully settled. Never rejects. */
|
|
4522
|
+
finished: Promise<void>;
|
|
4523
|
+
/** Resolves once the DOM mutation callback has run. */
|
|
4524
|
+
updateCallbackDone: Promise<void>;
|
|
4525
|
+
/** Skip the running transition to its end state (no-op off-platform). */
|
|
4526
|
+
skip(): void;
|
|
4527
|
+
/**
|
|
4528
|
+
* Which path actually ran — set SYNCHRONOUSLY at dispatch so a caller can
|
|
4529
|
+
* branch immediately: `"view-transition"` (native), `"flip"` (the
|
|
4530
|
+
* `flipShared` fallback), `"immediate"` (bare mutate — no platform, PRM snap,
|
|
4531
|
+
* or `fallback: "none"`).
|
|
4532
|
+
*/
|
|
4533
|
+
backend: "view-transition" | "flip" | "immediate";
|
|
4534
|
+
}
|
|
4535
|
+
|
|
4536
|
+
/** A synchronous DOM mutation the transition captures (may be async). */
|
|
4537
|
+
export declare type ViewTransitionMutate = () => void | Promise<void>;
|
|
4538
|
+
|
|
4539
|
+
/** Options for {@link viewTransition}. */
|
|
4540
|
+
export declare interface ViewTransitionOptions {
|
|
4541
|
+
/**
|
|
4542
|
+
* Typed same-doc View Transitions (`:active-view-transition-type(...)`).
|
|
4543
|
+
* Passed through the platform's typed-`update` object overload where the
|
|
4544
|
+
* browser supports it; DROPPED (the untyped cross-fade) where it does not —
|
|
4545
|
+
* conservative-correct, never a throw.
|
|
4546
|
+
*/
|
|
4547
|
+
types?: readonly string[];
|
|
4548
|
+
/** Fallback play duration (ms) — the `flipShared` pairs. Defaults to `300`. */
|
|
4549
|
+
duration?: number;
|
|
4550
|
+
/**
|
|
4551
|
+
* Fallback easing — a callable {@link TimingFunction} or typed {@link Easing}
|
|
4552
|
+
* (e.g. `springTimingFunction(...)` for a springy fallback).
|
|
4553
|
+
*/
|
|
4554
|
+
timingFunction?: TimingFunction | Easing;
|
|
4555
|
+
/**
|
|
4556
|
+
* The shared-element pairs the `flip` fallback morphs (`[from, to]`). When
|
|
4557
|
+
* the platform has no `startViewTransition`, each `from` morphs onto its
|
|
4558
|
+
* `to`'s rect via `flipShared` — the zero-peer visual-equivalence letter.
|
|
4559
|
+
*/
|
|
4560
|
+
shared?: ReadonlyArray<readonly [HTMLElement, HTMLElement]>;
|
|
4561
|
+
/**
|
|
4562
|
+
* The fallback strategy when View Transitions are unavailable: `"flip"`
|
|
4563
|
+
* (default — run the `shared` pairs; a bare mutate when none are given),
|
|
4564
|
+
* `"none"` (mutate immediately, no motion), or a custom async runner.
|
|
4565
|
+
*/
|
|
4566
|
+
fallback?: "flip" | "none" | ((mutate: ViewTransitionMutate) => Promise<void>);
|
|
4567
|
+
/**
|
|
4568
|
+
* Route through the ONE `withReducedMotion` gate (default `true`): under an
|
|
4569
|
+
* active `prefers-reduced-motion: reduce` the transition SNAPS — `mutate()`
|
|
4570
|
+
* runs directly and the handle settles (`backend: "immediate"`), skipping
|
|
4571
|
+
* `startViewTransition` entirely. The platform's own degrade, WCAG-aligned.
|
|
4572
|
+
*/
|
|
4573
|
+
respectReducedMotion?: boolean;
|
|
4574
|
+
}
|
|
4575
|
+
|
|
4576
|
+
/** A VT refusal — the CC-3 shape widened to the VT reason union. */
|
|
4577
|
+
export declare interface VTCompileRefusal extends Omit<CompileRefusal, "reason"> {
|
|
4578
|
+
reason: VTCompileRefusalReason;
|
|
4579
|
+
}
|
|
4580
|
+
|
|
4581
|
+
/** The four VT refusals atop the inherited CC-3 {@link CompileRefusalReason}. */
|
|
4582
|
+
export declare type VTCompileRefusalReason = CompileRefusalReason | "vt-scroll-grammar" | "vt-element-scoped-computed" | "vt-snapshot-inapplicable" | "vt-name-collision";
|
|
4583
|
+
|
|
4584
|
+
/**
|
|
4585
|
+
* The per-name VT role mapping (SF-1). A group/Sequence has NO old/new axis (the
|
|
4586
|
+
* group-as-primary reading is REJECTED), so the emitter's PRIMARY input is this
|
|
4587
|
+
* name-keyed role spec. `old`/`new` are the same `KeyframesAnimation`s
|
|
4588
|
+
* `compileToCSS` walks; `group` is timing-only by design.
|
|
4589
|
+
*/
|
|
4590
|
+
export declare type VTRoleSpec<V extends Vars = Vars> = {
|
|
4591
|
+
/** The outgoing snapshot's animation (`::view-transition-old(name)`). */
|
|
4592
|
+
old?: KeyframesAnimation<V>;
|
|
4593
|
+
/** The incoming snapshot's animation (`::view-transition-new(name)`). */
|
|
4594
|
+
new?: KeyframesAnimation<V>;
|
|
4595
|
+
/**
|
|
4596
|
+
* Timing-only for the group pseudo: duration + easing onto the UA geometry
|
|
4597
|
+
* morph (NEVER `animation-name`). A `KeyframesAnimation` contributes its
|
|
4598
|
+
* `options.duration`/`timingFunction`; a bare `{ duration, timingFunction }`
|
|
4599
|
+
* gives them directly. Omit → derived from `new ?? old` (the coherent default).
|
|
4600
|
+
*/
|
|
4601
|
+
group?: Pick<AnimationOptions, "duration" | "timingFunction"> | KeyframesAnimation<V>;
|
|
4602
|
+
/** A `view-transition-class` cohort name — uniform cohorts ride one rule. */
|
|
4603
|
+
class?: string;
|
|
4604
|
+
};
|
|
4605
|
+
|
|
4527
4606
|
declare type WAAPIEligibility = {
|
|
4528
4607
|
eligible: true;
|
|
4529
4608
|
} | {
|
|
@@ -4532,34 +4611,12 @@ declare type WAAPIEligibility = {
|
|
|
4532
4611
|
};
|
|
4533
4612
|
|
|
4534
4613
|
/**
|
|
4535
|
-
* Fire-and-forget idle-warmer for the heavy engine
|
|
4536
|
-
*
|
|
4537
|
-
*
|
|
4538
|
-
*
|
|
4539
|
-
*
|
|
4540
|
-
*
|
|
4541
|
-
* `requestIdleCallback`, `visibilitychange`, or `mouseenter` on the app shell:
|
|
4542
|
-
*
|
|
4543
|
-
* ```ts
|
|
4544
|
-
* requestIdleCallback(() => warmEngine());
|
|
4545
|
-
* ```
|
|
4546
|
-
*
|
|
4547
|
-
* Idempotent and value.js-free by construction: it shares the SAME
|
|
4548
|
-
* module-scope `_enginePromise` with `loadAnimationEngine()`, so a
|
|
4549
|
-
* `loadAnimationEngine()` after `warmEngine()` returns the same in-flight
|
|
4550
|
-
* Promise — no double import. It fires a DYNAMIC import only; it names no
|
|
4551
|
-
* static value.js specifier, so `proof:boundary` stays green.
|
|
4552
|
-
*
|
|
4553
|
-
* L.W7 S4 (MEASURE-FIRST — the `scheduler.postTask` adoption is DEFERRED, not
|
|
4554
|
-
* shipped). `scheduler.postTask("background", …)` would be the idiomatic home
|
|
4555
|
-
* for an idle warm, but the `proof:scheduler-posttask` probe only SKIPS in
|
|
4556
|
-
* jsdom (the API is absent there) — it has NOT positively MEASURED that the
|
|
4557
|
-
* `"background"` call does not degrade INP on a real engine. Per the wave's own
|
|
4558
|
-
* measure-first law (and inv ε — no claim without an observed oracle), warmEngine
|
|
4559
|
-
* stays on the PROVEN bare `void loadAnimationEngine()` path. The probe + gate are
|
|
4560
|
-
* ARMED: when a real-browser run (Playwright with `scheduler.postTask`) measures
|
|
4561
|
-
* the background dispatch safe, warmEngine adopts `postTask("background")` then —
|
|
4562
|
-
* a gated future change, not an unmeasured ship today.
|
|
4614
|
+
* Fire-and-forget idle-warmer for the heavy engine. Pre-flights
|
|
4615
|
+
* `loadAnimationEngine()`'s dynamic import during idle (`requestIdleCallback` /
|
|
4616
|
+
* `visibilitychange` / `mouseenter`) so the first `new CSSKeyframesAnimation()`
|
|
4617
|
+
* on a cold page resolves against an already-in-flight Promise. Idempotent and
|
|
4618
|
+
* value.js-free — it shares the one memoized `_enginePromise` (no double import)
|
|
4619
|
+
* and names only a dynamic import (`proof:boundary` stays green).
|
|
4563
4620
|
*/
|
|
4564
4621
|
export declare const warmEngine: () => void;
|
|
4565
4622
|
|