@scntix/animate 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +74 -0
  3. package/_runtime/bundler/scntix_animate_wasm.js +9 -0
  4. package/_runtime/bundler/scntix_animate_wasm_bg.js +5849 -0
  5. package/_runtime/node/scntix_animate_wasm.cjs +5922 -0
  6. package/_runtime/types/bundler.d.ts +1426 -0
  7. package/_runtime/types/node.d.ts +1426 -0
  8. package/_runtime/types/web.d.ts +1890 -0
  9. package/_runtime/wasm/scntix_animate_wasm_bg.wasm +0 -0
  10. package/_runtime/web/scntix_animate_wasm.js +5950 -0
  11. package/cjs/animation.cjs +15 -0
  12. package/cjs/browser.cjs +16 -0
  13. package/cjs/index.cjs +1 -0
  14. package/cjs/input.cjs +14 -0
  15. package/cjs/layout.cjs +10 -0
  16. package/cjs/motion.cjs +13 -0
  17. package/cjs/node.cjs +1 -0
  18. package/cjs/scroll.cjs +10 -0
  19. package/cjs/svg.cjs +9 -0
  20. package/cjs/text.cjs +10 -0
  21. package/cjs/utils.cjs +7 -0
  22. package/esm/animation.js +13 -0
  23. package/esm/browser.js +14 -0
  24. package/esm/bundler.js +1 -0
  25. package/esm/index.js +1 -0
  26. package/esm/input.js +12 -0
  27. package/esm/layout.js +8 -0
  28. package/esm/motion.js +11 -0
  29. package/esm/scroll.js +8 -0
  30. package/esm/svg.js +7 -0
  31. package/esm/text.js +8 -0
  32. package/esm/utils.js +5 -0
  33. package/esm/web.js +2 -0
  34. package/esm-node/animation.js +13 -0
  35. package/esm-node/browser.js +14 -0
  36. package/esm-node/index.js +1 -0
  37. package/esm-node/input.js +12 -0
  38. package/esm-node/layout.js +8 -0
  39. package/esm-node/motion.js +11 -0
  40. package/esm-node/node.js +72 -0
  41. package/esm-node/scroll.js +8 -0
  42. package/esm-node/svg.js +7 -0
  43. package/esm-node/text.js +8 -0
  44. package/esm-node/utils.js +5 -0
  45. package/package.json +149 -0
  46. package/types/animation.d.ts +13 -0
  47. package/types/browser.d.ts +14 -0
  48. package/types/bundler.d.ts +1 -0
  49. package/types/index.d.ts +1 -0
  50. package/types/input.d.ts +12 -0
  51. package/types/layout.d.ts +8 -0
  52. package/types/motion.d.ts +11 -0
  53. package/types/node.d.ts +1 -0
  54. package/types/scroll.d.ts +8 -0
  55. package/types/svg.d.ts +7 -0
  56. package/types/text.d.ts +8 -0
  57. package/types/utils.d.ts +5 -0
  58. package/types/web.d.ts +2 -0
@@ -0,0 +1,1426 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+
4
+ /**
5
+ * Opaque handle returned to JS after `createDrawable`.
6
+ *
7
+ * Wraps the underlying `Element` (already initialised with `pathLength=1000`
8
+ * and an initial `stroke-dasharray`).
9
+ */
10
+ export class DrawableHandle {
11
+ private constructor();
12
+ free(): void;
13
+ [Symbol.dispose](): void;
14
+ /**
15
+ * Apply a normalized draw amount from the start of the path.
16
+ */
17
+ draw(progress: number): void;
18
+ /**
19
+ * Apply a partial normalized draw range `[start, end]`.
20
+ */
21
+ setRange(start: number, end: number): void;
22
+ /**
23
+ * Apply a partial visible draw range from a spec string like `"20% 80%"`.
24
+ */
25
+ setRangeSpec(spec: string): void;
26
+ /**
27
+ * The underlying DOM element (for passing to `animate()`).
28
+ */
29
+ readonly element: Element;
30
+ }
31
+
32
+ export class Easing {
33
+ private constructor();
34
+ free(): void;
35
+ [Symbol.dispose](): void;
36
+ static clearRegistry(): void;
37
+ static customBounce(bounces: number, strength: number): Function;
38
+ static customEase(path: string): Function;
39
+ static easeInBack(t: number): number;
40
+ static easeInBounce(t: number): number;
41
+ static easeInCirc(t: number): number;
42
+ static easeInCubic(t: number): number;
43
+ static easeInElastic(t: number): number;
44
+ static easeInExpo(t: number): number;
45
+ static easeInOutBack(t: number): number;
46
+ static easeInOutBounce(t: number): number;
47
+ static easeInOutCirc(t: number): number;
48
+ static easeInOutCubic(t: number): number;
49
+ static easeInOutElastic(t: number): number;
50
+ static easeInOutExpo(t: number): number;
51
+ static easeInOutQuad(t: number): number;
52
+ static easeInOutQuart(t: number): number;
53
+ static easeInOutQuint(t: number): number;
54
+ static easeInOutSine(t: number): number;
55
+ static easeInQuad(t: number): number;
56
+ static easeInQuart(t: number): number;
57
+ static easeInQuint(t: number): number;
58
+ static easeInSine(t: number): number;
59
+ static easeOutBack(t: number): number;
60
+ static easeOutBounce(t: number): number;
61
+ static easeOutCirc(t: number): number;
62
+ static easeOutCubic(t: number): number;
63
+ static easeOutElastic(t: number): number;
64
+ static easeOutExpo(t: number): number;
65
+ static easeOutInBack(t: number): number;
66
+ static easeOutInBounce(t: number): number;
67
+ static easeOutInCirc(t: number): number;
68
+ static easeOutInCubic(t: number): number;
69
+ static easeOutInElastic(t: number): number;
70
+ static easeOutInExpo(t: number): number;
71
+ static easeOutInQuad(t: number): number;
72
+ static easeOutInQuart(t: number): number;
73
+ static easeOutInQuint(t: number): number;
74
+ static easeOutInSine(t: number): number;
75
+ static easeOutQuad(t: number): number;
76
+ static easeOutQuart(t: number): number;
77
+ static easeOutQuint(t: number): number;
78
+ static easeOutSine(t: number): number;
79
+ static expoScale(start: number, end: number): Function;
80
+ static irregular(steps: number, randomness: number, seed: bigint): Function;
81
+ static linear(t: number): number;
82
+ static register(name: string, easing: any): void;
83
+ static roughEase(steps: number, randomness: number, seed: bigint): Function;
84
+ static slowMo(config: any): Function;
85
+ static unregister(name: string): boolean;
86
+ static wiggle(wiggles: number): Function;
87
+ }
88
+
89
+ /**
90
+ * Returned to JS as `{ translateX, translateY, rotate }`.
91
+ *
92
+ * Each field is a JS object `{ from: 0, to: totalLength, modifier: fn }`.
93
+ * Fields are exposed via getters because `JsValue` is not `Copy`.
94
+ */
95
+ export class MotionPathValues {
96
+ private constructor();
97
+ free(): void;
98
+ [Symbol.dispose](): void;
99
+ readonly rotate: any;
100
+ readonly translateX: any;
101
+ readonly translateY: any;
102
+ }
103
+
104
+ /**
105
+ * SVG path morphing utilities.
106
+ */
107
+ export class PathMorph {
108
+ private constructor();
109
+ free(): void;
110
+ [Symbol.dispose](): void;
111
+ /**
112
+ * Equalize two paths to compatible cubic segment counts.
113
+ *
114
+ * Returns `[normalizedFrom, normalizedTo]`.
115
+ */
116
+ static equalize(from: string, to: string): Array<any>;
117
+ /**
118
+ * Interpolate between two SVG path data strings.
119
+ * Paths must have compatible structure (same commands, same number of values).
120
+ */
121
+ static interpolate(from: string, to: string, progress: number): string;
122
+ /**
123
+ * Normalize a path into absolute cubic segments.
124
+ */
125
+ static normalize(path: string): string;
126
+ /**
127
+ * Sample a position and tangent angle along a path at progress `[0, 1]`.
128
+ */
129
+ static sample(path: string, progress: number): any;
130
+ /**
131
+ * Parse an SVG path and return the number of segments.
132
+ * Useful for checking compatibility before interpolating.
133
+ */
134
+ static segmentCount(path: string): number;
135
+ }
136
+
137
+ export class ReducedMotion {
138
+ private constructor();
139
+ free(): void;
140
+ [Symbol.dispose](): void;
141
+ static getPolicy(): string;
142
+ static prefers(): boolean;
143
+ static resetPolicy(): void;
144
+ static setPolicy(policy: string): boolean;
145
+ static shouldReduce(): boolean;
146
+ }
147
+
148
+ /**
149
+ * Math, easing, and conversion utilities.
150
+ *
151
+ * ```js
152
+ * import { Utils } from 'scntix-animate';
153
+ *
154
+ * const x = Utils.clamp(150, 0, 100); // 100
155
+ * const y = Utils.mapRange(0.5, 0, 1, -100, 100); // 0
156
+ * const r = Utils.random(0, 10); // e.g. 7.3
157
+ * const s = Utils.lerp(0, 100, 0.25); // 25
158
+ * const w = Utils.wrap(380, 0, 360); // 20
159
+ * const d = Utils.degToRad(90); // π/2
160
+ * ```
161
+ */
162
+ export class Utils {
163
+ private constructor();
164
+ free(): void;
165
+ [Symbol.dispose](): void;
166
+ /**
167
+ * Absolute value.
168
+ */
169
+ static abs(value: number): number;
170
+ /**
171
+ * Angle from (x1,y1) to (x2,y2) in radians.
172
+ */
173
+ static angle(x1: number, y1: number, x2: number, y2: number): number;
174
+ /**
175
+ * Ceiling to integer.
176
+ */
177
+ static ceil(value: number): number;
178
+ /**
179
+ * Clamp a value between min and max.
180
+ */
181
+ static clamp(value: number, min: number, max: number): number;
182
+ /**
183
+ * Compose functions right-to-left (mathematical composition order).
184
+ *
185
+ * ```js
186
+ * const transform = Utils.compose(Math.round, v => v * 2);
187
+ * transform(1.7); // Math.round(1.7 * 2) = Math.round(3.4) = 3
188
+ * ```
189
+ */
190
+ static compose(fns: Array<any>): Function;
191
+ /**
192
+ * Frame-rate independent exponential decay (damped lerp).
193
+ *
194
+ * Useful for smooth mouse following without fixed durations.
195
+ *
196
+ * ```js
197
+ * // In a rAF loop:
198
+ * x = Utils.damp(x, targetX, deltaTime, 0.05); // 5% pull toward target each ms
199
+ * ```
200
+ */
201
+ static damp(start: number, end: number, delta_time: number, factor: number): number;
202
+ /**
203
+ * Convert degrees to radians.
204
+ */
205
+ static degToRad(degrees: number): number;
206
+ /**
207
+ * Distance between two 2D points.
208
+ */
209
+ static distance(x1: number, y1: number, x2: number, y2: number): number;
210
+ /**
211
+ * Floor to integer.
212
+ */
213
+ static floor(value: number): number;
214
+ /**
215
+ * Convert frames to milliseconds at a given FPS.
216
+ */
217
+ static framesToMs(frames: number, fps: number): number | undefined;
218
+ /**
219
+ * Get a computed CSS property value from an element as a number.
220
+ *
221
+ * ```js
222
+ * const opacity = Utils.getProperty(el, 'opacity'); // 1.0
223
+ * const x = Utils.getProperty(el, 'translateX'); // 0
224
+ * ```
225
+ */
226
+ static getProperty(element: Element, prop: string): number;
227
+ /**
228
+ * Hex color to [r, g, b, a] array (each 0-255, alpha 0-1).
229
+ */
230
+ static hexToRgba(hex: string): Float64Array;
231
+ /**
232
+ * HSL to RGB conversion.
233
+ * Input: h in [0, 360), s and l in [0, 1].
234
+ * Returns Float64Array [r, g, b] where each is 0-255.
235
+ */
236
+ static hslToRgb(h: number, s: number, l: number): Float64Array;
237
+ /**
238
+ * Interpolate between two CSS color strings at `progress` ∈ [0, 1].
239
+ *
240
+ * Supports any format recognized by scntix-animate (hex, rgb, rgba, hsl, hsla).
241
+ *
242
+ * ```js
243
+ * Utils.interpolateColor('#ff0000', 'blue', 0.5); // 'rgb(128, 0, 128)'
244
+ * ```
245
+ */
246
+ static interpolateColor(from: string, to: string, progress: number): string;
247
+ /**
248
+ * Inverse lerp — where does value fall between start and end? Returns [0, 1].
249
+ */
250
+ static invLerp(start: number, end: number, value: number): number;
251
+ /**
252
+ * Linear interpolation between start and end.
253
+ */
254
+ static lerp(start: number, end: number, factor: number): number;
255
+ /**
256
+ * Map a value from one range to another.
257
+ * Equivalent to anime.js `mapRange`.
258
+ *
259
+ * ```js
260
+ * Utils.mapRange(0.5, 0, 1, -100, 100); // 0
261
+ * Utils.mapRange(75, 0, 100, 0, 1); // 0.75
262
+ * ```
263
+ */
264
+ static mapRange(value: number, in_low: number, in_high: number, out_low: number, out_high: number): number;
265
+ /**
266
+ * Euclidean modulo (always positive).
267
+ *
268
+ * ```js
269
+ * Utils.modulo(-1, 5); // 4 (not -1 like JS %)
270
+ * ```
271
+ */
272
+ static modulo(a: number, b: number): number;
273
+ /**
274
+ * Convert milliseconds to frames at a given FPS.
275
+ */
276
+ static msToFrames(ms: number, fps: number): number | undefined;
277
+ /**
278
+ * Convert milliseconds to seconds.
279
+ */
280
+ static msToS(ms: number): number;
281
+ /**
282
+ * Get the current performance timestamp in ms.
283
+ */
284
+ static now(): number;
285
+ /**
286
+ * Pad start of a number string.
287
+ *
288
+ * ```js
289
+ * Utils.padStart(5, 3, '0'); // '005'
290
+ * ```
291
+ */
292
+ static padStart(value: number, total_length: number, pad: string): string;
293
+ /**
294
+ * Parse a time string ("1s", "500ms", "30f@60fps") to milliseconds.
295
+ */
296
+ static parseTime(s: string): number | undefined;
297
+ /**
298
+ * Apply a series of transform functions to a starting value (left-to-right pipe).
299
+ *
300
+ * ```js
301
+ * const transform = Utils.pipe(
302
+ * v => v * 2,
303
+ * v => v + 10,
304
+ * v => Math.round(v),
305
+ * );
306
+ * transform(5); // 20 (5*2=10, 10+10=20, round(20)=20)
307
+ * ```
308
+ */
309
+ static pipe(fns: Array<any>): Function;
310
+ /**
311
+ * Convert radians to degrees.
312
+ */
313
+ static radToDeg(radians: number): number;
314
+ /**
315
+ * Random float between min (inclusive) and max (exclusive).
316
+ *
317
+ * ```js
318
+ * Utils.random(0, 100); // e.g. 42.7
319
+ * Utils.random(0, 100, 0); // e.g. 73 (integer)
320
+ * ```
321
+ */
322
+ static random(min: number, max: number): number;
323
+ /**
324
+ * Random integer between min and max (inclusive).
325
+ */
326
+ static randomInt(min: number, max: number): number;
327
+ /**
328
+ * Random item from an array.
329
+ */
330
+ static randomItem(arr: Array<any>): any;
331
+ /**
332
+ * Alias for `mapRange`. Kept for backwards compatibility.
333
+ */
334
+ static remap(value: number, in_start: number, in_end: number, out_start: number, out_end: number): number;
335
+ /**
336
+ * Round and format a number with fixed decimal places.
337
+ *
338
+ * ```js
339
+ * Utils.roundPad(3.14159, 2); // '3.14'
340
+ * ```
341
+ */
342
+ static roundPad(value: number, decimal_length: number): string;
343
+ /**
344
+ * Round to specified decimal places.
345
+ */
346
+ static roundTo(value: number, decimals: number): number;
347
+ /**
348
+ * Convert seconds to milliseconds.
349
+ */
350
+ static sToMs(s: number): number;
351
+ /**
352
+ * Set a CSS property on an element immediately (no animation).
353
+ *
354
+ * ```js
355
+ * Utils.setProperty(el, 'opacity', 0.5);
356
+ * Utils.setProperty(el, 'translateX', 100); // applies as transform
357
+ * ```
358
+ */
359
+ static setProperty(element: Element, prop: string, value: number): void;
360
+ /**
361
+ * Shuffle an array (Fisher-Yates). Returns a new array.
362
+ */
363
+ static shuffle(arr: Array<any>): Array<any>;
364
+ /**
365
+ * Get the sign of a number (-1, 0, or 1).
366
+ */
367
+ static sign(value: number): number;
368
+ /**
369
+ * Snap value to nearest multiple of step.
370
+ *
371
+ * ```js
372
+ * Utils.snap(47, 50); // 50
373
+ * Utils.snap(24, 50); // 0
374
+ * ```
375
+ */
376
+ static snap(value: number, step: number): number;
377
+ /**
378
+ * Snap to the nearest value in a list of snap points.
379
+ *
380
+ * ```js
381
+ * Utils.snapToPoints(42, [0, 50, 100, 200]); // 50
382
+ * ```
383
+ */
384
+ static snapToPoints(value: number, points: Array<any>): number;
385
+ /**
386
+ * Truncate to integer (towards zero).
387
+ */
388
+ static trunc(value: number): number;
389
+ /**
390
+ * Wrap a value within a range [min, max).
391
+ *
392
+ * ```js
393
+ * Utils.wrap(380, 0, 360); // 20
394
+ * Utils.wrap(-10, 0, 360); // 350
395
+ * ```
396
+ */
397
+ static wrap(value: number, min: number, max: number): number;
398
+ }
399
+
400
+ /**
401
+ * Persistent per-property animation binder.
402
+ */
403
+ export class WasmAnimatable {
404
+ private constructor();
405
+ free(): void;
406
+ [Symbol.dispose](): void;
407
+ /**
408
+ * Get the currently cached target value for a property.
409
+ * To get the live DOM value, use `getLive(prop)`.
410
+ */
411
+ get(prop: string): number;
412
+ /**
413
+ * Get the live computed CSS value (reads from DOM each call).
414
+ */
415
+ getLive(prop: string): number;
416
+ /**
417
+ * Cancel all running animations and restore initial values.
418
+ */
419
+ revert(): void;
420
+ /**
421
+ * Animate a property to a new value.
422
+ *
423
+ * Parameters:
424
+ * - `prop` — CSS property or transform (e.g. `"translateX"`, `"opacity"`)
425
+ * - `to` — Target value as a number
426
+ * - `duration` — Override duration in ms (`null` = use per-property default)
427
+ * - `easing` — Override easing string (`null` = use per-property default)
428
+ */
429
+ set(prop: string, to: number, duration?: number | null, easing?: string | null): void;
430
+ /**
431
+ * Immediately set a property value without animation.
432
+ */
433
+ setImmediate(prop: string, value: number): void;
434
+ /**
435
+ * Stop all running animations without restoring values.
436
+ */
437
+ stop(): void;
438
+ /**
439
+ * Whether any property animation is currently running.
440
+ */
441
+ readonly isAnimating: boolean;
442
+ /**
443
+ * The underlying target element.
444
+ */
445
+ readonly target: Element;
446
+ }
447
+
448
+ /**
449
+ * Animation handle exposed to JavaScript.
450
+ */
451
+ export class WasmAnimation {
452
+ private constructor();
453
+ free(): void;
454
+ [Symbol.dispose](): void;
455
+ /**
456
+ * Remove this animation and clean up resources.
457
+ */
458
+ destroy(): void;
459
+ /**
460
+ * Set onBegin callback.
461
+ */
462
+ onBegin(cb: Function): void;
463
+ /**
464
+ * Set onComplete callback.
465
+ */
466
+ onComplete(cb: Function): void;
467
+ /**
468
+ * Set onLoop callback (receives iteration number).
469
+ */
470
+ onLoop(cb: Function): void;
471
+ /**
472
+ * Set onUpdate callback (receives progress 0.0–1.0).
473
+ */
474
+ onUpdate(cb: Function): void;
475
+ /**
476
+ * Pause the animation. Returns true if the animation was paused.
477
+ */
478
+ pause(): boolean;
479
+ /**
480
+ * Play the animation (or resume if paused). Returns true if an action was taken.
481
+ */
482
+ play(): boolean;
483
+ /**
484
+ * Restart the animation from the beginning. Returns true if restarted.
485
+ */
486
+ restart(): boolean;
487
+ /**
488
+ * Reverse the playback direction. Returns true if reversed.
489
+ */
490
+ reverse(): boolean;
491
+ /**
492
+ * Seek to a specific time in milliseconds.
493
+ */
494
+ seek(time: number): void;
495
+ /**
496
+ * Set playback speed (1.0 = normal, 2.0 = double, 0.5 = half).
497
+ */
498
+ setSpeed(speed: number): void;
499
+ /**
500
+ * Whether the animation has completed.
501
+ */
502
+ readonly completed: boolean;
503
+ /**
504
+ * Get the total duration in milliseconds.
505
+ */
506
+ readonly duration: number;
507
+ /**
508
+ * Get a Promise that resolves when the animation completes.
509
+ */
510
+ readonly finished: Promise<any>;
511
+ }
512
+
513
+ /**
514
+ * Physics-based draggable element.
515
+ */
516
+ export class WasmDraggable {
517
+ private constructor();
518
+ free(): void;
519
+ [Symbol.dispose](): void;
520
+ /**
521
+ * Destroy the draggable, release all event listeners and observers.
522
+ */
523
+ destroy(): void;
524
+ /**
525
+ * Disable dragging (cannot be grabbed).
526
+ */
527
+ disable(): void;
528
+ /**
529
+ * Enable dragging.
530
+ */
531
+ enable(): void;
532
+ /**
533
+ * Refresh container bounds (re-read from DOM). Called automatically on resize.
534
+ */
535
+ refresh(): void;
536
+ /**
537
+ * Reset position to (0, 0) and clear all state.
538
+ */
539
+ reset(): void;
540
+ /**
541
+ * Revert the draggable: reset position and destroy.
542
+ */
543
+ revert(): void;
544
+ /**
545
+ * Set X position immediately.
546
+ */
547
+ setX(x: number): void;
548
+ /**
549
+ * Set Y position immediately.
550
+ */
551
+ setY(y: number): void;
552
+ /**
553
+ * Apply current snap config to position.
554
+ */
555
+ snap(): void;
556
+ /**
557
+ * Current drag angle in radians.
558
+ */
559
+ readonly angle: number;
560
+ /**
561
+ * Delta X since last frame.
562
+ */
563
+ readonly deltaX: number;
564
+ /**
565
+ * Delta Y since last frame.
566
+ */
567
+ readonly deltaY: number;
568
+ /**
569
+ * Destination X (after snap/release calculation).
570
+ */
571
+ readonly destX: number;
572
+ /**
573
+ * Destination Y (after snap/release calculation).
574
+ */
575
+ readonly destY: number;
576
+ /**
577
+ * Whether currently being dragged.
578
+ */
579
+ readonly isDragging: boolean;
580
+ /**
581
+ * Whether the draggable is enabled.
582
+ */
583
+ readonly isEnabled: boolean;
584
+ /**
585
+ * Whether currently in release/settle phase.
586
+ */
587
+ readonly isReleasing: boolean;
588
+ /**
589
+ * X progress within container bounds [0, 1].
590
+ */
591
+ progressX: number;
592
+ /**
593
+ * Y progress within container bounds [0, 1].
594
+ */
595
+ progressY: number;
596
+ /**
597
+ * Current velocity magnitude (px/ms).
598
+ */
599
+ readonly velocity: number;
600
+ /**
601
+ * Current X velocity component.
602
+ */
603
+ readonly velocityX: number;
604
+ /**
605
+ * Current Y velocity component.
606
+ */
607
+ readonly velocityY: number;
608
+ /**
609
+ * Current X position (px).
610
+ */
611
+ readonly x: number;
612
+ /**
613
+ * Current Y position (px).
614
+ */
615
+ readonly y: number;
616
+ }
617
+
618
+ /**
619
+ * Global engine control exposed to JavaScript.
620
+ */
621
+ export class WasmEngine {
622
+ private constructor();
623
+ free(): void;
624
+ [Symbol.dispose](): void;
625
+ /**
626
+ * Number of currently active animations.
627
+ */
628
+ static activeCount(): number;
629
+ /**
630
+ * Resume after a manual `suspend()`.
631
+ */
632
+ static resume(): void;
633
+ /**
634
+ * Set target FPS (0 = no limit, use native rAF rate).
635
+ */
636
+ static setFPS(fps: number): void;
637
+ /**
638
+ * Stop all animations and clear the engine.
639
+ */
640
+ static stopAll(): void;
641
+ /**
642
+ * Manually suspend ALL animations (independent of page visibility).
643
+ *
644
+ * ```js
645
+ * WasmEngine.suspend(); // freeze everything
646
+ * WasmEngine.resume(); // unfreeze
647
+ * ```
648
+ */
649
+ static suspend(): void;
650
+ /**
651
+ * Add a per-frame tick subscriber. Returns a subscriber ID for removal.
652
+ *
653
+ * ```js
654
+ * const id = WasmEngine.tickerAdd((time, deltaTime) => {
655
+ * console.log(`frame at ${time}ms, delta=${deltaTime}ms`);
656
+ * });
657
+ * WasmEngine.tickerRemove(id);
658
+ * ```
659
+ */
660
+ static tickerAdd(cb: Function): bigint;
661
+ /**
662
+ * Remove all tick subscribers.
663
+ */
664
+ static tickerClear(): void;
665
+ /**
666
+ * Remove a tick subscriber by its ID.
667
+ */
668
+ static tickerRemove(id: bigint): void;
669
+ /**
670
+ * Number of DOM write errors encountered.
671
+ */
672
+ static writeErrorCount(): number;
673
+ /**
674
+ * Current measured frames-per-second (rolling 16-frame average).
675
+ */
676
+ static readonly fps: number;
677
+ /**
678
+ * Whether the engine is currently manually suspended.
679
+ */
680
+ static readonly suspended: boolean;
681
+ }
682
+
683
+ export class WasmFlipAnimation {
684
+ private constructor();
685
+ free(): void;
686
+ [Symbol.dispose](): void;
687
+ cancel(): void;
688
+ destroy(): void;
689
+ finish(): void;
690
+ pause(): void;
691
+ resume(): void;
692
+ revert(): void;
693
+ readonly isActive: boolean;
694
+ readonly progress: number;
695
+ }
696
+
697
+ export class WasmFlipState {
698
+ private constructor();
699
+ free(): void;
700
+ [Symbol.dispose](): void;
701
+ readonly length: number;
702
+ }
703
+
704
+ export class WasmHoverGesture {
705
+ private constructor();
706
+ free(): void;
707
+ [Symbol.dispose](): void;
708
+ destroy(): void;
709
+ disable(): void;
710
+ enable(): void;
711
+ revert(): void;
712
+ readonly isActive: boolean;
713
+ }
714
+
715
+ /**
716
+ * Standalone inertia simulation handle.
717
+ */
718
+ export class WasmInertia {
719
+ free(): void;
720
+ [Symbol.dispose](): void;
721
+ constructor(config: any);
722
+ /**
723
+ * Advance the inertia simulation and return `[position, settled_flag]`.
724
+ *
725
+ * `settled_flag` is `1.0` when the simulation is settled and `0.0` otherwise.
726
+ * A `Float64Array` is used here to keep the JS bridge allocation-light.
727
+ */
728
+ tick(delta_ms: number): Float64Array;
729
+ readonly isSettled: boolean;
730
+ readonly position: number;
731
+ readonly velocity: number;
732
+ }
733
+
734
+ /**
735
+ * Keyframe sequence for multi-stop animations.
736
+ *
737
+ * ```js
738
+ * const seq = new WasmKeyframeSequence('target', 'opacity', 1000);
739
+ * seq.addKeyframe(0.0, 0);
740
+ * seq.addKeyframe(0.5, 1, 'easeInQuad');
741
+ * seq.addKeyframe(1.0, 0.5);
742
+ * console.log(seq.valueAt(500)); // 1.0
743
+ * ```
744
+ */
745
+ export class WasmKeyframeSequence {
746
+ free(): void;
747
+ [Symbol.dispose](): void;
748
+ addKeyframe(offset: number, value: any, easing?: string | null): void;
749
+ formattedValueAt(time: number): string | undefined;
750
+ keyframeCount(): number;
751
+ constructor(target: string, property: string, duration: number);
752
+ valueAt(time: number): number | undefined;
753
+ readonly duration: number;
754
+ }
755
+
756
+ export class WasmLayoutTransition {
757
+ private constructor();
758
+ free(): void;
759
+ [Symbol.dispose](): void;
760
+ cancel(): void;
761
+ destroy(): void;
762
+ finish(): void;
763
+ pause(): void;
764
+ resume(): void;
765
+ revert(): void;
766
+ readonly isActive: boolean;
767
+ readonly progress: number;
768
+ readonly targetCount: number;
769
+ }
770
+
771
+ /**
772
+ * A reactive numeric motion value handle.
773
+ */
774
+ export class WasmMotionValue {
775
+ free(): void;
776
+ [Symbol.dispose](): void;
777
+ connectDOM(element: Element, property: string): void;
778
+ destroy(): void;
779
+ get(): number;
780
+ getVelocity(): number;
781
+ jump(value: number): void;
782
+ constructor(init: number);
783
+ on(callback: Function): Function;
784
+ set(value: number): void;
785
+ setWithVelocity(previous: number, current: number, delta_ms: number): void;
786
+ }
787
+
788
+ export class WasmObserver {
789
+ private constructor();
790
+ free(): void;
791
+ [Symbol.dispose](): void;
792
+ destroy(): void;
793
+ disable(): void;
794
+ enable(): void;
795
+ refresh(): void;
796
+ revert(): void;
797
+ readonly enabled: boolean;
798
+ }
799
+
800
+ export class WasmPanGesture {
801
+ private constructor();
802
+ free(): void;
803
+ [Symbol.dispose](): void;
804
+ destroy(): void;
805
+ disable(): void;
806
+ enable(): void;
807
+ revert(): void;
808
+ readonly isActive: boolean;
809
+ }
810
+
811
+ /**
812
+ * Standalone 2D physics simulation handle.
813
+ */
814
+ export class WasmPhysics2D {
815
+ free(): void;
816
+ [Symbol.dispose](): void;
817
+ clearAttractor(): void;
818
+ impulse(vx: number, vy: number): void;
819
+ constructor(config: any);
820
+ setAttractor(x: number, y: number, strength: number, max_force: number): void;
821
+ tick(delta_ms: number): Float64Array;
822
+ readonly isResting: boolean;
823
+ readonly velocityX: number;
824
+ readonly velocityY: number;
825
+ readonly x: number;
826
+ readonly y: number;
827
+ }
828
+
829
+ /**
830
+ * Standalone multi-property physics simulation handle.
831
+ */
832
+ export class WasmPhysicsProps {
833
+ free(): void;
834
+ [Symbol.dispose](): void;
835
+ constructor(config: any);
836
+ tick(delta_ms: number): any;
837
+ readonly isSettled: boolean;
838
+ }
839
+
840
+ export class WasmPressGesture {
841
+ private constructor();
842
+ free(): void;
843
+ [Symbol.dispose](): void;
844
+ destroy(): void;
845
+ disable(): void;
846
+ enable(): void;
847
+ revert(): void;
848
+ readonly isActive: boolean;
849
+ }
850
+
851
+ /**
852
+ * Scoped animation manager.
853
+ *
854
+ * ```js
855
+ * const scope = createScope({ mediaQueries: { sm: '(max-width: 768px)' } });
856
+ * scope.add(() => {
857
+ * animate('.box', { translateX: [0, 100], duration: 500 });
858
+ * });
859
+ * // Later:
860
+ * scope.revert(); // stops everything
861
+ * ```
862
+ */
863
+ export class WasmScope {
864
+ private constructor();
865
+ free(): void;
866
+ [Symbol.dispose](): void;
867
+ /**
868
+ * Add a constructor callback. Executed immediately; any animations created
869
+ * during execution are tracked for cleanup.
870
+ */
871
+ add(callback: Function): void;
872
+ /**
873
+ * Revert all current instances, then re-run all constructors.
874
+ */
875
+ refresh(): void;
876
+ /**
877
+ * Revert all tracked animations, observers, and splitters.
878
+ */
879
+ revert(): void;
880
+ /**
881
+ * Current media query match state.
882
+ */
883
+ readonly matches: object;
884
+ }
885
+
886
+ export class WasmScrambleText {
887
+ private constructor();
888
+ free(): void;
889
+ [Symbol.dispose](): void;
890
+ cancel(): void;
891
+ destroy(): void;
892
+ finish(): void;
893
+ pause(): void;
894
+ resume(): void;
895
+ revert(): void;
896
+ readonly currentText: string;
897
+ readonly isActive: boolean;
898
+ readonly progress: number;
899
+ }
900
+
901
+ export class WasmScrollObserver {
902
+ private constructor();
903
+ free(): void;
904
+ [Symbol.dispose](): void;
905
+ /**
906
+ * Destroy the observer and remove all listeners. This is an alias for `revert()`.
907
+ */
908
+ destroy(): void;
909
+ /**
910
+ * Link an animation to this scroll observer.
911
+ */
912
+ link(animation: WasmAnimation): void;
913
+ /**
914
+ * Recompute scroll offsets (call after layout changes).
915
+ */
916
+ refresh(): void;
917
+ /**
918
+ * Clean up the observer and remove scroll listeners if no longer needed.
919
+ */
920
+ revert(): void;
921
+ /**
922
+ * Whether the observed element is currently in the scroll view.
923
+ */
924
+ readonly isInView: boolean;
925
+ /**
926
+ * The scroll position (in px) where the leave threshold fires.
927
+ */
928
+ readonly offsetEnd: number;
929
+ /**
930
+ * The scroll position (in px) where the enter threshold fires.
931
+ */
932
+ readonly offsetStart: number;
933
+ /**
934
+ * Current scroll progress [0.0, 1.0].
935
+ */
936
+ readonly progress: number;
937
+ }
938
+
939
+ export class WasmScrollSmoother {
940
+ private constructor();
941
+ free(): void;
942
+ [Symbol.dispose](): void;
943
+ destroy(): void;
944
+ pause(): void;
945
+ refresh(): void;
946
+ resume(): void;
947
+ revert(): void;
948
+ readonly currentY: number;
949
+ readonly paused: boolean;
950
+ readonly progress: number;
951
+ readonly targetY: number;
952
+ }
953
+
954
+ export class WasmScrollTo {
955
+ private constructor();
956
+ free(): void;
957
+ [Symbol.dispose](): void;
958
+ cancel(): void;
959
+ destroy(): void;
960
+ revert(): void;
961
+ readonly isActive: boolean;
962
+ readonly progress: number;
963
+ }
964
+
965
+ /**
966
+ * Spring physics configuration and evaluation.
967
+ */
968
+ export class WasmSpring {
969
+ free(): void;
970
+ [Symbol.dispose](): void;
971
+ static fromBounce(bounce: number, duration: number): WasmSpring;
972
+ constructor(mass: number, stiffness: number, damping: number, velocity?: number | null);
973
+ /**
974
+ * Sample the spring at evenly spaced points from t=0 to t=1.
975
+ *
976
+ * For `count > 0`, returns `count + 1` samples (including endpoints).
977
+ * For `count == 0`, returns a single sample at t=0.
978
+ */
979
+ sample(count: number): Float64Array;
980
+ solve(t: number): number;
981
+ readonly dampingRatio: number;
982
+ readonly duration: number;
983
+ readonly isBouncy: boolean;
984
+ }
985
+
986
+ export class WasmTextReplace {
987
+ private constructor();
988
+ free(): void;
989
+ [Symbol.dispose](): void;
990
+ cancel(): void;
991
+ destroy(): void;
992
+ finish(): void;
993
+ pause(): void;
994
+ resume(): void;
995
+ revert(): void;
996
+ readonly currentText: string;
997
+ readonly isActive: boolean;
998
+ readonly progress: number;
999
+ }
1000
+
1001
+ export class WasmTextSplitter {
1002
+ private constructor();
1003
+ free(): void;
1004
+ [Symbol.dispose](): void;
1005
+ destroy(): void;
1006
+ refresh(): void;
1007
+ revert(): void;
1008
+ readonly chars: Array<any>;
1009
+ readonly isAutoResplit: boolean;
1010
+ readonly lines: Array<any>;
1011
+ readonly words: Array<any>;
1012
+ }
1013
+
1014
+ /**
1015
+ * Timeline for sequencing multiple animations.
1016
+ */
1017
+ export class WasmTimeline {
1018
+ free(): void;
1019
+ [Symbol.dispose](): void;
1020
+ /**
1021
+ * Add an animation at a position in the timeline.
1022
+ */
1023
+ add(config: any, position?: string | null): void;
1024
+ /**
1025
+ * Add a label at the current end.
1026
+ */
1027
+ addLabel(label: string): void;
1028
+ /**
1029
+ * Insert a callback at a position in the timeline.
1030
+ */
1031
+ call(cb: Function, position?: string | null): void;
1032
+ constructor();
1033
+ /**
1034
+ * Set onBegin callback.
1035
+ */
1036
+ onBegin(cb: Function): void;
1037
+ /**
1038
+ * Set onComplete callback.
1039
+ */
1040
+ onComplete(cb: Function): void;
1041
+ /**
1042
+ * Set onLoop callback (receives iteration number).
1043
+ */
1044
+ onLoop(cb: Function): void;
1045
+ /**
1046
+ * Set onPause callback.
1047
+ */
1048
+ onPause(cb: Function): void;
1049
+ /**
1050
+ * Set onResume callback.
1051
+ */
1052
+ onResume(cb: Function): void;
1053
+ /**
1054
+ * Set onUpdate callback (receives progress 0.0–1.0).
1055
+ */
1056
+ onUpdate(cb: Function): void;
1057
+ /**
1058
+ * Pause the timeline. Returns true if an active instance was paused.
1059
+ */
1060
+ pause(): boolean;
1061
+ /**
1062
+ * Play the timeline.
1063
+ */
1064
+ play(): void;
1065
+ /**
1066
+ * Restart the timeline. Returns true if an active instance was restarted.
1067
+ */
1068
+ restart(): boolean;
1069
+ /**
1070
+ * Reverse the timeline playback. Returns true if an action was taken.
1071
+ */
1072
+ reverse(): boolean;
1073
+ /**
1074
+ * Seek the timeline to a specific time and apply values.
1075
+ */
1076
+ seek(time: number): void;
1077
+ /**
1078
+ * Set repeat count (0 = infinite).
1079
+ */
1080
+ setRepeat(count: number): void;
1081
+ /**
1082
+ * Set playback speed (1.0 = normal, 2.0 = double, 0.5 = half).
1083
+ */
1084
+ setSpeed(speed: number): void;
1085
+ /**
1086
+ * Enable yoyo.
1087
+ */
1088
+ setYoyo(yoyo: boolean): void;
1089
+ /**
1090
+ * Duration of a single play-through.
1091
+ */
1092
+ readonly duration: number;
1093
+ /**
1094
+ * Get a Promise that resolves when the timeline completes.
1095
+ */
1096
+ readonly finished: Promise<any>;
1097
+ /**
1098
+ * Total duration including repeats.
1099
+ */
1100
+ readonly totalDuration: number;
1101
+ }
1102
+
1103
+ /**
1104
+ * A frame-accurate, fully-controllable timer.
1105
+ */
1106
+ export class WasmTimer {
1107
+ private constructor();
1108
+ free(): void;
1109
+ [Symbol.dispose](): void;
1110
+ /**
1111
+ * Cancel the timer (does not fire onComplete).
1112
+ */
1113
+ cancel(): void;
1114
+ /**
1115
+ * Pause the timer at the current position.
1116
+ */
1117
+ pause(): boolean;
1118
+ /**
1119
+ * Play the timer from its current position (or restart if completed).
1120
+ */
1121
+ play(): boolean;
1122
+ /**
1123
+ * Restart from the beginning.
1124
+ */
1125
+ restart(): boolean;
1126
+ /**
1127
+ * Reverse playback direction.
1128
+ */
1129
+ reverse(): void;
1130
+ /**
1131
+ * Seek to a specific time in ms.
1132
+ */
1133
+ seek(time: number): void;
1134
+ /**
1135
+ * Set playback speed multiplier.
1136
+ */
1137
+ setSpeed(speed: number): void;
1138
+ /**
1139
+ * Whether the timer has completed.
1140
+ */
1141
+ readonly completed: boolean;
1142
+ /**
1143
+ * Get the current elapsed time in ms.
1144
+ */
1145
+ readonly currentTime: number;
1146
+ /**
1147
+ * Total duration in ms.
1148
+ */
1149
+ readonly duration: number;
1150
+ /**
1151
+ * A Promise that resolves when the timer completes.
1152
+ */
1153
+ readonly finished: Promise<any>;
1154
+ /**
1155
+ * Whether the timer is currently paused.
1156
+ */
1157
+ readonly paused: boolean;
1158
+ /**
1159
+ * Get current progress [0.0, 1.0].
1160
+ */
1161
+ readonly progress: number;
1162
+ }
1163
+
1164
+ export class WasmViewTransition {
1165
+ private constructor();
1166
+ free(): void;
1167
+ [Symbol.dispose](): void;
1168
+ skipTransition(): void;
1169
+ readonly finished: any;
1170
+ readonly isNative: boolean;
1171
+ readonly ready: any;
1172
+ readonly updateCallbackDone: any;
1173
+ }
1174
+
1175
+ export class WasmWaapiAnimation {
1176
+ private constructor();
1177
+ free(): void;
1178
+ [Symbol.dispose](): void;
1179
+ cancel(): void;
1180
+ commitStyles(): void;
1181
+ destroy(): void;
1182
+ finish(): void;
1183
+ pause(): void;
1184
+ play(): void;
1185
+ reverse(): void;
1186
+ revert(): void;
1187
+ readonly animations: Array<any>;
1188
+ readonly currentTime: number;
1189
+ readonly duration: number;
1190
+ readonly persist: boolean;
1191
+ readonly progress: number;
1192
+ }
1193
+
1194
+ /**
1195
+ * Create and start an animation.
1196
+ *
1197
+ * ```js
1198
+ * const anim = animate({
1199
+ * targets: '.box',
1200
+ * translateX: [0, 250],
1201
+ * opacity: [0, 1],
1202
+ * scale: [0.5, 1],
1203
+ * duration: 1000,
1204
+ * delay: 0,
1205
+ * easing: 'easeOutCubic',
1206
+ * loop: 1,
1207
+ * direction: 'normal',
1208
+ * autoplay: true,
1209
+ * stagger: 100,
1210
+ * composition: 'replace', // or 'add', 'accumulate'
1211
+ * begin: (anim) => {},
1212
+ * update: (progress) => {},
1213
+ * complete: (anim) => {},
1214
+ * });
1215
+ *
1216
+ * // Control
1217
+ * anim.pause();
1218
+ * anim.play();
1219
+ * anim.seek(500);
1220
+ * anim.reverse();
1221
+ * anim.restart();
1222
+ *
1223
+ * // Promise
1224
+ * await anim.finished;
1225
+ * ```
1226
+ */
1227
+ export function animate(config: any): WasmAnimation;
1228
+
1229
+ /**
1230
+ * Animate properties of a plain JavaScript object.
1231
+ *
1232
+ * All numeric properties are interpolated each frame and written back to the
1233
+ * object via `Reflect.set`. Use the `update` callback to react to changes.
1234
+ *
1235
+ * ```js
1236
+ * const state = { progress: 0 };
1237
+ * const anim = animateObject(state, {
1238
+ * progress: [0, 1],
1239
+ * duration: 2000,
1240
+ * update: () => draw(state.progress),
1241
+ * });
1242
+ * ```
1243
+ */
1244
+ export function animateObject(obj: any, config: any): WasmAnimation;
1245
+
1246
+ export function commitStyles(value: any): void;
1247
+
1248
+ /**
1249
+ * Create a persistent property animator for a DOM element.
1250
+ *
1251
+ * Property configs are specified per-property in the `config` object:
1252
+ * - A number means duration in ms (uses default easing)
1253
+ * - An object `{ duration, easing }` sets both defaults
1254
+ *
1255
+ * ```js
1256
+ * const box = createAnimatable('.box', {
1257
+ * translateX: { duration: 600, easing: 'spring(1,80,12,0)' },
1258
+ * translateY: { duration: 600, easing: 'spring(1,80,12,0)' },
1259
+ * opacity: { duration: 200, easing: 'easeOutQuad' },
1260
+ * scale: 400, // 400ms, default easing
1261
+ * });
1262
+ * ```
1263
+ */
1264
+ export function createAnimatable(target: any, config: any): WasmAnimatable;
1265
+
1266
+ /**
1267
+ * Create a fully-featured draggable element.
1268
+ */
1269
+ export function createDraggable(target: any, config: any): WasmDraggable;
1270
+
1271
+ /**
1272
+ * Set up an SVG geometry element for stroke-drawing animation.
1273
+ *
1274
+ * - Resolves `selector` in the document.
1275
+ * - Casts the element to `SVGGeometryElement` (returns `Err` if not geometry).
1276
+ * - Sets `pathLength="1000"` so that dash values are normalised.
1277
+ * - Applies the initial draw state using `start`.
1278
+ * - Returns a `DrawableHandle` wrapping the element.
1279
+ */
1280
+ export function createDrawable(selector: string, start: number, end: number): DrawableHandle;
1281
+
1282
+ export function createHover(target: any, config: any): WasmHoverGesture;
1283
+
1284
+ /**
1285
+ * Resolve an SVG geometry element, read its total length once, and return
1286
+ * three tween-object values for `translateX`, `translateY`, and `rotate`.
1287
+ *
1288
+ * `offset` (clamped to `[0.0, 1.0]`) shifts the starting position along
1289
+ * the path.
1290
+ */
1291
+ export function createMotionPath(path_selector: string, offset: number): MotionPathValues;
1292
+
1293
+ export function createObserver(config: any): WasmObserver;
1294
+
1295
+ export function createPan(target: any, config: any): WasmPanGesture;
1296
+
1297
+ export function createPress(target: any, config: any): WasmPressGesture;
1298
+
1299
+ /**
1300
+ * Create a new scope.
1301
+ *
1302
+ * ```js
1303
+ * const scope = createScope({
1304
+ * mediaQueries: { sm: '(max-width: 768px)', lg: '(min-width: 1024px)' }
1305
+ * });
1306
+ * ```
1307
+ */
1308
+ export function createScope(config: any): WasmScope;
1309
+
1310
+ /**
1311
+ * Create a scroll observer from a JS config object.
1312
+ *
1313
+ * ```js
1314
+ * const obs = createScrollObserver({
1315
+ * target: '.hero',
1316
+ * enter: 'end start',
1317
+ * leave: 'start end',
1318
+ * sync: 'linear',
1319
+ * axis: 'y',
1320
+ * });
1321
+ * obs.link(animation);
1322
+ * ```
1323
+ */
1324
+ export function createScrollObserver(config: any): WasmScrollObserver;
1325
+
1326
+ export function createScrollSmoother(config: any): WasmScrollSmoother;
1327
+
1328
+ /**
1329
+ * Create a new timer.
1330
+ *
1331
+ * ```js
1332
+ * const timer = createTimer({
1333
+ * duration: 2000,
1334
+ * loop: 3,
1335
+ * easing: 'linear',
1336
+ * onBegin: (t) => console.log('start'),
1337
+ * onUpdate: (t) => draw(t.progress),
1338
+ * onLoop: (t) => console.log('loop', t.currentIteration),
1339
+ * onComplete: (t) => console.log('done'),
1340
+ * });
1341
+ *
1342
+ * // Infinite: use `duration: Infinity` or `loop: Infinity`
1343
+ * const ticker = createTimer({
1344
+ * duration: Infinity,
1345
+ * onUpdate: (t) => physics.step(t.deltaTime),
1346
+ * });
1347
+ * ```
1348
+ */
1349
+ export function createTimer(config: any): WasmTimer;
1350
+
1351
+ export function easingToLinear(easing: any, samples: number): string;
1352
+
1353
+ export function flipCapture(targets: any): WasmFlipState;
1354
+
1355
+ export function flipFrom(state: WasmFlipState, config: any): WasmFlipAnimation;
1356
+
1357
+ export function followValue(source: WasmMotionValue, spring_config: any): WasmMotionValue;
1358
+
1359
+ export function init(): void;
1360
+
1361
+ export function layoutTransition(targets: any, update: Function, config: any): WasmLayoutTransition;
1362
+
1363
+ export function mapValue(source: WasmMotionValue, input_range: Array<any>, output_range: Array<any>): WasmMotionValue;
1364
+
1365
+ export function motionValue(init: number): WasmMotionValue;
1366
+
1367
+ export function registerTransformProperties(): boolean;
1368
+
1369
+ /**
1370
+ * Register a JS object (scroll observer, text splitter, draggable, etc.) with the currently
1371
+ * active scope. The object must have a `.revert()` or `.destroy()` method.
1372
+ *
1373
+ * This is called automatically for `animate()` and `animateObject()` calls.
1374
+ * For other objects (draggable, scroll observer, text splitter), call this manually
1375
+ * inside a scope constructor, or call `scope.add(() => { ... })` which auto-tracks them.
1376
+ *
1377
+ * ```js
1378
+ * scope.add(() => {
1379
+ * const drag = createDraggable('.el', {...});
1380
+ * scopeRegisterJs(drag); // register for auto-destroy on scope.revert()
1381
+ * });
1382
+ * ```
1383
+ */
1384
+ export function scopeRegisterJs(val: any): void;
1385
+
1386
+ export function scrambleText(target: any, config: any): WasmScrambleText;
1387
+
1388
+ export function scrollTo(config: any): WasmScrollTo;
1389
+
1390
+ export function splitText(target: any, config: any): WasmTextSplitter;
1391
+
1392
+ /**
1393
+ * Calculate stagger delays.
1394
+ *
1395
+ * ```js
1396
+ * // Simple: 100ms between each
1397
+ * const delays = stagger(100, 5); // [0, 100, 200, 300, 400]
1398
+ *
1399
+ * // From center
1400
+ * const delays = stagger(100, 5, { from: 'center' }); // [200, 100, 0, 100, 200]
1401
+ *
1402
+ * // Value range [min, max] mapped across elements
1403
+ * const delays = stagger([100, 500], 5); // [100, 200, 300, 400, 500]
1404
+ *
1405
+ * // Grid stagger (2D)
1406
+ * const delays = stagger(50, 20, { grid: [5, 4], from: 'center', axis: 'x' });
1407
+ * ```
1408
+ */
1409
+ export function stagger(value: any, count: number, options: any): Float64Array;
1410
+
1411
+ /**
1412
+ * Simple stagger with count + optional from string (backwards-compatible API).
1413
+ *
1414
+ * ```js
1415
+ * const delays = staggerSimple(100, 5, 'center');
1416
+ * ```
1417
+ */
1418
+ export function staggerSimple(delay: number, count: number, from?: string | null): Float64Array;
1419
+
1420
+ export function startViewTransition(update: Function, config: any): WasmViewTransition;
1421
+
1422
+ export function textReplace(target: any, config: any): WasmTextReplace;
1423
+
1424
+ export function version(): string;
1425
+
1426
+ export function waapi(targets: any, config: any): WasmWaapiAnimation;