@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.
@@ -786,292 +786,328 @@ declare class DotLottiePlayerWasm {
786
786
  __wbg_ptr: number;
787
787
  free(): void;
788
788
  /**
789
- * Load a Lottie JSON animation. Sets up the rendering target automatically.
790
- * @param {string} data
791
- * @param {number} width
792
- * @param {number} height
789
+ * @param {string} id
793
790
  * @returns {boolean}
794
791
  */
795
- load_animation(data: string, width: number, height: number): boolean;
792
+ clear_slot(id: string): boolean;
796
793
  /**
797
- * Load a .lottie archive from raw bytes.
798
- * @param {Uint8Array} data
799
- * @param {number} width
800
- * @param {number} height
801
794
  * @returns {boolean}
802
795
  */
803
- load_dotlottie_data(data: Uint8Array, width: number, height: number): boolean;
796
+ is_playing(): boolean;
804
797
  /**
805
- * Load an animation from an already-loaded .lottie archive by its ID.
806
- * @param {string} id
807
- * @param {number} width
808
- * @param {number} height
809
798
  * @returns {boolean}
810
799
  */
811
- load_animation_from_id(id: string, width: number, height: number): boolean;
800
+ is_stopped(): boolean;
812
801
  /**
813
- * Advance time and render. Call once per `requestAnimationFrame`.
814
- * @returns {boolean}
802
+ * @returns {string}
815
803
  */
816
- tick(): boolean;
804
+ layout_fit(): string;
817
805
  /**
818
- * Render the current frame without advancing time.
819
- * @returns {boolean}
806
+ * @returns {number}
820
807
  */
821
- render(): boolean;
808
+ loop_count(): number;
822
809
  /**
823
- * Clear the canvas to the background colour.
810
+ * Poll the next player event. Returns `null` if the queue is empty,
811
+ * otherwise a plain JS object with a `type` string field and optional
812
+ * payload fields (`frameNo`, `loopCount`).
813
+ * @returns {any}
824
814
  */
825
- clear(): void;
815
+ poll_event(): any;
826
816
  /**
827
- * Resize the canvas. For the SW renderer this also resizes the pixel buffer.
828
- * @param {number} width
829
- * @param {number} height
817
+ * Reset a slot to its default value from the animation.
818
+ * @param {string} id
830
819
  * @returns {boolean}
831
820
  */
832
- resize(width: number, height: number): boolean;
821
+ reset_slot(id: string): boolean;
833
822
  /**
834
- * Zero-copy `Uint8Array` view into WASM linear memory.
823
+ * Set the layout.
835
824
  *
836
- * **Use the returned array immediately.** Do not store the reference across
837
- * any call that may reallocate the buffer (e.g. `resize` / `load_animation`
838
- * with different dimensions).
839
- * @returns {Uint8Array}
825
+ * `fit` is one of `"contain"`, `"fill"`, `"cover"`, `"fit-width"`,
826
+ * `"fit-height"`, `"none"`. `align_x` / `align_y` are in [0, 1].
827
+ * @param {string} fit
828
+ * @param {number} align_x
829
+ * @param {number} align_y
830
+ * @returns {boolean}
840
831
  */
841
- get_pixel_buffer(): Uint8Array;
832
+ set_layout(fit: string, align_x: number, align_y: number): boolean;
833
+ /**
834
+ * @param {string} name
835
+ */
836
+ set_marker(name: string): void;
842
837
  /**
843
838
  * @returns {boolean}
844
839
  */
845
- play(): boolean;
840
+ tween_stop(): boolean;
846
841
  /**
847
842
  * @returns {boolean}
848
843
  */
849
- pause(): boolean;
844
+ clear_slots(): boolean;
850
845
  /**
851
846
  * @returns {boolean}
852
847
  */
853
- stop(): boolean;
848
+ has_segment(): boolean;
854
849
  /**
855
850
  * @returns {boolean}
856
851
  */
857
- is_playing(): boolean;
852
+ is_complete(): boolean;
858
853
  /**
859
854
  * @returns {boolean}
860
855
  */
861
- is_paused(): boolean;
856
+ is_tweening(): boolean;
862
857
  /**
858
+ * Reset all slots to their default values from the animation.
863
859
  * @returns {boolean}
864
860
  */
865
- is_stopped(): boolean;
861
+ reset_slots(): boolean;
866
862
  /**
867
863
  * @returns {boolean}
868
864
  */
869
- is_loaded(): boolean;
865
+ reset_theme(): boolean;
866
+ /**
867
+ * @returns {number}
868
+ */
869
+ segment_end(): number;
870
870
  /**
871
+ * @param {number} quality
871
872
  * @returns {boolean}
872
873
  */
873
- is_complete(): boolean;
874
+ set_quality(quality: number): boolean;
874
875
  /**
876
+ * @param {number} start
877
+ * @param {number} end
875
878
  * @returns {boolean}
876
879
  */
877
- is_tweening(): boolean;
880
+ set_segment(start: number, end: number): boolean;
878
881
  /**
879
- * @returns {number}
882
+ * @returns {string | undefined}
880
883
  */
881
- current_frame(): number;
884
+ animation_id(): string | undefined;
885
+ clear_marker(): void;
886
+ emit_on_loop(): void;
882
887
  /**
883
- * @returns {number}
888
+ * Get all slot IDs as a JS array.
889
+ * @returns {any}
884
890
  */
885
- total_frames(): number;
891
+ get_slot_ids(): any;
886
892
  /**
887
- * @returns {number}
893
+ * Get the JSON value of a single slot by ID, or `undefined` if not found.
894
+ * @param {string} id
895
+ * @returns {string | undefined}
888
896
  */
889
- request_frame(): number;
897
+ get_slot_str(id: string): string | undefined;
890
898
  /**
891
- * @param {number} no
899
+ * Returns an array of marker name strings.
900
+ * @returns {any}
901
+ */
902
+ marker_names(): any;
903
+ /**
904
+ * @param {boolean} v
905
+ */
906
+ set_autoplay(v: boolean): void;
907
+ /**
908
+ * Set a single slot by ID from a JSON value string.
909
+ * @param {string} id
910
+ * @param {string} json
892
911
  * @returns {boolean}
893
912
  */
894
- set_frame(no: number): boolean;
913
+ set_slot_str(id: string, json: string): boolean;
895
914
  /**
896
- * @param {number} no
915
+ * @param {number} x
916
+ * @param {number} y
917
+ * @param {number} w
918
+ * @param {number} h
897
919
  * @returns {boolean}
898
920
  */
899
- seek(no: number): boolean;
921
+ set_viewport(x: number, y: number, w: number, h: number): boolean;
900
922
  /**
901
923
  * @returns {number}
902
924
  */
903
- duration(): number;
925
+ total_frames(): number;
904
926
  /**
905
- * @returns {number}
927
+ * @param {number | null} [progress]
928
+ * @returns {boolean}
906
929
  */
907
- segment_duration(): number;
930
+ tween_update(progress?: number | null): boolean;
908
931
  /**
909
- * @returns {number}
932
+ * @returns {boolean}
910
933
  */
911
- current_loop_count(): number;
912
- reset_current_loop_count(): void;
934
+ clear_segment(): boolean;
913
935
  /**
914
936
  * @returns {number}
915
937
  */
916
- width(): number;
938
+ current_frame(): number;
917
939
  /**
918
- * @returns {number}
940
+ * Get the type string of a slot, or `undefined` if not found.
941
+ * @param {string} id
942
+ * @returns {string | undefined}
919
943
  */
920
- height(): number;
944
+ get_slot_type(id: string): string | undefined;
921
945
  /**
922
- * `[width, height]` of the animation in its native coordinate space.
923
- * @returns {Float32Array}
946
+ * Get all slots as a JSON object string.
947
+ * @returns {string}
924
948
  */
925
- animation_size(): Float32Array;
949
+ get_slots_str(): string;
926
950
  /**
927
- * @returns {Mode}
951
+ * Returns the current affine transform as a flat `Float32Array`.
952
+ * @returns {Float32Array}
928
953
  */
929
- mode(): Mode$1;
954
+ get_transform(): Float32Array;
930
955
  /**
931
- * @param {Mode} mode
956
+ * @returns {number}
932
957
  */
933
- set_mode(mode: Mode$1): void;
958
+ request_frame(): number;
934
959
  /**
935
960
  * @returns {number}
936
961
  */
937
- speed(): number;
962
+ segment_start(): number;
938
963
  /**
939
- * @param {number} speed
964
+ * Set multiple slots at once from a JSON string.
965
+ * @param {string} json
966
+ * @returns {boolean}
940
967
  */
941
- set_speed(speed: number): void;
968
+ set_slots_str(json: string): boolean;
942
969
  /**
970
+ * @param {string} id
971
+ * @param {string} text
943
972
  * @returns {boolean}
944
973
  */
945
- loop_animation(): boolean;
974
+ set_text_slot(id: string, text: string): boolean;
946
975
  /**
947
- * @param {boolean} v
976
+ * @param {Float32Array} data
977
+ * @returns {boolean}
948
978
  */
949
- set_loop(v: boolean): void;
979
+ set_transform(data: Float32Array): boolean;
950
980
  /**
951
- * @returns {number}
981
+ * Returns all state machine inputs as a JS array of strings.
982
+ * @returns {any}
952
983
  */
953
- loop_count(): number;
984
+ sm_get_inputs(): any;
954
985
  /**
955
- * @param {number} n
986
+ * Poll the next state machine event. Returns `null` if the queue is empty,
987
+ * otherwise a JS object with a `type` field and optional payload.
988
+ * @returns {any}
956
989
  */
957
- set_loop_count(n: number): void;
990
+ sm_poll_event(): any;
958
991
  /**
959
- * @returns {boolean}
992
+ * @param {number} x
993
+ * @param {number} y
960
994
  */
961
- autoplay(): boolean;
995
+ sm_post_click(x: number, y: number): void;
962
996
  /**
963
- * @param {boolean} v
997
+ * `[width, height]` of the animation in its native coordinate space.
998
+ * @returns {Float32Array}
964
999
  */
965
- set_autoplay(v: boolean): void;
1000
+ animation_size(): Float32Array;
966
1001
  /**
967
- * @returns {boolean}
1002
+ * Name of the currently active marker, or `undefined` if none.
1003
+ * @returns {string | undefined}
968
1004
  */
969
- use_frame_interpolation(): boolean;
1005
+ current_marker(): string | undefined;
970
1006
  /**
971
- * @param {boolean} v
1007
+ * @returns {number}
972
1008
  */
973
- set_use_frame_interpolation(v: boolean): void;
1009
+ layout_align_x(): number;
974
1010
  /**
975
1011
  * @returns {number}
976
1012
  */
977
- background_color(): number;
1013
+ layout_align_y(): number;
978
1014
  /**
979
- * Set background colour (`0xAARRGGBB`).
980
- * @param {number} color
1015
+ * Load a Lottie JSON animation. Sets up the rendering target automatically.
1016
+ * @param {string} data
1017
+ * @param {number} width
1018
+ * @param {number} height
981
1019
  * @returns {boolean}
982
1020
  */
983
- set_background_color(color: number): boolean;
1021
+ load_animation(data: string, width: number, height: number): boolean;
984
1022
  /**
985
- * Clear the background colour (transparent).
986
1023
  * @returns {boolean}
987
1024
  */
988
- clear_background_color(): boolean;
1025
+ loop_animation(): boolean;
989
1026
  /**
990
- * @param {number} quality
1027
+ * Set a color slot (`r`, `g`, `b` in [0, 1]).
1028
+ * @param {string} id
1029
+ * @param {number} r
1030
+ * @param {number} g
1031
+ * @param {number} b
991
1032
  * @returns {boolean}
992
1033
  */
993
- set_quality(quality: number): boolean;
1034
+ set_color_slot(id: string, r: number, g: number, b: number): boolean;
1035
+ /**
1036
+ * @param {number} n
1037
+ */
1038
+ set_loop_count(n: number): void;
994
1039
  /**
1040
+ * @param {string} data
995
1041
  * @returns {boolean}
996
1042
  */
997
- has_segment(): boolean;
1043
+ set_theme_data(data: string): boolean;
998
1044
  /**
999
- * @returns {number}
1045
+ * @param {string} key
1000
1046
  */
1001
- segment_start(): number;
1047
+ sm_reset_input(key: string): void;
1002
1048
  /**
1003
- * @returns {number}
1049
+ * Returns the animation manifest as a JSON string, or empty string if unavailable.
1050
+ * @returns {string}
1004
1051
  */
1005
- segment_end(): number;
1052
+ manifest_string(): string;
1006
1053
  /**
1007
- * @param {number} start
1008
- * @param {number} end
1054
+ * @param {string} id
1055
+ * @param {number} value
1009
1056
  * @returns {boolean}
1010
1057
  */
1011
- set_segment(start: number, end: number): boolean;
1058
+ set_scalar_slot(id: string, value: number): boolean;
1012
1059
  /**
1060
+ * @param {string} id
1061
+ * @param {number} x
1062
+ * @param {number} y
1013
1063
  * @returns {boolean}
1014
1064
  */
1015
- clear_segment(): boolean;
1065
+ set_vector_slot(id: string, x: number, y: number): boolean;
1016
1066
  /**
1017
- * Set the layout.
1018
- *
1019
- * `fit` is one of `"contain"`, `"fill"`, `"cover"`, `"fit-width"`,
1020
- * `"fit-height"`, `"none"`. `align_x` / `align_y` are in [0, 1].
1021
- * @param {string} fit
1022
- * @param {number} align_x
1023
- * @param {number} align_y
1067
+ * @param {string} marker
1068
+ * @param {number | null} [duration]
1024
1069
  * @returns {boolean}
1025
1070
  */
1026
- set_layout(fit: string, align_x: number, align_y: number): boolean;
1027
- /**
1028
- * @returns {string}
1029
- */
1030
- layout_fit(): string;
1071
+ tween_to_marker(marker: string, duration?: number | null): boolean;
1031
1072
  /**
1032
1073
  * @returns {number}
1033
1074
  */
1034
- layout_align_x(): number;
1075
+ background_color(): number;
1035
1076
  /**
1036
- * @returns {number}
1077
+ * Returns `[x, y, width, height]` of the layer's bounding box.
1078
+ * @param {string} layer_name
1079
+ * @returns {Float32Array}
1037
1080
  */
1038
- layout_align_y(): number;
1081
+ get_layer_bounds(layer_name: string): Float32Array;
1039
1082
  /**
1040
- * @param {number} x
1041
- * @param {number} y
1042
- * @param {number} w
1043
- * @param {number} h
1044
- * @returns {boolean}
1083
+ * Zero-copy `Uint8Array` view into WASM linear memory.
1084
+ *
1085
+ * **Use the returned array immediately.** Do not store the reference across
1086
+ * any call that may reallocate the buffer (e.g. `resize` / `load_animation`
1087
+ * with different dimensions).
1088
+ * @returns {Uint8Array}
1045
1089
  */
1046
- set_viewport(x: number, y: number, w: number, h: number): boolean;
1090
+ get_pixel_buffer(): Uint8Array;
1047
1091
  /**
1048
- * Set a color slot (`r`, `g`, `b` in [0, 1]).
1049
- * @param {string} id
1050
- * @param {number} r
1051
- * @param {number} g
1052
- * @param {number} b
1053
- * @returns {boolean}
1092
+ * @returns {number}
1054
1093
  */
1055
- set_color_slot(id: string, r: number, g: number, b: number): boolean;
1094
+ segment_duration(): number;
1056
1095
  /**
1057
- * @param {string} id
1058
- * @param {number} value
1059
- * @returns {boolean}
1096
+ * Get the name of the current state.
1097
+ * @returns {string}
1060
1098
  */
1061
- set_scalar_slot(id: string, value: number): boolean;
1099
+ sm_current_state(): string;
1062
1100
  /**
1063
- * @param {string} id
1064
- * @param {string} text
1065
- * @returns {boolean}
1101
+ * Returns the ID of the currently active state machine, or `undefined`.
1102
+ * @returns {string | undefined}
1066
1103
  */
1067
- set_text_slot(id: string, text: string): boolean;
1104
+ state_machine_id(): string | undefined;
1068
1105
  /**
1106
+ * Returns the raw JSON definition of a state machine by ID, or `undefined`.
1069
1107
  * @param {string} id
1070
- * @param {number} x
1071
- * @param {number} y
1072
- * @returns {boolean}
1108
+ * @returns {string | undefined}
1073
1109
  */
1074
- set_vector_slot(id: string, x: number, y: number): boolean;
1110
+ get_state_machine(id: string): string | undefined;
1075
1111
  /**
1076
1112
  * @param {string} id
1077
1113
  * @param {number} x
@@ -1080,206 +1116,216 @@ declare class DotLottiePlayerWasm {
1080
1116
  */
1081
1117
  set_position_slot(id: string, x: number, y: number): boolean;
1082
1118
  /**
1119
+ * Tween with a cubic-bezier easing (`e0..e3`).
1120
+ * @param {number} to
1121
+ * @param {number | null | undefined} duration
1122
+ * @param {number} e0
1123
+ * @param {number} e1
1124
+ * @param {number} e2
1125
+ * @param {number} e3
1083
1126
  * @returns {boolean}
1084
1127
  */
1085
- clear_slots(): boolean;
1086
- /**
1087
- * @param {string} id
1088
- * @returns {boolean}
1089
- */
1090
- clear_slot(id: string): boolean;
1128
+ tween_with_easing(to: number, duration: number | null | undefined, e0: number, e1: number, e2: number, e3: number): boolean;
1091
1129
  /**
1092
- * Set multiple slots at once from a JSON string.
1093
- * @param {string} json
1094
- * @returns {boolean}
1130
+ * @returns {number}
1095
1131
  */
1096
- set_slots_str(json: string): boolean;
1132
+ current_loop_count(): number;
1097
1133
  /**
1098
- * Set a single slot by ID from a JSON value string.
1099
- * @param {string} id
1100
- * @param {string} json
1101
- * @returns {boolean}
1134
+ * Returns the framework setup listeners as a JS array of strings.
1135
+ * @returns {any}
1102
1136
  */
1103
- set_slot_str(id: string, json: string): boolean;
1137
+ sm_framework_setup(): any;
1104
1138
  /**
1105
- * Get the JSON value of a single slot by ID, or `undefined` if not found.
1106
- * @param {string} id
1107
- * @returns {string | undefined}
1139
+ * @param {number} x
1140
+ * @param {number} y
1108
1141
  */
1109
- get_slot_str(id: string): string | undefined;
1142
+ sm_post_pointer_up(x: number, y: number): void;
1110
1143
  /**
1111
- * Get all slots as a JSON object string.
1112
- * @returns {string}
1144
+ * Load a state machine from a JSON definition string. Returns `true` on
1145
+ * success. The engine is kept alive inside the player and interacted
1146
+ * with via the `sm_*` methods.
1147
+ * @param {string} definition
1148
+ * @returns {boolean}
1113
1149
  */
1114
- get_slots_str(): string;
1150
+ state_machine_load(definition: string): boolean;
1115
1151
  /**
1116
- * Get all slot IDs as a JS array.
1117
- * @returns {any}
1152
+ * Load a .lottie archive from raw bytes.
1153
+ * @param {Uint8Array} data
1154
+ * @param {number} width
1155
+ * @param {number} height
1156
+ * @returns {boolean}
1118
1157
  */
1119
- get_slot_ids(): any;
1158
+ load_dotlottie_data(data: Uint8Array, width: number, height: number): boolean;
1120
1159
  /**
1121
- * Get the type string of a slot, or `undefined` if not found.
1122
- * @param {string} id
1160
+ * @param {string} key
1123
1161
  * @returns {string | undefined}
1124
1162
  */
1125
- get_slot_type(id: string): string | undefined;
1163
+ sm_get_string_input(key: string): string | undefined;
1126
1164
  /**
1127
- * Reset a slot to its default value from the animation.
1128
- * @param {string} id
1165
+ * @param {string} key
1166
+ * @param {string} value
1129
1167
  * @returns {boolean}
1130
1168
  */
1131
- reset_slot(id: string): boolean;
1169
+ sm_set_string_input(key: string, value: string): boolean;
1132
1170
  /**
1133
- * Reset all slots to their default values from the animation.
1171
+ * Set background colour (`0xAARRGGBB`).
1172
+ * @param {number} color
1134
1173
  * @returns {boolean}
1135
1174
  */
1136
- reset_slots(): boolean;
1175
+ set_background_color(color: number): boolean;
1176
+ /**
1177
+ * @param {string} key
1178
+ * @returns {boolean | undefined}
1179
+ */
1180
+ sm_get_boolean_input(key: string): boolean | undefined;
1181
+ /**
1182
+ * @param {string} key
1183
+ * @returns {number | undefined}
1184
+ */
1185
+ sm_get_numeric_input(key: string): number | undefined;
1137
1186
  /**
1138
1187
  * @param {number} x
1139
1188
  * @param {number} y
1140
- * @param {string} layer_name
1141
- * @returns {boolean}
1142
1189
  */
1143
- intersect(x: number, y: number, layer_name: string): boolean;
1190
+ sm_post_pointer_down(x: number, y: number): void;
1144
1191
  /**
1145
- * Returns `[x, y, width, height]` of the layer's bounding box.
1146
- * @param {string} layer_name
1147
- * @returns {Float32Array}
1192
+ * @param {number} x
1193
+ * @param {number} y
1148
1194
  */
1149
- get_layer_bounds(layer_name: string): Float32Array;
1195
+ sm_post_pointer_exit(x: number, y: number): void;
1150
1196
  /**
1151
- * Returns the current affine transform as a flat `Float32Array`.
1152
- * @returns {Float32Array}
1197
+ * @param {number} x
1198
+ * @param {number} y
1153
1199
  */
1154
- get_transform(): Float32Array;
1200
+ sm_post_pointer_move(x: number, y: number): void;
1155
1201
  /**
1156
- * @param {Float32Array} data
1202
+ * @param {string} key
1203
+ * @param {boolean} value
1157
1204
  * @returns {boolean}
1158
1205
  */
1159
- set_transform(data: Float32Array): boolean;
1206
+ sm_set_boolean_input(key: string, value: boolean): boolean;
1160
1207
  /**
1161
- * Tween to `to` frame. `duration` in seconds; pass `undefined` for default.
1162
- * @param {number} to
1163
- * @param {number | null} [duration]
1208
+ * @param {string} key
1209
+ * @param {number} value
1164
1210
  * @returns {boolean}
1165
1211
  */
1166
- tween(to: number, duration?: number | null): boolean;
1212
+ sm_set_numeric_input(key: string, value: number): boolean;
1167
1213
  /**
1168
- * Tween with a cubic-bezier easing (`e0..e3`).
1169
- * @param {number} to
1170
- * @param {number | null | undefined} duration
1171
- * @param {number} e0
1172
- * @param {number} e1
1173
- * @param {number} e2
1174
- * @param {number} e3
1175
- * @returns {boolean}
1214
+ * Unload the active state machine.
1176
1215
  */
1177
- tween_with_easing(to: number, duration: number | null | undefined, e0: number, e1: number, e2: number, e3: number): boolean;
1216
+ state_machine_unload(): void;
1178
1217
  /**
1179
- * @returns {boolean}
1218
+ * @param {number} x
1219
+ * @param {number} y
1180
1220
  */
1181
- tween_stop(): boolean;
1221
+ sm_post_pointer_enter(x: number, y: number): void;
1182
1222
  /**
1183
- * @param {number | null} [progress]
1223
+ * Clear the background colour (transparent).
1184
1224
  * @returns {boolean}
1185
1225
  */
1186
- tween_update(progress?: number | null): boolean;
1226
+ clear_background_color(): boolean;
1187
1227
  /**
1188
- * @param {string} marker
1189
- * @param {number | null} [duration]
1228
+ * Load an animation from an already-loaded .lottie archive by its ID.
1229
+ * @param {string} id
1230
+ * @param {number} width
1231
+ * @param {number} height
1190
1232
  * @returns {boolean}
1191
1233
  */
1192
- tween_to_marker(marker: string, duration?: number | null): boolean;
1234
+ load_animation_from_id(id: string, width: number, height: number): boolean;
1193
1235
  /**
1194
- * Returns an array of `{ name, time, duration }` objects.
1236
+ * Poll the next state machine internal event. Returns `null` if the
1237
+ * queue is empty, otherwise a JS object `{ type: "Message", message }`.
1195
1238
  * @returns {any}
1196
1239
  */
1197
- markers(): any;
1240
+ sm_poll_internal_event(): any;
1198
1241
  /**
1199
- * Returns an array of marker name strings.
1200
- * @returns {any}
1242
+ * @returns {boolean}
1201
1243
  */
1202
- marker_names(): any;
1244
+ use_frame_interpolation(): boolean;
1245
+ reset_current_loop_count(): void;
1203
1246
  /**
1204
- * Name of the currently active marker, or `undefined` if none.
1205
- * @returns {string | undefined}
1247
+ * Override the current state.
1248
+ * @param {string} state
1249
+ * @param {boolean} immediate
1250
+ * @returns {boolean}
1206
1251
  */
1207
- current_marker(): string | undefined;
1252
+ sm_override_current_state(state: string, immediate: boolean): boolean;
1208
1253
  /**
1209
- * @param {string} name
1254
+ * Load a state machine from a .lottie archive by state-machine ID.
1255
+ * @param {string} id
1256
+ * @returns {boolean}
1210
1257
  */
1211
- set_marker(name: string): void;
1212
- clear_marker(): void;
1258
+ state_machine_load_from_id(id: string): boolean;
1213
1259
  /**
1214
- * Poll the next player event. Returns `null` if the queue is empty,
1215
- * otherwise a plain JS object with a `type` string field and optional
1216
- * payload fields (`frameNo`, `loopCount`).
1217
- * @returns {any}
1260
+ * @param {boolean} v
1218
1261
  */
1219
- poll_event(): any;
1220
- emit_on_loop(): void;
1262
+ set_use_frame_interpolation(v: boolean): void;
1263
+ /**
1264
+ * @returns {Mode}
1265
+ */
1266
+ mode(): Mode$1;
1221
1267
  /**
1222
- * @param {string} name
1223
- * @param {Uint8Array} data
1224
1268
  * @returns {boolean}
1225
1269
  */
1226
- load_font(name: string, data: Uint8Array): boolean;
1270
+ play(): boolean;
1227
1271
  /**
1228
- * @param {string} id
1272
+ * @param {number} no
1229
1273
  * @returns {boolean}
1230
1274
  */
1231
- set_theme(id: string): boolean;
1275
+ seek(no: number): boolean;
1232
1276
  /**
1233
1277
  * @returns {boolean}
1234
1278
  */
1235
- reset_theme(): boolean;
1279
+ stop(): boolean;
1236
1280
  /**
1237
- * @param {string} data
1281
+ * Advance time and render. Call once per `requestAnimationFrame`.
1238
1282
  * @returns {boolean}
1239
1283
  */
1240
- set_theme_data(data: string): boolean;
1284
+ tick(): boolean;
1241
1285
  /**
1242
- * @returns {string | undefined}
1286
+ * Clear the canvas to the background colour.
1243
1287
  */
1244
- theme_id(): string | undefined;
1288
+ clear(): void;
1245
1289
  /**
1246
- * @returns {string | undefined}
1290
+ * @returns {boolean}
1247
1291
  */
1248
- animation_id(): string | undefined;
1292
+ pause(): boolean;
1249
1293
  /**
1250
- * Returns the animation manifest as a JSON string, or empty string if unavailable.
1251
- * @returns {string}
1294
+ * @returns {number}
1252
1295
  */
1253
- manifest_string(): string;
1296
+ speed(): number;
1254
1297
  /**
1255
- * Returns the raw JSON definition of a state machine by ID, or `undefined`.
1256
- * @param {string} id
1257
- * @returns {string | undefined}
1298
+ * Tween to `to` frame. `duration` in seconds; pass `undefined` for default.
1299
+ * @param {number} to
1300
+ * @param {number | null} [duration]
1301
+ * @returns {boolean}
1258
1302
  */
1259
- get_state_machine(id: string): string | undefined;
1303
+ tween(to: number, duration?: number | null): boolean;
1260
1304
  /**
1261
- * Returns the ID of the currently active state machine, or `undefined`.
1262
- * @returns {string | undefined}
1305
+ * @returns {number}
1263
1306
  */
1264
- state_machine_id(): string | undefined;
1307
+ width(): number;
1265
1308
  /**
1266
- * Load a state machine from a JSON definition string. Returns `true` on
1267
- * success. The engine is kept alive inside the player and interacted
1268
- * with via the `sm_*` methods.
1269
- * @param {string} definition
1309
+ * @returns {number}
1310
+ */
1311
+ height(): number;
1312
+ /**
1313
+ * Render the current frame without advancing time.
1270
1314
  * @returns {boolean}
1271
1315
  */
1272
- state_machine_load(definition: string): boolean;
1316
+ render(): boolean;
1273
1317
  /**
1274
- * Load a state machine from a .lottie archive by state-machine ID.
1275
- * @param {string} id
1318
+ * Resize the canvas. For the SW renderer this also resizes the pixel buffer.
1319
+ * @param {number} width
1320
+ * @param {number} height
1276
1321
  * @returns {boolean}
1277
1322
  */
1278
- state_machine_load_from_id(id: string): boolean;
1323
+ resize(width: number, height: number): boolean;
1279
1324
  /**
1280
- * Unload the active state machine.
1325
+ * Returns an array of `{ name, time, duration }` objects.
1326
+ * @returns {any}
1281
1327
  */
1282
- state_machine_unload(): void;
1328
+ markers(): any;
1283
1329
  /**
1284
1330
  * Fire a named event into the state machine.
1285
1331
  * @param {string} event
@@ -1287,48 +1333,32 @@ declare class DotLottiePlayerWasm {
1287
1333
  */
1288
1334
  sm_fire(event: string): boolean;
1289
1335
  /**
1290
- * @param {string} key
1291
- * @param {number} value
1336
+ * Stop the state machine.
1292
1337
  * @returns {boolean}
1293
1338
  */
1294
- sm_set_numeric_input(key: string, value: number): boolean;
1295
- /**
1296
- * @param {string} key
1297
- * @returns {number | undefined}
1298
- */
1299
- sm_get_numeric_input(key: string): number | undefined;
1339
+ sm_stop(): boolean;
1300
1340
  /**
1301
- * @param {string} key
1302
- * @param {string} value
1341
+ * Advance the state machine by one tick. Returns `false` if no state machine
1342
+ * is loaded, otherwise `true` (even if the machine is stopped or errored).
1303
1343
  * @returns {boolean}
1304
1344
  */
1305
- sm_set_string_input(key: string, value: string): boolean;
1306
- /**
1307
- * @param {string} key
1308
- * @returns {string | undefined}
1309
- */
1310
- sm_get_string_input(key: string): string | undefined;
1345
+ sm_tick(): boolean;
1311
1346
  /**
1312
- * @param {string} key
1313
- * @param {boolean} value
1314
1347
  * @returns {boolean}
1315
1348
  */
1316
- sm_set_boolean_input(key: string, value: boolean): boolean;
1349
+ autoplay(): boolean;
1317
1350
  /**
1318
- * @param {string} key
1319
- * @returns {boolean | undefined}
1351
+ * @returns {number}
1320
1352
  */
1321
- sm_get_boolean_input(key: string): boolean | undefined;
1353
+ duration(): number;
1322
1354
  /**
1323
- * @param {string} key
1355
+ * @param {boolean} v
1324
1356
  */
1325
- sm_reset_input(key: string): void;
1357
+ set_loop(v: boolean): void;
1326
1358
  /**
1327
- * Poll the next state machine event. Returns `null` if the queue is empty,
1328
- * otherwise a JS object with a `type` field and optional payload.
1329
- * @returns {any}
1359
+ * @param {Mode} mode
1330
1360
  */
1331
- sm_poll_event(): any;
1361
+ set_mode(mode: Mode$1): void;
1332
1362
  /**
1333
1363
  * Start the state machine with an open-URL policy.
1334
1364
  * @param {boolean} require_user_interaction
@@ -1337,79 +1367,49 @@ declare class DotLottiePlayerWasm {
1337
1367
  */
1338
1368
  sm_start(require_user_interaction: boolean, whitelist: any[]): boolean;
1339
1369
  /**
1340
- * Stop the state machine.
1341
- * @returns {boolean}
1342
- */
1343
- sm_stop(): boolean;
1344
- /**
1345
- * Get the current status of the state machine as a string.
1346
- * @returns {string}
1347
- */
1348
- sm_status(): string;
1349
- /**
1350
- * Get the name of the current state.
1351
- * @returns {string}
1352
- */
1353
- sm_current_state(): string;
1354
- /**
1355
- * Override the current state.
1356
- * @param {string} state
1357
- * @param {boolean} immediate
1358
- * @returns {boolean}
1359
- */
1360
- sm_override_current_state(state: string, immediate: boolean): boolean;
1361
- /**
1362
- * Returns the framework setup listeners as a JS array of strings.
1363
- * @returns {any}
1364
- */
1365
- sm_framework_setup(): any;
1366
- /**
1367
- * Returns all state machine inputs as a JS array of strings.
1368
- * @returns {any}
1370
+ * @returns {string | undefined}
1369
1371
  */
1370
- sm_get_inputs(): any;
1372
+ theme_id(): string | undefined;
1371
1373
  /**
1372
1374
  * @param {number} x
1373
1375
  * @param {number} y
1376
+ * @param {string} layer_name
1377
+ * @returns {boolean}
1374
1378
  */
1375
- sm_post_click(x: number, y: number): void;
1379
+ intersect(x: number, y: number, layer_name: string): boolean;
1376
1380
  /**
1377
- * @param {number} x
1378
- * @param {number} y
1381
+ * @returns {boolean}
1379
1382
  */
1380
- sm_post_pointer_down(x: number, y: number): void;
1383
+ is_loaded(): boolean;
1381
1384
  /**
1382
- * @param {number} x
1383
- * @param {number} y
1385
+ * @returns {boolean}
1384
1386
  */
1385
- sm_post_pointer_up(x: number, y: number): void;
1387
+ is_paused(): boolean;
1386
1388
  /**
1387
- * @param {number} x
1388
- * @param {number} y
1389
+ * @param {string} name
1390
+ * @param {Uint8Array} data
1391
+ * @returns {boolean}
1389
1392
  */
1390
- sm_post_pointer_move(x: number, y: number): void;
1393
+ load_font(name: string, data: Uint8Array): boolean;
1391
1394
  /**
1392
- * @param {number} x
1393
- * @param {number} y
1395
+ * @param {number} no
1396
+ * @returns {boolean}
1394
1397
  */
1395
- sm_post_pointer_enter(x: number, y: number): void;
1398
+ set_frame(no: number): boolean;
1396
1399
  /**
1397
- * @param {number} x
1398
- * @param {number} y
1400
+ * @param {number} speed
1399
1401
  */
1400
- sm_post_pointer_exit(x: number, y: number): void;
1402
+ set_speed(speed: number): void;
1401
1403
  /**
1402
- * Poll the next state machine internal event. Returns `null` if the
1403
- * queue is empty, otherwise a JS object `{ type: "Message", message }`.
1404
- * @returns {any}
1404
+ * @param {string} id
1405
+ * @returns {boolean}
1405
1406
  */
1406
- sm_poll_internal_event(): any;
1407
+ set_theme(id: string): boolean;
1407
1408
  /**
1408
- * Advance the state machine by one tick. Returns `false` if no state machine
1409
- * is loaded, otherwise `true` (even if the machine is stopped or errored).
1410
- * @returns {boolean}
1409
+ * Get the current status of the state machine as a string.
1410
+ * @returns {string}
1411
1411
  */
1412
- sm_tick(): boolean;
1412
+ sm_status(): string;
1413
1413
  }
1414
1414
  //#endregion
1415
1415
  //#region src/dotlottie.d.ts