@@ -57,8 +57,6 @@ declare module 'react-native-reanimated' {
57
57
import ( './lib/types/lib/reanimated2/commonTypes' ) . MeasuredDimensions ;
58
58
59
59
namespace Animated {
60
- type Nullable < T > = T | null | undefined ;
61
-
62
60
export enum Extrapolate {
63
61
EXTEND = 'extend' ,
64
62
CLAMP = 'clamp' ,
@@ -80,22 +78,10 @@ declare module 'react-native-reanimated' {
80
78
81
79
export type SharedValue < T > = { value : T } ;
82
80
export type DerivedValue < T > = Readonly < SharedValue < T > > ;
83
- export type Mapping = { [ key : string ] : Mapping } | Adaptable < any > ;
84
81
export type Adaptable < T > =
85
82
| T
86
- | AnimatedNode < T >
87
- | ReadonlyArray < T | AnimatedNode < T > | ReadonlyArray < T | AnimatedNode < T > > >
83
+ | ReadonlyArray < T | ReadonlyArray < T > >
88
84
| SharedValue < T > ;
89
- type BinaryOperator < T = number > = (
90
- left : Adaptable < number > ,
91
- right : Adaptable < number >
92
- ) => AnimatedNode < T > ;
93
- type UnaryOperator = ( value : Adaptable < number > ) => AnimatedNode < number > ;
94
- type MultiOperator < T = number > = (
95
- a : Adaptable < number > ,
96
- b : Adaptable < number > ,
97
- ...others : Adaptable < number > [ ]
98
- ) => AnimatedNode < T > ;
99
85
100
86
export type TransformStyleTypes = TransformsStyle [ 'transform' ] extends
101
87
| readonly ( infer T ) [ ]
@@ -116,24 +102,15 @@ declare module 'react-native-reanimated' {
116
102
? AnimateStyle < S [ K ] >
117
103
: S [ K ] extends ColorValue | undefined
118
104
? S [ K ] | number
119
- :
120
- | S [ K ]
121
- | AnimatedNode <
122
- // allow `number` where `string` normally is to support colors
123
- S [ K ] extends ColorValue | undefined ? S [ K ] | number : S [ K ]
124
- >
125
- | SharedValue < AnimatableValue > ;
105
+ : S [ K ] | SharedValue < AnimatableValue > ;
126
106
} ;
127
107
128
108
export type StylesOrDefault < T > = 'style' extends keyof T
129
109
? T [ 'style' ]
130
110
: Record < string , unknown > ;
131
111
132
112
export type AnimateProps < P extends object > = {
133
- [ K in keyof Omit < P , 'style' > ] :
134
- | P [ K ]
135
- | AnimatedNode < P [ K ] >
136
- | SharedValue < P [ K ] > ;
113
+ [ K in keyof Omit < P , 'style' > ] : P [ K ] | SharedValue < P [ K ] > ;
137
114
} & {
138
115
style ?: StyleProp < AnimateStyle < StylesOrDefault < P > > > ;
139
116
} & {
@@ -156,82 +133,6 @@ declare module 'react-native-reanimated' {
156
133
sharedTransitionStyle ?: ILayoutAnimationBuilder ;
157
134
} ;
158
135
159
- export interface PhysicsAnimationState extends AnimationState {
160
- velocity : AnimatedValue < number > ;
161
- }
162
-
163
- export type DecayState = PhysicsAnimationState ;
164
-
165
- export interface DecayConfig {
166
- deceleration : Adaptable < number > ;
167
- }
168
- export interface BackwardCompatibleWrapper {
169
- start : ( callback ?: ( data : { finished : boolean } ) => any ) => void ;
170
- stop : ( ) => void ;
171
- }
172
-
173
- export interface TimingState extends AnimationState {
174
- frameTime : AnimatedValue < number > ;
175
- }
176
- export type EasingNodeFunction = (
177
- value : Adaptable < number >
178
- ) => AnimatedNode < number > ;
179
- export type EasingFunction = ( value : number ) => number ;
180
- export interface TimingConfig {
181
- toValue : Adaptable < number > ;
182
- duration : Adaptable < number > ;
183
- easing : EasingNodeFunction ;
184
- }
185
-
186
- export type SpringState = PhysicsAnimationState ;
187
-
188
- export interface SpringConfig {
189
- damping : Adaptable < number > ;
190
- mass : Adaptable < number > ;
191
- stiffness : Adaptable < number > ;
192
- overshootClamping : Adaptable < number > | boolean ;
193
- restSpeedThreshold : Adaptable < number > ;
194
- restDisplacementThreshold : Adaptable < number > ;
195
- toValue : Adaptable < number > ;
196
- }
197
- interface SpringConfigWithOrigamiTensionAndFriction {
198
- tension : Adaptable < number > ;
199
- mass : Adaptable < number > ;
200
- friction : Adaptable < number > ;
201
- overshootClamping : Adaptable < number > | boolean ;
202
- restSpeedThreshold : Adaptable < number > ;
203
- restDisplacementThreshold : Adaptable < number > ;
204
- toValue : Adaptable < number > ;
205
- }
206
-
207
- interface SpringConfigWithBouncinessAndSpeed {
208
- bounciness : Adaptable < number > ;
209
- mass : Adaptable < number > ;
210
- speed : Adaptable < number > ;
211
- overshootClamping : Adaptable < number > | boolean ;
212
- restSpeedThreshold : Adaptable < number > ;
213
- restDisplacementThreshold : Adaptable < number > ;
214
- toValue : Adaptable < number > ;
215
- }
216
-
217
- type SpringUtils = {
218
- makeDefaultConfig : ( ) => SpringConfig ;
219
- makeConfigFromBouncinessAndSpeed : (
220
- prevConfig : SpringConfigWithBouncinessAndSpeed
221
- ) => SpringConfig ;
222
- makeConfigFromOrigamiTensionAndFriction : (
223
- prevConfig : SpringConfigWithOrigamiTensionAndFriction
224
- ) => SpringConfig ;
225
- } ;
226
-
227
- export const SpringUtils : SpringUtils ;
228
-
229
- type CodeProps = {
230
- exec ?: AnimatedNode < number > ;
231
- children ?: ( ) => AnimatedNode < number > ;
232
- dependencies ?: Array < any > ;
233
- } ;
234
-
235
136
// components
236
137
export class View extends Component < AnimateProps < ViewProps > > {
237
138
getNode ( ) : ReactNativeView ;
@@ -253,8 +154,6 @@ declare module 'react-native-reanimated' {
253
154
}
254
155
// eslint-disable-next-line @typescript-eslint/no-empty-interface
255
156
export interface ScrollView extends ReactNativeScrollView { }
256
-
257
- export class Code extends Component < CodeProps > { }
258
157
export interface FlatListPropsWithLayout < T > extends FlatListProps < T > {
259
158
itemLayoutAnimation ?: ILayoutAnimationBuilder ;
260
159
}
@@ -290,7 +189,6 @@ declare module 'react-native-reanimated' {
290
189
export type SharedValue < T > = Animated . SharedValue < T > ;
291
190
export type AnimateStyle < S > = Animated . AnimateStyle < S > ;
292
191
export type DerivedValue < T > = Animated . DerivedValue < T > ;
293
- export type Mapping = Animated . Mapping ;
294
192
export type Adaptable < T > = Animated . Adaptable < T > ;
295
193
export type TransformStyleTypes = Animated . TransformStyleTypes ;
296
194
export type AdaptTransforms < T > = Animated . AdaptTransforms < T > ;
@@ -932,32 +830,6 @@ declare module 'react-native-reanimated' {
932
830
export class RollInRight extends ComplexAnimationBuilder { }
933
831
export class RollOutLeft extends ComplexAnimationBuilder { }
934
832
export class RollOutRight extends ComplexAnimationBuilder { }
935
- interface EasingNodeStatic {
936
- linear : Animated . EasingNodeFunction ;
937
- ease : Animated . EasingNodeFunction ;
938
- quad : Animated . EasingNodeFunction ;
939
- cubic : Animated . EasingNodeFunction ;
940
- poly ( n : Animated . Adaptable < number > ) : Animated . EasingNodeFunction ;
941
- sin : Animated . EasingNodeFunction ;
942
- circle : Animated . EasingNodeFunction ;
943
- exp : Animated . EasingNodeFunction ;
944
- elastic (
945
- bounciness ?: Animated . Adaptable < number >
946
- ) : Animated . EasingNodeFunction ;
947
- back ( s ?: Animated . Adaptable < number > ) : Animated . EasingNodeFunction ;
948
- bounce : Animated . EasingNodeFunction ;
949
- bezier (
950
- x1 : number ,
951
- y1 : number ,
952
- x2 : number ,
953
- y2 : number
954
- ) : Animated . EasingNodeFunction ;
955
- in ( easing : Animated . EasingNodeFunction ) : Animated . EasingNodeFunction ;
956
- out ( easing : Animated . EasingNodeFunction ) : Animated . EasingNodeFunction ;
957
- inOut ( easing : Animated . EasingNodeFunction ) : Animated . EasingNodeFunction ;
958
- }
959
-
960
- export const EasingNode : EasingNodeStatic ;
961
833
962
834
interface EasingStatic {
963
835
linear : Animated . EasingFunction ;
@@ -992,6 +864,8 @@ declare module 'react-native-reanimated' {
992
864
993
865
export function enableLayoutAnimations ( flag : boolean ) : void ;
994
866
867
+ export const Extrapolate : typeof Animated . Extrapolate ;
868
+
995
869
type AnimationFactoryType = ( values : LayoutAnimationsValues ) => StyleProps ;
996
870
997
871
export class SharedTransition implements ILayoutAnimationBuilder {
0 commit comments