@lordicon/web 1.0.0 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/{LICENSE → LICENSE.md} +2 -11
- package/dist/index.js +5289 -6264
- package/dist/src/index.d.ts +2 -0
- package/dist/src/interfaces.d.ts +163 -0
- package/dist/src/lottie.d.ts +48 -0
- package/dist/src/parsers.d.ts +40 -0
- package/dist/{index.d.ts → src/player.d.ts} +233 -388
- package/dist/src/utils.d.ts +39 -0
- package/examples/03-states.html +3 -1
- package/examples/04-events.ts +0 -1
- package/examples/index.html +1 -0
- package/package.json +10 -10
- package/src/player.ts +15 -1
|
@@ -1,388 +1,233 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
*
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
*
|
|
9
|
-
*/
|
|
10
|
-
export declare
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
*
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
/**
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
/**
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
/**
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
/**
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
*
|
|
182
|
-
* @param
|
|
183
|
-
*/
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
*
|
|
202
|
-
*/
|
|
203
|
-
|
|
204
|
-
/**
|
|
205
|
-
*
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
*
|
|
231
|
-
*/
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
* Stop the animation.
|
|
235
|
-
*/
|
|
236
|
-
stop(): void;
|
|
237
|
-
/**
|
|
238
|
-
* Moves the animation to a specific frame and stops.
|
|
239
|
-
* @param frame Frame number to seek to.
|
|
240
|
-
*/
|
|
241
|
-
seek(frame: number): void;
|
|
242
|
-
/**
|
|
243
|
-
* Moves the animation to the first frame and stops.
|
|
244
|
-
*/
|
|
245
|
-
seekToStart(): void;
|
|
246
|
-
/**
|
|
247
|
-
* Moves the animation to the last frame and stops.
|
|
248
|
-
*/
|
|
249
|
-
seekToEnd(): void;
|
|
250
|
-
/**
|
|
251
|
-
* Sets the animation segment to play.
|
|
252
|
-
* If no segment is provided, resets to the default segment.
|
|
253
|
-
* @param segment Optional segment as [start, end] frame numbers.
|
|
254
|
-
*/
|
|
255
|
-
switchSegment(segment?: [number, number]): void;
|
|
256
|
-
/**
|
|
257
|
-
* Sets multiple icon properties at once.
|
|
258
|
-
* Any property not provided will be reset to its default value.
|
|
259
|
-
* @param properties Properties to assign.
|
|
260
|
-
*/
|
|
261
|
-
set properties(properties: IconProperties);
|
|
262
|
-
/**
|
|
263
|
-
* Gets the current icon properties (colors, stroke, state).
|
|
264
|
-
* @returns The current properties.
|
|
265
|
-
*/
|
|
266
|
-
get properties(): IconProperties;
|
|
267
|
-
/**
|
|
268
|
-
* Sets all customizable colors at once.
|
|
269
|
-
* Pass null to reset all colors to default.
|
|
270
|
-
* @param colors Color map or null.
|
|
271
|
-
*/
|
|
272
|
-
set colors(colors: ColorMap | null);
|
|
273
|
-
/**
|
|
274
|
-
* Provides a proxy for reading or updating individual colors by name.
|
|
275
|
-
*
|
|
276
|
-
* Example:
|
|
277
|
-
* player.colors.primary = '#ff0000';
|
|
278
|
-
* delete player.colors.secondary;
|
|
279
|
-
*/
|
|
280
|
-
get colors(): ColorMap;
|
|
281
|
-
/**
|
|
282
|
-
* Sets the stroke width for the icon.
|
|
283
|
-
* Pass null to reset to default.
|
|
284
|
-
* @param stroke Stroke value or null.
|
|
285
|
-
*/
|
|
286
|
-
set stroke(stroke: Stroke | null);
|
|
287
|
-
/**
|
|
288
|
-
* Gets the current stroke width of the icon.
|
|
289
|
-
* @returns Stroke value or null if not set.
|
|
290
|
-
*/
|
|
291
|
-
get stroke(): Stroke | null;
|
|
292
|
-
/**
|
|
293
|
-
* Sets the current state (animation segment) of the icon.
|
|
294
|
-
* If the state does not exist, falls back to the default state.
|
|
295
|
-
* @param state State name or null for default.
|
|
296
|
-
*/
|
|
297
|
-
set state(state: string | null);
|
|
298
|
-
/**
|
|
299
|
-
* Gets the current state (animation segment) of the icon.
|
|
300
|
-
* @returns State name or null if not set.
|
|
301
|
-
*/
|
|
302
|
-
get state(): string | null;
|
|
303
|
-
/**
|
|
304
|
-
* Sets the playback speed of the animation.
|
|
305
|
-
* @param speed Playback speed (1 = normal).
|
|
306
|
-
*/
|
|
307
|
-
set speed(speed: number);
|
|
308
|
-
/**
|
|
309
|
-
* Gets the current playback speed.
|
|
310
|
-
* @returns Playback speed.
|
|
311
|
-
*/
|
|
312
|
-
get speed(): number;
|
|
313
|
-
/**
|
|
314
|
-
* Sets the playback direction.
|
|
315
|
-
* @param direction 1 for forward, -1 for reverse.
|
|
316
|
-
*/
|
|
317
|
-
set direction(direction: PlaybackDirection_2);
|
|
318
|
-
/**
|
|
319
|
-
* Gets the current playback direction.
|
|
320
|
-
* @returns Playback direction.
|
|
321
|
-
*/
|
|
322
|
-
get direction(): PlaybackDirection_2;
|
|
323
|
-
/**
|
|
324
|
-
* Enables or disables looping of the animation.
|
|
325
|
-
* @param loop True to loop, false otherwise.
|
|
326
|
-
*/
|
|
327
|
-
set loop(loop: boolean);
|
|
328
|
-
/**
|
|
329
|
-
* Gets whether the animation is set to loop.
|
|
330
|
-
* @returns True if looping, false otherwise.
|
|
331
|
-
*/
|
|
332
|
-
get loop(): boolean;
|
|
333
|
-
/**
|
|
334
|
-
* Sets the current frame of the animation.
|
|
335
|
-
* @param frame Frame number.
|
|
336
|
-
*/
|
|
337
|
-
set frame(frame: number);
|
|
338
|
-
/**
|
|
339
|
-
* Gets the current frame of the animation.
|
|
340
|
-
* @returns Current frame number.
|
|
341
|
-
*/
|
|
342
|
-
get frame(): number;
|
|
343
|
-
/**
|
|
344
|
-
* Gets the list of available states for the icon.
|
|
345
|
-
* @returns Array of available states.
|
|
346
|
-
*/
|
|
347
|
-
get availableStates(): IconState[];
|
|
348
|
-
/**
|
|
349
|
-
* Returns true if the animation is currently playing.
|
|
350
|
-
*/
|
|
351
|
-
get playing(): boolean;
|
|
352
|
-
/**
|
|
353
|
-
* Returns true if the player is ready for interaction.
|
|
354
|
-
*/
|
|
355
|
-
get ready(): boolean;
|
|
356
|
-
/**
|
|
357
|
-
* Gets the total number of frames in the animation.
|
|
358
|
-
* @returns Frame count.
|
|
359
|
-
*/
|
|
360
|
-
get frameCount(): number;
|
|
361
|
-
/**
|
|
362
|
-
* Gets the current segment of the animation as [start, end] frame numbers.
|
|
363
|
-
* @returns Segment as [start, end].
|
|
364
|
-
*/
|
|
365
|
-
get segment(): [number, number];
|
|
366
|
-
/**
|
|
367
|
-
* Gets the duration of the animation in seconds.
|
|
368
|
-
* @returns Duration in seconds.
|
|
369
|
-
*/
|
|
370
|
-
get duration(): number;
|
|
371
|
-
/**
|
|
372
|
-
* Provides access to the underlying Lottie player instance.
|
|
373
|
-
* @returns LottieAnimationInstance.
|
|
374
|
-
*/
|
|
375
|
-
get lottieInstance(): LottieAnimationInstance | undefined;
|
|
376
|
-
/**
|
|
377
|
-
* Gets all customizable properties for the icon.
|
|
378
|
-
* @returns Array of LottieProperty.
|
|
379
|
-
*/
|
|
380
|
-
get lottieProperties(): LottieProperty[];
|
|
381
|
-
}
|
|
382
|
-
|
|
383
|
-
/**
|
|
384
|
-
* Supported stroke weights for icons.
|
|
385
|
-
*/
|
|
386
|
-
export declare type Stroke = 1 | 2 | 3 | 'light' | 'regular' | 'bold';
|
|
387
|
-
|
|
388
|
-
export { }
|
|
1
|
+
import { AnimationConfig } from '@lordicon/internal';
|
|
2
|
+
import { ColorMap, EventHandler, EventName, IconProperties, IconState, LegacyIconProperties, LottieAnimationInstance, LottieData, LottieProperty, PlaybackDirection, Stroke } from './interfaces';
|
|
3
|
+
/**
|
|
4
|
+
* LottieOptions type represents the configuration options for the Lottie player.
|
|
5
|
+
*/
|
|
6
|
+
export type LottieOptions = Omit<AnimationConfig, 'container'>;
|
|
7
|
+
/**
|
|
8
|
+
* Player class for controlling and customizing Lottie-based icons.
|
|
9
|
+
*/
|
|
10
|
+
export declare class Player {
|
|
11
|
+
protected _container: HTMLElement;
|
|
12
|
+
protected _iconData: any;
|
|
13
|
+
protected _initialProperties: IconProperties & LegacyIconProperties;
|
|
14
|
+
protected _lottieInstance?: LottieAnimationInstance;
|
|
15
|
+
protected _ready: boolean;
|
|
16
|
+
protected _colorsProxy?: any;
|
|
17
|
+
protected _direction: PlaybackDirection;
|
|
18
|
+
protected _speed: number;
|
|
19
|
+
protected _lottieProperties?: LottieProperty[];
|
|
20
|
+
protected _eventHandlers: any;
|
|
21
|
+
protected _state?: IconState;
|
|
22
|
+
protected _availableStates: IconState[];
|
|
23
|
+
protected _animationFrameRate: number;
|
|
24
|
+
/**
|
|
25
|
+
* Creates a new Player instance.
|
|
26
|
+
* @param container The DOM element where the animation will be rendered.
|
|
27
|
+
* @param data Lottie animation data.
|
|
28
|
+
* @param properties Initial icon properties (colors, stroke, state, etc.).
|
|
29
|
+
* @param options Additional options (e.g., autoInit).
|
|
30
|
+
*/
|
|
31
|
+
constructor(container: HTMLElement, data: LottieData, properties?: IconProperties & LegacyIconProperties, options?: {
|
|
32
|
+
autoInit?: boolean;
|
|
33
|
+
});
|
|
34
|
+
/**
|
|
35
|
+
* Initializes the player and connects it to the DOM element.
|
|
36
|
+
* Throws an error if already initialized.
|
|
37
|
+
*/
|
|
38
|
+
init(): void;
|
|
39
|
+
/**
|
|
40
|
+
* Destroys the player and releases all resources.
|
|
41
|
+
* Throws an error if not initialized.
|
|
42
|
+
*/
|
|
43
|
+
destroy(): void;
|
|
44
|
+
/**
|
|
45
|
+
* Registers an event listener for a player event.
|
|
46
|
+
* @param name Event name (e.g., 'complete', 'frame', 'ready').
|
|
47
|
+
* @param handler Handler function to call when the event is triggered.
|
|
48
|
+
* @returns Function to remove the listener.
|
|
49
|
+
*/
|
|
50
|
+
addEventListener(name: EventName, handler: EventHandler): () => void;
|
|
51
|
+
/**
|
|
52
|
+
* Removes an event listener for a player event.
|
|
53
|
+
* @param name Event name.
|
|
54
|
+
* @param handler Handler function to remove. If not provided, removes all handlers for the event.
|
|
55
|
+
*/
|
|
56
|
+
removeEventListener(name: EventName, handler?: EventHandler): void;
|
|
57
|
+
/**
|
|
58
|
+
* Triggers a player event and invokes all registered callbacks.
|
|
59
|
+
* @param name Event name.
|
|
60
|
+
* @param args Optional arguments to pass to the callbacks.
|
|
61
|
+
*/
|
|
62
|
+
protected triggerEvent(name: EventName, args?: any): void;
|
|
63
|
+
/**
|
|
64
|
+
* Forces a re-render of the animation.
|
|
65
|
+
*/
|
|
66
|
+
protected refresh(): void;
|
|
67
|
+
/**
|
|
68
|
+
* Starts playing the animation from the current frame.
|
|
69
|
+
* Note: If the animation is finished, it cannot be played again from the last frame.
|
|
70
|
+
*/
|
|
71
|
+
play(): void;
|
|
72
|
+
/**
|
|
73
|
+
* Plays the animation from the beginning of the current state or from the start if no state is set.
|
|
74
|
+
*/
|
|
75
|
+
playFromStart(): void;
|
|
76
|
+
/**
|
|
77
|
+
* Pauses the animation at the current frame.
|
|
78
|
+
*/
|
|
79
|
+
pause(): void;
|
|
80
|
+
/**
|
|
81
|
+
* Stop the animation.
|
|
82
|
+
*/
|
|
83
|
+
stop(): void;
|
|
84
|
+
/**
|
|
85
|
+
* Moves the animation to a specific frame and stops.
|
|
86
|
+
* @param frame Frame number to seek to.
|
|
87
|
+
*/
|
|
88
|
+
seek(frame: number): void;
|
|
89
|
+
/**
|
|
90
|
+
* Moves the animation to the first frame and stops.
|
|
91
|
+
*/
|
|
92
|
+
seekToStart(): void;
|
|
93
|
+
/**
|
|
94
|
+
* Moves the animation to the last frame and stops.
|
|
95
|
+
*/
|
|
96
|
+
seekToEnd(): void;
|
|
97
|
+
/**
|
|
98
|
+
* Sets the animation segment to play.
|
|
99
|
+
* If no segment is provided, resets to the default segment.
|
|
100
|
+
* @param segment Optional segment as [start, end] frame numbers.
|
|
101
|
+
*/
|
|
102
|
+
switchSegment(segment?: [number, number]): void;
|
|
103
|
+
/**
|
|
104
|
+
* Sets multiple icon properties at once.
|
|
105
|
+
* Any property not provided will be reset to its default value.
|
|
106
|
+
* @param properties Properties to assign.
|
|
107
|
+
*/
|
|
108
|
+
set properties(properties: IconProperties);
|
|
109
|
+
/**
|
|
110
|
+
* Gets the current icon properties (colors, stroke, state).
|
|
111
|
+
* @returns The current properties.
|
|
112
|
+
*/
|
|
113
|
+
get properties(): IconProperties;
|
|
114
|
+
/**
|
|
115
|
+
* Sets all customizable colors at once.
|
|
116
|
+
* Pass null to reset all colors to default.
|
|
117
|
+
* @param colors Color map or null.
|
|
118
|
+
*/
|
|
119
|
+
set colors(colors: ColorMap | null);
|
|
120
|
+
/**
|
|
121
|
+
* Provides a proxy for reading or updating individual colors by name.
|
|
122
|
+
*
|
|
123
|
+
* Example:
|
|
124
|
+
* player.colors.primary = '#ff0000';
|
|
125
|
+
* delete player.colors.secondary;
|
|
126
|
+
*/
|
|
127
|
+
get colors(): ColorMap;
|
|
128
|
+
/**
|
|
129
|
+
* Sets the stroke width for the icon.
|
|
130
|
+
* Pass null to reset to default.
|
|
131
|
+
* @param stroke Stroke value or null.
|
|
132
|
+
*/
|
|
133
|
+
set stroke(stroke: Stroke | null);
|
|
134
|
+
/**
|
|
135
|
+
* Gets the current stroke width of the icon.
|
|
136
|
+
* @returns Stroke value or null if not set.
|
|
137
|
+
*/
|
|
138
|
+
get stroke(): Stroke | null;
|
|
139
|
+
/**
|
|
140
|
+
* Sets the current state (animation segment) of the icon.
|
|
141
|
+
* If the state does not exist, falls back to the default state.
|
|
142
|
+
* @param state State name or null for default.
|
|
143
|
+
*/
|
|
144
|
+
set state(state: string | null);
|
|
145
|
+
/**
|
|
146
|
+
* Gets the current state (animation segment) of the icon.
|
|
147
|
+
* @returns State name or null if not set.
|
|
148
|
+
*/
|
|
149
|
+
get state(): string | null;
|
|
150
|
+
/**
|
|
151
|
+
* Sets the playback speed of the animation.
|
|
152
|
+
* @param speed Playback speed (1 = normal).
|
|
153
|
+
*/
|
|
154
|
+
set speed(speed: number);
|
|
155
|
+
/**
|
|
156
|
+
* Gets the current playback speed.
|
|
157
|
+
* @returns Playback speed.
|
|
158
|
+
*/
|
|
159
|
+
get speed(): number;
|
|
160
|
+
/**
|
|
161
|
+
* Sets the playback direction.
|
|
162
|
+
* @param direction 1 for forward, -1 for reverse.
|
|
163
|
+
*/
|
|
164
|
+
set direction(direction: PlaybackDirection);
|
|
165
|
+
/**
|
|
166
|
+
* Gets the current playback direction.
|
|
167
|
+
* @returns Playback direction.
|
|
168
|
+
*/
|
|
169
|
+
get direction(): PlaybackDirection;
|
|
170
|
+
/**
|
|
171
|
+
* Enables or disables looping of the animation.
|
|
172
|
+
* @param loop True to loop, false otherwise.
|
|
173
|
+
*/
|
|
174
|
+
set loop(loop: boolean);
|
|
175
|
+
/**
|
|
176
|
+
* Gets whether the animation is set to loop.
|
|
177
|
+
* @returns True if looping, false otherwise.
|
|
178
|
+
*/
|
|
179
|
+
get loop(): boolean;
|
|
180
|
+
/**
|
|
181
|
+
* Sets the current frame of the animation.
|
|
182
|
+
* @param frame Frame number.
|
|
183
|
+
*/
|
|
184
|
+
set frame(frame: number);
|
|
185
|
+
/**
|
|
186
|
+
* Gets the current frame of the animation.
|
|
187
|
+
* @returns Current frame number.
|
|
188
|
+
*/
|
|
189
|
+
get frame(): number;
|
|
190
|
+
/**
|
|
191
|
+
* Gets the list of available states for the icon.
|
|
192
|
+
* @returns Array of available states.
|
|
193
|
+
*/
|
|
194
|
+
get availableStates(): IconState[];
|
|
195
|
+
/**
|
|
196
|
+
* Gets the frame rate of the animation.
|
|
197
|
+
* @returns Frame rate in frames per second.
|
|
198
|
+
*/
|
|
199
|
+
get frameRate(): number;
|
|
200
|
+
/**
|
|
201
|
+
* Returns true if the animation is currently playing.
|
|
202
|
+
*/
|
|
203
|
+
get playing(): boolean;
|
|
204
|
+
/**
|
|
205
|
+
* Returns true if the player is ready for interaction.
|
|
206
|
+
*/
|
|
207
|
+
get ready(): boolean;
|
|
208
|
+
/**
|
|
209
|
+
* Gets the total number of frames in the animation.
|
|
210
|
+
* @returns Frame count.
|
|
211
|
+
*/
|
|
212
|
+
get frameCount(): number;
|
|
213
|
+
/**
|
|
214
|
+
* Gets the current segment of the animation as [start, end] frame numbers.
|
|
215
|
+
* @returns Segment as [start, end].
|
|
216
|
+
*/
|
|
217
|
+
get segment(): [number, number];
|
|
218
|
+
/**
|
|
219
|
+
* Gets the duration of the animation in seconds.
|
|
220
|
+
* @returns Duration in seconds.
|
|
221
|
+
*/
|
|
222
|
+
get duration(): number;
|
|
223
|
+
/**
|
|
224
|
+
* Provides access to the underlying Lottie player instance.
|
|
225
|
+
* @returns LottieAnimationInstance.
|
|
226
|
+
*/
|
|
227
|
+
get lottieInstance(): LottieAnimationInstance | undefined;
|
|
228
|
+
/**
|
|
229
|
+
* Gets all customizable properties for the icon.
|
|
230
|
+
* @returns Array of LottieProperty.
|
|
231
|
+
*/
|
|
232
|
+
get lottieProperties(): LottieProperty[];
|
|
233
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Deep clone value.
|
|
3
|
+
* @param value Value to clone.
|
|
4
|
+
*/
|
|
5
|
+
export declare function deepClone<T = any>(value: T): T;
|
|
6
|
+
/**
|
|
7
|
+
* Checks if value is null or undefined.
|
|
8
|
+
* @param value Value to check.
|
|
9
|
+
* @returns True if value is null or undefined, false otherwise.
|
|
10
|
+
*/
|
|
11
|
+
export declare function isNil(value: any): boolean;
|
|
12
|
+
/**
|
|
13
|
+
* Checks if value is object like.
|
|
14
|
+
* @param value Value to check.
|
|
15
|
+
* @returns True if value is object like, false otherwise.
|
|
16
|
+
*/
|
|
17
|
+
export declare function isObjectLike(value: any): value is object;
|
|
18
|
+
/**
|
|
19
|
+
* Checks if path is a direct property of object.
|
|
20
|
+
* @param object Object to check.
|
|
21
|
+
* @param path Path to check.
|
|
22
|
+
*/
|
|
23
|
+
export declare function has<T>(object: T, path: string | string[]): boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Retrieves the value at the given path from the object.
|
|
26
|
+
* Returns defaultValue if the path does not exist.
|
|
27
|
+
* @param object Object to get value from.
|
|
28
|
+
* @param path Property path as a dot-separated string or array of keys.
|
|
29
|
+
* @param defaultValue Value to return if the path does not exist.
|
|
30
|
+
* @returns Value at the given path or defaultValue.
|
|
31
|
+
*/
|
|
32
|
+
export declare function get<T>(object: T, path: string | string[], defaultValue?: any): any;
|
|
33
|
+
/**
|
|
34
|
+
* Update object value on path.
|
|
35
|
+
* @param object Object to update.
|
|
36
|
+
* @param path Path to the value.
|
|
37
|
+
* @param value New value to set.
|
|
38
|
+
*/
|
|
39
|
+
export declare function set(object: any, path: string | string[], value: any): void;
|