UNPKG

1.72 kBTypeScriptView Raw
1import { View } from '../core/view';
2import { CoreTypes } from '../../core-types';
3import { Color } from '../../color';
4export type Transformation = {
5 property: TransformationType;
6 value: TransformationValue;
7};
8export type TransformationType = 'rotate' | 'translate' | 'translateX' | 'translateY' | 'scale' | 'scaleX' | 'scaleY';
9export type TransformationValue = Pair | number;
10export type TransformFunctionsInfo = {
11 translate: Pair;
12 rotate: number;
13 scale: Pair;
14};
15export interface AnimationPromise extends Promise<any>, Cancelable {
16 then(...args: any[]): AnimationPromise;
17 catch(...args: any[]): AnimationPromise;
18}
19export interface Pair {
20 x: number;
21 y: number;
22}
23export interface Cancelable {
24 cancel(): void;
25}
26export interface PropertyAnimation {
27 target: View;
28 property: string;
29 value: any;
30 duration?: number;
31 delay?: number;
32 iterations?: number;
33 curve?: any;
34}
35export interface PropertyAnimationInfo extends PropertyAnimation {
36 _propertyResetCallback?: any;
37 _originalValue?: any;
38}
39export interface AnimationDefinition {
40 target?: View;
41 opacity?: number;
42 backgroundColor?: Color;
43 translate?: Pair;
44 scale?: Pair;
45 height?: CoreTypes.PercentLengthType | string;
46 width?: CoreTypes.PercentLengthType | string;
47 rotate?: number;
48 duration?: number;
49 delay?: number;
50 iterations?: number;
51 curve?: any;
52}
53export interface AnimationDefinitionInternal extends AnimationDefinition {
54 valueSource?: 'animation' | 'keyframe';
55}
56export interface IOSView extends View {
57 _suspendPresentationLayerUpdates(): any;
58 _resumePresentationLayerUpdates(): any;
59 _isPresentationLayerUpdateSuspended(): any;
60}