1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 | export type LayoutAnimationType =
|
11 | | 'spring'
|
12 | | 'linear'
|
13 | | 'easeInEaseOut'
|
14 | | 'easeIn'
|
15 | | 'easeOut'
|
16 | | 'keyboard';
|
17 |
|
18 | export type LayoutAnimationTypes = {
|
19 | [type in LayoutAnimationType]: type;
|
20 | };
|
21 |
|
22 | export type LayoutAnimationProperty =
|
23 | | 'opacity'
|
24 | | 'scaleX'
|
25 | | 'scaleY'
|
26 | | 'scaleXY';
|
27 |
|
28 | export type LayoutAnimationProperties = {
|
29 | [prop in LayoutAnimationProperty]: prop;
|
30 | };
|
31 |
|
32 | export interface LayoutAnimationAnim {
|
33 | duration?: number | undefined;
|
34 | delay?: number | undefined;
|
35 | springDamping?: number | undefined;
|
36 | initialVelocity?: number | undefined;
|
37 | type?: LayoutAnimationType | undefined;
|
38 | property?: LayoutAnimationProperty | undefined;
|
39 | }
|
40 |
|
41 | export interface LayoutAnimationConfig {
|
42 | duration: number;
|
43 | create?: LayoutAnimationAnim | undefined;
|
44 | update?: LayoutAnimationAnim | undefined;
|
45 | delete?: LayoutAnimationAnim | undefined;
|
46 | }
|
47 |
|
48 |
|
49 |
|
50 |
|
51 | export interface LayoutAnimationStatic {
|
52 | |
53 |
|
54 |
|
55 |
|
56 |
|
57 |
|
58 |
|
59 | configureNext: (
|
60 | config: LayoutAnimationConfig,
|
61 | onAnimationDidEnd?: () => void,
|
62 | onAnimationDidFail?: () => void,
|
63 | ) => void;
|
64 |
|
65 | create: (
|
66 | duration: number,
|
67 | type?: LayoutAnimationType,
|
68 | creationProp?: LayoutAnimationProperty,
|
69 | ) => LayoutAnimationConfig;
|
70 | Types: LayoutAnimationTypes;
|
71 | Properties: LayoutAnimationProperties;
|
72 | configChecker: (shapeTypes: {[key: string]: any}) => any;
|
73 | Presets: {
|
74 | easeInEaseOut: LayoutAnimationConfig;
|
75 | linear: LayoutAnimationConfig;
|
76 | spring: LayoutAnimationConfig;
|
77 | };
|
78 | easeInEaseOut: (onAnimationDidEnd?: () => void) => void;
|
79 | linear: (onAnimationDidEnd?: () => void) => void;
|
80 | spring: (onAnimationDidEnd?: () => void) => void;
|
81 | }
|
82 |
|
83 | export const LayoutAnimation: LayoutAnimationStatic;
|
84 | export type LayoutAnimation = LayoutAnimationStatic;
|