|
1 | 1 | export interface LottieParams { |
2 | | - autoplay?: boolean; |
3 | | - animationData?: any; |
4 | | - container?: any; |
5 | | - loop?: boolean | number; |
6 | | - name?: string; |
7 | | - path: string; |
8 | | - renderer?: 'svg' | 'canvas' | 'html'; |
9 | | - rendererSettings?: LottieRenderSettings; |
| 2 | + autoplay?: boolean; |
| 3 | + animationData?: any; |
| 4 | + container?: any; |
| 5 | + loop?: boolean | number; |
| 6 | + name?: string; |
| 7 | + path: string; |
| 8 | + renderer?: 'svg' | 'canvas' | 'html'; |
| 9 | + rendererSettings?: LottieRenderSettings; |
10 | 10 | } |
11 | 11 |
|
12 | 12 | export interface LottieRenderSettings { |
13 | | - context: any; |
14 | | - scaleMode: 'noScale' | string; |
15 | | - clearCanvas: boolean; |
16 | | - progressiveLoad: boolean; |
17 | | - hideOnTransparent: boolean; |
18 | | - className: string; |
| 13 | + context: any; |
| 14 | + scaleMode: 'noScale' | string; |
| 15 | + clearCanvas: boolean; |
| 16 | + progressiveLoad: boolean; |
| 17 | + hideOnTransparent: boolean; |
| 18 | + className: string; |
19 | 19 | } |
20 | 20 |
|
21 | 21 | export interface LottieAnimation { |
22 | | - /** |
23 | | - * @param name to target a specific animation |
24 | | - */ |
25 | | - play(name?: string): void; |
26 | | - /** |
27 | | - * @param name to target a specific animation |
28 | | - */ |
29 | | - pause(name?: string): void; |
30 | | - /** |
31 | | - * @param name to target a specific animation |
32 | | - */ |
33 | | - stop(name?: string): void; |
34 | | - destroy(): void; |
35 | | - /** |
36 | | - * @param href usually pass as location.href. Its useful when you experience mask issue in safari where your url does not have # symbol. |
37 | | - */ |
38 | | - setLocationHref(href: string); |
39 | | - /** |
40 | | - * @param speed 1 is normal speed, plays reverse if minus |
41 | | - * @param name to target a specific animation |
42 | | - */ |
43 | | - setSpeed(speed: number, name?: string); |
44 | | - /** |
45 | | - * @param value frame value |
46 | | - * @param isFrame defines if first argument is a time based value or a frame based (default false) |
47 | | - */ |
48 | | - goToAndStop(value: number, isFrame?: boolean); |
49 | | - /** |
50 | | - * @param value frame value |
51 | | - * @param isFrame defines if first argument is a time based value or a frame based (default false) |
52 | | - */ |
53 | | - goToAndPlay(value: number, isFrame?: boolean); |
54 | | - /** |
55 | | - * @param direction 1 is forward, -1 is reverse |
56 | | - */ |
57 | | - setDirection(direction: 1 | -1); |
58 | | - /** |
59 | | - * @param inFrames If true, returns duration in frames, if false, in seconds |
60 | | - */ |
61 | | - getDuration(inFrames?: boolean): number; |
62 | | - /** |
63 | | - * @param segments Can contain 2 numeric values that will be used as first and last frame of the animation. |
64 | | - * Or can contain a sequence of arrays each with 2 numeric values. |
65 | | - * @param forceFlag If set to false, it will wait until the current segment is complete. If true, it will update values immediately. |
66 | | - */ |
67 | | - playSegments(segments: any[], forceFlag?: boolean); |
| 22 | + /** |
| 23 | + * @param name to target a specific animation |
| 24 | + */ |
| 25 | + play(name?: string): void; |
| 26 | + /** |
| 27 | + * @param name to target a specific animation |
| 28 | + */ |
| 29 | + pause(name?: string): void; |
| 30 | + /** |
| 31 | + * @param name to target a specific animation |
| 32 | + */ |
| 33 | + stop(name?: string): void; |
| 34 | + destroy(): void; |
| 35 | + /** |
| 36 | + * @param href usually pass as location.href. Its useful when you experience mask issue in safari where your url does not have # symbol. |
| 37 | + */ |
| 38 | + setLocationHref(href: string); |
| 39 | + /** |
| 40 | + * @param speed 1 is normal speed, plays reverse if minus |
| 41 | + * @param name to target a specific animation |
| 42 | + */ |
| 43 | + setSpeed(speed: number, name?: string); |
| 44 | + /** |
| 45 | + * @param value frame value |
| 46 | + * @param isFrame defines if first argument is a time based value or a frame based (default false) |
| 47 | + */ |
| 48 | + goToAndStop(value: number, isFrame?: boolean); |
| 49 | + /** |
| 50 | + * @param value frame value |
| 51 | + * @param isFrame defines if first argument is a time based value or a frame based (default false) |
| 52 | + */ |
| 53 | + goToAndPlay(value: number, isFrame?: boolean); |
| 54 | + /** |
| 55 | + * @param direction 1 is forward, -1 is reverse |
| 56 | + */ |
| 57 | + setDirection(direction: 1 | -1); |
| 58 | + /** |
| 59 | + * @param inFrames If true, returns duration in frames, if false, in seconds |
| 60 | + */ |
| 61 | + getDuration(inFrames?: boolean): number; |
| 62 | + /** |
| 63 | + * @param segments Can contain 2 numeric values that will be used as first and last frame of the animation. |
| 64 | + * Or can contain a sequence of arrays each with 2 numeric values. |
| 65 | + * @param forceFlag If set to false, it will wait until the current segment is complete. If true, it will update values immediately. |
| 66 | + */ |
| 67 | + playSegments(segments: any[], forceFlag?: boolean); |
68 | 68 | } |
0 commit comments