@lottiefiles/dotlottie-web 0.67.0 → 0.69.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/dist/index.d.ts CHANGED
@@ -27,292 +27,328 @@ declare class DotLottiePlayerWasm {
27
27
  __wbg_ptr: number;
28
28
  free(): void;
29
29
  /**
30
- * Load a Lottie JSON animation. Sets up the rendering target automatically.
31
- * @param {string} data
32
- * @param {number} width
33
- * @param {number} height
30
+ * @param {string} id
34
31
  * @returns {boolean}
35
32
  */
36
- load_animation(data: string, width: number, height: number): boolean;
33
+ clear_slot(id: string): boolean;
37
34
  /**
38
- * Load a .lottie archive from raw bytes.
39
- * @param {Uint8Array} data
40
- * @param {number} width
41
- * @param {number} height
42
35
  * @returns {boolean}
43
36
  */
44
- load_dotlottie_data(data: Uint8Array, width: number, height: number): boolean;
37
+ is_playing(): boolean;
45
38
  /**
46
- * Load an animation from an already-loaded .lottie archive by its ID.
47
- * @param {string} id
48
- * @param {number} width
49
- * @param {number} height
50
39
  * @returns {boolean}
51
40
  */
52
- load_animation_from_id(id: string, width: number, height: number): boolean;
41
+ is_stopped(): boolean;
53
42
  /**
54
- * Advance time and render. Call once per `requestAnimationFrame`.
55
- * @returns {boolean}
43
+ * @returns {string}
56
44
  */
57
- tick(): boolean;
45
+ layout_fit(): string;
58
46
  /**
59
- * Render the current frame without advancing time.
60
- * @returns {boolean}
47
+ * @returns {number}
61
48
  */
62
- render(): boolean;
49
+ loop_count(): number;
63
50
  /**
64
- * Clear the canvas to the background colour.
51
+ * Poll the next player event. Returns `null` if the queue is empty,
52
+ * otherwise a plain JS object with a `type` string field and optional
53
+ * payload fields (`frameNo`, `loopCount`).
54
+ * @returns {any}
65
55
  */
66
- clear(): void;
56
+ poll_event(): any;
67
57
  /**
68
- * Resize the canvas. For the SW renderer this also resizes the pixel buffer.
69
- * @param {number} width
70
- * @param {number} height
58
+ * Reset a slot to its default value from the animation.
59
+ * @param {string} id
71
60
  * @returns {boolean}
72
61
  */
73
- resize(width: number, height: number): boolean;
62
+ reset_slot(id: string): boolean;
74
63
  /**
75
- * Zero-copy `Uint8Array` view into WASM linear memory.
64
+ * Set the layout.
76
65
  *
77
- * **Use the returned array immediately.** Do not store the reference across
78
- * any call that may reallocate the buffer (e.g. `resize` / `load_animation`
79
- * with different dimensions).
80
- * @returns {Uint8Array}
66
+ * `fit` is one of `"contain"`, `"fill"`, `"cover"`, `"fit-width"`,
67
+ * `"fit-height"`, `"none"`. `align_x` / `align_y` are in [0, 1].
68
+ * @param {string} fit
69
+ * @param {number} align_x
70
+ * @param {number} align_y
71
+ * @returns {boolean}
81
72
  */
82
- get_pixel_buffer(): Uint8Array;
73
+ set_layout(fit: string, align_x: number, align_y: number): boolean;
74
+ /**
75
+ * @param {string} name
76
+ */
77
+ set_marker(name: string): void;
83
78
  /**
84
79
  * @returns {boolean}
85
80
  */
86
- play(): boolean;
81
+ tween_stop(): boolean;
87
82
  /**
88
83
  * @returns {boolean}
89
84
  */
90
- pause(): boolean;
85
+ clear_slots(): boolean;
91
86
  /**
92
87
  * @returns {boolean}
93
88
  */
94
- stop(): boolean;
89
+ has_segment(): boolean;
95
90
  /**
96
91
  * @returns {boolean}
97
92
  */
98
- is_playing(): boolean;
93
+ is_complete(): boolean;
99
94
  /**
100
95
  * @returns {boolean}
101
96
  */
102
- is_paused(): boolean;
97
+ is_tweening(): boolean;
103
98
  /**
99
+ * Reset all slots to their default values from the animation.
104
100
  * @returns {boolean}
105
101
  */
106
- is_stopped(): boolean;
102
+ reset_slots(): boolean;
107
103
  /**
108
104
  * @returns {boolean}
109
105
  */
110
- is_loaded(): boolean;
106
+ reset_theme(): boolean;
107
+ /**
108
+ * @returns {number}
109
+ */
110
+ segment_end(): number;
111
111
  /**
112
+ * @param {number} quality
112
113
  * @returns {boolean}
113
114
  */
114
- is_complete(): boolean;
115
+ set_quality(quality: number): boolean;
115
116
  /**
117
+ * @param {number} start
118
+ * @param {number} end
116
119
  * @returns {boolean}
117
120
  */
118
- is_tweening(): boolean;
121
+ set_segment(start: number, end: number): boolean;
119
122
  /**
120
- * @returns {number}
123
+ * @returns {string | undefined}
121
124
  */
122
- current_frame(): number;
125
+ animation_id(): string | undefined;
126
+ clear_marker(): void;
127
+ emit_on_loop(): void;
123
128
  /**
124
- * @returns {number}
129
+ * Get all slot IDs as a JS array.
130
+ * @returns {any}
125
131
  */
126
- total_frames(): number;
132
+ get_slot_ids(): any;
127
133
  /**
128
- * @returns {number}
134
+ * Get the JSON value of a single slot by ID, or `undefined` if not found.
135
+ * @param {string} id
136
+ * @returns {string | undefined}
129
137
  */
130
- request_frame(): number;
138
+ get_slot_str(id: string): string | undefined;
131
139
  /**
132
- * @param {number} no
140
+ * Returns an array of marker name strings.
141
+ * @returns {any}
142
+ */
143
+ marker_names(): any;
144
+ /**
145
+ * @param {boolean} v
146
+ */
147
+ set_autoplay(v: boolean): void;
148
+ /**
149
+ * Set a single slot by ID from a JSON value string.
150
+ * @param {string} id
151
+ * @param {string} json
133
152
  * @returns {boolean}
134
153
  */
135
- set_frame(no: number): boolean;
154
+ set_slot_str(id: string, json: string): boolean;
136
155
  /**
137
- * @param {number} no
156
+ * @param {number} x
157
+ * @param {number} y
158
+ * @param {number} w
159
+ * @param {number} h
138
160
  * @returns {boolean}
139
161
  */
140
- seek(no: number): boolean;
162
+ set_viewport(x: number, y: number, w: number, h: number): boolean;
141
163
  /**
142
164
  * @returns {number}
143
165
  */
144
- duration(): number;
166
+ total_frames(): number;
145
167
  /**
146
- * @returns {number}
168
+ * @param {number | null} [progress]
169
+ * @returns {boolean}
147
170
  */
148
- segment_duration(): number;
171
+ tween_update(progress?: number | null): boolean;
149
172
  /**
150
- * @returns {number}
173
+ * @returns {boolean}
151
174
  */
152
- current_loop_count(): number;
153
- reset_current_loop_count(): void;
175
+ clear_segment(): boolean;
154
176
  /**
155
177
  * @returns {number}
156
178
  */
157
- width(): number;
179
+ current_frame(): number;
158
180
  /**
159
- * @returns {number}
181
+ * Get the type string of a slot, or `undefined` if not found.
182
+ * @param {string} id
183
+ * @returns {string | undefined}
160
184
  */
161
- height(): number;
185
+ get_slot_type(id: string): string | undefined;
162
186
  /**
163
- * `[width, height]` of the animation in its native coordinate space.
164
- * @returns {Float32Array}
187
+ * Get all slots as a JSON object string.
188
+ * @returns {string}
165
189
  */
166
- animation_size(): Float32Array;
190
+ get_slots_str(): string;
167
191
  /**
168
- * @returns {Mode}
192
+ * Returns the current affine transform as a flat `Float32Array`.
193
+ * @returns {Float32Array}
169
194
  */
170
- mode(): Mode$1;
195
+ get_transform(): Float32Array;
171
196
  /**
172
- * @param {Mode} mode
197
+ * @returns {number}
173
198
  */
174
- set_mode(mode: Mode$1): void;
199
+ request_frame(): number;
175
200
  /**
176
201
  * @returns {number}
177
202
  */
178
- speed(): number;
203
+ segment_start(): number;
179
204
  /**
180
- * @param {number} speed
205
+ * Set multiple slots at once from a JSON string.
206
+ * @param {string} json
207
+ * @returns {boolean}
181
208
  */
182
- set_speed(speed: number): void;
209
+ set_slots_str(json: string): boolean;
183
210
  /**
211
+ * @param {string} id
212
+ * @param {string} text
184
213
  * @returns {boolean}
185
214
  */
186
- loop_animation(): boolean;
215
+ set_text_slot(id: string, text: string): boolean;
187
216
  /**
188
- * @param {boolean} v
217
+ * @param {Float32Array} data
218
+ * @returns {boolean}
189
219
  */
190
- set_loop(v: boolean): void;
220
+ set_transform(data: Float32Array): boolean;
191
221
  /**
192
- * @returns {number}
222
+ * Returns all state machine inputs as a JS array of strings.
223
+ * @returns {any}
193
224
  */
194
- loop_count(): number;
225
+ sm_get_inputs(): any;
195
226
  /**
196
- * @param {number} n
227
+ * Poll the next state machine event. Returns `null` if the queue is empty,
228
+ * otherwise a JS object with a `type` field and optional payload.
229
+ * @returns {any}
197
230
  */
198
- set_loop_count(n: number): void;
231
+ sm_poll_event(): any;
199
232
  /**
200
- * @returns {boolean}
233
+ * @param {number} x
234
+ * @param {number} y
201
235
  */
202
- autoplay(): boolean;
236
+ sm_post_click(x: number, y: number): void;
203
237
  /**
204
- * @param {boolean} v
238
+ * `[width, height]` of the animation in its native coordinate space.
239
+ * @returns {Float32Array}
205
240
  */
206
- set_autoplay(v: boolean): void;
241
+ animation_size(): Float32Array;
207
242
  /**
208
- * @returns {boolean}
243
+ * Name of the currently active marker, or `undefined` if none.
244
+ * @returns {string | undefined}
209
245
  */
210
- use_frame_interpolation(): boolean;
246
+ current_marker(): string | undefined;
211
247
  /**
212
- * @param {boolean} v
248
+ * @returns {number}
213
249
  */
214
- set_use_frame_interpolation(v: boolean): void;
250
+ layout_align_x(): number;
215
251
  /**
216
252
  * @returns {number}
217
253
  */
218
- background_color(): number;
254
+ layout_align_y(): number;
219
255
  /**
220
- * Set background colour (`0xAARRGGBB`).
221
- * @param {number} color
256
+ * Load a Lottie JSON animation. Sets up the rendering target automatically.
257
+ * @param {string} data
258
+ * @param {number} width
259
+ * @param {number} height
222
260
  * @returns {boolean}
223
261
  */
224
- set_background_color(color: number): boolean;
262
+ load_animation(data: string, width: number, height: number): boolean;
225
263
  /**
226
- * Clear the background colour (transparent).
227
264
  * @returns {boolean}
228
265
  */
229
- clear_background_color(): boolean;
266
+ loop_animation(): boolean;
230
267
  /**
231
- * @param {number} quality
268
+ * Set a color slot (`r`, `g`, `b` in [0, 1]).
269
+ * @param {string} id
270
+ * @param {number} r
271
+ * @param {number} g
272
+ * @param {number} b
232
273
  * @returns {boolean}
233
274
  */
234
- set_quality(quality: number): boolean;
275
+ set_color_slot(id: string, r: number, g: number, b: number): boolean;
276
+ /**
277
+ * @param {number} n
278
+ */
279
+ set_loop_count(n: number): void;
235
280
  /**
281
+ * @param {string} data
236
282
  * @returns {boolean}
237
283
  */
238
- has_segment(): boolean;
284
+ set_theme_data(data: string): boolean;
239
285
  /**
240
- * @returns {number}
286
+ * @param {string} key
241
287
  */
242
- segment_start(): number;
288
+ sm_reset_input(key: string): void;
243
289
  /**
244
- * @returns {number}
290
+ * Returns the animation manifest as a JSON string, or empty string if unavailable.
291
+ * @returns {string}
245
292
  */
246
- segment_end(): number;
293
+ manifest_string(): string;
247
294
  /**
248
- * @param {number} start
249
- * @param {number} end
295
+ * @param {string} id
296
+ * @param {number} value
250
297
  * @returns {boolean}
251
298
  */
252
- set_segment(start: number, end: number): boolean;
299
+ set_scalar_slot(id: string, value: number): boolean;
253
300
  /**
301
+ * @param {string} id
302
+ * @param {number} x
303
+ * @param {number} y
254
304
  * @returns {boolean}
255
305
  */
256
- clear_segment(): boolean;
306
+ set_vector_slot(id: string, x: number, y: number): boolean;
257
307
  /**
258
- * Set the layout.
259
- *
260
- * `fit` is one of `"contain"`, `"fill"`, `"cover"`, `"fit-width"`,
261
- * `"fit-height"`, `"none"`. `align_x` / `align_y` are in [0, 1].
262
- * @param {string} fit
263
- * @param {number} align_x
264
- * @param {number} align_y
308
+ * @param {string} marker
309
+ * @param {number | null} [duration]
265
310
  * @returns {boolean}
266
311
  */
267
- set_layout(fit: string, align_x: number, align_y: number): boolean;
268
- /**
269
- * @returns {string}
270
- */
271
- layout_fit(): string;
312
+ tween_to_marker(marker: string, duration?: number | null): boolean;
272
313
  /**
273
314
  * @returns {number}
274
315
  */
275
- layout_align_x(): number;
316
+ background_color(): number;
276
317
  /**
277
- * @returns {number}
318
+ * Returns `[x, y, width, height]` of the layer's bounding box.
319
+ * @param {string} layer_name
320
+ * @returns {Float32Array}
278
321
  */
279
- layout_align_y(): number;
322
+ get_layer_bounds(layer_name: string): Float32Array;
280
323
  /**
281
- * @param {number} x
282
- * @param {number} y
283
- * @param {number} w
284
- * @param {number} h
285
- * @returns {boolean}
324
+ * Zero-copy `Uint8Array` view into WASM linear memory.
325
+ *
326
+ * **Use the returned array immediately.** Do not store the reference across
327
+ * any call that may reallocate the buffer (e.g. `resize` / `load_animation`
328
+ * with different dimensions).
329
+ * @returns {Uint8Array}
286
330
  */
287
- set_viewport(x: number, y: number, w: number, h: number): boolean;
331
+ get_pixel_buffer(): Uint8Array;
288
332
  /**
289
- * Set a color slot (`r`, `g`, `b` in [0, 1]).
290
- * @param {string} id
291
- * @param {number} r
292
- * @param {number} g
293
- * @param {number} b
294
- * @returns {boolean}
333
+ * @returns {number}
295
334
  */
296
- set_color_slot(id: string, r: number, g: number, b: number): boolean;
335
+ segment_duration(): number;
297
336
  /**
298
- * @param {string} id
299
- * @param {number} value
300
- * @returns {boolean}
337
+ * Get the name of the current state.
338
+ * @returns {string}
301
339
  */
302
- set_scalar_slot(id: string, value: number): boolean;
340
+ sm_current_state(): string;
303
341
  /**
304
- * @param {string} id
305
- * @param {string} text
306
- * @returns {boolean}
342
+ * Returns the ID of the currently active state machine, or `undefined`.
343
+ * @returns {string | undefined}
307
344
  */
308
- set_text_slot(id: string, text: string): boolean;
345
+ state_machine_id(): string | undefined;
309
346
  /**
347
+ * Returns the raw JSON definition of a state machine by ID, or `undefined`.
310
348
  * @param {string} id
311
- * @param {number} x
312
- * @param {number} y
313
- * @returns {boolean}
349
+ * @returns {string | undefined}
314
350
  */
315
- set_vector_slot(id: string, x: number, y: number): boolean;
351
+ get_state_machine(id: string): string | undefined;
316
352
  /**
317
353
  * @param {string} id
318
354
  * @param {number} x
@@ -321,206 +357,216 @@ declare class DotLottiePlayerWasm {
321
357
  */
322
358
  set_position_slot(id: string, x: number, y: number): boolean;
323
359
  /**
360
+ * Tween with a cubic-bezier easing (`e0..e3`).
361
+ * @param {number} to
362
+ * @param {number | null | undefined} duration
363
+ * @param {number} e0
364
+ * @param {number} e1
365
+ * @param {number} e2
366
+ * @param {number} e3
324
367
  * @returns {boolean}
325
368
  */
326
- clear_slots(): boolean;
327
- /**
328
- * @param {string} id
329
- * @returns {boolean}
330
- */
331
- clear_slot(id: string): boolean;
369
+ tween_with_easing(to: number, duration: number | null | undefined, e0: number, e1: number, e2: number, e3: number): boolean;
332
370
  /**
333
- * Set multiple slots at once from a JSON string.
334
- * @param {string} json
335
- * @returns {boolean}
371
+ * @returns {number}
336
372
  */
337
- set_slots_str(json: string): boolean;
373
+ current_loop_count(): number;
338
374
  /**
339
- * Set a single slot by ID from a JSON value string.
340
- * @param {string} id
341
- * @param {string} json
342
- * @returns {boolean}
375
+ * Returns the framework setup listeners as a JS array of strings.
376
+ * @returns {any}
343
377
  */
344
- set_slot_str(id: string, json: string): boolean;
378
+ sm_framework_setup(): any;
345
379
  /**
346
- * Get the JSON value of a single slot by ID, or `undefined` if not found.
347
- * @param {string} id
348
- * @returns {string | undefined}
380
+ * @param {number} x
381
+ * @param {number} y
349
382
  */
350
- get_slot_str(id: string): string | undefined;
383
+ sm_post_pointer_up(x: number, y: number): void;
351
384
  /**
352
- * Get all slots as a JSON object string.
353
- * @returns {string}
385
+ * Load a state machine from a JSON definition string. Returns `true` on
386
+ * success. The engine is kept alive inside the player and interacted
387
+ * with via the `sm_*` methods.
388
+ * @param {string} definition
389
+ * @returns {boolean}
354
390
  */
355
- get_slots_str(): string;
391
+ state_machine_load(definition: string): boolean;
356
392
  /**
357
- * Get all slot IDs as a JS array.
358
- * @returns {any}
393
+ * Load a .lottie archive from raw bytes.
394
+ * @param {Uint8Array} data
395
+ * @param {number} width
396
+ * @param {number} height
397
+ * @returns {boolean}
359
398
  */
360
- get_slot_ids(): any;
399
+ load_dotlottie_data(data: Uint8Array, width: number, height: number): boolean;
361
400
  /**
362
- * Get the type string of a slot, or `undefined` if not found.
363
- * @param {string} id
401
+ * @param {string} key
364
402
  * @returns {string | undefined}
365
403
  */
366
- get_slot_type(id: string): string | undefined;
404
+ sm_get_string_input(key: string): string | undefined;
367
405
  /**
368
- * Reset a slot to its default value from the animation.
369
- * @param {string} id
406
+ * @param {string} key
407
+ * @param {string} value
370
408
  * @returns {boolean}
371
409
  */
372
- reset_slot(id: string): boolean;
410
+ sm_set_string_input(key: string, value: string): boolean;
373
411
  /**
374
- * Reset all slots to their default values from the animation.
412
+ * Set background colour (`0xAARRGGBB`).
413
+ * @param {number} color
375
414
  * @returns {boolean}
376
415
  */
377
- reset_slots(): boolean;
416
+ set_background_color(color: number): boolean;
417
+ /**
418
+ * @param {string} key
419
+ * @returns {boolean | undefined}
420
+ */
421
+ sm_get_boolean_input(key: string): boolean | undefined;
422
+ /**
423
+ * @param {string} key
424
+ * @returns {number | undefined}
425
+ */
426
+ sm_get_numeric_input(key: string): number | undefined;
378
427
  /**
379
428
  * @param {number} x
380
429
  * @param {number} y
381
- * @param {string} layer_name
382
- * @returns {boolean}
383
430
  */
384
- intersect(x: number, y: number, layer_name: string): boolean;
431
+ sm_post_pointer_down(x: number, y: number): void;
385
432
  /**
386
- * Returns `[x, y, width, height]` of the layer's bounding box.
387
- * @param {string} layer_name
388
- * @returns {Float32Array}
433
+ * @param {number} x
434
+ * @param {number} y
389
435
  */
390
- get_layer_bounds(layer_name: string): Float32Array;
436
+ sm_post_pointer_exit(x: number, y: number): void;
391
437
  /**
392
- * Returns the current affine transform as a flat `Float32Array`.
393
- * @returns {Float32Array}
438
+ * @param {number} x
439
+ * @param {number} y
394
440
  */
395
- get_transform(): Float32Array;
441
+ sm_post_pointer_move(x: number, y: number): void;
396
442
  /**
397
- * @param {Float32Array} data
443
+ * @param {string} key
444
+ * @param {boolean} value
398
445
  * @returns {boolean}
399
446
  */
400
- set_transform(data: Float32Array): boolean;
447
+ sm_set_boolean_input(key: string, value: boolean): boolean;
401
448
  /**
402
- * Tween to `to` frame. `duration` in seconds; pass `undefined` for default.
403
- * @param {number} to
404
- * @param {number | null} [duration]
449
+ * @param {string} key
450
+ * @param {number} value
405
451
  * @returns {boolean}
406
452
  */
407
- tween(to: number, duration?: number | null): boolean;
453
+ sm_set_numeric_input(key: string, value: number): boolean;
408
454
  /**
409
- * Tween with a cubic-bezier easing (`e0..e3`).
410
- * @param {number} to
411
- * @param {number | null | undefined} duration
412
- * @param {number} e0
413
- * @param {number} e1
414
- * @param {number} e2
415
- * @param {number} e3
416
- * @returns {boolean}
455
+ * Unload the active state machine.
417
456
  */
418
- tween_with_easing(to: number, duration: number | null | undefined, e0: number, e1: number, e2: number, e3: number): boolean;
457
+ state_machine_unload(): void;
419
458
  /**
420
- * @returns {boolean}
459
+ * @param {number} x
460
+ * @param {number} y
421
461
  */
422
- tween_stop(): boolean;
462
+ sm_post_pointer_enter(x: number, y: number): void;
423
463
  /**
424
- * @param {number | null} [progress]
464
+ * Clear the background colour (transparent).
425
465
  * @returns {boolean}
426
466
  */
427
- tween_update(progress?: number | null): boolean;
467
+ clear_background_color(): boolean;
428
468
  /**
429
- * @param {string} marker
430
- * @param {number | null} [duration]
469
+ * Load an animation from an already-loaded .lottie archive by its ID.
470
+ * @param {string} id
471
+ * @param {number} width
472
+ * @param {number} height
431
473
  * @returns {boolean}
432
474
  */
433
- tween_to_marker(marker: string, duration?: number | null): boolean;
475
+ load_animation_from_id(id: string, width: number, height: number): boolean;
434
476
  /**
435
- * Returns an array of `{ name, time, duration }` objects.
477
+ * Poll the next state machine internal event. Returns `null` if the
478
+ * queue is empty, otherwise a JS object `{ type: "Message", message }`.
436
479
  * @returns {any}
437
480
  */
438
- markers(): any;
481
+ sm_poll_internal_event(): any;
439
482
  /**
440
- * Returns an array of marker name strings.
441
- * @returns {any}
483
+ * @returns {boolean}
442
484
  */
443
- marker_names(): any;
485
+ use_frame_interpolation(): boolean;
486
+ reset_current_loop_count(): void;
444
487
  /**
445
- * Name of the currently active marker, or `undefined` if none.
446
- * @returns {string | undefined}
488
+ * Override the current state.
489
+ * @param {string} state
490
+ * @param {boolean} immediate
491
+ * @returns {boolean}
447
492
  */
448
- current_marker(): string | undefined;
493
+ sm_override_current_state(state: string, immediate: boolean): boolean;
449
494
  /**
450
- * @param {string} name
495
+ * Load a state machine from a .lottie archive by state-machine ID.
496
+ * @param {string} id
497
+ * @returns {boolean}
451
498
  */
452
- set_marker(name: string): void;
453
- clear_marker(): void;
499
+ state_machine_load_from_id(id: string): boolean;
454
500
  /**
455
- * Poll the next player event. Returns `null` if the queue is empty,
456
- * otherwise a plain JS object with a `type` string field and optional
457
- * payload fields (`frameNo`, `loopCount`).
458
- * @returns {any}
501
+ * @param {boolean} v
459
502
  */
460
- poll_event(): any;
461
- emit_on_loop(): void;
503
+ set_use_frame_interpolation(v: boolean): void;
504
+ /**
505
+ * @returns {Mode}
506
+ */
507
+ mode(): Mode$1;
462
508
  /**
463
- * @param {string} name
464
- * @param {Uint8Array} data
465
509
  * @returns {boolean}
466
510
  */
467
- load_font(name: string, data: Uint8Array): boolean;
511
+ play(): boolean;
468
512
  /**
469
- * @param {string} id
513
+ * @param {number} no
470
514
  * @returns {boolean}
471
515
  */
472
- set_theme(id: string): boolean;
516
+ seek(no: number): boolean;
473
517
  /**
474
518
  * @returns {boolean}
475
519
  */
476
- reset_theme(): boolean;
520
+ stop(): boolean;
477
521
  /**
478
- * @param {string} data
522
+ * Advance time and render. Call once per `requestAnimationFrame`.
479
523
  * @returns {boolean}
480
524
  */
481
- set_theme_data(data: string): boolean;
525
+ tick(): boolean;
482
526
  /**
483
- * @returns {string | undefined}
527
+ * Clear the canvas to the background colour.
484
528
  */
485
- theme_id(): string | undefined;
529
+ clear(): void;
486
530
  /**
487
- * @returns {string | undefined}
531
+ * @returns {boolean}
488
532
  */
489
- animation_id(): string | undefined;
533
+ pause(): boolean;
490
534
  /**
491
- * Returns the animation manifest as a JSON string, or empty string if unavailable.
492
- * @returns {string}
535
+ * @returns {number}
493
536
  */
494
- manifest_string(): string;
537
+ speed(): number;
495
538
  /**
496
- * Returns the raw JSON definition of a state machine by ID, or `undefined`.
497
- * @param {string} id
498
- * @returns {string | undefined}
539
+ * Tween to `to` frame. `duration` in seconds; pass `undefined` for default.
540
+ * @param {number} to
541
+ * @param {number | null} [duration]
542
+ * @returns {boolean}
499
543
  */
500
- get_state_machine(id: string): string | undefined;
544
+ tween(to: number, duration?: number | null): boolean;
501
545
  /**
502
- * Returns the ID of the currently active state machine, or `undefined`.
503
- * @returns {string | undefined}
546
+ * @returns {number}
504
547
  */
505
- state_machine_id(): string | undefined;
548
+ width(): number;
506
549
  /**
507
- * Load a state machine from a JSON definition string. Returns `true` on
508
- * success. The engine is kept alive inside the player and interacted
509
- * with via the `sm_*` methods.
510
- * @param {string} definition
550
+ * @returns {number}
551
+ */
552
+ height(): number;
553
+ /**
554
+ * Render the current frame without advancing time.
511
555
  * @returns {boolean}
512
556
  */
513
- state_machine_load(definition: string): boolean;
557
+ render(): boolean;
514
558
  /**
515
- * Load a state machine from a .lottie archive by state-machine ID.
516
- * @param {string} id
559
+ * Resize the canvas. For the SW renderer this also resizes the pixel buffer.
560
+ * @param {number} width
561
+ * @param {number} height
517
562
  * @returns {boolean}
518
563
  */
519
- state_machine_load_from_id(id: string): boolean;
564
+ resize(width: number, height: number): boolean;
520
565
  /**
521
- * Unload the active state machine.
566
+ * Returns an array of `{ name, time, duration }` objects.
567
+ * @returns {any}
522
568
  */
523
- state_machine_unload(): void;
569
+ markers(): any;
524
570
  /**
525
571
  * Fire a named event into the state machine.
526
572
  * @param {string} event
@@ -528,48 +574,32 @@ declare class DotLottiePlayerWasm {
528
574
  */
529
575
  sm_fire(event: string): boolean;
530
576
  /**
531
- * @param {string} key
532
- * @param {number} value
577
+ * Stop the state machine.
533
578
  * @returns {boolean}
534
579
  */
535
- sm_set_numeric_input(key: string, value: number): boolean;
536
- /**
537
- * @param {string} key
538
- * @returns {number | undefined}
539
- */
540
- sm_get_numeric_input(key: string): number | undefined;
580
+ sm_stop(): boolean;
541
581
  /**
542
- * @param {string} key
543
- * @param {string} value
582
+ * Advance the state machine by one tick. Returns `false` if no state machine
583
+ * is loaded, otherwise `true` (even if the machine is stopped or errored).
544
584
  * @returns {boolean}
545
585
  */
546
- sm_set_string_input(key: string, value: string): boolean;
547
- /**
548
- * @param {string} key
549
- * @returns {string | undefined}
550
- */
551
- sm_get_string_input(key: string): string | undefined;
586
+ sm_tick(): boolean;
552
587
  /**
553
- * @param {string} key
554
- * @param {boolean} value
555
588
  * @returns {boolean}
556
589
  */
557
- sm_set_boolean_input(key: string, value: boolean): boolean;
590
+ autoplay(): boolean;
558
591
  /**
559
- * @param {string} key
560
- * @returns {boolean | undefined}
592
+ * @returns {number}
561
593
  */
562
- sm_get_boolean_input(key: string): boolean | undefined;
594
+ duration(): number;
563
595
  /**
564
- * @param {string} key
596
+ * @param {boolean} v
565
597
  */
566
- sm_reset_input(key: string): void;
598
+ set_loop(v: boolean): void;
567
599
  /**
568
- * Poll the next state machine event. Returns `null` if the queue is empty,
569
- * otherwise a JS object with a `type` field and optional payload.
570
- * @returns {any}
600
+ * @param {Mode} mode
571
601
  */
572
- sm_poll_event(): any;
602
+ set_mode(mode: Mode$1): void;
573
603
  /**
574
604
  * Start the state machine with an open-URL policy.
575
605
  * @param {boolean} require_user_interaction
@@ -578,79 +608,49 @@ declare class DotLottiePlayerWasm {
578
608
  */
579
609
  sm_start(require_user_interaction: boolean, whitelist: any[]): boolean;
580
610
  /**
581
- * Stop the state machine.
582
- * @returns {boolean}
583
- */
584
- sm_stop(): boolean;
585
- /**
586
- * Get the current status of the state machine as a string.
587
- * @returns {string}
588
- */
589
- sm_status(): string;
590
- /**
591
- * Get the name of the current state.
592
- * @returns {string}
593
- */
594
- sm_current_state(): string;
595
- /**
596
- * Override the current state.
597
- * @param {string} state
598
- * @param {boolean} immediate
599
- * @returns {boolean}
600
- */
601
- sm_override_current_state(state: string, immediate: boolean): boolean;
602
- /**
603
- * Returns the framework setup listeners as a JS array of strings.
604
- * @returns {any}
605
- */
606
- sm_framework_setup(): any;
607
- /**
608
- * Returns all state machine inputs as a JS array of strings.
609
- * @returns {any}
611
+ * @returns {string | undefined}
610
612
  */
611
- sm_get_inputs(): any;
613
+ theme_id(): string | undefined;
612
614
  /**
613
615
  * @param {number} x
614
616
  * @param {number} y
617
+ * @param {string} layer_name
618
+ * @returns {boolean}
615
619
  */
616
- sm_post_click(x: number, y: number): void;
620
+ intersect(x: number, y: number, layer_name: string): boolean;
617
621
  /**
618
- * @param {number} x
619
- * @param {number} y
622
+ * @returns {boolean}
620
623
  */
621
- sm_post_pointer_down(x: number, y: number): void;
624
+ is_loaded(): boolean;
622
625
  /**
623
- * @param {number} x
624
- * @param {number} y
626
+ * @returns {boolean}
625
627
  */
626
- sm_post_pointer_up(x: number, y: number): void;
628
+ is_paused(): boolean;
627
629
  /**
628
- * @param {number} x
629
- * @param {number} y
630
+ * @param {string} name
631
+ * @param {Uint8Array} data
632
+ * @returns {boolean}
630
633
  */
631
- sm_post_pointer_move(x: number, y: number): void;
634
+ load_font(name: string, data: Uint8Array): boolean;
632
635
  /**
633
- * @param {number} x
634
- * @param {number} y
636
+ * @param {number} no
637
+ * @returns {boolean}
635
638
  */
636
- sm_post_pointer_enter(x: number, y: number): void;
639
+ set_frame(no: number): boolean;
637
640
  /**
638
- * @param {number} x
639
- * @param {number} y
641
+ * @param {number} speed
640
642
  */
641
- sm_post_pointer_exit(x: number, y: number): void;
643
+ set_speed(speed: number): void;
642
644
  /**
643
- * Poll the next state machine internal event. Returns `null` if the
644
- * queue is empty, otherwise a JS object `{ type: "Message", message }`.
645
- * @returns {any}
645
+ * @param {string} id
646
+ * @returns {boolean}
646
647
  */
647
- sm_poll_internal_event(): any;
648
+ set_theme(id: string): boolean;
648
649
  /**
649
- * Advance the state machine by one tick. Returns `false` if no state machine
650
- * is loaded, otherwise `true` (even if the machine is stopped or errored).
651
- * @returns {boolean}
650
+ * Get the current status of the state machine as a string.
651
+ * @returns {string}
652
652
  */
653
- sm_tick(): boolean;
653
+ sm_status(): string;
654
654
  }
655
655
  //#endregion
656
656
  //#region src/event-manager.d.ts