react-native-reanimated 3.0.0-rc.1 → 3.0.0-rc.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-reanimated",
3
- "version": "3.0.0-rc.1",
3
+ "version": "3.0.0-rc.2",
4
4
  "description": "More powerful alternative to Animated library for React Native.",
5
5
  "scripts": {
6
6
  "test": "yarn run format:js && yarn run lint:js && yarn run test:unit",
@@ -38,6 +38,7 @@
38
38
  "!**/__fixtures__",
39
39
  "!**/__mocks__",
40
40
  "!lib/typescript",
41
+ "react-native-reanimated.d.ts",
41
42
  "android/src/main/AndroidManifest.xml",
42
43
  "android/src/main/java/",
43
44
  "android/build.gradle",
@@ -0,0 +1,1237 @@
1
+ // Project: https://github.com/software-mansion/react-native-reanimated
2
+ // TypeScript Version: 2.8
3
+
4
+ declare module 'react-native-reanimated' {
5
+ import {
6
+ ComponentClass,
7
+ ReactNode,
8
+ Component,
9
+ RefObject,
10
+ FunctionComponent,
11
+ } from 'react';
12
+ import {
13
+ ViewProps,
14
+ TextProps,
15
+ ImageProps,
16
+ ScrollViewProps,
17
+ FlatListProps,
18
+ StyleProp,
19
+ RegisteredStyle,
20
+ ViewStyle,
21
+ TextStyle,
22
+ ImageStyle,
23
+ TransformsStyle,
24
+ View as ReactNativeView,
25
+ Text as ReactNativeText,
26
+ Image as ReactNativeImage,
27
+ ScrollView as ReactNativeScrollView,
28
+ FlatList as ReactNativeFlatList,
29
+ NativeScrollEvent,
30
+ NativeSyntheticEvent,
31
+ ColorValue,
32
+ EasingFunction,
33
+ } from 'react-native';
34
+ import {
35
+ GestureHandlerGestureEvent,
36
+ PanGestureHandlerGestureEvent,
37
+ } from 'react-native-gesture-handler';
38
+
39
+ import('./lib/reanimated2/globals');
40
+
41
+ export type TimingAnimation =
42
+ import('./lib/types/lib/reanimated2/animation/index').TimingAnimation;
43
+ export type SpringAnimation =
44
+ import('./lib/types/lib/reanimated2/animation/index').SpringAnimation;
45
+ export type DecayAnimation =
46
+ import('./lib/types/lib/reanimated2/animation/index').DecayAnimation;
47
+ export type DelayAnimation =
48
+ import('./lib/types/lib/reanimated2/animation/commonTypes').DelayAnimation;
49
+ export type RepeatAnimation =
50
+ import('./lib/types/lib/reanimated2/animation/index').RepeatAnimation;
51
+ export type SequenceAnimation =
52
+ import('./lib/types/lib/reanimated2/animation/index').SequenceAnimation;
53
+ export type StyleLayoutAnimation =
54
+ import('./lib/types/lib/reanimated2/animation/index').StyleLayoutAnimation;
55
+ export type Animation<T> =
56
+ import('./lib/types/lib/reanimated2/commonTypes').Animation<T>;
57
+
58
+ namespace Animated {
59
+ type Nullable<T> = T | null | undefined;
60
+ class AnimatedNode<T> {
61
+ constructor(
62
+ nodeConfig: object,
63
+ inputNodes?: ReadonlyArray<AnimatedNode<any>>
64
+ );
65
+
66
+ isNativelyInitialized(): boolean;
67
+ /**
68
+ * ' __value' is not available at runtime on AnimatedNode<T>. It is
69
+ * necessary to have some discriminating property on a type to know that
70
+ * an AnimatedNode<number> and AnimatedNode<string> are not compatible types.
71
+ */
72
+ ' __value': T;
73
+ }
74
+ class AnimatedClock extends AnimatedNode<number> {
75
+ constructor();
76
+ }
77
+
78
+ export enum Extrapolate {
79
+ EXTEND = 'extend',
80
+ CLAMP = 'clamp',
81
+ IDENTITY = 'identity',
82
+ }
83
+
84
+ type ExtrapolateParameter =
85
+ | Extrapolate
86
+ | { extrapolateLeft?: Extrapolate; extrapolateRight?: Extrapolate };
87
+
88
+ interface InterpolationConfig {
89
+ inputRange: ReadonlyArray<Adaptable<number>>;
90
+ outputRange: ReadonlyArray<Adaptable<number | string>>;
91
+ extrapolate?: ExtrapolateParameter;
92
+ extrapolateLeft?: Extrapolate;
93
+ extrapolateRight?: Extrapolate;
94
+ }
95
+ type Value = string | number | boolean;
96
+ class AnimatedValue<T extends Value> extends AnimatedNode<T> {
97
+ constructor(value?: T);
98
+
99
+ setValue(value: Adaptable<T>): void;
100
+
101
+ interpolate(config: InterpolationConfig): AnimatedNode<number>;
102
+ }
103
+ export interface AnimationState {
104
+ finished: AnimatedValue<number>;
105
+ position: AnimatedValue<number>;
106
+ time: AnimatedValue<number>;
107
+ }
108
+
109
+ export type SharedValue<T> = { value: T };
110
+ export type DerivedValue<T> = Readonly<SharedValue<T>>;
111
+ export type Mapping = { [key: string]: Mapping } | Adaptable<any>;
112
+ export type Adaptable<T> =
113
+ | T
114
+ | AnimatedNode<T>
115
+ | ReadonlyArray<T | AnimatedNode<T> | ReadonlyArray<T | AnimatedNode<T>>>;
116
+ type BinaryOperator<T = number> = (
117
+ left: Adaptable<number>,
118
+ right: Adaptable<number>
119
+ ) => AnimatedNode<T>;
120
+ type UnaryOperator = (value: Adaptable<number>) => AnimatedNode<number>;
121
+ type MultiOperator<T = number> = (
122
+ a: Adaptable<number>,
123
+ b: Adaptable<number>,
124
+ ...others: Adaptable<number>[]
125
+ ) => AnimatedNode<T>;
126
+
127
+ export type TransformStyleTypes = TransformsStyle['transform'] extends
128
+ | readonly (infer T)[]
129
+ | undefined
130
+ ? T
131
+ : never;
132
+ export type AdaptTransforms<T> = {
133
+ [P in keyof T]: Adaptable<T[P]>;
134
+ };
135
+ export type AnimatedTransform = AdaptTransforms<TransformStyleTypes>[];
136
+
137
+ export type AnimateStyle<S> = {
138
+ [K in keyof S]: K extends 'transform'
139
+ ? AnimatedTransform
140
+ : S[K] extends ReadonlyArray<any>
141
+ ? ReadonlyArray<AnimateStyle<S[K][0]>>
142
+ : S[K] extends object
143
+ ? AnimateStyle<S[K]>
144
+ : S[K] extends ColorValue | undefined
145
+ ? S[K] | number
146
+ :
147
+ | S[K]
148
+ | AnimatedNode<
149
+ // allow `number` where `string` normally is to support colors
150
+ S[K] extends ColorValue | undefined ? S[K] | number : S[K]
151
+ >;
152
+ };
153
+
154
+ export type StylesOrDefault<T> = 'style' extends keyof T
155
+ ? T['style']
156
+ : Record<string, unknown>;
157
+
158
+ export type AnimateProps<P extends object> = {
159
+ [K in keyof Omit<P, 'style'>]: P[K] | AnimatedNode<P[K]>;
160
+ } & {
161
+ style?: StyleProp<AnimateStyle<StylesOrDefault<P>>>;
162
+ } & {
163
+ animatedProps?: Partial<AnimateProps<P>>;
164
+ layout?:
165
+ | BaseAnimationBuilder
166
+ | LayoutAnimationFunction
167
+ | typeof BaseAnimationBuilder;
168
+ entering?:
169
+ | BaseAnimationBuilder
170
+ | typeof BaseAnimationBuilder
171
+ | EntryExitAnimationFunction
172
+ | Keyframe;
173
+ exiting?:
174
+ | BaseAnimationBuilder
175
+ | typeof BaseAnimationBuilder
176
+ | EntryExitAnimationFunction
177
+ | Keyframe;
178
+ };
179
+
180
+ export interface PhysicsAnimationState extends AnimationState {
181
+ velocity: AnimatedValue<number>;
182
+ }
183
+
184
+ export type DecayState = PhysicsAnimationState;
185
+
186
+ export interface DecayConfig {
187
+ deceleration: Adaptable<number>;
188
+ }
189
+ export interface BackwardCompatibleWrapper {
190
+ start: (callback?: (data: { finished: boolean }) => any) => void;
191
+ stop: () => void;
192
+ }
193
+
194
+ export interface TimingState extends AnimationState {
195
+ frameTime: AnimatedValue<number>;
196
+ }
197
+ export type EasingNodeFunction = (
198
+ value: Adaptable<number>
199
+ ) => AnimatedNode<number>;
200
+ export type EasingFunction = (value: number) => number;
201
+ export interface TimingConfig {
202
+ toValue: Adaptable<number>;
203
+ duration: Adaptable<number>;
204
+ easing: EasingNodeFunction;
205
+ }
206
+
207
+ export type SpringState = PhysicsAnimationState;
208
+
209
+ export interface SpringConfig {
210
+ damping: Adaptable<number>;
211
+ mass: Adaptable<number>;
212
+ stiffness: Adaptable<number>;
213
+ overshootClamping: Adaptable<number> | boolean;
214
+ restSpeedThreshold: Adaptable<number>;
215
+ restDisplacementThreshold: Adaptable<number>;
216
+ toValue: Adaptable<number>;
217
+ }
218
+ interface SpringConfigWithOrigamiTensionAndFriction {
219
+ tension: Adaptable<number>;
220
+ mass: Adaptable<number>;
221
+ friction: Adaptable<number>;
222
+ overshootClamping: Adaptable<number> | boolean;
223
+ restSpeedThreshold: Adaptable<number>;
224
+ restDisplacementThreshold: Adaptable<number>;
225
+ toValue: Adaptable<number>;
226
+ }
227
+
228
+ interface SpringConfigWithBouncinessAndSpeed {
229
+ bounciness: Adaptable<number>;
230
+ mass: Adaptable<number>;
231
+ speed: Adaptable<number>;
232
+ overshootClamping: Adaptable<number> | boolean;
233
+ restSpeedThreshold: Adaptable<number>;
234
+ restDisplacementThreshold: Adaptable<number>;
235
+ toValue: Adaptable<number>;
236
+ }
237
+
238
+ type SpringUtils = {
239
+ makeDefaultConfig: () => SpringConfig;
240
+ makeConfigFromBouncinessAndSpeed: (
241
+ prevConfig: SpringConfigWithBouncinessAndSpeed
242
+ ) => SpringConfig;
243
+ makeConfigFromOrigamiTensionAndFriction: (
244
+ prevConfig: SpringConfigWithOrigamiTensionAndFriction
245
+ ) => SpringConfig;
246
+ };
247
+
248
+ export const SpringUtils: SpringUtils;
249
+
250
+ type CodeProps = {
251
+ exec?: AnimatedNode<number>;
252
+ children?: () => AnimatedNode<number>;
253
+ dependencies?: Array<any>;
254
+ };
255
+
256
+ // components
257
+ export class View extends Component<AnimateProps<ViewProps>> {
258
+ getNode(): ReactNativeView;
259
+ }
260
+ // eslint-disable-next-line @typescript-eslint/no-empty-interface
261
+ export interface View extends ReactNativeView {}
262
+ export class Text extends Component<AnimateProps<TextProps>> {
263
+ getNode(): ReactNativeText;
264
+ }
265
+ // eslint-disable-next-line @typescript-eslint/no-empty-interface
266
+ export interface Text extends ReactNativeText {}
267
+ export class Image extends Component<AnimateProps<ImageProps>> {
268
+ getNode(): ReactNativeImage;
269
+ }
270
+ // eslint-disable-next-line @typescript-eslint/no-empty-interface
271
+ export interface Image extends ReactNativeImage {}
272
+ export class ScrollView extends Component<AnimateProps<ScrollViewProps>> {
273
+ getNode(): ReactNativeScrollView;
274
+ }
275
+ // eslint-disable-next-line @typescript-eslint/no-empty-interface
276
+ export interface ScrollView extends ReactNativeScrollView {}
277
+
278
+ export class Code extends Component<CodeProps> {}
279
+ export class FlatList<T> extends Component<AnimateProps<FlatListProps<T>>> {
280
+ itemLayoutAnimation: ILayoutAnimationBuilder;
281
+ getNode(): ReactNativeFlatList;
282
+ }
283
+ // eslint-disable-next-line @typescript-eslint/no-empty-interface
284
+ export interface FlatList<T> extends ReactNativeView<T> {}
285
+
286
+ type Options<P> = {
287
+ setNativeProps: (ref: any, props: P) => void;
288
+ };
289
+ export function createAnimatedComponent<P extends object>(
290
+ component: ComponentClass<P>,
291
+ options?: Options<P>
292
+ ): ComponentClass<AnimateProps<P>>;
293
+ export function createAnimatedComponent<P extends object>(
294
+ component: FunctionComponent<P>,
295
+ options?: Options<P>
296
+ ): FunctionComponent<AnimateProps<P>>;
297
+
298
+ // classes
299
+ export {
300
+ AnimatedClock as Clock,
301
+ AnimatedNode as Node,
302
+ AnimatedValue as Value,
303
+ };
304
+
305
+ // base operations
306
+ export const add: MultiOperator;
307
+ export const sub: MultiOperator;
308
+ export const multiply: MultiOperator;
309
+ export const divide: MultiOperator;
310
+ export const pow: MultiOperator;
311
+ export const modulo: MultiOperator;
312
+ export const sqrt: UnaryOperator;
313
+ export const log: UnaryOperator;
314
+ export const sin: UnaryOperator;
315
+ export const cos: UnaryOperator;
316
+ export const tan: UnaryOperator;
317
+ export const acos: UnaryOperator;
318
+ export const asin: UnaryOperator;
319
+ export const atan: UnaryOperator;
320
+ export const exp: UnaryOperator;
321
+ export const round: UnaryOperator;
322
+ export const floor: UnaryOperator;
323
+ export const ceil: UnaryOperator;
324
+ export const lessThan: BinaryOperator<0 | 1>;
325
+ export const eq: BinaryOperator<0 | 1>;
326
+ export const greaterThan: BinaryOperator<0 | 1>;
327
+ export const lessOrEq: BinaryOperator<0 | 1>;
328
+ export const greaterOrEq: BinaryOperator<0 | 1>;
329
+ export const neq: BinaryOperator<0 | 1>;
330
+ export const and: MultiOperator<0 | 1>;
331
+ export const or: MultiOperator<0 | 1>;
332
+ export function proc<T extends (Adaptable<Value> | undefined)[]>(
333
+ func: (...args: T) => AnimatedNode<number>
334
+ ): typeof func;
335
+ export function defined(value: Adaptable<any>): AnimatedNode<0 | 1>;
336
+ export function not(value: Adaptable<any>): AnimatedNode<0 | 1>;
337
+ export function set<T extends Value>(
338
+ valueToBeUpdated: AnimatedValue<T>,
339
+ sourceNode: Adaptable<T>
340
+ ): AnimatedNode<T>;
341
+ export function concat(
342
+ ...args: Array<Adaptable<string> | Adaptable<number>>
343
+ ): AnimatedNode<string>;
344
+ export function cond<T1 extends Value = number, T2 extends Value = number>(
345
+ conditionNode: Adaptable<number>,
346
+ ifNode: Adaptable<T1>,
347
+ elseNode?: Adaptable<T2>
348
+ ): AnimatedNode<T1 | T2>;
349
+ export function block<T1 extends Value = number, T2 extends Value = any>(
350
+ items: ReadonlyArray<Adaptable<T2>>
351
+ ): AnimatedNode<T1>;
352
+ export function call<T>(
353
+ args: ReadonlyArray<T | AnimatedNode<T>>,
354
+ callback: (args: ReadonlyArray<T>) => void
355
+ ): AnimatedNode<0>;
356
+ export function debug<T>(
357
+ message: string,
358
+ value: AnimatedNode<T>
359
+ ): AnimatedNode<T>;
360
+ export function onChange(
361
+ value: Adaptable<number>,
362
+ action: Adaptable<number>
363
+ ): AnimatedNode<number>;
364
+ export function startClock(clock: AnimatedClock): AnimatedNode<0>;
365
+ export function stopClock(clock: AnimatedClock): AnimatedNode<0>;
366
+ export function clockRunning(clock: AnimatedClock): AnimatedNode<0 | 1>;
367
+ // the return type for `event` is a lie, but it's the same lie that
368
+ // react-native makes within Animated
369
+ type EventArgFunc<T> = (arg: T) => AnimatedNode<number>;
370
+ type EventMapping<T> = T extends object
371
+ ? { [K in keyof T]?: EventMapping<T[K]> | EventArgFunc<T[K]> }
372
+ : Adaptable<T> | EventArgFunc<T>;
373
+ type EventMappingArray<T> = T extends Array<any>
374
+ ? { [I in keyof T]: EventMapping<T[I]> }
375
+ : [EventMapping<T>];
376
+ export function event<T>(
377
+ argMapping: T extends never
378
+ ? ReadonlyArray<Mapping>
379
+ : Readonly<EventMappingArray<T>>,
380
+ config?: {}
381
+ ): (...args: any[]) => void;
382
+
383
+ // derived operations
384
+ export function abs(value: Adaptable<number>): AnimatedNode<number>;
385
+ export function acc(value: Adaptable<number>): AnimatedNode<number>;
386
+ export function color(
387
+ r: Adaptable<number>,
388
+ g: Adaptable<number>,
389
+ b: Adaptable<number>,
390
+ a?: Adaptable<number>
391
+ ): AnimatedNode<number | string>;
392
+ export function diff(value: Adaptable<number>): AnimatedNode<number>;
393
+ export function diffClamp(
394
+ value: Adaptable<number>,
395
+ minVal: Adaptable<number>,
396
+ maxVal: Adaptable<number>
397
+ ): AnimatedNode<number>;
398
+ export function interpolateNode(
399
+ value: Adaptable<number>,
400
+ config: InterpolationConfig
401
+ ): AnimatedNode<number>;
402
+ export function interpolateColors<T extends string | number>(
403
+ animationValue: Adaptable<number>,
404
+ {
405
+ inputRange,
406
+ outputColorRange,
407
+ }: {
408
+ inputRange: ReadonlyArray<Adaptable<number>>;
409
+ outputColorRange: ReadonlyArray<Adaptable<T>>;
410
+ }
411
+ ): AnimatedNode<T>;
412
+ export const max: BinaryOperator;
413
+ export const min: BinaryOperator;
414
+
415
+ // animations
416
+ export function decay(
417
+ clock: AnimatedClock,
418
+ state: DecayState,
419
+ config: DecayConfig
420
+ ): AnimatedNode<number>;
421
+ export function timing(
422
+ clock: AnimatedClock,
423
+ state: TimingState,
424
+ config: TimingConfig
425
+ ): AnimatedNode<number>;
426
+ export function spring(
427
+ clock: AnimatedClock,
428
+ state: SpringState,
429
+ config: SpringConfig
430
+ ): AnimatedNode<number>;
431
+ // backward compatible API
432
+ export function spring(
433
+ node: AnimatedNode<number>,
434
+ config: SpringConfig
435
+ ): BackwardCompatibleWrapper;
436
+ export function timing(
437
+ node: AnimatedNode<number>,
438
+ config: TimingConfig
439
+ ): BackwardCompatibleWrapper;
440
+ export function decay(
441
+ node: AnimatedNode<number>,
442
+ config: DecayConfig
443
+ ): BackwardCompatibleWrapper;
444
+
445
+ // hooks
446
+ export function useCode(
447
+ exec: () =>
448
+ | Nullable<AnimatedNode<number>[] | AnimatedNode<number>>
449
+ | boolean,
450
+ deps: Array<any>
451
+ ): void;
452
+ export function useValue<T extends Value>(
453
+ initialValue: T
454
+ ): AnimatedValue<T>;
455
+
456
+ // configuration
457
+ export function addWhitelistedNativeProps(props: {
458
+ [key: string]: true;
459
+ }): void;
460
+ export function addWhitelistedUIProps(props: { [key: string]: true }): void;
461
+ }
462
+
463
+ export default Animated;
464
+
465
+ export type SharedValue<T> = Animated.SharedValue<T>;
466
+ export type AnimateStyle<S> = Animated.AnimateStyle<S>;
467
+ export type DerivedValue<T> = Animated.DerivedValue<T>;
468
+ export type Mapping = Animated.Mapping;
469
+ export type Adaptable<T> = Animated.Adaptable<T>;
470
+ export type TransformStyleTypes = Animated.TransformStyleTypes;
471
+ export type AdaptTransforms<T> = Animated.AdaptTransforms<T>;
472
+ export type AnimatedTransform = Animated.AnimatedTransform;
473
+ export type AnimateProps<P extends object> = Animated.AnimateProps<P>;
474
+
475
+ export type LayoutAnimation = {
476
+ initialValues: StyleProps;
477
+ animations: AnimateStyle;
478
+ };
479
+
480
+ export interface EntryAnimationsValues {
481
+ targetOriginX: number;
482
+ targetOriginY: number;
483
+ targetWidth: number;
484
+ targetHeight: number;
485
+ targetGlobalOriginX: number;
486
+ targetGlobalOriginY: number;
487
+ }
488
+
489
+ export enum SensorType {
490
+ ACCELEROMETER = 1,
491
+ GYROSCOPE = 2,
492
+ GRAVITY = 3,
493
+ MAGNETIC_FIELD = 4,
494
+ ROTATION = 5,
495
+ }
496
+
497
+ export type SensorConfig = {
498
+ interval: number | 'auto';
499
+ };
500
+
501
+ export type Value3D = {
502
+ x: number;
503
+ y: number;
504
+ z: number;
505
+ };
506
+
507
+ export type SensorValue3D = SharedValue<Value3D>;
508
+
509
+ export type ValueRotation = {
510
+ qw: number;
511
+ qx: number;
512
+ qy: number;
513
+ qz: number;
514
+ yaw: number;
515
+ pitch: number;
516
+ roll: number;
517
+ };
518
+
519
+ export type SensorValueRotation = SharedValue<ValueRotation>;
520
+
521
+ export type AnimatedSensor<SensorValueType> = {
522
+ sensor: SensorValueType;
523
+ unregister: () => void;
524
+ isAvailable: boolean;
525
+ config: SensorConfig;
526
+ };
527
+
528
+ export function useAnimatedSensor(
529
+ sensorType: SensorType.ROTATION,
530
+ userConfig?: SensorConfig
531
+ ): AnimatedSensor<SensorValueRotation>;
532
+ export function useAnimatedSensor(
533
+ sensorType: Exclude<SensorType, SensorType.ROTATION>,
534
+ userConfig?: SensorConfig
535
+ ): AnimatedSensor<SensorValue3D>;
536
+ export function useAnimatedSensor(
537
+ sensorType: SensorType,
538
+ userConfig?: SensorConfig
539
+ ): AnimatedSensor<any>;
540
+
541
+ export type FrameCallback = {
542
+ setActive: (isActive: boolean) => void;
543
+ isActive: boolean;
544
+ callbackId: number;
545
+ };
546
+ export function useFrameCallback(
547
+ callback: () => void,
548
+ autostart?: boolean
549
+ ): FrameCallback;
550
+
551
+ export enum KeyboardState {
552
+ UNKNOWN = 0,
553
+ OPENING = 1,
554
+ OPEN = 2,
555
+ CLOSING = 3,
556
+ CLOSED = 4,
557
+ }
558
+ export type AnimatedKeyboardInfo = {
559
+ height: SharedValue<number>;
560
+ state: SharedValue<KeyboardState>;
561
+ };
562
+ export function useAnimatedKeyboard(): AnimatedKeyboardInfo;
563
+
564
+ export interface ExitAnimationsValues {
565
+ currentOriginX: number;
566
+ currentOriginY: number;
567
+ currentWidth: number;
568
+ currentHeight: number;
569
+ currentGlobalOriginX: number;
570
+ currentGlobalOriginY: number;
571
+ }
572
+
573
+ export type EntryExitAnimationFunction =
574
+ | ((targetValues: EntryAnimationsValues) => LayoutAnimation)
575
+ | ((targetValues: ExitAnimationsValues) => LayoutAnimation);
576
+
577
+ export type LayoutAnimationsValues = {
578
+ currentOriginX: number;
579
+ currentOriginY: number;
580
+ currentWidth: number;
581
+ currentHeight: number;
582
+ currentGlobalOriginX: number;
583
+ currentGlobalOriginY: number;
584
+ targetOriginX: number;
585
+ targetOriginY: number;
586
+ targetWidth: number;
587
+ targetHeight: number;
588
+ targetGlobalOriginX: number;
589
+ targetGlobalOriginY: number;
590
+ windowWidth: number;
591
+ windowHeight: number;
592
+ };
593
+
594
+ export type LayoutAnimationFunction = (
595
+ targetValues: LayoutAnimationsValues
596
+ ) => LayoutAnimation;
597
+
598
+ export interface ILayoutAnimationBuilder {
599
+ build: () => LayoutAnimationFunction;
600
+ }
601
+
602
+ export interface IEntryExitAnimationBuilder {
603
+ build: () => EntryExitAnimationFunction;
604
+ }
605
+
606
+ export type AnimatableValue = number | string | Array<number>;
607
+
608
+ // reanimated2 derived operations
609
+ export enum Extrapolation {
610
+ IDENTITY = 'identity',
611
+ CLAMP = 'clamp',
612
+ EXTEND = 'extend',
613
+ }
614
+ export interface InterpolatedNode {
615
+ __nodeId: number;
616
+ }
617
+ export interface ExtrapolationConfig {
618
+ extrapolateLeft?: Extrapolation | string;
619
+ extrapolateRight?: Extrapolation | string;
620
+ }
621
+
622
+ export type ExtrapolationType =
623
+ | ExtrapolationConfig
624
+ | Extrapolation
625
+ | string
626
+ | undefined;
627
+
628
+ export function interpolate(
629
+ x: number,
630
+ input: readonly number[],
631
+ output: readonly number[],
632
+ type?: ExtrapolationType
633
+ ): number;
634
+
635
+ // reanimated2 animations
636
+ export type AnimationCallback = (
637
+ finished?: boolean,
638
+ current?: AnimatableValue
639
+ ) => void;
640
+ export type EasingFunctionFactory = { factory: () => EasingFunction };
641
+ export interface WithTimingConfig {
642
+ duration?: number;
643
+ easing?: EasingFunction | EasingFunctionFactory;
644
+ }
645
+ export interface WithDecayConfig {
646
+ deceleration?: number;
647
+ velocity?: number;
648
+ clamp?: [number, number];
649
+ velocityFactor?: number;
650
+ rubberBandEffect?: boolean;
651
+ rubberBandFactor?: number;
652
+ }
653
+ export interface WithSpringConfig {
654
+ damping?: number;
655
+ mass?: number;
656
+ stiffness?: number;
657
+ overshootClamping?: boolean;
658
+ restSpeedThreshold?: number;
659
+ restDisplacementThreshold?: number;
660
+ velocity?: number;
661
+ }
662
+ export function withTiming<T extends AnimatableValue>(
663
+ toValue: T,
664
+ userConfig?: WithTimingConfig,
665
+ callback?: AnimationCallback
666
+ ): T;
667
+ export function withSpring<T extends AnimatableValue>(
668
+ toValue: T,
669
+ userConfig?: WithSpringConfig,
670
+ callback?: AnimationCallback
671
+ ): T;
672
+ export function withDecay(
673
+ userConfig: WithDecayConfig,
674
+ callback?: AnimationCallback
675
+ ): number;
676
+ export function cancelAnimation<T>(sharedValue: SharedValue<T>): void;
677
+ export function withDelay<T extends AnimatableValue>(
678
+ delayMS: number,
679
+ delayedAnimation: T
680
+ ): T;
681
+ export function withRepeat<T extends AnimatableValue>(
682
+ animation: T,
683
+ numberOfReps?: number,
684
+ reverse?: boolean,
685
+ callback?: AnimationCallback
686
+ ): T;
687
+ export function withSequence<T extends AnimatableValue>(
688
+ ...animations: [T, ...T[]]
689
+ ): T;
690
+
691
+ // reanimated2 functions
692
+ export function runOnUI<A extends any[], R>(
693
+ fn: (...args: A) => R
694
+ ): (...args: Parameters<typeof fn>) => void;
695
+ export function runOnJS<A extends any[], R>(
696
+ fn: (...args: A) => R
697
+ ): (...args: Parameters<typeof fn>) => void;
698
+
699
+ type PropsAdapterFunction = (props: Record<string, unknown>) => void;
700
+ export function createAnimatedPropAdapter(
701
+ adapter: PropsAdapterFunction,
702
+ nativeProps?: string[]
703
+ ): PropsAdapterFunction;
704
+
705
+ export function processColor(color: number | string): number;
706
+
707
+ export function interpolateColor<T extends string | number>(
708
+ value: number,
709
+ inputRange: readonly number[],
710
+ outputRange: readonly T[],
711
+ colorSpace?: 'RGB' | 'HSV'
712
+ ): T;
713
+
714
+ export enum ColorSpace {
715
+ RGB = 0,
716
+ HSV = 1,
717
+ }
718
+
719
+ export interface InterpolateRGB {
720
+ r: number[];
721
+ g: number[];
722
+ b: number[];
723
+ a: number[];
724
+ }
725
+
726
+ export interface InterpolateHSV {
727
+ h: number[];
728
+ s: number[];
729
+ v: number[];
730
+ }
731
+
732
+ export interface InterpolateConfig {
733
+ inputRange: readonly number[];
734
+ outputRange: readonly (string | number)[];
735
+ colorSpace: ColorSpace;
736
+ cache: SharedValue<InterpolateRGB | InterpolateHSV | null>;
737
+ }
738
+
739
+ export function useInterpolateConfig(
740
+ inputRange: readonly number[],
741
+ outputRange: readonly (string | number)[],
742
+ colorSpace?: ColorSpace
743
+ ): SharedValue<InterpolateConfig>;
744
+
745
+ export function interpolateSharableColor(
746
+ value: number,
747
+ interpolateConfig: SharedValue<InterpolateConfig>
748
+ ): string | number;
749
+
750
+ export function makeMutable<T>(initialValue: T): SharedValue<T>;
751
+
752
+ type DependencyList = ReadonlyArray<any>;
753
+
754
+ // reanimated2 hooks
755
+ export function useSharedValue<T>(initialValue: T): SharedValue<T>;
756
+
757
+ export function useDerivedValue<T>(
758
+ processor: () => T,
759
+ deps?: DependencyList
760
+ ): DerivedValue<T>;
761
+
762
+ export function useAnimatedReaction<D>(
763
+ prepare: () => D,
764
+ react: (prepareResult: D, preparePreviousResult: D | null) => void,
765
+ deps?: DependencyList
766
+ ): void;
767
+
768
+ export type AnimatedStyleProp<T> =
769
+ | AnimateStyle<T>
770
+ | RegisteredStyle<AnimateStyle<T>>;
771
+ export function useAnimatedStyle<
772
+ T extends AnimatedStyleProp<ViewStyle | ImageStyle | TextStyle>
773
+ >(updater: () => T, deps?: DependencyList | null): T;
774
+ export function useAnimatedProps<T extends {}>(
775
+ updater: () => Partial<T>,
776
+ deps?: DependencyList | null,
777
+ adapters?: PropsAdapterFunction | PropsAdapterFunction[] | null
778
+ ): Partial<T>;
779
+ export function useEvent<T extends {}>(
780
+ handler: (e: T) => void,
781
+ eventNames?: string[],
782
+ rebuild?: boolean
783
+ ): (e: NativeSyntheticEvent<T>) => void;
784
+ export function useHandler<T, TContext extends Context = {}>(
785
+ handlers: Record<string, Handler<T, TContext>>,
786
+ deps?: DependencyList
787
+ ): { context: TContext; doDependenciesDiffer: boolean; useWeb: boolean };
788
+ export function useAnimatedGestureHandler<
789
+ T extends GestureHandlerGestureEvent = PanGestureHandlerGestureEvent,
790
+ TContext extends Context = {}
791
+ >(
792
+ handlers: GestureHandlers<T['nativeEvent'], TContext>,
793
+ deps?: DependencyList
794
+ ): OnGestureEvent<T>;
795
+ export function useAnimatedScrollHandler<TContext extends Context = {}>(
796
+ handlers: ScrollHandlers<TContext> | ScrollHandler<TContext>,
797
+ deps?: DependencyList
798
+ ): OnScroll;
799
+ export function useWorkletCallback<A extends any[], R>(
800
+ fn: (...args: A) => R,
801
+ deps?: DependencyList
802
+ ): (...args: Parameters<typeof fn>) => R;
803
+
804
+ export function useAnimatedRef<T extends Component>(): RefObject<T>;
805
+ export function defineAnimation<T>(starting: any, factory: () => T): number;
806
+ export function measure<T extends Component>(
807
+ ref: RefObject<T>
808
+ ): {
809
+ width: number;
810
+ height: number;
811
+ x: number;
812
+ y: number;
813
+ pageX: number;
814
+ pageY: number;
815
+ };
816
+
817
+ export function getRelativeCoords(
818
+ ref: RefObject<Component>,
819
+ x: number,
820
+ y: number
821
+ ): {
822
+ x: number;
823
+ y: number;
824
+ };
825
+
826
+ export function scrollTo(
827
+ ref: RefObject<ReactNativeScrollView | ScrollView>,
828
+ x: number,
829
+ y: number,
830
+ animated: boolean
831
+ ): void;
832
+
833
+ // gesture-handler
834
+ type OnGestureEvent<T extends GestureHandlerGestureEvent> = (
835
+ event: T
836
+ ) => void;
837
+
838
+ type Context = Record<string, unknown>;
839
+
840
+ type Handler<T, TContext extends Context> = (
841
+ event: T,
842
+ context: TContext
843
+ ) => void;
844
+
845
+ export interface GestureHandlers<T, TContext extends Context> {
846
+ onStart?: Handler<T, TContext>;
847
+ onActive?: Handler<T, TContext>;
848
+ onEnd?: Handler<T, TContext>;
849
+ onFail?: Handler<T, TContext>;
850
+ onCancel?: Handler<T, TContext>;
851
+ onFinish?: (
852
+ event: T,
853
+ context: TContext,
854
+ isCanceledOrFailed: boolean
855
+ ) => void;
856
+ }
857
+
858
+ // scroll view
859
+ type OnScroll = (event: NativeSyntheticEvent<NativeScrollEvent>) => void;
860
+
861
+ type ScrollHandler<TContext extends Context> = (
862
+ event: NativeScrollEvent,
863
+ context: TContext
864
+ ) => void;
865
+
866
+ export interface ScrollHandlers<TContext extends Context> {
867
+ onScroll?: ScrollHandler<TContext>;
868
+ onBeginDrag?: ScrollHandler<TContext>;
869
+ onEndDrag?: ScrollHandler<TContext>;
870
+ onMomentumBegin?: ScrollHandler<TContext>;
871
+ onMomentumEnd?: ScrollHandler<TContext>;
872
+ }
873
+ export interface StyleProps extends ViewStyle, TextStyle {
874
+ originX?: number;
875
+ originY?: number;
876
+ [key: string]: any;
877
+ }
878
+ export type EasingFn = (t: number) => number;
879
+ export interface KeyframeProps extends StyleProps {
880
+ easing?: EasingFn;
881
+ [key: string]: any;
882
+ }
883
+ export class Keyframe {
884
+ constructor(definitions: Record<string, KeyframeProps>);
885
+ duration(durationMs: number): Keyframe;
886
+ delay(delayMs: number): Keyframe;
887
+ withCallback(callback: (finished: boolean) => void): Keyframe;
888
+ }
889
+ export class BaseAnimationBuilder {
890
+ static duration(durationMs: number): BaseAnimationBuilder;
891
+ duration(durationMs: number): BaseAnimationBuilder;
892
+ static delay(durationMs: number): BaseAnimationBuilder;
893
+ delay(durationMs: number): BaseAnimationBuilder;
894
+ static withCallback(
895
+ callback: (finished: boolean) => void
896
+ ): BaseAnimationBuilder;
897
+
898
+ withCallback(callback: (finished: boolean) => void): BaseAnimationBuilder;
899
+ static randomDelay(): BaseAnimationBuilder;
900
+ randomDelay(): BaseAnimationBuilder;
901
+ build: () => LayoutAnimationFunction | EntryExitAnimationFunction;
902
+ }
903
+
904
+ export class ComplexAnimationBuilder extends BaseAnimationBuilder {
905
+ static duration(durationMs: number): ComplexAnimationBuilder;
906
+ duration(durationMs: number): ComplexAnimationBuilder;
907
+ static delay(durationMs: number): ComplexAnimationBuilder;
908
+ delay(durationMs: number): ComplexAnimationBuilder;
909
+ static withCallback(
910
+ callback: (finished: boolean) => void
911
+ ): ComplexAnimationBuilder;
912
+
913
+ withCallback(
914
+ callback: (finished: boolean) => void
915
+ ): ComplexAnimationBuilder;
916
+
917
+ static withInitialValues(values: StyleProps): BaseAnimationBuilder;
918
+ withInitialValues(values: StyleProps): BaseAnimationBuilder;
919
+
920
+ static easing(easingFunction: EasingFunction): ComplexAnimationBuilder;
921
+ easing(easingFunction: EasingFunction): ComplexAnimationBuilder;
922
+ static springify(): ComplexAnimationBuilder;
923
+ springify(): ComplexAnimationBuilder;
924
+ static damping(dampingFactor: number): ComplexAnimationBuilder;
925
+ damping(dampingFactor: number): ComplexAnimationBuilder;
926
+ static mass(mass: number): ComplexAnimationBuilder;
927
+ mass(mass: number): ComplexAnimationBuilder;
928
+ static stiffness(stiffnessFactor: number): ComplexAnimationBuilder;
929
+ stiffness(stiffnessFactor: number): ComplexAnimationBuilder;
930
+ static overshootClamping(
931
+ overshootClampingFactor: number
932
+ ): ComplexAnimationBuilder;
933
+
934
+ overshootClamping(overshootClampingFactor: number): ComplexAnimationBuilder;
935
+
936
+ static restDisplacementThreshold(
937
+ restDisplacementThresholdFactor: number
938
+ ): ComplexAnimationBuilder;
939
+
940
+ restDisplacementThreshold(
941
+ restDisplacementThresholdFactor: number
942
+ ): ComplexAnimationBuilder;
943
+
944
+ static restSpeedThreshold(
945
+ restSpeedThresholdFactor: number
946
+ ): ComplexAnimationBuilder;
947
+
948
+ restSpeedThreshold(
949
+ restSpeedThresholdFactor: number
950
+ ): ComplexAnimationBuilder;
951
+ }
952
+
953
+ export class Layout extends ComplexAnimationBuilder {}
954
+ export class FadingTransition extends BaseAnimationBuilder {}
955
+ export class SequencedTransition extends BaseAnimationBuilder {
956
+ static reverse(): SequencedTransition;
957
+ reverse(): SequencedTransition;
958
+ }
959
+ export class JumpingTransition extends BaseAnimationBuilder {}
960
+ export class CurvedTransition extends BaseAnimationBuilder {
961
+ static delay(durationMs: number): CurvedTransition;
962
+ delay(durationMs: number): CurvedTransition;
963
+ static easingX(easing: EasingFn): CurvedTransition;
964
+
965
+ easingX(easing: EasingFn): CurvedTransition;
966
+
967
+ static easingY(easing: EasingFn): CurvedTransition;
968
+
969
+ easingY(easing: EasingFn): CurvedTransition;
970
+
971
+ static easingWidth(easing: EasingFn): CurvedTransition;
972
+
973
+ easingWidth(easing: EasingFn): CurvedTransition;
974
+
975
+ static easingHeight(easing: EasingFn): CurvedTransition;
976
+
977
+ easingHeight(easing: EasingFn): CurvedTransition;
978
+ }
979
+ export class EntryExitTransition extends BaseAnimationBuilder {
980
+ static delay(durationMs: number): EntryExitTransition;
981
+ delay(durationMs: number): EntryExitTransition;
982
+ static entering(
983
+ animation: BaseAnimationBuilder | typeof BaseAnimationBuilder
984
+ ): EntryExitTransition;
985
+
986
+ entering(
987
+ animation: BaseAnimationBuilder | typeof BaseAnimationBuilder
988
+ ): EntryExitTransition;
989
+
990
+ static exiting(
991
+ animation: BaseAnimationBuilder | typeof BaseAnimationBuilder
992
+ ): EntryExitTransition;
993
+
994
+ exiting(
995
+ animation: BaseAnimationBuilder | typeof BaseAnimationBuilder
996
+ ): EntryExitTransition;
997
+ }
998
+ export function combineTransition(
999
+ exiting: BaseAnimationBuilder | typeof BaseAnimationBuilder,
1000
+ entering: BaseAnimationBuilder | typeof BaseAnimationBuilder
1001
+ ): EntryExitTransition;
1002
+ export class SlideInRight extends ComplexAnimationBuilder {}
1003
+ export class SlideOutRight extends ComplexAnimationBuilder {}
1004
+ export class SlideInUp extends ComplexAnimationBuilder {}
1005
+ export class SlideInDown extends ComplexAnimationBuilder {}
1006
+ export class SlideOutUp extends ComplexAnimationBuilder {}
1007
+ export class SlideOutDown extends ComplexAnimationBuilder {}
1008
+ export class FadeIn extends ComplexAnimationBuilder {}
1009
+ export class FadeInRight extends ComplexAnimationBuilder {}
1010
+ export class FadeInLeft extends ComplexAnimationBuilder {}
1011
+ export class FadeInUp extends ComplexAnimationBuilder {}
1012
+ export class FadeInDown extends ComplexAnimationBuilder {}
1013
+ export class FadeOut extends ComplexAnimationBuilder {}
1014
+ export class FadeOutRight extends ComplexAnimationBuilder {}
1015
+ export class FadeOutLeft extends ComplexAnimationBuilder {}
1016
+ export class FadeOutUp extends ComplexAnimationBuilder {}
1017
+ export class FadeOutDown extends ComplexAnimationBuilder {}
1018
+ export class SlideOutLeft extends ComplexAnimationBuilder {}
1019
+ export class SlideInLeft extends ComplexAnimationBuilder {}
1020
+ export class ZoomIn extends ComplexAnimationBuilder {}
1021
+ export class ZoomInRotate extends ComplexAnimationBuilder {}
1022
+ export class ZoomInRight extends ComplexAnimationBuilder {}
1023
+ export class ZoomInLeft extends ComplexAnimationBuilder {}
1024
+ export class ZoomInUp extends ComplexAnimationBuilder {}
1025
+ export class ZoomInDown extends ComplexAnimationBuilder {}
1026
+ export class ZoomInEasyUp extends ComplexAnimationBuilder {}
1027
+ export class ZoomInEasyDown extends ComplexAnimationBuilder {}
1028
+ export class ZoomOut extends ComplexAnimationBuilder {}
1029
+ export class ZoomOutRotate extends ComplexAnimationBuilder {}
1030
+ export class ZoomOutRight extends ComplexAnimationBuilder {}
1031
+ export class ZoomOutLeft extends ComplexAnimationBuilder {}
1032
+ export class ZoomOutUp extends ComplexAnimationBuilder {}
1033
+ export class ZoomOutDown extends ComplexAnimationBuilder {}
1034
+ export class ZoomOutEasyUp extends ComplexAnimationBuilder {}
1035
+ export class ZoomOutEasyDown extends ComplexAnimationBuilder {}
1036
+ export class StretchInX extends ComplexAnimationBuilder {}
1037
+ export class StretchInY extends ComplexAnimationBuilder {}
1038
+ export class StretchOutX extends ComplexAnimationBuilder {}
1039
+ export class StretchOutY extends ComplexAnimationBuilder {}
1040
+ export class FlipInXUp extends ComplexAnimationBuilder {}
1041
+ export class FlipInYLeft extends ComplexAnimationBuilder {}
1042
+ export class FlipInXDown extends ComplexAnimationBuilder {}
1043
+ export class FlipInYRight extends ComplexAnimationBuilder {}
1044
+ export class FlipInEasyX extends ComplexAnimationBuilder {}
1045
+ export class FlipInEasyY extends ComplexAnimationBuilder {}
1046
+ export class FlipOutXUp extends ComplexAnimationBuilder {}
1047
+ export class FlipOutYLeft extends ComplexAnimationBuilder {}
1048
+ export class FlipOutXDown extends ComplexAnimationBuilder {}
1049
+ export class FlipOutYRight extends ComplexAnimationBuilder {}
1050
+ export class FlipOutEasyX extends ComplexAnimationBuilder {}
1051
+ export class FlipOutEasyY extends ComplexAnimationBuilder {}
1052
+ export class BounceIn extends BaseAnimationBuilder {}
1053
+ export class BounceInDown extends BaseAnimationBuilder {}
1054
+ export class BounceInUp extends BaseAnimationBuilder {}
1055
+ export class BounceInLeft extends BaseAnimationBuilder {}
1056
+ export class BounceInRight extends BaseAnimationBuilder {}
1057
+ export class BounceOut extends BaseAnimationBuilder {}
1058
+ export class BounceOutDown extends BaseAnimationBuilder {}
1059
+ export class BounceOutUp extends BaseAnimationBuilder {}
1060
+ export class BounceOutLeft extends BaseAnimationBuilder {}
1061
+ export class BounceOutRight extends BaseAnimationBuilder {}
1062
+ export class LightSpeedInRight extends ComplexAnimationBuilder {}
1063
+ export class LightSpeedInLeft extends ComplexAnimationBuilder {}
1064
+ export class LightSpeedOutRight extends ComplexAnimationBuilder {}
1065
+ export class LightSpeedOutLeft extends ComplexAnimationBuilder {}
1066
+ export class PinwheelIn extends ComplexAnimationBuilder {}
1067
+ export class PinwheelOut extends ComplexAnimationBuilder {}
1068
+ export class RotateInDownLeft extends ComplexAnimationBuilder {}
1069
+ export class RotateInDownRight extends ComplexAnimationBuilder {}
1070
+ export class RotateInUpRight extends ComplexAnimationBuilder {}
1071
+ export class RotateInUpLeft extends ComplexAnimationBuilder {}
1072
+ export class RotateOutDownRight extends ComplexAnimationBuilder {}
1073
+ export class RotateOutDownLeft extends ComplexAnimationBuilder {}
1074
+ export class RotateOutUpLeft extends ComplexAnimationBuilder {}
1075
+ export class RotateOutUpRight extends ComplexAnimationBuilder {}
1076
+ export class RollInLeft extends ComplexAnimationBuilder {}
1077
+ export class RollInRight extends ComplexAnimationBuilder {}
1078
+ export class RollOutLeft extends ComplexAnimationBuilder {}
1079
+ export class RollOutRight extends ComplexAnimationBuilder {}
1080
+ interface EasingNodeStatic {
1081
+ linear: Animated.EasingNodeFunction;
1082
+ ease: Animated.EasingNodeFunction;
1083
+ quad: Animated.EasingNodeFunction;
1084
+ cubic: Animated.EasingNodeFunction;
1085
+ poly(n: Animated.Adaptable<number>): Animated.EasingNodeFunction;
1086
+ sin: Animated.EasingNodeFunction;
1087
+ circle: Animated.EasingNodeFunction;
1088
+ exp: Animated.EasingNodeFunction;
1089
+ elastic(
1090
+ bounciness?: Animated.Adaptable<number>
1091
+ ): Animated.EasingNodeFunction;
1092
+ back(s?: Animated.Adaptable<number>): Animated.EasingNodeFunction;
1093
+ bounce: Animated.EasingNodeFunction;
1094
+ bezier(
1095
+ x1: number,
1096
+ y1: number,
1097
+ x2: number,
1098
+ y2: number
1099
+ ): Animated.EasingNodeFunction;
1100
+ in(easing: Animated.EasingNodeFunction): Animated.EasingNodeFunction;
1101
+ out(easing: Animated.EasingNodeFunction): Animated.EasingNodeFunction;
1102
+ inOut(easing: Animated.EasingNodeFunction): Animated.EasingNodeFunction;
1103
+ }
1104
+
1105
+ export const EasingNode: EasingNodeStatic;
1106
+
1107
+ interface EasingStatic {
1108
+ linear: Animated.EasingFunction;
1109
+ ease: Animated.EasingFunction;
1110
+ quad: Animated.EasingFunction;
1111
+ cubic: Animated.EasingFunction;
1112
+ poly(n: number): Animated.EasingFunction;
1113
+ sin: Animated.EasingFunction;
1114
+ circle: Animated.EasingFunction;
1115
+ exp: Animated.EasingFunction;
1116
+ elastic(bounciness?: number): Animated.EasingFunction;
1117
+ back(s?: number): Animated.EasingFunction;
1118
+ bounce: Animated.EasingFunction;
1119
+ bezier(
1120
+ x1: number,
1121
+ y1: number,
1122
+ x2: number,
1123
+ y2: number
1124
+ ): { factory: () => Animated.EasingFunction };
1125
+ bezierFn(
1126
+ x1: number,
1127
+ y1: number,
1128
+ x2: number,
1129
+ y2: number
1130
+ ): Animated.EasingFunction;
1131
+ in(easing: Animated.EasingFunction): Animated.EasingFunction;
1132
+ out(easing: Animated.EasingFunction): Animated.EasingFunction;
1133
+ inOut(easing: Animated.EasingFunction): Animated.EasingFunction;
1134
+ }
1135
+
1136
+ export const Easing: EasingStatic;
1137
+
1138
+ export interface TransitioningViewProps extends ViewProps {
1139
+ transition: ReactNode;
1140
+ }
1141
+
1142
+ export class TransitioningView extends Component<TransitioningViewProps> {
1143
+ animateNextTransition(): void;
1144
+ }
1145
+
1146
+ export class Transitioning extends Component {
1147
+ static View: typeof TransitioningView;
1148
+ }
1149
+
1150
+ export interface TransitionProps {
1151
+ delayMs?: number;
1152
+ durationMs?: number;
1153
+ interpolation?: 'linear' | 'easeIn' | 'easeOut' | 'easeInOut';
1154
+ propagation?: 'top' | 'bottom' | 'left' | 'right';
1155
+ }
1156
+
1157
+ export interface TransitionInOutProps extends TransitionProps {
1158
+ type?:
1159
+ | 'fade'
1160
+ | 'scale'
1161
+ | 'slide-top'
1162
+ | 'slide-bottom'
1163
+ | 'slide-right'
1164
+ | 'slide-left';
1165
+ }
1166
+ export class Transition extends Component {
1167
+ static In: ComponentClass<TransitionInOutProps>;
1168
+ static Out: ComponentClass<TransitionInOutProps>;
1169
+ static Change: ComponentClass<TransitionProps>;
1170
+ static Together: ComponentClass<{}>;
1171
+ static Sequence: ComponentClass<{}>;
1172
+ }
1173
+
1174
+ export class Clock extends Animated.Clock {}
1175
+ export class Value<
1176
+ T extends string | number | boolean
1177
+ > extends Animated.Value<T> {}
1178
+ export class Node<T> extends Animated.Node<T> {}
1179
+ export const add: typeof Animated.add;
1180
+ export const sub: typeof Animated.sub;
1181
+ export const multiply: typeof Animated.multiply;
1182
+ export const divide: typeof Animated.divide;
1183
+ export const pow: typeof Animated.pow;
1184
+ export const modulo: typeof Animated.modulo;
1185
+ export const sqrt: typeof Animated.sqrt;
1186
+ export const log: typeof Animated.log;
1187
+ export const sin: typeof Animated.sin;
1188
+ export const cos: typeof Animated.cos;
1189
+ export const exp: typeof Animated.exp;
1190
+ export const round: typeof Animated.round;
1191
+ export const lessThan: typeof Animated.lessThan;
1192
+ export const eq: typeof Animated.eq;
1193
+ export const greaterThan: typeof Animated.greaterThan;
1194
+ export const lessOrEq: typeof Animated.lessOrEq;
1195
+ export const greaterOrEq: typeof Animated.greaterOrEq;
1196
+ export const neq: typeof Animated.neq;
1197
+ export const and: typeof Animated.and;
1198
+ export const or: typeof Animated.or;
1199
+ export const defined: typeof Animated.defined;
1200
+ export const not: typeof Animated.not;
1201
+ export const tan: typeof Animated.tan;
1202
+ export const acos: typeof Animated.acos;
1203
+ export const asin: typeof Animated.asin;
1204
+ export const atan: typeof Animated.atan;
1205
+ export const proc: typeof Animated.proc;
1206
+ export const block: typeof Animated.block;
1207
+ export const concat: typeof Animated.concat;
1208
+ export const event: typeof Animated.event;
1209
+ export const call: typeof Animated.call;
1210
+ export const debug: typeof Animated.debug;
1211
+ export const clockRunning: typeof Animated.clockRunning;
1212
+ export const stopClock: typeof Animated.stopClock;
1213
+ export const startClock: typeof Animated.startClock;
1214
+ export const set: typeof Animated.set;
1215
+ export const cond: typeof Animated.cond;
1216
+ export const abs: typeof Animated.abs;
1217
+ export const acc: typeof Animated.acc;
1218
+ export const color: typeof Animated.color;
1219
+ export const interpolateColors: typeof Animated.interpolateColors;
1220
+ export const diff: typeof Animated.diff;
1221
+ export const diffClamp: typeof Animated.diffClamp;
1222
+ export const interpolateNode: typeof Animated.interpolateNode;
1223
+ export const Extrapolate: typeof Animated.Extrapolate;
1224
+ export const max: typeof Animated.max;
1225
+ export const min: typeof Animated.min;
1226
+ export const onChange: typeof Animated.onChange;
1227
+ export const floor: typeof Animated.floor;
1228
+ export const ceil: typeof Animated.ceil;
1229
+ export const useCode: typeof Animated.useCode;
1230
+ export const decay: typeof Animated.decay;
1231
+ export const timing: typeof Animated.timing;
1232
+ export const spring: typeof Animated.spring;
1233
+ export const SpringUtils: typeof Animated.SpringUtils;
1234
+ export const useValue: typeof Animated.useValue;
1235
+ export const ReverseAnimation: typeof Animated.ReverseAnimation;
1236
+ export function enableLayoutAnimations(flag: boolean): void;
1237
+ }