forked from software-mansion/react-native-gesture-handler
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbase.js
More file actions
81 lines (68 loc) · 2.42 KB
/
base.js
File metadata and controls
81 lines (68 loc) · 2.42 KB
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
import AnimatedCond from './core/AnimatedCond';
import AnimatedSet from './core/AnimatedSet';
import AnimatedOperator from './core/AnimatedOperator';
import AnimatedOnChange from './core/AnimatedOnChange';
import AnimatedStartClock from './core/AnimatedStartClock';
import AnimatedStopClock from './core/AnimatedStopClock';
import AnimatedClockTest from './core/AnimatedClockTest';
import AnimatedDebug from './core/AnimatedDebug';
import AnimatedCall from './core/AnimatedCall';
import AnimatedEvent from './core/AnimatedEvent';
import { adapt } from './utils';
function operator(name) {
return (...args) => new AnimatedOperator(name, args.map(adapt));
}
export const add = operator('add');
export const sub = operator('sub');
export const multiply = operator('multiply');
export const divide = operator('divide');
export const pow = operator('pow');
export const modulo = operator('modulo');
export const sqrt = operator('sqrt');
export const sin = operator('sin');
export const cos = operator('cos');
export const exp = operator('exp');
export const lessThan = operator('lessThan');
export const eq = operator('eq');
export const greaterThan = operator('greaterThan');
export const lessOrEq = operator('lessOrEq');
export const greaterOrEq = operator('greaterOrEq');
export const neq = operator('neq');
export const and = operator('and');
export const or = operator('or');
export const defined = operator('defined');
export const not = operator('not');
export const set = function(what, value) {
return new AnimatedSet(what, adapt(value));
};
export const cond = function(cond, ifBlock, elseBlock) {
return new AnimatedCond(
adapt(cond),
adapt(ifBlock),
elseBlock === undefined ? undefined : adapt(elseBlock)
);
};
export const block = function(items) {
return adapt(items);
};
export const call = function(args, func) {
return new AnimatedCall(args, func);
};
export const debug = function(message, value) {
return new AnimatedDebug(message, adapt(value));
};
export const onChange = function(value, action) {
return new AnimatedOnChange(adapt(value), adapt(action));
};
export const startClock = function(clock) {
return new AnimatedStartClock(clock);
};
export const stopClock = function(clock) {
return new AnimatedStopClock(clock);
};
export const clockRunning = function(clock) {
return new AnimatedClockTest(clock);
};
export const event = function(argMapping, config) {
return new AnimatedEvent(argMapping, config);
};