-
Notifications
You must be signed in to change notification settings - Fork 38
/
index.d.ts
49 lines (40 loc) · 1.29 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
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
import { AnimationItem } from 'lottie-web';
export type Point = [number, number];
export type ScaleData = {
scaleYOffset: number
scaleXOffset: number
scale: number
}
export interface LayerList {
getLayers(): LayerList,
getLayersByType(type: number): LayerList,
getLayersByName(name: string): LayerList,
layer(index: number): [] | any,
concat(list: any[]): any[],
getTargetElements(): any[],
readonly length: number;
}
export interface KeyPathList {
getKeyPath(propertyPath: string): any;
concat(nodes: KeyPathList): KeyPathList;
getElements(): any[];
getPropertyAtIndex(index: number): any;
readonly length: number;
}
export interface AnimationItemAPI extends KeyPathList, LayerList {
getRendererType(): string;
recalculateSize(): void;
getScaleData(): ScaleData;
toContainerPoint(point: Point): Point;
fromContainerPoint(point: Point): Point;
getCurrentFrame(): number;
getCurrentTime(): number;
addValueCallback(properties: KeyPathList, value: any): void;
toKeypathLayerPoint(properties: KeyPathList, point: Point): Point | Point[];
fromKeypathLayerPoint(properties: KeyPathList, point: Point): Point | Point[];
}
export type LottieAPI = {
createAnimationApi(animationInstance: AnimationItem): AnimationItemAPI;
}
declare const LottieAPIModule: LottieAPI;
export default LottieAPIModule;