1 | import { View } from '../core/view';
|
2 | import { CoreTypes } from '../../core-types';
|
3 | import { Color } from '../../color';
|
4 |
|
5 | export { KeyframeAnimation, KeyframeAnimationInfo, KeyframeDeclaration, KeyframeInfo } from './keyframe-animation';
|
6 |
|
7 |
|
8 |
|
9 |
|
10 | export interface AnimationDefinition {
|
11 | |
12 |
|
13 |
|
14 | target?: View;
|
15 |
|
16 | |
17 |
|
18 |
|
19 | opacity?: number;
|
20 |
|
21 | |
22 |
|
23 |
|
24 | backgroundColor?: Color;
|
25 |
|
26 | |
27 |
|
28 |
|
29 | translate?: Pair;
|
30 |
|
31 | |
32 |
|
33 |
|
34 | scale?: Pair;
|
35 |
|
36 | |
37 |
|
38 |
|
39 | height?: CoreTypes.PercentLengthType | string;
|
40 |
|
41 | |
42 |
|
43 |
|
44 | width?: CoreTypes.PercentLengthType | string;
|
45 |
|
46 | |
47 |
|
48 |
|
49 | rotate?: number | Point3D;
|
50 |
|
51 | |
52 |
|
53 |
|
54 | duration?: number;
|
55 |
|
56 | |
57 |
|
58 |
|
59 | delay?: number;
|
60 |
|
61 | |
62 |
|
63 |
|
64 |
|
65 |
|
66 | iterations?: number;
|
67 |
|
68 | |
69 |
|
70 |
|
71 |
|
72 | curve?: any;
|
73 | }
|
74 |
|
75 |
|
76 |
|
77 |
|
78 |
|
79 | export class CubicBezierAnimationCurve {
|
80 | public x1: number;
|
81 | public y1: number;
|
82 | public x2: number;
|
83 | public y2: number;
|
84 |
|
85 | constructor(x1: number, y1: number, x2: number, y2: number);
|
86 | }
|
87 |
|
88 | /**
|
89 | * Defines a key-value pair for css transformation
|
90 | */
|
91 | export type Transformation = {
|
92 | property: TransformationType;
|
93 | value: TransformationValue;
|
94 | };
|
95 |
|
96 |
|
97 |
|
98 |
|
99 | export type TransformationType = 'rotate' | 'rotateX' | 'rotateY' | 'translate' | 'translateX' | 'translateY' | 'scale' | 'scaleX' | 'scaleY';
|
100 |
|
101 |
|
102 |
|
103 |
|
104 | export type TransformationValue = Point3D | Pair | number;
|
105 |
|
106 |
|
107 |
|
108 |
|
109 | export interface Point3D {
|
110 | x: number;
|
111 | y: number;
|
112 | z: number;
|
113 | }
|
114 |
|
115 |
|
116 |
|
117 |
|
118 | export interface Pair {
|
119 | x: number;
|
120 | y: number;
|
121 | }
|
122 |
|
123 |
|
124 |
|
125 |
|
126 | export type TransformFunctionsInfo = {
|
127 | translate: Pair;
|
128 | rotate: Point3D;
|
129 | scale: Pair;
|
130 | };
|
131 |
|
132 | export interface Cancelable {
|
133 | cancel(): void;
|
134 | }
|
135 |
|
136 |
|
137 |
|
138 |
|
139 | export type AnimationPromise = Promise<void> & Cancelable;
|
140 |
|
141 |
|
142 |
|
143 |
|
144 | export class Animation {
|
145 | constructor(animationDefinitions: Array<AnimationDefinition>, playSequentially?: boolean);
|
146 | public play: (resetOnFinish?: boolean) => AnimationPromise;
|
147 | public cancel: () => void;
|
148 | public isPlaying: boolean;
|
149 | public _resolveAnimationCurve(curve: any): any;
|
150 | }
|
151 |
|
152 | export function _resolveAnimationCurve(curve: any): any;
|