UNPKG

2.23 kBJavaScriptView Raw
1import { Image, ScrollView, Text, View } from 'react-native';
2import Easing 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';
26
27const decayWrapper = backwardCompatibleAnimWrapper(
28 decay,
29 Animation.decayDefaultState
30);
31const timingWrapper = backwardCompatibleAnimWrapper(
32 timing,
33 Animation.timingDefaultState
34);
35const springWrapper = backwardCompatibleAnimWrapper(
36 spring,
37 Animation.springDefaultState
38);
39const Animated = {
40 // components
41 View: createAnimatedComponent(View),
42 Text: createAnimatedComponent(Text),
43 Image: createAnimatedComponent(Image),
44 ScrollView: createAnimatedComponent(ScrollView),
45 Code: AnimatedCode,
46 createAnimatedComponent,
47
48 // classes
49 Clock: AnimatedClock,
50 Value: AnimatedValue,
51 Node: AnimatedNode,
52
53 // operations
54 ...base,
55 ...derived,
56
57 // animations
58 decay: decayWrapper,
59 timing: timingWrapper,
60 spring: springWrapper,
61 SpringUtils,
62
63 // configuration
64 addWhitelistedNativeProps,
65 addWhitelistedUIProps,
66
67 // hooks
68 useValue,
69};
70
71export default Animated;
72
73// operations
74export * from './base';
75export * from './derived';
76
77export {
78 Easing,
79 Transitioning,
80 Transition,
81 createTransitioningComponent,
82 // classes
83 AnimatedClock as Clock,
84 AnimatedValue as Value,
85 AnimatedNode as Node,
86 // animations
87 decayWrapper as decay,
88 timingWrapper as timing,
89 springWrapper as spring,
90 SpringUtils,
91 // hooks
92 useValue,
93};