react-native-reanimated 2.4.1 → 2.7.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/Common/cpp/AnimatedSensor/AnimatedSensorModule.cpp +72 -0
- package/Common/cpp/NativeModules/NativeReanimatedModule.cpp +30 -1
- package/Common/cpp/NativeModules/NativeReanimatedModuleSpec.cpp +64 -39
- package/Common/cpp/SharedItems/ShareableValue.cpp +2 -2
- package/Common/cpp/Tools/RuntimeDecorator.cpp +2 -14
- package/Common/cpp/headers/AnimatedSensor/AnimatedSensorModule.h +41 -0
- package/Common/cpp/headers/NativeModules/NativeReanimatedModule.h +14 -0
- package/Common/cpp/headers/NativeModules/NativeReanimatedModuleSpec.h +14 -0
- package/Common/cpp/headers/SharedItems/MutableValue.h +4 -1
- package/Common/cpp/headers/SharedItems/ShareableValue.h +3 -0
- package/Common/cpp/headers/SharedItems/ValueWrapper.h +3 -0
- package/Common/cpp/headers/Tools/PlatformDepMethodsHolder.h +11 -0
- package/Common/cpp/headers/Tools/RuntimeDecorator.h +2 -0
- package/README.md +2 -2
- package/RNReanimated.podspec +15 -6
- package/android/.gradle/7.2/dependencies-accessors/dependencies-accessors.lock +0 -0
- package/android/.gradle/7.2/dependencies-accessors/gc.properties +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/fileChanges/last-build.bin +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/7.2/fileHashes/resourceHashesCache.bin +0 -0
- package/android/.gradle/7.2/gc.properties +0 -0
- package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
- package/android/.gradle/buildOutputCleanup/cache.properties +2 -0
- 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/.gradle/vcs-1/gc.properties +0 -0
- package/android/CMakeLists.txt +198 -0
- package/android/README.md +15 -0
- package/android/build.gradle +676 -73
- package/android/empty.cpp +1 -0
- package/android/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/android/gradle/wrapper/gradle-wrapper.properties +5 -0
- package/android/gradle.properties +25 -0
- package/android/gradlew +234 -0
- package/android/gradlew.bat +89 -0
- package/android/react-native-reanimated-64-hermes.aar +0 -0
- package/android/react-native-reanimated-64-jsc.aar +0 -0
- package/android/react-native-reanimated-65-hermes.aar +0 -0
- package/android/react-native-reanimated-65-jsc.aar +0 -0
- package/android/react-native-reanimated-66-hermes.aar +0 -0
- package/android/react-native-reanimated-66-jsc.aar +0 -0
- package/android/react-native-reanimated-67-hermes.aar +0 -0
- package/android/react-native-reanimated-67-jsc.aar +0 -0
- package/android/react-native-reanimated-68-hermes.aar +0 -0
- package/android/react-native-reanimated-68-jsc.aar +0 -0
- package/android/rnVersionPatch/62/layoutReanimation/ReanimatedNativeHierarchyManager.java +412 -0
- package/android/rnVersionPatch/62/layoutReanimation/ReanimatedUIImplementation.java +68 -0
- package/android/rnVersionPatch/63/layoutReanimation/ReanimatedUIImplementation.java +68 -0
- package/android/rnVersionPatch/64/layoutReanimation/ReanimatedUIImplementation.java +68 -0
- package/android/rnVersionPatch/65/.gitkeep +0 -0
- package/android/rnVersionPatch/66/.gitkeep +0 -0
- package/android/rnVersionPatch/67/.gitkeep +0 -0
- package/android/rnVersionPatch/68/.gitkeep +0 -0
- package/android/rnVersionPatch/backup/.gitkeep +0 -0
- package/android/settings.gradle +1 -0
- package/android/spotless.gradle +9 -0
- package/android/src/{AndroidManifest.xml → main/AndroidManifest.xml} +0 -0
- package/android/src/main/cpp/AndroidErrorHandler.cpp +42 -0
- package/android/src/main/cpp/AndroidLogger.cpp +27 -0
- package/android/src/main/cpp/AndroidScheduler.cpp +59 -0
- package/android/src/main/cpp/JNIHelper.cpp +59 -0
- package/android/src/main/cpp/LayoutAnimations.cpp +103 -0
- package/android/src/main/cpp/NativeProxy.cpp +327 -0
- package/android/src/main/cpp/OnLoad.cpp +17 -0
- package/android/src/main/cpp/TurboModule.cpp +44 -0
- package/android/src/main/cpp/headers/AndroidErrorHandler.h +30 -0
- package/android/src/main/cpp/headers/AndroidLogger.h +16 -0
- package/android/src/main/cpp/headers/AndroidScheduler.h +41 -0
- package/android/src/main/cpp/headers/JNIHelper.h +30 -0
- package/android/src/main/cpp/headers/LayoutAnimations.h +42 -0
- package/android/src/main/cpp/headers/NativeProxy.h +170 -0
- package/android/src/main/cpp/headers/TurboModule.h +70 -0
- package/android/src/main/java/com/facebook/react/uimanager/UIManagerReanimatedHelper.java +15 -0
- package/android/src/main/java/com/swmansion/common/GestureHandlerStateManager.java +5 -0
- package/android/src/main/java/com/swmansion/reanimated/AndroidErrorHandler.java +8 -0
- package/android/src/main/java/com/swmansion/reanimated/CopiedEvent.java +43 -0
- package/android/src/main/java/com/swmansion/reanimated/MapUtils.java +26 -0
- package/android/src/main/java/com/swmansion/reanimated/NativeMethodsHelper.java +117 -0
- package/android/src/main/java/com/swmansion/reanimated/NativeProxy.java +288 -0
- package/android/src/main/java/com/swmansion/reanimated/NodesManager.java +682 -0
- package/android/src/main/java/com/swmansion/reanimated/ReanimatedJSIModulePackage.java +29 -0
- package/android/src/main/java/com/swmansion/reanimated/ReanimatedModule.java +251 -0
- package/android/src/main/java/com/swmansion/reanimated/ReanimatedPackage.java +96 -0
- package/android/src/main/java/com/swmansion/reanimated/Scheduler.java +51 -0
- package/android/src/main/java/com/swmansion/reanimated/UpdateContext.java +11 -0
- package/android/src/main/java/com/swmansion/reanimated/Utils.java +32 -0
- package/android/src/main/java/com/swmansion/reanimated/layoutReanimation/AnimationsManager.java +524 -0
- package/android/src/main/java/com/swmansion/reanimated/layoutReanimation/LayoutAnimations.java +56 -0
- package/android/src/main/java/com/swmansion/reanimated/layoutReanimation/NativeMethodsHolder.java +11 -0
- package/android/src/main/java/com/swmansion/reanimated/layoutReanimation/ReanimatedNativeHierarchyManager.java +410 -0
- package/android/src/main/java/com/swmansion/reanimated/layoutReanimation/ReanimatedUIImplementation.java +68 -0
- package/android/src/main/java/com/swmansion/reanimated/layoutReanimation/ReanimatedUIManager.java +292 -0
- package/android/src/main/java/com/swmansion/reanimated/layoutReanimation/Snapshot.java +121 -0
- package/android/src/main/java/com/swmansion/reanimated/layoutReanimation/ViewHierarchyObserver.java +12 -0
- package/android/src/main/java/com/swmansion/reanimated/nodes/AlwaysNode.java +29 -0
- package/android/src/main/java/com/swmansion/reanimated/nodes/BezierNode.java +87 -0
- package/android/src/main/java/com/swmansion/reanimated/nodes/BlockNode.java +24 -0
- package/android/src/main/java/com/swmansion/reanimated/nodes/CallFuncNode.java +49 -0
- package/android/src/main/java/com/swmansion/reanimated/nodes/ClockNode.java +38 -0
- package/android/src/main/java/com/swmansion/reanimated/nodes/ClockOpNode.java +73 -0
- package/android/src/main/java/com/swmansion/reanimated/nodes/ConcatNode.java +36 -0
- package/android/src/main/java/com/swmansion/reanimated/nodes/CondNode.java +41 -0
- package/android/src/main/java/com/swmansion/reanimated/nodes/DebugNode.java +33 -0
- package/android/src/main/java/com/swmansion/reanimated/nodes/EventNode.java +83 -0
- package/android/src/main/java/com/swmansion/reanimated/nodes/FinalNode.java +5 -0
- package/android/src/main/java/com/swmansion/reanimated/nodes/FunctionNode.java +20 -0
- package/android/src/main/java/com/swmansion/reanimated/nodes/JSCallNode.java +41 -0
- package/android/src/main/java/com/swmansion/reanimated/nodes/Node.java +139 -0
- package/android/src/main/java/com/swmansion/reanimated/nodes/NoopNode.java +37 -0
- package/android/src/main/java/com/swmansion/reanimated/nodes/OperatorNode.java +377 -0
- package/android/src/main/java/com/swmansion/reanimated/nodes/ParamNode.java +71 -0
- package/android/src/main/java/com/swmansion/reanimated/nodes/PropsNode.java +153 -0
- package/android/src/main/java/com/swmansion/reanimated/nodes/SetNode.java +32 -0
- package/android/src/main/java/com/swmansion/reanimated/nodes/StyleNode.java +40 -0
- package/android/src/main/java/com/swmansion/reanimated/nodes/TransformNode.java +84 -0
- package/android/src/main/java/com/swmansion/reanimated/nodes/ValueNode.java +40 -0
- package/android/src/main/java/com/swmansion/reanimated/sensor/ReanimatedSensor.java +41 -0
- package/android/src/main/java/com/swmansion/reanimated/sensor/ReanimatedSensorContainer.java +40 -0
- package/android/src/main/java/com/swmansion/reanimated/sensor/ReanimatedSensorListener.java +31 -0
- package/android/src/main/java/com/swmansion/reanimated/sensor/ReanimatedSensorType.java +35 -0
- package/android/src/main/java/com/swmansion/reanimated/transitions/ChangeTransition.java +84 -0
- package/android/src/main/java/com/swmansion/reanimated/transitions/SaneSidePropagation.java +25 -0
- package/android/src/main/java/com/swmansion/reanimated/transitions/Scale.java +86 -0
- package/android/src/main/java/com/swmansion/reanimated/transitions/TransitionModule.java +41 -0
- package/android/src/main/java/com/swmansion/reanimated/transitions/TransitionUtils.java +161 -0
- package/ios/LayoutReanimation/REAAnimationsManager.h +1 -1
- package/ios/LayoutReanimation/REAAnimationsManager.m +16 -6
- package/ios/LayoutReanimation/REASnapshot.m +1 -1
- package/ios/LayoutReanimation/REAUIManager.h +1 -1
- package/ios/LayoutReanimation/REAUIManager.mm +4 -5
- package/ios/Nodes/REAAlwaysNode.h +1 -1
- package/ios/Nodes/REAAlwaysNode.m +5 -5
- package/ios/Nodes/REABezierNode.h +1 -1
- package/ios/Nodes/REABezierNode.m +4 -5
- package/ios/Nodes/REABlockNode.h +1 -1
- package/ios/Nodes/REABlockNode.m +2 -2
- package/ios/Nodes/REACallFuncNode.h +1 -1
- package/ios/Nodes/REACallFuncNode.m +5 -5
- package/ios/Nodes/REAClockNodes.h +1 -1
- package/ios/Nodes/REAClockNodes.m +4 -4
- package/ios/Nodes/REAConcatNode.h +1 -1
- package/ios/Nodes/REAConcatNode.m +3 -3
- package/ios/Nodes/REACondNode.h +1 -1
- package/ios/Nodes/REACondNode.m +3 -3
- package/ios/Nodes/READebugNode.h +1 -1
- package/ios/Nodes/READebugNode.m +3 -3
- package/ios/Nodes/REAEventNode.h +1 -2
- package/ios/Nodes/REAEventNode.m +3 -3
- package/ios/Nodes/REAFunctionNode.h +1 -1
- package/ios/Nodes/REAFunctionNode.m +3 -3
- package/ios/Nodes/REAJSCallNode.h +1 -1
- package/ios/Nodes/REAJSCallNode.m +3 -3
- package/ios/Nodes/REANode.m +2 -2
- package/ios/Nodes/REAOperatorNode.h +1 -1
- package/ios/Nodes/REAOperatorNode.m +2 -3
- package/ios/Nodes/REAParamNode.h +1 -1
- package/ios/Nodes/REAParamNode.m +4 -4
- package/ios/Nodes/REAPropsNode.h +1 -1
- package/ios/Nodes/REAPropsNode.m +4 -6
- package/ios/Nodes/REASetNode.h +1 -1
- package/ios/Nodes/REASetNode.m +4 -4
- package/ios/Nodes/REAStyleNode.h +1 -1
- package/ios/Nodes/REAStyleNode.m +2 -3
- package/ios/Nodes/REATransformNode.h +1 -1
- package/ios/Nodes/REATransformNode.m +2 -2
- package/ios/Nodes/REAValueNode.h +1 -3
- package/ios/Nodes/REAValueNode.m +1 -1
- package/ios/REAEventDispatcher.m +1 -1
- package/ios/REAModule.h +1 -1
- package/ios/REAModule.m +12 -14
- package/ios/REANodesManager.h +5 -3
- package/ios/REANodesManager.m +97 -27
- package/ios/Transitioning/RCTConvert+REATransition.h +1 -2
- package/ios/Transitioning/RCTConvert+REATransition.m +1 -1
- package/ios/Transitioning/REAAllTransitions.h +1 -1
- package/ios/Transitioning/REAAllTransitions.m +2 -3
- package/ios/Transitioning/REATransition.h +2 -3
- package/ios/Transitioning/REATransition.m +3 -4
- package/ios/Transitioning/REATransitionAnimation.m +1 -2
- package/ios/Transitioning/REATransitionManager.m +2 -4
- package/ios/Transitioning/REATransitionValues.m +2 -3
- package/ios/native/NativeMethods.h +1 -3
- package/ios/native/NativeMethods.mm +1 -1
- package/ios/native/NativeProxy.h +2 -2
- package/ios/native/NativeProxy.mm +86 -15
- package/ios/native/REAIOSErrorHandler.h +2 -4
- package/ios/native/REAIOSErrorHandler.mm +1 -1
- package/ios/native/REAIOSLogger.h +1 -3
- package/ios/native/REAIOSLogger.mm +1 -1
- package/ios/native/REAIOSScheduler.h +1 -3
- package/ios/native/REAIOSScheduler.mm +2 -2
- package/ios/native/REAInitializer.h +0 -7
- package/ios/native/REAInitializer.mm +2 -2
- package/ios/native/UIResponder+Reanimated.mm +3 -3
- package/ios/sensor/ReanimatedSensor.h +25 -0
- package/ios/sensor/ReanimatedSensor.m +217 -0
- package/ios/sensor/ReanimatedSensorContainer.h +12 -0
- package/ios/sensor/ReanimatedSensorContainer.m +40 -0
- package/ios/sensor/ReanimatedSensorType.h +7 -0
- package/lib/ConfigHelper.js +2 -3
- package/lib/createAnimatedComponent.js +3 -4
- package/lib/reanimated1/core/AnimatedFunction.js +1 -1
- package/lib/reanimated1/derived/interpolate.js +2 -4
- package/lib/reanimated2/Colors.js +2 -1
- package/lib/reanimated2/Easing.js +9 -3
- package/lib/reanimated2/NativeReanimated/NativeReanimated.js +25 -12
- package/lib/reanimated2/NativeReanimated/index.js +0 -4
- package/lib/reanimated2/ViewDescriptorsSet.js +2 -2
- package/lib/reanimated2/animation/styleAnimation.js +2 -1
- package/lib/reanimated2/core.js +30 -60
- package/lib/reanimated2/globals.d.ts +7 -2
- package/lib/reanimated2/hook/index.js +1 -0
- package/lib/reanimated2/hook/useAnimatedSensor.js +66 -0
- package/lib/reanimated2/interpolateColor.js +11 -11
- package/lib/reanimated2/interpolation.js +1 -1
- package/lib/reanimated2/jestUtils.js +9 -4
- package/lib/reanimated2/js-reanimated/JSReanimated.js +23 -2
- package/lib/reanimated2/js-reanimated/index.js +3 -3
- package/lib/reanimated2/layoutReanimation/animationBuilder/ComplexAnimationBuilder.js +8 -0
- package/lib/reanimated2/layoutReanimation/animationBuilder/Keyframe.js +2 -1
- package/lib/reanimated2/layoutReanimation/defaultAnimations/Bounce.js +32 -42
- package/lib/reanimated2/layoutReanimation/defaultAnimations/Fade.js +20 -38
- package/lib/reanimated2/layoutReanimation/defaultAnimations/Flip.js +32 -44
- package/lib/reanimated2/layoutReanimation/defaultAnimations/Lightspeed.js +8 -16
- package/lib/reanimated2/layoutReanimation/defaultAnimations/Pinwheel.js +6 -10
- package/lib/reanimated2/layoutReanimation/defaultAnimations/Roll.js +8 -12
- package/lib/reanimated2/layoutReanimation/defaultAnimations/Rotate.js +20 -36
- package/lib/reanimated2/layoutReanimation/defaultAnimations/Slide.js +16 -20
- package/lib/reanimated2/layoutReanimation/defaultAnimations/Stretch.js +8 -12
- package/lib/reanimated2/layoutReanimation/defaultAnimations/Zoom.js +32 -48
- package/lib/reanimated2/layoutReanimation/defaultTransitions/EntryExitTransition.js +22 -18
- package/lib/reanimated2/mock.js +3 -2
- 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 +79 -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/mock.js +4 -4
- package/package.json +43 -39
- package/plugin.js +3 -12
- package/react-native-reanimated.d.ts +58 -32
- package/src/ConfigHelper.ts +4 -5
- package/src/createAnimatedComponent.tsx +4 -4
- package/src/reanimated1/core/AnimatedFunction.js +1 -1
- package/src/reanimated1/derived/interpolate.js +2 -4
- package/src/reanimated2/Colors.ts +2 -1
- package/src/reanimated2/Easing.ts +9 -3
- package/src/reanimated2/NativeReanimated/NativeReanimated.ts +42 -15
- package/src/reanimated2/NativeReanimated/index.ts +0 -6
- package/src/reanimated2/ViewDescriptorsSet.ts +2 -3
- package/src/reanimated2/animation/index.ts +1 -0
- package/src/reanimated2/animation/styleAnimation.ts +10 -7
- package/src/reanimated2/animation/timing.ts +3 -1
- package/src/reanimated2/animation/util.ts +10 -11
- package/src/reanimated2/commonTypes.ts +20 -1
- package/src/reanimated2/component/FlatList.tsx +3 -2
- package/src/reanimated2/core.ts +34 -73
- package/src/reanimated2/globals.d.ts +7 -2
- package/src/reanimated2/hook/index.ts +1 -0
- package/src/reanimated2/hook/useAnimatedSensor.ts +91 -0
- package/src/reanimated2/hook/utils.ts +2 -1
- package/src/reanimated2/interpolateColor.ts +11 -11
- package/src/reanimated2/interpolation.ts +2 -6
- package/src/reanimated2/jestUtils.ts +20 -4
- package/src/reanimated2/js-reanimated/JSReanimated.ts +25 -2
- package/src/reanimated2/js-reanimated/index.ts +3 -3
- package/src/reanimated2/layoutReanimation/animationBuilder/ComplexAnimationBuilder.ts +13 -0
- package/src/reanimated2/layoutReanimation/animationBuilder/Keyframe.ts +2 -3
- package/src/reanimated2/layoutReanimation/defaultAnimations/Bounce.ts +51 -21
- package/src/reanimated2/layoutReanimation/defaultAnimations/Fade.ts +40 -10
- package/src/reanimated2/layoutReanimation/defaultAnimations/Flip.ts +48 -12
- package/src/reanimated2/layoutReanimation/defaultAnimations/Lightspeed.ts +16 -4
- package/src/reanimated2/layoutReanimation/defaultAnimations/Pinwheel.ts +8 -2
- package/src/reanimated2/layoutReanimation/defaultAnimations/Roll.ts +16 -4
- package/src/reanimated2/layoutReanimation/defaultAnimations/Rotate.ts +32 -8
- package/src/reanimated2/layoutReanimation/defaultAnimations/Slide.ts +32 -10
- package/src/reanimated2/layoutReanimation/defaultAnimations/Stretch.ts +16 -4
- package/src/reanimated2/layoutReanimation/defaultAnimations/Zoom.ts +64 -16
- package/src/reanimated2/layoutReanimation/defaultTransitions/CurvedTransition.ts +2 -1
- package/src/reanimated2/layoutReanimation/defaultTransitions/EntryExitTransition.ts +26 -19
- package/src/reanimated2/layoutReanimation/defaultTransitions/FadingTransition.ts +2 -1
- package/src/reanimated2/layoutReanimation/defaultTransitions/JumpingTransition.ts +2 -1
- package/src/reanimated2/layoutReanimation/defaultTransitions/LinearTransition.ts +2 -1
- package/src/reanimated2/layoutReanimation/defaultTransitions/SequencedTransition.ts +2 -1
- package/src/reanimated2/mock.ts +3 -2
- 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/android/react-native-reanimated-63-hermes.aar +0 -0
- package/android/react-native-reanimated-63-jsc.aar +0 -0
- package/android/src/main/java/com/swmansion/reanimated/ReanimatedProxyPackage.java +0 -15
- package/expo-module.config.json +0 -3
- package/libSo/fbjni/jni/arm64-v8a/libfbjni.so +0 -0
- package/libSo/fbjni/jni/armeabi-v7a/libfbjni.so +0 -0
- package/libSo/fbjni/jni/x86/libfbjni.so +0 -0
- package/libSo/fbjni/jni/x86_64/libfbjni.so +0 -0
|
@@ -74,24 +74,28 @@ export class EntryExitTransition extends BaseAnimationBuilder {
|
|
|
74
74
|
}
|
|
75
75
|
}
|
|
76
76
|
const mergedTransform = ((_c = exitingValues.initialValues.transform) !== null && _c !== void 0 ? _c : []).concat(((_d = enteringValues.animations.transform) !== null && _d !== void 0 ? _d : []).map((value) => {
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
else
|
|
90
|
-
return {
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
77
|
+
const objectKeys = Object.keys(value);
|
|
78
|
+
if ((objectKeys === null || objectKeys === void 0 ? void 0 : objectKeys.length) < 1) {
|
|
79
|
+
console.error(`[Reanimated]: \${value} is not a valid Transform object`);
|
|
80
|
+
return value;
|
|
81
|
+
}
|
|
82
|
+
const transformProp = objectKeys[0];
|
|
83
|
+
const current = value[transformProp].current;
|
|
84
|
+
if (typeof current === 'string') {
|
|
85
|
+
if (current.includes('deg'))
|
|
86
|
+
return {
|
|
87
|
+
[transformProp]: '0deg',
|
|
88
|
+
};
|
|
89
|
+
else
|
|
90
|
+
return {
|
|
91
|
+
[transformProp]: '0',
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
else if (transformProp.includes('translate')) {
|
|
95
|
+
return { [transformProp]: 0 };
|
|
96
|
+
}
|
|
97
|
+
else {
|
|
98
|
+
return { [transformProp]: 1 };
|
|
95
99
|
}
|
|
96
100
|
return value;
|
|
97
101
|
}));
|
package/lib/reanimated2/mock.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
/* eslint-disable
|
|
2
|
+
/* eslint-disable node/no-callback-literal */
|
|
3
3
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
4
4
|
// @ts-nocheck
|
|
5
5
|
const NOOP = () => {
|
|
@@ -58,7 +58,8 @@ const ReanimatedV2 = {
|
|
|
58
58
|
elastic: ID,
|
|
59
59
|
back: ID,
|
|
60
60
|
bounce: ID,
|
|
61
|
-
bezier: ID,
|
|
61
|
+
bezier: () => ({ factory: ID }),
|
|
62
|
+
bezierFn: ID,
|
|
62
63
|
in: ID,
|
|
63
64
|
out: ID,
|
|
64
65
|
inOut: ID,
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare function addWhitelistedNativeProps(props: Record<string, boolean>): void;
|
|
2
|
+
export declare function addWhitelistedUIProps(props: Record<string, boolean>): void;
|
|
3
|
+
interface ViewConfig {
|
|
4
|
+
uiViewClassName: string;
|
|
5
|
+
validAttributes: Record<string, unknown>;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* updates UI props whitelist for given view host instance
|
|
9
|
+
* this will work just once for every view name
|
|
10
|
+
*/
|
|
11
|
+
export declare function adaptViewConfig(viewConfig: ViewConfig): void;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
disconnectNodeFromView(): Promise<void>;
|
|
3
|
+
attachEvent(_viewTag: number, _eventName: string, _nodeID: number): Promise<void>;
|
|
4
|
+
detachEvent(_viewTag: number, _eventName: string, _nodeID: number): Promise<void>;
|
|
5
|
+
createNode(_nodeID: number, _config: Record<string, unknown>): Promise<void>;
|
|
6
|
+
dropNode(_nodeID: number): Promise<void>;
|
|
7
|
+
configureProps(_nativeProps: string[], _uiProps: string[]): Promise<void>;
|
|
8
|
+
disconnectNodes(): Promise<void>;
|
|
9
|
+
addListener(): Promise<void>;
|
|
10
|
+
removeListeners(): Promise<void>;
|
|
11
|
+
removeAllListeners(): Promise<void>;
|
|
12
|
+
animateNextTransition(): Promise<void>;
|
|
13
|
+
};
|
|
14
|
+
export default _default;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { Component, ComponentType, Ref } from 'react';
|
|
2
|
+
import './reanimated2/layoutReanimation/LayoutAnimationRepository';
|
|
3
|
+
import { BaseAnimationBuilder, EntryExitAnimationFunction, ILayoutAnimationBuilder } from './reanimated2/layoutReanimation';
|
|
4
|
+
import { SharedValue, StyleProps } from './reanimated2/commonTypes';
|
|
5
|
+
import { ViewDescriptorsSet, ViewRefSet } from './reanimated2/ViewDescriptorsSet';
|
|
6
|
+
declare type NestedArray<T> = T | NestedArray<T>[];
|
|
7
|
+
interface AnimatedProps extends Record<string, unknown> {
|
|
8
|
+
viewDescriptors?: ViewDescriptorsSet;
|
|
9
|
+
viewsRef?: ViewRefSet<unknown>;
|
|
10
|
+
initial?: SharedValue<StyleProps>;
|
|
11
|
+
}
|
|
12
|
+
export declare type AnimatedComponentProps<P extends Record<string, unknown>> = P & {
|
|
13
|
+
forwardedRef?: Ref<Component>;
|
|
14
|
+
style?: NestedArray<StyleProps>;
|
|
15
|
+
animatedProps?: Partial<AnimatedComponentProps<AnimatedProps>>;
|
|
16
|
+
animatedStyle?: StyleProps;
|
|
17
|
+
layout?: BaseAnimationBuilder | ILayoutAnimationBuilder | typeof BaseAnimationBuilder;
|
|
18
|
+
entering?: BaseAnimationBuilder | typeof BaseAnimationBuilder | EntryExitAnimationFunction | Keyframe;
|
|
19
|
+
exiting?: BaseAnimationBuilder | typeof BaseAnimationBuilder | EntryExitAnimationFunction | Keyframe;
|
|
20
|
+
};
|
|
21
|
+
declare type Options<P> = {
|
|
22
|
+
setNativeProps: (ref: ComponentRef, props: P) => void;
|
|
23
|
+
};
|
|
24
|
+
interface ComponentRef extends Component {
|
|
25
|
+
setNativeProps?: (props: Record<string, unknown>) => void;
|
|
26
|
+
getScrollableNode?: () => ComponentRef;
|
|
27
|
+
}
|
|
28
|
+
export interface InitialComponentProps extends Record<string, unknown> {
|
|
29
|
+
ref?: Ref<Component>;
|
|
30
|
+
collapsable?: boolean;
|
|
31
|
+
}
|
|
32
|
+
export default function createAnimatedComponent(Component: ComponentType<InitialComponentProps>, options?: Options<InitialComponentProps>): ComponentType<AnimatedComponentProps<InitialComponentProps>>;
|
|
33
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* https://github.com/gre/bezier-easing
|
|
3
|
+
* BezierEasing - use bezier curve for transition easing function
|
|
4
|
+
* by Gaëtan Renaudeau 2014 - 2015 – MIT License
|
|
5
|
+
*/
|
|
6
|
+
export declare function Bezier(mX1: number, mY1: number, mX2: number, mY2: number): (x: number) => number;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copied from:
|
|
3
|
+
* react-native/Libraries/StyleSheet/normalizeColor.js
|
|
4
|
+
* react-native/Libraries/StyleSheet/processColor.js
|
|
5
|
+
* https://github.com/wcandillon/react-native-redash/blob/master/src/Colors.ts
|
|
6
|
+
*/
|
|
7
|
+
interface RGB {
|
|
8
|
+
r: number;
|
|
9
|
+
g: number;
|
|
10
|
+
b: number;
|
|
11
|
+
}
|
|
12
|
+
interface HSV {
|
|
13
|
+
h: number;
|
|
14
|
+
s: number;
|
|
15
|
+
v: number;
|
|
16
|
+
}
|
|
17
|
+
export declare const opacity: (c: number) => number;
|
|
18
|
+
export declare const red: (c: number) => number;
|
|
19
|
+
export declare const green: (c: number) => number;
|
|
20
|
+
export declare const blue: (c: number) => number;
|
|
21
|
+
export declare const rgbaColor: (r: number, g: number, b: number, alpha?: number) => number | string;
|
|
22
|
+
export declare function RGBtoHSV(rgb: RGB): HSV;
|
|
23
|
+
export declare function RGBtoHSV(r: number, g: number, b: number): HSV;
|
|
24
|
+
export declare const hsvToColor: (h: number, s: number, v: number) => number | string;
|
|
25
|
+
export declare function processColorInitially(color: unknown): number | null | undefined;
|
|
26
|
+
export declare function isColor(value: unknown): boolean;
|
|
27
|
+
export declare function processColor(color: unknown): number | null | undefined;
|
|
28
|
+
export declare type ParsedColorArray = [number, number, number, number];
|
|
29
|
+
export declare function convertToHSVA(color: unknown): ParsedColorArray;
|
|
30
|
+
export declare function toRGBA(HSVA: ParsedColorArray): string;
|
|
31
|
+
export {};
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The `Easing` module implements common easing functions. This module is used
|
|
3
|
+
* by [Animate.timing()](docs/animate.html#timing) to convey physically
|
|
4
|
+
* believable motion in animations.
|
|
5
|
+
*
|
|
6
|
+
* You can find a visualization of some common easing functions at
|
|
7
|
+
* http://easings.net/
|
|
8
|
+
*
|
|
9
|
+
* ### Predefined animations
|
|
10
|
+
*
|
|
11
|
+
* The `Easing` module provides several predefined animations through the
|
|
12
|
+
* following methods:
|
|
13
|
+
*
|
|
14
|
+
* - [`back`](docs/easing.html#back) provides a simple animation where the
|
|
15
|
+
* object goes slightly back before moving forward
|
|
16
|
+
* - [`bounce`](docs/easing.html#bounce) provides a bouncing animation
|
|
17
|
+
* - [`ease`](docs/easing.html#ease) provides a simple inertial animation
|
|
18
|
+
* - [`elastic`](docs/easing.html#elastic) provides a simple spring interaction
|
|
19
|
+
*
|
|
20
|
+
* ### Standard functions
|
|
21
|
+
*
|
|
22
|
+
* Three standard easing functions are provided:
|
|
23
|
+
*
|
|
24
|
+
* - [`linear`](docs/easing.html#linear)
|
|
25
|
+
* - [`quad`](docs/easing.html#quad)
|
|
26
|
+
* - [`cubic`](docs/easing.html#cubic)
|
|
27
|
+
*
|
|
28
|
+
* The [`poly`](docs/easing.html#poly) function can be used to implement
|
|
29
|
+
* quartic, quintic, and other higher power functions.
|
|
30
|
+
*
|
|
31
|
+
* ### Additional functions
|
|
32
|
+
*
|
|
33
|
+
* Additional mathematical functions are provided by the following methods:
|
|
34
|
+
*
|
|
35
|
+
* - [`bezier`](docs/easing.html#bezier) provides a cubic bezier curve
|
|
36
|
+
* - [`circle`](docs/easing.html#circle) provides a circular function
|
|
37
|
+
* - [`sin`](docs/easing.html#sin) provides a sinusoidal function
|
|
38
|
+
* - [`exp`](docs/easing.html#exp) provides an exponential function
|
|
39
|
+
*
|
|
40
|
+
* The following helpers are used to modify other easing functions.
|
|
41
|
+
*
|
|
42
|
+
* - [`in`](docs/easing.html#in) runs an easing function forwards
|
|
43
|
+
* - [`inOut`](docs/easing.html#inout) makes any easing function symmetrical
|
|
44
|
+
* - [`out`](docs/easing.html#out) runs an easing function backwards
|
|
45
|
+
*/
|
|
46
|
+
export declare type EasingFn = (t: number) => number;
|
|
47
|
+
export declare type EasingFactoryFn = {
|
|
48
|
+
factory: () => EasingFn;
|
|
49
|
+
};
|
|
50
|
+
/**
|
|
51
|
+
* A linear function, `f(t) = t`. Position correlates to elapsed time one to
|
|
52
|
+
* one.
|
|
53
|
+
*
|
|
54
|
+
* http://cubic-bezier.com/#0,0,1,1
|
|
55
|
+
*/
|
|
56
|
+
declare function linear(t: number): number;
|
|
57
|
+
/**
|
|
58
|
+
* A simple inertial interaction, similar to an object slowly accelerating to
|
|
59
|
+
* speed.
|
|
60
|
+
*
|
|
61
|
+
* http://cubic-bezier.com/#.42,0,1,1
|
|
62
|
+
*/
|
|
63
|
+
declare function ease(t: number): number;
|
|
64
|
+
/**
|
|
65
|
+
* A quadratic function, `f(t) = t * t`. Position equals the square of elapsed
|
|
66
|
+
* time.
|
|
67
|
+
*
|
|
68
|
+
* http://easings.net/#easeInQuad
|
|
69
|
+
*/
|
|
70
|
+
declare function quad(t: number): number;
|
|
71
|
+
/**
|
|
72
|
+
* A cubic function, `f(t) = t * t * t`. Position equals the cube of elapsed
|
|
73
|
+
* time.
|
|
74
|
+
*
|
|
75
|
+
* http://easings.net/#easeInCubic
|
|
76
|
+
*/
|
|
77
|
+
declare function cubic(t: number): number;
|
|
78
|
+
/**
|
|
79
|
+
* A power function. Position is equal to the Nth power of elapsed time.
|
|
80
|
+
*
|
|
81
|
+
* n = 4: http://easings.net/#easeInQuart
|
|
82
|
+
* n = 5: http://easings.net/#easeInQuint
|
|
83
|
+
*/
|
|
84
|
+
declare function poly(n: number): EasingFn;
|
|
85
|
+
/**
|
|
86
|
+
* A sinusoidal function.
|
|
87
|
+
*
|
|
88
|
+
* http://easings.net/#easeInSine
|
|
89
|
+
*/
|
|
90
|
+
declare function sin(t: number): number;
|
|
91
|
+
/**
|
|
92
|
+
* A circular function.
|
|
93
|
+
*
|
|
94
|
+
* http://easings.net/#easeInCirc
|
|
95
|
+
*/
|
|
96
|
+
declare function circle(t: number): number;
|
|
97
|
+
/**
|
|
98
|
+
* An exponential function.
|
|
99
|
+
*
|
|
100
|
+
* http://easings.net/#easeInExpo
|
|
101
|
+
*/
|
|
102
|
+
declare function exp(t: number): number;
|
|
103
|
+
/**
|
|
104
|
+
* A simple elastic interaction, similar to a spring oscillating back and
|
|
105
|
+
* forth.
|
|
106
|
+
*
|
|
107
|
+
* Default bounciness is 1, which overshoots a little bit once. 0 bounciness
|
|
108
|
+
* doesn't overshoot at all, and bounciness of N > 1 will overshoot about N
|
|
109
|
+
* times.
|
|
110
|
+
*
|
|
111
|
+
* http://easings.net/#easeInElastic
|
|
112
|
+
*/
|
|
113
|
+
declare function elastic(bounciness?: number): EasingFn;
|
|
114
|
+
/**
|
|
115
|
+
* Use with `Animated.parallel()` to create a simple effect where the object
|
|
116
|
+
* animates back slightly as the animation starts.
|
|
117
|
+
*
|
|
118
|
+
* Wolfram Plot:
|
|
119
|
+
*
|
|
120
|
+
* - http://tiny.cc/back_default (s = 1.70158, default)
|
|
121
|
+
*/
|
|
122
|
+
declare function back(s?: number): (t: number) => number;
|
|
123
|
+
/**
|
|
124
|
+
* Provides a simple bouncing effect.
|
|
125
|
+
*
|
|
126
|
+
* http://easings.net/#easeInBounce
|
|
127
|
+
*/
|
|
128
|
+
declare function bounce(t: number): number;
|
|
129
|
+
/**
|
|
130
|
+
* Provides a cubic bezier curve, equivalent to CSS Transitions'
|
|
131
|
+
* `transition-timing-function`.
|
|
132
|
+
*
|
|
133
|
+
* A useful tool to visualize cubic bezier curves can be found at
|
|
134
|
+
* http://cubic-bezier.com/
|
|
135
|
+
*/
|
|
136
|
+
declare function bezier(x1: number, y1: number, x2: number, y2: number): {
|
|
137
|
+
factory: () => (x: number) => number;
|
|
138
|
+
};
|
|
139
|
+
declare function bezierFn(x1: number, y1: number, x2: number, y2: number): (x: number) => number;
|
|
140
|
+
/**
|
|
141
|
+
* Runs an easing function forwards.
|
|
142
|
+
*/
|
|
143
|
+
declare function in_(easing: EasingFn): EasingFn;
|
|
144
|
+
/**
|
|
145
|
+
* Runs an easing function backwards.
|
|
146
|
+
*/
|
|
147
|
+
declare function out(easing: EasingFn): EasingFn;
|
|
148
|
+
/**
|
|
149
|
+
* Makes any easing function symmetrical. The easing function will run
|
|
150
|
+
* forwards for half of the duration, then backwards for the rest of the
|
|
151
|
+
* duration.
|
|
152
|
+
*/
|
|
153
|
+
declare function inOut(easing: EasingFn): EasingFn;
|
|
154
|
+
export declare const Easing: {
|
|
155
|
+
linear: typeof linear;
|
|
156
|
+
ease: typeof ease;
|
|
157
|
+
quad: typeof quad;
|
|
158
|
+
cubic: typeof cubic;
|
|
159
|
+
poly: typeof poly;
|
|
160
|
+
sin: typeof sin;
|
|
161
|
+
circle: typeof circle;
|
|
162
|
+
exp: typeof exp;
|
|
163
|
+
elastic: typeof elastic;
|
|
164
|
+
back: typeof back;
|
|
165
|
+
bounce: typeof bounce;
|
|
166
|
+
bezier: typeof bezier;
|
|
167
|
+
bezierFn: typeof bezierFn;
|
|
168
|
+
in: typeof in_;
|
|
169
|
+
out: typeof out;
|
|
170
|
+
inOut: typeof inOut;
|
|
171
|
+
};
|
|
172
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Component } from 'react';
|
|
2
|
+
import { RefObjectFunction } from './commonTypes';
|
|
3
|
+
export declare function getTag(view: null | number | React.Component<any, any> | React.ComponentClass<any>): null | number;
|
|
4
|
+
export interface MeasuredDimensions {
|
|
5
|
+
x: number;
|
|
6
|
+
y: number;
|
|
7
|
+
width: number;
|
|
8
|
+
height: number;
|
|
9
|
+
pageX: number;
|
|
10
|
+
pageY: number;
|
|
11
|
+
}
|
|
12
|
+
export declare function measure(animatedRef: RefObjectFunction<Component>): MeasuredDimensions;
|
|
13
|
+
export declare function scrollTo(animatedRef: RefObjectFunction<Component>, x: number, y: number, animated: boolean): void;
|
|
14
|
+
export declare function setGestureState(handlerTag: number, newState: number): void;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { SharedValue, SensorValue3D, SensorValueRotation } from '../commonTypes';
|
|
2
|
+
import { Descriptor } from '../hook/commonTypes';
|
|
3
|
+
export declare class NativeReanimated {
|
|
4
|
+
native: boolean;
|
|
5
|
+
private InnerNativeModule;
|
|
6
|
+
constructor(native?: boolean);
|
|
7
|
+
installCoreFunctions(valueSetter: <T>(value: T) => void): void;
|
|
8
|
+
makeShareable<T>(value: T): T;
|
|
9
|
+
makeMutable<T>(value: T): SharedValue<T>;
|
|
10
|
+
makeRemote<T>(object?: {}): T;
|
|
11
|
+
registerSensor(sensorType: number, interval: number, sensorData: SensorValue3D | SensorValueRotation): any;
|
|
12
|
+
unregisterSensor(sensorId: number): any;
|
|
13
|
+
startMapper(mapper: () => void, inputs: any[] | undefined, outputs: any[] | undefined, updater: () => void, viewDescriptors: Descriptor[] | SharedValue<Descriptor[]>): number;
|
|
14
|
+
stopMapper(mapperId: number): void;
|
|
15
|
+
registerEventHandler<T>(eventHash: string, eventHandler: (event: T) => void): string;
|
|
16
|
+
unregisterEventHandler(id: string): void;
|
|
17
|
+
getViewProp<T>(viewTag: string, propName: string, callback?: (result: T) => void): Promise<T>;
|
|
18
|
+
enableLayoutAnimations(flag: boolean): void;
|
|
19
|
+
configureProps(uiProps: string[], nativeProps: string[]): void;
|
|
20
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { AdapterWorkletFunction } from './commonTypes';
|
|
2
|
+
export declare function createAnimatedPropAdapter(adapter: AdapterWorkletFunction, nativeProps?: string[]): AdapterWorkletFunction;
|
|
3
|
+
export declare const SVGAdapter: AdapterWorkletFunction;
|
|
4
|
+
export declare const TextInputAdapter: AdapterWorkletFunction;
|
|
@@ -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 {};
|