react-native-reanimated 2.5.0 → 2.6.0
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/RNReanimated.podspec +15 -6
- package/android/.gradle/7.2/dependencies-accessors/dependencies-accessors.lock +0 -0
- package/android/.gradle/7.2/executionHistory/executionHistory.bin +0 -0
- package/android/.gradle/7.2/executionHistory/executionHistory.lock +0 -0
- package/android/.gradle/7.2/fileHashes/fileHashes.bin +0 -0
- package/android/.gradle/7.2/fileHashes/fileHashes.lock +0 -0
- package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
- package/android/.gradle/buildOutputCleanup/cache.properties +1 -1
- package/android/.gradle/buildOutputCleanup/outputFiles.bin +0 -0
- package/android/.gradle/checksums/checksums.lock +0 -0
- package/android/.gradle/checksums/md5-checksums.bin +0 -0
- package/android/.gradle/checksums/sha1-checksums.bin +0 -0
- package/android/build.gradle +13 -23
- package/ios/REANodesManager.m +1 -1
- package/ios/sensor/ReanimatedSensor.h +4 -0
- package/ios/sensor/ReanimatedSensor.m +48 -0
- package/ios/sensor/ReanimatedSensorContainer.h +0 -1
- package/ios/sensor/ReanimatedSensorContainer.m +0 -1
- package/lib/reanimated2/interpolateColor.js +11 -11
- package/lib/reanimated2/js-reanimated/index.js +3 -3
- package/lib/types/lib/ConfigHelper.d.ts +12 -0
- package/lib/types/lib/ReanimatedEventEmitter.d.ts +3 -0
- package/lib/types/lib/ReanimatedModule.d.ts +2 -0
- package/lib/types/lib/ReanimatedModule.macos.d.ts +2 -0
- package/lib/types/lib/ReanimatedModule.native.d.ts +2 -0
- package/lib/types/lib/ReanimatedModule.windows.d.ts +2 -0
- package/lib/types/lib/ReanimatedModuleCompat.d.ts +14 -0
- package/lib/types/lib/createAnimatedComponent.d.ts +33 -0
- package/lib/types/lib/reanimated2/Bezier.d.ts +6 -0
- package/lib/types/lib/reanimated2/Colors.d.ts +31 -0
- package/lib/types/lib/reanimated2/Easing.d.ts +172 -0
- package/lib/types/lib/reanimated2/NativeMethods.d.ts +14 -0
- package/lib/types/lib/reanimated2/NativeReanimated/NativeReanimated.d.ts +20 -0
- package/lib/types/lib/reanimated2/NativeReanimated/index.d.ts +3 -0
- package/lib/types/lib/reanimated2/PlatformChecker.d.ts +5 -0
- package/lib/types/lib/reanimated2/PropAdapters.d.ts +4 -0
- package/lib/types/lib/reanimated2/UpdateProps.d.ts +9 -0
- package/lib/types/lib/reanimated2/ViewDescriptorsSet.d.ts +20 -0
- package/lib/types/lib/reanimated2/WorkletEventHandler.d.ts +13 -0
- package/lib/types/lib/reanimated2/__mocks__/MutableValue.d.ts +5 -0
- package/lib/types/lib/reanimated2/__mocks__/NativeReanimated.d.ts +13 -0
- package/lib/types/lib/reanimated2/__mocks__/NativeReanimated.native.d.ts +13 -0
- package/lib/types/lib/reanimated2/animation/commonTypes.d.ts +27 -0
- package/lib/types/lib/reanimated2/animation/decay.d.ts +19 -0
- package/lib/types/lib/reanimated2/animation/delay.d.ts +7 -0
- package/lib/types/lib/reanimated2/animation/index.d.ts +9 -0
- package/lib/types/lib/reanimated2/animation/repeat.d.ts +12 -0
- package/lib/types/lib/reanimated2/animation/sequence.d.ts +7 -0
- package/lib/types/lib/reanimated2/animation/spring.d.ts +22 -0
- package/lib/types/lib/reanimated2/animation/styleAnimation.d.ts +7 -0
- package/lib/types/lib/reanimated2/animation/timing.d.ts +21 -0
- package/lib/types/lib/reanimated2/animation/util.d.ts +9 -0
- package/lib/types/lib/reanimated2/commonTypes.d.ts +80 -0
- package/lib/types/lib/reanimated2/component/FlatList.d.ts +9 -0
- package/lib/types/lib/reanimated2/component/WrappedComponents.d.ts +8 -0
- package/lib/types/lib/reanimated2/component/index.d.ts +9 -0
- package/lib/types/lib/reanimated2/core.d.ts +24 -0
- package/lib/types/lib/reanimated2/hook/Hooks.d.ts +5 -0
- package/lib/types/lib/reanimated2/hook/commonTypes.d.ts +14 -0
- package/lib/types/lib/reanimated2/hook/index.d.ts +10 -0
- package/lib/types/lib/reanimated2/hook/useAnimatedGestureHandler.d.ts +35 -0
- package/lib/types/lib/reanimated2/hook/useAnimatedReaction.d.ts +12 -0
- package/lib/types/lib/reanimated2/hook/useAnimatedRef.d.ts +3 -0
- package/lib/types/lib/reanimated2/hook/useAnimatedScrollHandler.d.ts +21 -0
- package/lib/types/lib/reanimated2/hook/useAnimatedSensor.d.ts +20 -0
- package/lib/types/lib/reanimated2/hook/useAnimatedStyle.d.ts +11 -0
- package/lib/types/lib/reanimated2/hook/useDerivedValue.d.ts +4 -0
- package/lib/types/lib/reanimated2/hook/useSharedValue.d.ts +2 -0
- package/lib/types/lib/reanimated2/hook/utils.d.ts +28 -0
- package/lib/types/lib/reanimated2/index.d.ts +12 -0
- package/lib/types/lib/reanimated2/interpolateColor.d.ts +26 -0
- package/lib/types/lib/reanimated2/interpolation.d.ts +14 -0
- package/lib/types/lib/reanimated2/jestUtils.d.ts +12 -0
- package/lib/types/lib/reanimated2/js-reanimated/JSReanimated.d.ts +30 -0
- package/lib/types/lib/reanimated2/js-reanimated/Mapper.d.ts +14 -0
- package/lib/types/lib/reanimated2/js-reanimated/MapperRegistry.d.ts +14 -0
- package/lib/types/lib/reanimated2/js-reanimated/MutableValue.d.ts +14 -0
- package/lib/types/lib/reanimated2/js-reanimated/commonTypes.d.ts +44 -0
- package/lib/types/lib/reanimated2/js-reanimated/index.d.ts +15 -0
- package/lib/types/lib/reanimated2/layoutReanimation/LayoutAnimationRepository.d.ts +1 -0
- package/lib/types/lib/reanimated2/layoutReanimation/animationBuilder/BaseAnimationBuilder.d.ts +22 -0
- package/lib/types/lib/reanimated2/layoutReanimation/animationBuilder/ComplexAnimationBuilder.d.ts +38 -0
- package/lib/types/lib/reanimated2/layoutReanimation/animationBuilder/Keyframe.d.ts +25 -0
- package/lib/types/lib/reanimated2/layoutReanimation/animationBuilder/commonTypes.d.ts +77 -0
- package/lib/types/lib/reanimated2/layoutReanimation/animationBuilder/index.d.ts +4 -0
- package/lib/types/lib/reanimated2/layoutReanimation/defaultAnimations/Bounce.d.ts +62 -0
- package/lib/types/lib/reanimated2/layoutReanimation/defaultAnimations/Default.d.ts +4 -0
- package/lib/types/lib/reanimated2/layoutReanimation/defaultAnimations/Fade.d.ts +42 -0
- package/lib/types/lib/reanimated2/layoutReanimation/defaultAnimations/Flip.d.ts +50 -0
- package/lib/types/lib/reanimated2/layoutReanimation/defaultAnimations/Lightspeed.d.ts +18 -0
- package/lib/types/lib/reanimated2/layoutReanimation/defaultAnimations/Pinwheel.d.ts +10 -0
- package/lib/types/lib/reanimated2/layoutReanimation/defaultAnimations/Roll.d.ts +18 -0
- package/lib/types/lib/reanimated2/layoutReanimation/defaultAnimations/Rotate.d.ts +34 -0
- package/lib/types/lib/reanimated2/layoutReanimation/defaultAnimations/Slide.d.ts +34 -0
- package/lib/types/lib/reanimated2/layoutReanimation/defaultAnimations/Stretch.d.ts +18 -0
- package/lib/types/lib/reanimated2/layoutReanimation/defaultAnimations/Zoom.d.ts +66 -0
- package/lib/types/lib/reanimated2/layoutReanimation/defaultAnimations/index.d.ts +10 -0
- package/lib/types/lib/reanimated2/layoutReanimation/defaultTransitions/CurvedTransition.d.ts +19 -0
- package/lib/types/lib/reanimated2/layoutReanimation/defaultTransitions/EntryExitTransition.d.ts +13 -0
- package/lib/types/lib/reanimated2/layoutReanimation/defaultTransitions/FadingTransition.d.ts +6 -0
- package/lib/types/lib/reanimated2/layoutReanimation/defaultTransitions/JumpingTransition.d.ts +6 -0
- package/lib/types/lib/reanimated2/layoutReanimation/defaultTransitions/LinearTransition.d.ts +7 -0
- package/lib/types/lib/reanimated2/layoutReanimation/defaultTransitions/SequencedTransition.d.ts +9 -0
- package/lib/types/lib/reanimated2/layoutReanimation/defaultTransitions/index.d.ts +6 -0
- package/lib/types/lib/reanimated2/layoutReanimation/index.d.ts +4 -0
- package/lib/types/lib/reanimated2/mock.d.ts +55 -0
- package/lib/types/lib/reanimated2/platform-specific/RNRenderer.d.ts +1 -0
- package/lib/types/lib/reanimated2/platform-specific/RNRenderer.web.d.ts +0 -0
- package/lib/types/lib/reanimated2/utils.d.ts +7 -0
- package/lib/types/lib/setAndForwardRef.d.ts +40 -0
- package/lib/types/react-native-reanimated-tests.d.ts +1 -0
- package/package.json +4 -4
- package/plugin.js +1 -0
- package/react-native-reanimated.d.ts +26 -29
- package/src/createAnimatedComponent.tsx +1 -1
- package/src/reanimated2/component/FlatList.tsx +1 -1
- package/src/reanimated2/interpolateColor.ts +11 -11
- package/src/reanimated2/jestUtils.ts +11 -0
- package/src/reanimated2/js-reanimated/index.ts +3 -3
- package/android/expo/linking.gradle +0 -46
- package/android/expo/src/main/java/com/swmansion/reanimated/EXReanimatedAdapter.java +0 -12
- package/android/expo/src/main/java/expo/modules/adapters/reanimated/EXReanimatedPackage.java +0 -26
- package/expo-module.config.json +0 -3
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { MutableRefObject } from 'react';
|
|
2
|
+
import { AnimatedStyle, SharedValue, StyleProps } from './commonTypes';
|
|
3
|
+
import { Descriptor } from './hook/commonTypes';
|
|
4
|
+
import { ViewRefSet } from './ViewDescriptorsSet';
|
|
5
|
+
export declare const colorProps: string[];
|
|
6
|
+
export declare const ColorProperties: string[];
|
|
7
|
+
export declare const updateProps: (viewDescriptor: SharedValue<Descriptor[]>, updates: StyleProps | AnimatedStyle, maybeViewRef: ViewRefSet<any> | undefined) => void;
|
|
8
|
+
export declare const updatePropsJestWrapper: (viewDescriptors: SharedValue<Descriptor[]>, updates: AnimatedStyle, maybeViewRef: ViewRefSet<any> | undefined, animatedStyle: MutableRefObject<AnimatedStyle>, adapters: ((updates: AnimatedStyle) => void)[]) => void;
|
|
9
|
+
export default updateProps;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { SharedValue } from './commonTypes';
|
|
2
|
+
import { Descriptor } from './hook/commonTypes';
|
|
3
|
+
export interface ViewRefSet<T> {
|
|
4
|
+
items: Set<T>;
|
|
5
|
+
add: (item: T) => void;
|
|
6
|
+
remove: (item: T) => void;
|
|
7
|
+
}
|
|
8
|
+
export interface ViewDescriptorsSet {
|
|
9
|
+
batchToRemove: Set<number>;
|
|
10
|
+
tags: Set<number>;
|
|
11
|
+
waitForInsertSync: boolean;
|
|
12
|
+
waitForRemoveSync: boolean;
|
|
13
|
+
sharableViewDescriptors: SharedValue<Descriptor[]>;
|
|
14
|
+
items: Descriptor[];
|
|
15
|
+
add: (item: Descriptor) => void;
|
|
16
|
+
remove: (viewTag: number) => void;
|
|
17
|
+
rebuildsharableViewDescriptors: (sharableViewDescriptor: SharedValue<Descriptor[]>) => void;
|
|
18
|
+
}
|
|
19
|
+
export declare function makeViewDescriptorsSet(): ViewDescriptorsSet;
|
|
20
|
+
export declare function makeViewsRefSet<T>(): ViewRefSet<T>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { NativeEvent } from './commonTypes';
|
|
2
|
+
export default class WorkletEventHandler<T extends NativeEvent<T>> {
|
|
3
|
+
worklet: (event: T) => void;
|
|
4
|
+
eventNames: string[];
|
|
5
|
+
reattachNeeded: boolean;
|
|
6
|
+
listeners: Record<string, (event: T) => void>;
|
|
7
|
+
viewTag: number | undefined;
|
|
8
|
+
registrations: string[];
|
|
9
|
+
constructor(worklet: (event: T) => void, eventNames?: string[]);
|
|
10
|
+
updateWorklet(newWorklet: (event: T) => void): void;
|
|
11
|
+
registerForEvents(viewTag: number, fallbackEventName?: string): void;
|
|
12
|
+
unregisterFromEvents(): void;
|
|
13
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import MutableValue from './MutableValue';
|
|
2
|
+
declare const _default: {
|
|
3
|
+
installCoreFunctions: () => void;
|
|
4
|
+
makeShareable: (worklet: any) => any;
|
|
5
|
+
makeMutable: (init: any) => MutableValue;
|
|
6
|
+
makeRemote: () => void;
|
|
7
|
+
startMapper: () => void;
|
|
8
|
+
stopMapper: () => void;
|
|
9
|
+
registerEventHandler: () => void;
|
|
10
|
+
unregisterEventHandler: () => void;
|
|
11
|
+
getViewProp: () => void;
|
|
12
|
+
};
|
|
13
|
+
export default _default;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import MutableValue from './MutableValue';
|
|
2
|
+
declare const _default: {
|
|
3
|
+
installCoreFunctions: () => void;
|
|
4
|
+
makeShareable: (worklet: any) => any;
|
|
5
|
+
makeMutable: (init: any) => MutableValue;
|
|
6
|
+
makeRemote: () => void;
|
|
7
|
+
startMapper: () => void;
|
|
8
|
+
stopMapper: () => void;
|
|
9
|
+
registerEventHandler: () => void;
|
|
10
|
+
unregisterEventHandler: () => void;
|
|
11
|
+
getViewProp: () => void;
|
|
12
|
+
};
|
|
13
|
+
export default _default;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { AnimatedStyle, StyleProps, AnimatableValue, AnimationObject, Animation, Timestamp, AnimationCallback } from '../commonTypes';
|
|
2
|
+
export interface HigherOrderAnimation {
|
|
3
|
+
isHigherOrder?: boolean;
|
|
4
|
+
}
|
|
5
|
+
export declare type NextAnimation<T extends AnimationObject> = T | (() => T);
|
|
6
|
+
export interface DelayAnimation extends Animation<DelayAnimation>, HigherOrderAnimation {
|
|
7
|
+
startTime: Timestamp;
|
|
8
|
+
started: boolean;
|
|
9
|
+
previousAnimation: DelayAnimation | null;
|
|
10
|
+
current: AnimatableValue;
|
|
11
|
+
}
|
|
12
|
+
export interface RepeatAnimation extends Animation<RepeatAnimation>, HigherOrderAnimation {
|
|
13
|
+
reps: number;
|
|
14
|
+
startValue: AnimatableValue;
|
|
15
|
+
toValue?: AnimatableValue;
|
|
16
|
+
previousAnimation?: RepeatAnimation;
|
|
17
|
+
}
|
|
18
|
+
export interface SequenceAnimation extends Animation<SequenceAnimation>, HigherOrderAnimation {
|
|
19
|
+
animationIndex: number;
|
|
20
|
+
}
|
|
21
|
+
export interface StyleLayoutAnimation extends HigherOrderAnimation {
|
|
22
|
+
current: StyleProps;
|
|
23
|
+
styleAnimations: AnimatedStyle;
|
|
24
|
+
onFrame: (animation: StyleLayoutAnimation, timestamp: Timestamp) => boolean;
|
|
25
|
+
onStart: (nextAnimation: StyleLayoutAnimation, current: AnimatedStyle, timestamp: Timestamp, previousAnimation: StyleLayoutAnimation) => void;
|
|
26
|
+
callback?: AnimationCallback;
|
|
27
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Animation, AnimationCallback, AnimationObject, AnimatableValue, Timestamp } from '../commonTypes';
|
|
2
|
+
interface DecayConfig {
|
|
3
|
+
deceleration?: number;
|
|
4
|
+
velocityFactor?: number;
|
|
5
|
+
clamp?: number[];
|
|
6
|
+
velocity?: number;
|
|
7
|
+
}
|
|
8
|
+
export interface DecayAnimation extends Animation<DecayAnimation> {
|
|
9
|
+
lastTimestamp: Timestamp;
|
|
10
|
+
startTimestamp: Timestamp;
|
|
11
|
+
initialVelocity: number;
|
|
12
|
+
velocity: number;
|
|
13
|
+
current: AnimatableValue;
|
|
14
|
+
}
|
|
15
|
+
export interface InnerDecayAnimation extends Omit<DecayAnimation, 'current'>, AnimationObject {
|
|
16
|
+
current: number;
|
|
17
|
+
}
|
|
18
|
+
export declare function withDecay(userConfig: DecayConfig, callback?: AnimationCallback): Animation<DecayAnimation>;
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Animation } from '../commonTypes';
|
|
2
|
+
import { NextAnimation, DelayAnimation } from './commonTypes';
|
|
3
|
+
export declare function withDelay(delayMs: number, _nextAnimation: NextAnimation<DelayAnimation>): Animation<DelayAnimation>;
|
|
4
|
+
/**
|
|
5
|
+
* @deprecated Kept for backward compatibility. Will be removed soon.
|
|
6
|
+
*/
|
|
7
|
+
export declare function delay(delayMs: number, _nextAnimation: NextAnimation<DelayAnimation>): Animation<DelayAnimation>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export { HigherOrderAnimation, NextAnimation, DelayAnimation, RepeatAnimation, SequenceAnimation, StyleLayoutAnimation, } from './commonTypes';
|
|
2
|
+
export { cancelAnimation, defineAnimation, initialUpdaterRun } from './util';
|
|
3
|
+
export { withTiming, TimingAnimation } from './timing';
|
|
4
|
+
export { withSpring, SpringAnimation } from './spring';
|
|
5
|
+
export { withDecay, DecayAnimation } from './decay';
|
|
6
|
+
export { withDelay } from './delay';
|
|
7
|
+
export { withRepeat } from './repeat';
|
|
8
|
+
export { withSequence } from './sequence';
|
|
9
|
+
export { withStyleAnimation } from './styleAnimation';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Animation, AnimationCallback } from '../commonTypes';
|
|
2
|
+
import { NextAnimation, RepeatAnimation } from './commonTypes';
|
|
3
|
+
export interface InnerRepeatAnimation extends Omit<RepeatAnimation, 'toValue' | 'startValue'> {
|
|
4
|
+
toValue: number;
|
|
5
|
+
startValue: number;
|
|
6
|
+
}
|
|
7
|
+
export declare function withRepeat(_nextAnimation: NextAnimation<RepeatAnimation>, numberOfReps?: number, reverse?: boolean, callback?: AnimationCallback): Animation<RepeatAnimation>;
|
|
8
|
+
/**
|
|
9
|
+
* @deprecated Kept for backward compatibility. Will be removed soon.
|
|
10
|
+
*/
|
|
11
|
+
export declare function repeat(_nextAnimation: NextAnimation<RepeatAnimation>, numberOfReps?: number, reverse?: boolean, callback?: AnimationCallback): Animation<RepeatAnimation>;
|
|
12
|
+
export declare function loop(nextAnimation: NextAnimation<RepeatAnimation>, numberOfLoops?: number): Animation<RepeatAnimation>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { NextAnimation, SequenceAnimation } from './commonTypes';
|
|
2
|
+
import { Animation, AnimationObject } from '../commonTypes';
|
|
3
|
+
export declare function withSequence(..._animations: NextAnimation<AnimationObject>[]): Animation<SequenceAnimation>;
|
|
4
|
+
/**
|
|
5
|
+
* @deprecated Kept for backward compatibility. Will be removed soon.
|
|
6
|
+
*/
|
|
7
|
+
export declare function sequence(..._animations: NextAnimation<SequenceAnimation>[]): Animation<SequenceAnimation>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Animation, AnimationCallback, AnimatableValue, Timestamp } from '../commonTypes';
|
|
2
|
+
interface SpringConfig {
|
|
3
|
+
mass?: number;
|
|
4
|
+
stiffness?: number;
|
|
5
|
+
overshootClamping?: boolean;
|
|
6
|
+
restDisplacementThreshold?: number;
|
|
7
|
+
restSpeedThreshold?: number;
|
|
8
|
+
velocity?: number;
|
|
9
|
+
damping?: number;
|
|
10
|
+
}
|
|
11
|
+
export interface SpringAnimation extends Animation<SpringAnimation> {
|
|
12
|
+
current: AnimatableValue;
|
|
13
|
+
toValue: AnimatableValue;
|
|
14
|
+
velocity: number;
|
|
15
|
+
lastTimestamp: Timestamp;
|
|
16
|
+
}
|
|
17
|
+
export interface InnerSpringAnimation extends Omit<SpringAnimation, 'toValue' | 'current'> {
|
|
18
|
+
toValue: number;
|
|
19
|
+
current: number;
|
|
20
|
+
}
|
|
21
|
+
export declare function withSpring(toValue: AnimatableValue, userConfig?: SpringConfig, callback?: AnimationCallback): Animation<SpringAnimation>;
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { AnimatableValue, AnimatedStyle, NestedObject, NestedObjectValues } from '../commonTypes';
|
|
2
|
+
import { StyleLayoutAnimation } from './commonTypes';
|
|
3
|
+
export declare function resolvePath<T>(obj: NestedObject<T>, path: AnimatableValue[] | AnimatableValue): NestedObjectValues<T> | undefined;
|
|
4
|
+
declare type Path = Array<string | number> | string | number;
|
|
5
|
+
export declare function setPath<T>(obj: NestedObject<T>, path: Path, value: NestedObjectValues<T>): void;
|
|
6
|
+
export declare function withStyleAnimation(styleAnimations: AnimatedStyle): StyleLayoutAnimation;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { EasingFn, EasingFactoryFn } from '../Easing';
|
|
2
|
+
import { Animation, AnimationCallback, Timestamp, AnimatableValue } from '../commonTypes';
|
|
3
|
+
interface TimingConfig {
|
|
4
|
+
duration?: number;
|
|
5
|
+
easing?: EasingFn | EasingFactoryFn;
|
|
6
|
+
}
|
|
7
|
+
export interface TimingAnimation extends Animation<TimingAnimation> {
|
|
8
|
+
type: string;
|
|
9
|
+
easing: EasingFn;
|
|
10
|
+
startValue: AnimatableValue;
|
|
11
|
+
startTime: Timestamp;
|
|
12
|
+
progress: number;
|
|
13
|
+
toValue: AnimatableValue;
|
|
14
|
+
current: AnimatableValue;
|
|
15
|
+
}
|
|
16
|
+
export interface InnerTimingAnimation extends Omit<TimingAnimation, 'toValue' | 'current'> {
|
|
17
|
+
toValue: number;
|
|
18
|
+
current: number;
|
|
19
|
+
}
|
|
20
|
+
export declare function withTiming(toValue: AnimatableValue, userConfig?: TimingConfig, callback?: AnimationCallback): Animation<TimingAnimation>;
|
|
21
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { NextAnimation, DelayAnimation, RepeatAnimation, SequenceAnimation, StyleLayoutAnimation } from './commonTypes';
|
|
2
|
+
import { AnimatedStyle, SharedValue, AnimatableValue, Animation, AnimationObject } from '../commonTypes';
|
|
3
|
+
export declare type UserUpdater = () => AnimatedStyle;
|
|
4
|
+
export declare function initialUpdaterRun<T>(updater: () => T): T;
|
|
5
|
+
declare type AnimationToDecoration<T extends AnimationObject | StyleLayoutAnimation> = T extends StyleLayoutAnimation ? Record<string, unknown> : T extends DelayAnimation ? NextAnimation<DelayAnimation> : T extends RepeatAnimation ? NextAnimation<RepeatAnimation> : T extends SequenceAnimation ? NextAnimation<SequenceAnimation> : AnimatableValue | T;
|
|
6
|
+
export declare function defineAnimation<T extends AnimationObject | StyleLayoutAnimation>(starting: AnimationToDecoration<T>, factory: () => T): T;
|
|
7
|
+
export declare function cancelAnimation<T>(sharedValue: SharedValue<T>): void;
|
|
8
|
+
export declare function withStartValue(startValue: AnimatableValue, animation: NextAnimation<AnimationObject>): Animation<AnimationObject>;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { PerpectiveTransform, RotateTransform, RotateXTransform, RotateYTransform, RotateZTransform, ScaleTransform, ScaleXTransform, ScaleYTransform, TranslateXTransform, TranslateYTransform, SkewXTransform, SkewYTransform, MatrixTransform, ViewStyle, TextStyle } from 'react-native';
|
|
2
|
+
import { Context } from './hook/commonTypes';
|
|
3
|
+
export declare type TransformProperty = PerpectiveTransform | RotateTransform | RotateXTransform | RotateYTransform | RotateZTransform | ScaleTransform | ScaleXTransform | ScaleYTransform | TranslateXTransform | TranslateYTransform | SkewXTransform | SkewYTransform | MatrixTransform;
|
|
4
|
+
export interface StyleProps extends ViewStyle, TextStyle {
|
|
5
|
+
originX?: number;
|
|
6
|
+
originY?: number;
|
|
7
|
+
[key: string]: any;
|
|
8
|
+
}
|
|
9
|
+
export interface AnimatedStyle extends Record<string, Animation<AnimationObject>> {
|
|
10
|
+
[key: string]: any;
|
|
11
|
+
transform?: Array<Record<string, Animation<AnimationObject>>>;
|
|
12
|
+
}
|
|
13
|
+
export interface SharedValue<T> {
|
|
14
|
+
value: T;
|
|
15
|
+
}
|
|
16
|
+
export interface WorkletFunction {
|
|
17
|
+
_closure?: Context;
|
|
18
|
+
__workletHash?: number;
|
|
19
|
+
__optimalization?: number;
|
|
20
|
+
__worklet?: boolean;
|
|
21
|
+
}
|
|
22
|
+
export interface BasicWorkletFunction<T> extends WorkletFunction {
|
|
23
|
+
(): T;
|
|
24
|
+
}
|
|
25
|
+
export interface BasicWorkletFunctionOptional<T> extends WorkletFunction {
|
|
26
|
+
(): Partial<T>;
|
|
27
|
+
}
|
|
28
|
+
export interface NativeEvent<T> {
|
|
29
|
+
nativeEvent: T;
|
|
30
|
+
}
|
|
31
|
+
export interface ComplexWorkletFunction<A extends any[], R> extends WorkletFunction {
|
|
32
|
+
(...args: A): R;
|
|
33
|
+
}
|
|
34
|
+
export interface NestedObject<T> {
|
|
35
|
+
[key: string]: NestedObjectValues<T>;
|
|
36
|
+
}
|
|
37
|
+
export declare type NestedObjectValues<T> = T | Array<NestedObjectValues<T>> | NestedObject<T>;
|
|
38
|
+
export interface AdapterWorkletFunction extends WorkletFunction {
|
|
39
|
+
(value: NestedObject<string | number | AnimationObject>): void;
|
|
40
|
+
}
|
|
41
|
+
export declare type AnimatableValue = number | string | Array<number>;
|
|
42
|
+
export interface AnimationObject {
|
|
43
|
+
[key: string]: any;
|
|
44
|
+
callback: AnimationCallback;
|
|
45
|
+
current?: AnimatableValue;
|
|
46
|
+
toValue?: AnimationObject['current'];
|
|
47
|
+
startValue?: AnimationObject['current'];
|
|
48
|
+
finished?: boolean;
|
|
49
|
+
strippedCurrent?: number;
|
|
50
|
+
cancelled?: boolean;
|
|
51
|
+
__prefix?: string;
|
|
52
|
+
__suffix?: string;
|
|
53
|
+
onFrame: (animation: any, timestamp: Timestamp) => boolean;
|
|
54
|
+
onStart: (nextAnimation: any, current: any, timestamp: Timestamp, previousAnimation: any) => void;
|
|
55
|
+
}
|
|
56
|
+
export interface Animation<T extends AnimationObject> extends AnimationObject {
|
|
57
|
+
onFrame: (animation: T, timestamp: Timestamp) => boolean;
|
|
58
|
+
onStart: (nextAnimation: T, current: T extends NumericAnimation ? number : AnimatableValue, timestamp: Timestamp, previousAnimation: T) => void;
|
|
59
|
+
}
|
|
60
|
+
export interface NumericAnimation {
|
|
61
|
+
current?: number;
|
|
62
|
+
}
|
|
63
|
+
export declare type AnimationCallback = (finished?: boolean, current?: AnimatableValue) => void;
|
|
64
|
+
export declare type Timestamp = number;
|
|
65
|
+
export declare type Value3D = {
|
|
66
|
+
x: number;
|
|
67
|
+
y: number;
|
|
68
|
+
z: number;
|
|
69
|
+
};
|
|
70
|
+
export declare type SensorValue3D = SharedValue<Value3D>;
|
|
71
|
+
export declare type ValueRotation = {
|
|
72
|
+
qw: number;
|
|
73
|
+
qx: number;
|
|
74
|
+
qy: number;
|
|
75
|
+
qz: number;
|
|
76
|
+
yaw: number;
|
|
77
|
+
pitch: number;
|
|
78
|
+
roll: number;
|
|
79
|
+
};
|
|
80
|
+
export declare type SensorValueRotation = SharedValue<ValueRotation>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { FlatListProps } from 'react-native';
|
|
3
|
+
import { ILayoutAnimationBuilder } from '../layoutReanimation/animationBuilder/commonTypes';
|
|
4
|
+
export interface ReanimatedFlatlistProps<ItemT> extends FlatListProps<ItemT> {
|
|
5
|
+
itemLayoutAnimation?: ILayoutAnimationBuilder;
|
|
6
|
+
}
|
|
7
|
+
declare type ReanimatedFlatListFC<T = any> = React.FC<ReanimatedFlatlistProps<T>>;
|
|
8
|
+
declare const ReanimatedFlatlist: ReanimatedFlatListFC;
|
|
9
|
+
export default ReanimatedFlatlist;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
declare const WrappedComponents: {
|
|
3
|
+
View: import("react").ComponentType<import("../../createAnimatedComponent").AnimatedComponentProps<import("../../createAnimatedComponent").InitialComponentProps>>;
|
|
4
|
+
Text: import("react").ComponentType<import("../../createAnimatedComponent").AnimatedComponentProps<import("../../createAnimatedComponent").InitialComponentProps>>;
|
|
5
|
+
Image: import("react").ComponentType<import("../../createAnimatedComponent").AnimatedComponentProps<import("../../createAnimatedComponent").InitialComponentProps>>;
|
|
6
|
+
ScrollView: import("react").ComponentType<import("../../createAnimatedComponent").AnimatedComponentProps<import("../../createAnimatedComponent").InitialComponentProps>>;
|
|
7
|
+
};
|
|
8
|
+
export default WrappedComponents;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
declare const ReanimatedComponents: {
|
|
3
|
+
FlatList: import("react").FC<import("./FlatList").ReanimatedFlatlistProps<any>>;
|
|
4
|
+
View: import("react").ComponentType<import("../../createAnimatedComponent").AnimatedComponentProps<import("../../createAnimatedComponent").InitialComponentProps>>;
|
|
5
|
+
Text: import("react").ComponentType<import("../../createAnimatedComponent").AnimatedComponentProps<import("../../createAnimatedComponent").InitialComponentProps>>;
|
|
6
|
+
Image: import("react").ComponentType<import("../../createAnimatedComponent").AnimatedComponentProps<import("../../createAnimatedComponent").InitialComponentProps>>;
|
|
7
|
+
ScrollView: import("react").ComponentType<import("../../createAnimatedComponent").AnimatedComponentProps<import("../../createAnimatedComponent").InitialComponentProps>>;
|
|
8
|
+
};
|
|
9
|
+
export default ReanimatedComponents;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { ComplexWorkletFunction, SharedValue, AnimationObject, AnimatableValue, Timestamp } from './commonTypes';
|
|
2
|
+
import { Descriptor } from './hook/commonTypes';
|
|
3
|
+
export declare type ReanimatedConsole = Pick<Console, 'debug' | 'log' | 'warn' | 'info' | 'error'>;
|
|
4
|
+
export declare type WorkletValue = (() => AnimationObject) | AnimationObject | AnimatableValue | Descriptor;
|
|
5
|
+
export declare const checkPluginState: (throwError: boolean) => boolean;
|
|
6
|
+
export declare const isConfigured: (throwError?: boolean) => boolean;
|
|
7
|
+
export declare const isConfiguredCheck: () => void;
|
|
8
|
+
export declare function requestFrame(frame: (timestamp: Timestamp) => void): void;
|
|
9
|
+
export declare function runOnUI<A extends any[], R>(worklet: ComplexWorkletFunction<A, R>): (...args: A) => void;
|
|
10
|
+
export declare function makeShareable<T>(value: T): T;
|
|
11
|
+
export declare function getViewProp<T>(viewTag: string, propName: string): Promise<T>;
|
|
12
|
+
export declare function getTimestamp(): number;
|
|
13
|
+
export declare function makeMutable<T>(value: T): SharedValue<T>;
|
|
14
|
+
export declare function makeRemote<T>(object?: {}): T;
|
|
15
|
+
export declare function startMapper(mapper: () => void, inputs?: any[], outputs?: any[], updater?: () => void, viewDescriptors?: Descriptor[] | SharedValue<Descriptor[]>): number;
|
|
16
|
+
export declare function stopMapper(mapperId: number): void;
|
|
17
|
+
export interface RunOnJSFunction<A extends any[], R> {
|
|
18
|
+
__callAsync?: (...args: A) => void;
|
|
19
|
+
(...args: A): R;
|
|
20
|
+
}
|
|
21
|
+
export declare function runOnJS<A extends any[], R>(fun: RunOnJSFunction<A, R>): () => void;
|
|
22
|
+
export declare function enableLayoutAnimations(flag: boolean, isCallByUser?: boolean): void;
|
|
23
|
+
export declare function configureProps(uiProps: string[], nativeProps: string[]): void;
|
|
24
|
+
export declare function jestResetJsReanimatedModule(): void;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { DependencyList } from './commonTypes';
|
|
2
|
+
import { useAnimatedStyle } from './useAnimatedStyle';
|
|
3
|
+
export declare const useAnimatedProps: typeof useAnimatedStyle;
|
|
4
|
+
export declare function useWorkletCallback<A extends unknown[], R>(fun: (...args: A) => R, deps?: DependencyList): (...args: Parameters<typeof fun>) => R;
|
|
5
|
+
export { useEvent, useHandler } from './utils';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export declare type DependencyList = Array<unknown> | undefined;
|
|
2
|
+
export declare type Context = Record<string, unknown>;
|
|
3
|
+
export interface ContextWithDependencies<TContext extends Context> {
|
|
4
|
+
context: TContext;
|
|
5
|
+
savedDependencies: DependencyList;
|
|
6
|
+
}
|
|
7
|
+
export interface Descriptor {
|
|
8
|
+
tag: number;
|
|
9
|
+
name: string;
|
|
10
|
+
}
|
|
11
|
+
export interface RefObjectFunction<T> {
|
|
12
|
+
current: T | null;
|
|
13
|
+
(component?: T): number;
|
|
14
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export { DependencyList, Context } from './commonTypes';
|
|
2
|
+
export { useAnimatedProps, useEvent, useHandler, useWorkletCallback, } from './Hooks';
|
|
3
|
+
export { useSharedValue } from './useSharedValue';
|
|
4
|
+
export { useAnimatedStyle, AnimatedStyleResult } from './useAnimatedStyle';
|
|
5
|
+
export { useAnimatedGestureHandler, GestureHandlerEvent, GestureHandlers, } from './useAnimatedGestureHandler';
|
|
6
|
+
export { useAnimatedReaction, AnimatedReactionWorkletFunction, } from './useAnimatedReaction';
|
|
7
|
+
export { useAnimatedRef } from './useAnimatedRef';
|
|
8
|
+
export { useAnimatedScrollHandler, ScrollHandler, ScrollHandlers, } from './useAnimatedScrollHandler';
|
|
9
|
+
export { useDerivedValue, DerivedValue } from './useDerivedValue';
|
|
10
|
+
export { useAnimatedSensor, SensorType } from './useAnimatedSensor';
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { MutableRefObject } from 'react';
|
|
2
|
+
import { WorkletFunction } from '../commonTypes';
|
|
3
|
+
import WorkletEventHandler from '../WorkletEventHandler';
|
|
4
|
+
import { Context, DependencyList } from './commonTypes';
|
|
5
|
+
interface Handler<T, TContext extends Context> extends WorkletFunction {
|
|
6
|
+
(event: T, context: TContext, isCanceledOrFailed?: boolean): void;
|
|
7
|
+
}
|
|
8
|
+
export interface GestureHandlers<T, TContext extends Context> {
|
|
9
|
+
[key: string]: Handler<T, TContext> | undefined;
|
|
10
|
+
onStart?: Handler<T, TContext>;
|
|
11
|
+
onActive?: Handler<T, TContext>;
|
|
12
|
+
onEnd?: Handler<T, TContext>;
|
|
13
|
+
onFail?: Handler<T, TContext>;
|
|
14
|
+
onCancel?: Handler<T, TContext>;
|
|
15
|
+
onFinish?: Handler<T, TContext>;
|
|
16
|
+
}
|
|
17
|
+
export declare enum EventType {
|
|
18
|
+
UNDETERMINED = 0,
|
|
19
|
+
FAILED = 1,
|
|
20
|
+
BEGAN = 2,
|
|
21
|
+
CANCELLED = 3,
|
|
22
|
+
ACTIVE = 4,
|
|
23
|
+
END = 5
|
|
24
|
+
}
|
|
25
|
+
export interface GestureHandlerStateChangeNativeEvent {
|
|
26
|
+
handlerTag: number;
|
|
27
|
+
numberOfPointers: number;
|
|
28
|
+
state: EventType;
|
|
29
|
+
oldState: EventType;
|
|
30
|
+
}
|
|
31
|
+
export interface GestureHandlerEvent<T> extends GestureHandlerStateChangeNativeEvent {
|
|
32
|
+
nativeEvent: T;
|
|
33
|
+
}
|
|
34
|
+
export declare function useAnimatedGestureHandler<T extends GestureHandlerEvent<T>, TContext extends Context>(handlers: GestureHandlers<T, TContext>, dependencies?: DependencyList): MutableRefObject<WorkletEventHandler<T> | null> | ((e: T) => void);
|
|
35
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { BasicWorkletFunction, WorkletFunction } from '../commonTypes';
|
|
2
|
+
import { DependencyList } from './commonTypes';
|
|
3
|
+
export interface AnimatedReactionWorkletFunction<T> extends WorkletFunction {
|
|
4
|
+
(prepared: T, previous: T | null): void;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* @param prepare - worklet used for data preparation for the second parameter
|
|
8
|
+
* @param react - worklet which takes data prepared by the one in the first parameter and performs certain actions
|
|
9
|
+
* the first worklet defines the inputs, in other words on which shared values change will it be called.
|
|
10
|
+
* the second one can modify any shared values but those which are mentioned in the first worklet. Beware of that, because this may result in endless loop and high cpu usage.
|
|
11
|
+
*/
|
|
12
|
+
export declare function useAnimatedReaction<T>(prepare: BasicWorkletFunction<T>, react: AnimatedReactionWorkletFunction<T>, dependencies: DependencyList): void;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { RefObject } from 'react';
|
|
2
|
+
import { NativeScrollEvent } from 'react-native';
|
|
3
|
+
import { NativeEvent, WorkletFunction } from '../commonTypes';
|
|
4
|
+
import WorkletEventHandler from '../WorkletEventHandler';
|
|
5
|
+
import { Context, DependencyList } from './commonTypes';
|
|
6
|
+
export interface ScrollHandler<TContext extends Context> extends WorkletFunction {
|
|
7
|
+
(event: NativeScrollEvent, context?: TContext): void;
|
|
8
|
+
}
|
|
9
|
+
interface ScrollEvent extends NativeScrollEvent, NativeEvent<ScrollEvent> {
|
|
10
|
+
eventName: string;
|
|
11
|
+
}
|
|
12
|
+
export interface ScrollHandlers<TContext extends Context> {
|
|
13
|
+
[key: string]: ScrollHandler<TContext> | undefined;
|
|
14
|
+
onScroll?: ScrollHandler<TContext>;
|
|
15
|
+
onBeginDrag?: ScrollHandler<TContext>;
|
|
16
|
+
onEndDrag?: ScrollHandler<TContext>;
|
|
17
|
+
onMomentumBegin?: ScrollHandler<TContext>;
|
|
18
|
+
onMomentumEnd?: ScrollHandler<TContext>;
|
|
19
|
+
}
|
|
20
|
+
export declare function useAnimatedScrollHandler<TContext extends Context>(handlers: ScrollHandlers<TContext> | ScrollHandler<TContext>, dependencies?: DependencyList): RefObject<WorkletEventHandler<ScrollEvent>>;
|
|
21
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { SensorValue3D, SensorValueRotation } from '../commonTypes';
|
|
2
|
+
export declare enum SensorType {
|
|
3
|
+
ACCELEROMETER = 1,
|
|
4
|
+
GYROSCOPE = 2,
|
|
5
|
+
GRAVITY = 3,
|
|
6
|
+
MAGNETIC_FIELD = 4,
|
|
7
|
+
ROTATION = 5
|
|
8
|
+
}
|
|
9
|
+
export declare type SensorConfig = {
|
|
10
|
+
interval: number;
|
|
11
|
+
};
|
|
12
|
+
export declare type AnimatedSensor = {
|
|
13
|
+
sensor: SensorValue3D | SensorValueRotation | null;
|
|
14
|
+
unregister: () => void;
|
|
15
|
+
isAvailable: boolean;
|
|
16
|
+
config: {
|
|
17
|
+
interval: number;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
export declare function useAnimatedSensor(sensorType: SensorType, userConfig?: SensorConfig): AnimatedSensor;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { MutableRefObject } from 'react';
|
|
2
|
+
import { DependencyList } from './commonTypes';
|
|
3
|
+
import { ViewDescriptorsSet, ViewRefSet } from '../ViewDescriptorsSet';
|
|
4
|
+
import { AdapterWorkletFunction, AnimatedStyle, BasicWorkletFunction } from '../commonTypes';
|
|
5
|
+
export interface AnimatedStyleResult {
|
|
6
|
+
viewDescriptors: ViewDescriptorsSet;
|
|
7
|
+
initial: AnimatedStyle;
|
|
8
|
+
viewsRef: ViewRefSet<any>;
|
|
9
|
+
animatedStyle?: MutableRefObject<AnimatedStyle>;
|
|
10
|
+
}
|
|
11
|
+
export declare function useAnimatedStyle<T extends AnimatedStyle>(updater: BasicWorkletFunction<T>, dependencies?: DependencyList, adapters?: AdapterWorkletFunction | AdapterWorkletFunction[]): AnimatedStyleResult;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { BasicWorkletFunction, SharedValue } from '../commonTypes';
|
|
2
|
+
import { DependencyList } from './commonTypes';
|
|
3
|
+
export declare type DerivedValue<T> = Readonly<SharedValue<T>>;
|
|
4
|
+
export declare function useDerivedValue<T>(processor: BasicWorkletFunction<T>, dependencies: DependencyList): DerivedValue<T>;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { MutableRefObject } from 'react';
|
|
2
|
+
import { AnimatedStyle, NativeEvent, NestedObjectValues, StyleProps, WorkletFunction, AnimationObject } from '../commonTypes';
|
|
3
|
+
import WorkletEventHandler from '../WorkletEventHandler';
|
|
4
|
+
import { Context, DependencyList } from './commonTypes';
|
|
5
|
+
interface Handler<T, TContext extends Context> extends WorkletFunction {
|
|
6
|
+
(event: T, context: TContext): void;
|
|
7
|
+
}
|
|
8
|
+
interface Handlers<T, TContext extends Context> {
|
|
9
|
+
[key: string]: Handler<T, TContext> | undefined;
|
|
10
|
+
}
|
|
11
|
+
export interface UseHandlerContext<TContext extends Context> {
|
|
12
|
+
context: TContext;
|
|
13
|
+
doDependenciesDiffer: boolean;
|
|
14
|
+
useWeb: boolean;
|
|
15
|
+
}
|
|
16
|
+
export declare function useEvent<T extends NativeEvent<T>>(handler: (event: T) => void, eventNames?: string[], rebuild?: boolean): MutableRefObject<WorkletEventHandler<T> | null>;
|
|
17
|
+
export declare function useHandler<T, TContext extends Context>(handlers: Handlers<T, TContext>, dependencies?: DependencyList): UseHandlerContext<TContext>;
|
|
18
|
+
export declare function buildWorkletsHash(handlers: Record<string, WorkletFunction> | Array<WorkletFunction>): string;
|
|
19
|
+
export declare function buildDependencies(dependencies: DependencyList, handlers: Record<string, WorkletFunction | undefined>): Array<unknown>;
|
|
20
|
+
export declare function areDependenciesEqual(nextDeps: DependencyList, prevDeps: DependencyList): boolean;
|
|
21
|
+
export declare function hasColorProps(updates: AnimatedStyle): boolean;
|
|
22
|
+
export declare function parseColors(updates: AnimatedStyle): void;
|
|
23
|
+
export declare function canApplyOptimalisation(upadterFn: WorkletFunction): number;
|
|
24
|
+
export declare function isAnimated(prop: NestedObjectValues<AnimationObject>): boolean;
|
|
25
|
+
export declare function styleDiff<T extends AnimatedStyle>(oldStyle: AnimatedStyle, newStyle: AnimatedStyle): Partial<T>;
|
|
26
|
+
export declare function getStyleWithoutAnimations(newStyle: AnimatedStyle): StyleProps;
|
|
27
|
+
export declare const validateAnimatedStyles: (styles: AnimatedStyle) => void;
|
|
28
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export * from './core';
|
|
2
|
+
export * from './hook';
|
|
3
|
+
export * from './animation';
|
|
4
|
+
export * from './interpolation';
|
|
5
|
+
export * from './interpolateColor';
|
|
6
|
+
export * from './Easing';
|
|
7
|
+
export * from './NativeMethods';
|
|
8
|
+
export * from './Colors';
|
|
9
|
+
export * from './PropAdapters';
|
|
10
|
+
export * from './layoutReanimation';
|
|
11
|
+
export * from './utils';
|
|
12
|
+
export * from './commonTypes';
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { SharedValue } from './commonTypes';
|
|
2
|
+
interface InterpolateRGB {
|
|
3
|
+
r: number[];
|
|
4
|
+
g: number[];
|
|
5
|
+
b: number[];
|
|
6
|
+
a: number[];
|
|
7
|
+
}
|
|
8
|
+
interface InterpolateHSV {
|
|
9
|
+
h: number[];
|
|
10
|
+
s: number[];
|
|
11
|
+
v: number[];
|
|
12
|
+
}
|
|
13
|
+
export declare const interpolateColor: (value: number, inputRange: readonly number[], outputRange: readonly (string | number)[], colorSpace?: 'RGB' | 'HSV') => string | number;
|
|
14
|
+
export declare enum ColorSpace {
|
|
15
|
+
RGB = 0,
|
|
16
|
+
HSV = 1
|
|
17
|
+
}
|
|
18
|
+
export interface InterpolateConfig {
|
|
19
|
+
inputRange: readonly number[];
|
|
20
|
+
outputRange: readonly (string | number)[];
|
|
21
|
+
colorSpace: ColorSpace;
|
|
22
|
+
cache: SharedValue<InterpolateRGB | InterpolateHSV | null>;
|
|
23
|
+
}
|
|
24
|
+
export declare function useInterpolateConfig(inputRange: readonly number[], outputRange: readonly (string | number)[], colorSpace?: ColorSpace): SharedValue<InterpolateConfig>;
|
|
25
|
+
export declare const interpolateSharableColor: (value: number, interpolateConfig: SharedValue<InterpolateConfig>) => string | number;
|
|
26
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export declare enum Extrapolation {
|
|
2
|
+
IDENTITY = "identity",
|
|
3
|
+
CLAMP = "clamp",
|
|
4
|
+
EXTEND = "extend"
|
|
5
|
+
}
|
|
6
|
+
export interface InterpolatedNode {
|
|
7
|
+
__nodeId: number;
|
|
8
|
+
}
|
|
9
|
+
export interface ExtrapolationConfig {
|
|
10
|
+
extrapolateLeft?: Extrapolation | string;
|
|
11
|
+
extrapolateRight?: Extrapolation | string;
|
|
12
|
+
}
|
|
13
|
+
export declare type ExtrapolationType = ExtrapolationConfig | Extrapolation | string | undefined;
|
|
14
|
+
export declare function interpolate(x: number | InterpolatedNode, input: readonly number[], output: readonly number[], type?: ExtrapolationType): number;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
declare global {
|
|
2
|
+
namespace jest {
|
|
3
|
+
interface Matchers<R> {
|
|
4
|
+
toHaveAnimatedStyle(style: Record<string, unknown>[] | Record<string, unknown>): R;
|
|
5
|
+
}
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
export declare const withReanimatedTimer: (animatonTest: any) => void;
|
|
9
|
+
export declare const advanceAnimationByTime: (time?: number) => void;
|
|
10
|
+
export declare const advanceAnimationByFrame: (count: any) => void;
|
|
11
|
+
export declare const setUpTests: (userConfig?: {}) => void;
|
|
12
|
+
export declare const getAnimatedStyle: (received: any) => {};
|