UNPKG

2.35 kBJavaScriptView Raw
1import { Image, ScrollView, Text, View } from 'react-native';
2import EasingNode from './Easing';
3import AnimatedClock from './core/AnimatedClock';
4import AnimatedValue from './core/AnimatedValue';
5import AnimatedNode from './core/AnimatedNode';
6import AnimatedCode from './core/AnimatedCode';
7import * as base from './base';
8import * as derived from './derived';
9import createAnimatedComponent from './createAnimatedComponent';
10import decay from './animations/decay';
11import timing from './animations/timing';
12import spring from './animations/spring';
13import Animation from './animations/Animation';
14import {
15 addWhitelistedNativeProps,
16 addWhitelistedUIProps,
17} from './ConfigHelper';
18import backwardCompatibleAnimWrapper from './animations/backwardCompatibleAnimWrapper';
19import {
20 Transition,
21 Transitioning,
22 createTransitioningComponent,
23} from './Transitioning';
24import SpringUtils from './animations/SpringUtils';
25import useValue from './useValue';
26import * as reanimated2 from './reanimated2';
27
28const decayWrapper = backwardCompatibleAnimWrapper(
29 decay,
30 Animation.decayDefaultState
31);
32const timingWrapper = backwardCompatibleAnimWrapper(
33 timing,
34 Animation.timingDefaultState
35);
36const springWrapper = backwardCompatibleAnimWrapper(
37 spring,
38 Animation.springDefaultState
39);
40const Animated = {
41 // components
42 View: createAnimatedComponent(View),
43 Text: createAnimatedComponent(Text),
44 Image: createAnimatedComponent(Image),
45 ScrollView: createAnimatedComponent(ScrollView),
46 Code: AnimatedCode,
47 createAnimatedComponent,
48
49 // classes
50 Clock: AnimatedClock,
51 Value: AnimatedValue,
52 Node: AnimatedNode,
53
54 // operations
55 ...base,
56 ...derived,
57
58 // animations
59 decay: decayWrapper,
60 timing: timingWrapper,
61 spring: springWrapper,
62 SpringUtils,
63
64 // configuration
65 addWhitelistedNativeProps,
66 addWhitelistedUIProps,
67
68 // hooks
69 useValue,
70
71 // reanimated2
72 ...reanimated2,
73};
74
75export default Animated;
76
77// operations
78export * from './base';
79export * from './derived';
80
81export * from './reanimated2';
82
83export {
84 EasingNode,
85 Transitioning,
86 Transition,
87 createTransitioningComponent,
88 // classes
89 AnimatedClock as Clock,
90 AnimatedValue as Value,
91 AnimatedNode as Node,
92 // animations
93 decayWrapper as decay,
94 timingWrapper as timing,
95 springWrapper as spring,
96 SpringUtils,
97 // hooks
98 useValue,
99};