/
AnimatedMock.js.flow
112 lines (98 loc) · 3.47 KB
/
AnimatedMock.js.flow
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
// @flow
declare var AnimatedEvent: typeof $2.AnimatedEvent;
declare var attachNativeEvent: typeof $10.attachNativeEvent;
declare var $2: typeof $1;
declare var $10: typeof $9;
const $1 = require("./AnimatedEvent");
const $9 = require("./AnimatedEvent");
declare var AnimatedImplementation: typeof $3;
const $3 = require("./AnimatedImplementation");
declare var AnimatedInterpolation: typeof $4;
const $4 = require("./nodes/AnimatedInterpolation");
declare var AnimatedNode: typeof $5;
const $5 = require("./nodes/AnimatedNode");
declare var AnimatedProps: typeof $6;
const $6 = require("./nodes/AnimatedProps");
declare var AnimatedValue: typeof $7;
const $7 = require("./nodes/AnimatedValue");
declare var AnimatedValueXY: typeof $8;
const $8 = require("./nodes/AnimatedValueXY");
declare var createAnimatedComponent: typeof $11;
const $11 = require("./createAnimatedComponent");
import type {EndCallback} from "./animations/Animation";
import type {TimingAnimationConfig} from "./animations/TimingAnimation";
import type {DecayAnimationConfig} from "./animations/DecayAnimation";
import type {SpringAnimationConfig} from "./animations/SpringAnimation";
import type {Mapping} from "./AnimatedEvent";
import type {EventConfig} from "./AnimatedEvent";
type CompositeAnimation = {
start: (callback?: ?EndCallback) => void,
stop: () => void,
reset: () => void,
_startNativeLoop: (iterations?: number) => void,
_isUsingNativeDriver: () => boolean,
...,
};
declare var spring: (
value: AnimatedValue | AnimatedValueXY,
config: SpringAnimationConfig
) => CompositeAnimation;
declare var timing: (
value: AnimatedValue | AnimatedValueXY,
config: TimingAnimationConfig
) => CompositeAnimation;
declare var decay: (
value: AnimatedValue | AnimatedValueXY,
config: DecayAnimationConfig
) => CompositeAnimation;
declare var sequence: (
animations: Array<CompositeAnimation>
) => CompositeAnimation;
type ParallelConfig = {stopTogether?: boolean,...};
declare var parallel: (
animations: Array<CompositeAnimation>,
config?: ?ParallelConfig
) => CompositeAnimation;
declare var delay: (time: number) => CompositeAnimation;
declare var stagger: (
time: number,
animations: Array<CompositeAnimation>
) => CompositeAnimation;
type LoopAnimationConfig = {
iterations: number,
resetBeforeIteration?: boolean,
...,
};
declare var loop: (
animation: CompositeAnimation,
_?: LoopAnimationConfig
) => CompositeAnimation;
declare var event: (argMapping: Array<?Mapping>, config: EventConfig) => any;
export type {CompositeAnimation};
declare module.exports: {|
Value: typeof AnimatedValue,
ValueXY: typeof AnimatedValueXY,
Interpolation: typeof AnimatedInterpolation,
Node: typeof AnimatedNode,
decay: typeof decay,
timing: typeof timing,
spring: typeof spring,
add: typeof AnimatedImplementation.add,
subtract: typeof AnimatedImplementation.subtract,
divide: typeof AnimatedImplementation.divide,
multiply: typeof AnimatedImplementation.multiply,
modulo: typeof AnimatedImplementation.modulo,
diffClamp: typeof AnimatedImplementation.diffClamp,
delay: typeof delay,
sequence: typeof sequence,
parallel: typeof parallel,
stagger: typeof stagger,
loop: typeof loop,
event: typeof event,
createAnimatedComponent: typeof createAnimatedComponent,
attachNativeEvent: typeof attachNativeEvent,
forkEvent: typeof AnimatedImplementation.forkEvent,
unforkEvent: typeof AnimatedImplementation.unforkEvent,
Event: typeof AnimatedEvent,
__PropsOnlyForTests: typeof AnimatedProps,
|};