react-native-reanimated 2.14.4 → 2.16.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.
Files changed (295) hide show
  1. package/Common/cpp/Registries/EventHandlerRegistry.cpp +8 -2
  2. package/Common/cpp/Tools/SingleInstanceChecker.h +10 -2
  3. package/android/build.gradle +4 -4
  4. package/android/src/main/java/com/swmansion/reanimated/NodesManager.java +6 -7
  5. package/ios/REANodesManager.m +23 -4
  6. package/package.json +6 -3
  7. package/src/reanimated2/hook/useAnimatedReaction.ts +9 -5
  8. package/src/reanimated2/hook/useAnimatedStyle.ts +14 -3
  9. package/src/reanimated2/hook/useDerivedValue.ts +8 -1
  10. package/android/.gradle/7.5.1/checksums/checksums.lock +0 -0
  11. package/android/.gradle/7.5.1/checksums/md5-checksums.bin +0 -0
  12. package/android/.gradle/7.5.1/checksums/sha1-checksums.bin +0 -0
  13. package/android/.gradle/7.5.1/dependencies-accessors/dependencies-accessors.lock +0 -0
  14. package/android/.gradle/7.5.1/dependencies-accessors/gc.properties +0 -0
  15. package/android/.gradle/7.5.1/executionHistory/executionHistory.bin +0 -0
  16. package/android/.gradle/7.5.1/executionHistory/executionHistory.lock +0 -0
  17. package/android/.gradle/7.5.1/fileChanges/last-build.bin +0 -0
  18. package/android/.gradle/7.5.1/fileHashes/fileHashes.bin +0 -0
  19. package/android/.gradle/7.5.1/fileHashes/fileHashes.lock +0 -0
  20. package/android/.gradle/7.5.1/fileHashes/resourceHashesCache.bin +0 -0
  21. package/android/.gradle/7.5.1/gc.properties +0 -0
  22. package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
  23. package/android/.gradle/buildOutputCleanup/cache.properties +0 -2
  24. package/android/.gradle/buildOutputCleanup/outputFiles.bin +0 -0
  25. package/android/.gradle/file-system.probe +0 -0
  26. package/android/.gradle/vcs-1/gc.properties +0 -0
  27. package/android/react-native-reanimated-67-hermes.aar +0 -0
  28. package/android/react-native-reanimated-67-jsc.aar +0 -0
  29. package/android/react-native-reanimated-68-hermes.aar +0 -0
  30. package/android/react-native-reanimated-68-jsc.aar +0 -0
  31. package/android/react-native-reanimated-69-hermes.aar +0 -0
  32. package/android/react-native-reanimated-69-jsc.aar +0 -0
  33. package/android/react-native-reanimated-70-hermes.aar +0 -0
  34. package/android/react-native-reanimated-70-jsc.aar +0 -0
  35. package/android/react-native-reanimated-71-hermes.aar +0 -0
  36. package/android/react-native-reanimated-71-jsc.aar +0 -0
  37. package/lib/Animated.js +0 -9
  38. package/lib/ConfigHelper.js +0 -145
  39. package/lib/ReanimatedEventEmitter.js +0 -3
  40. package/lib/ReanimatedModule.js +0 -2
  41. package/lib/ReanimatedModule.macos.js +0 -2
  42. package/lib/ReanimatedModule.native.js +0 -12
  43. package/lib/ReanimatedModule.windows.js +0 -2
  44. package/lib/ReanimatedModuleCompat.js +0 -66
  45. package/lib/__mocks__/ReanimatedEventEmitter.js +0 -8
  46. package/lib/__mocks__/ReanimatedModule.native.js +0 -11
  47. package/lib/createAnimatedComponent.js +0 -518
  48. package/lib/index.js +0 -14
  49. package/lib/index.web.js +0 -6
  50. package/lib/reanimated1/Easing.js +0 -231
  51. package/lib/reanimated1/SpringConfig.js +0 -79
  52. package/lib/reanimated1/Transitioning.js +0 -158
  53. package/lib/reanimated1/animations/Animation.js +0 -32
  54. package/lib/reanimated1/animations/SpringUtils.js +0 -199
  55. package/lib/reanimated1/animations/backwardCompatibleAnimWrapper.js +0 -117
  56. package/lib/reanimated1/animations/decay.js +0 -54
  57. package/lib/reanimated1/animations/spring.js +0 -198
  58. package/lib/reanimated1/animations/timing.js +0 -74
  59. package/lib/reanimated1/base.js +0 -13
  60. package/lib/reanimated1/core/AnimatedAlways.js +0 -33
  61. package/lib/reanimated1/core/AnimatedBezier.js +0 -150
  62. package/lib/reanimated1/core/AnimatedBlock.js +0 -52
  63. package/lib/reanimated1/core/AnimatedCall.js +0 -55
  64. package/lib/reanimated1/core/AnimatedCallFunc.js +0 -72
  65. package/lib/reanimated1/core/AnimatedClock.js +0 -90
  66. package/lib/reanimated1/core/AnimatedClockTest.js +0 -22
  67. package/lib/reanimated1/core/AnimatedCode.js +0 -32
  68. package/lib/reanimated1/core/AnimatedConcat.js +0 -32
  69. package/lib/reanimated1/core/AnimatedCond.js +0 -57
  70. package/lib/reanimated1/core/AnimatedDebug.js +0 -62
  71. package/lib/reanimated1/core/AnimatedEvent.js +0 -126
  72. package/lib/reanimated1/core/AnimatedFunction.js +0 -55
  73. package/lib/reanimated1/core/AnimatedNode.js +0 -223
  74. package/lib/reanimated1/core/AnimatedOperator.js +0 -103
  75. package/lib/reanimated1/core/AnimatedParam.js +0 -88
  76. package/lib/reanimated1/core/AnimatedProps.js +0 -108
  77. package/lib/reanimated1/core/AnimatedSet.js +0 -38
  78. package/lib/reanimated1/core/AnimatedStartClock.js +0 -30
  79. package/lib/reanimated1/core/AnimatedStopClock.js +0 -30
  80. package/lib/reanimated1/core/AnimatedStyle.js +0 -78
  81. package/lib/reanimated1/core/AnimatedTransform.js +0 -78
  82. package/lib/reanimated1/core/AnimatedValue.js +0 -38
  83. package/lib/reanimated1/core/Core.test.js +0 -30
  84. package/lib/reanimated1/core/InternalAnimatedValue.js +0 -87
  85. package/lib/reanimated1/core/__mocks__/AnimatedProps.js +0 -86
  86. package/lib/reanimated1/core/createEventObjectProxyPolyfill.js +0 -44
  87. package/lib/reanimated1/derived/__mocks__/evaluateOnce.js +0 -14
  88. package/lib/reanimated1/derived/acc.js +0 -11
  89. package/lib/reanimated1/derived/color.js +0 -47
  90. package/lib/reanimated1/derived/diff.js +0 -16
  91. package/lib/reanimated1/derived/diffClamp.js +0 -11
  92. package/lib/reanimated1/derived/evaluateOnce.js +0 -35
  93. package/lib/reanimated1/derived/index.js +0 -8
  94. package/lib/reanimated1/derived/interpolate.js +0 -152
  95. package/lib/reanimated1/derived/interpolateColors.js +0 -62
  96. package/lib/reanimated1/derived/onChange.js +0 -14
  97. package/lib/reanimated1/derived/useCode.js +0 -41
  98. package/lib/reanimated1/index.js +0 -53
  99. package/lib/reanimated1/operators.js +0 -35
  100. package/lib/reanimated1/useValue.js +0 -10
  101. package/lib/reanimated1/val.js +0 -3
  102. package/lib/reanimated2/Bezier.js +0 -126
  103. package/lib/reanimated2/Colors.js +0 -538
  104. package/lib/reanimated2/Easing.js +0 -248
  105. package/lib/reanimated2/NativeMethods.js +0 -94
  106. package/lib/reanimated2/NativeReanimated/NativeReanimated.js +0 -60
  107. package/lib/reanimated2/NativeReanimated/index.js +0 -11
  108. package/lib/reanimated2/PlatformChecker.js +0 -16
  109. package/lib/reanimated2/PropAdapters.js +0 -55
  110. package/lib/reanimated2/UpdateProps.js +0 -55
  111. package/lib/reanimated2/ViewDescriptorsSet.js +0 -75
  112. package/lib/reanimated2/WorkletEventHandler.js +0 -37
  113. package/lib/reanimated2/__mocks__/MutableValue.js +0 -13
  114. package/lib/reanimated2/__mocks__/NativeReanimated.js +0 -20
  115. package/lib/reanimated2/animation/commonTypes.js +0 -1
  116. package/lib/reanimated2/animation/decay.js +0 -71
  117. package/lib/reanimated2/animation/delay.js +0 -64
  118. package/lib/reanimated2/animation/index.js +0 -8
  119. package/lib/reanimated2/animation/repeat.js +0 -69
  120. package/lib/reanimated2/animation/sequence.js +0 -69
  121. package/lib/reanimated2/animation/spring.js +0 -103
  122. package/lib/reanimated2/animation/styleAnimation.js +0 -174
  123. package/lib/reanimated2/animation/timing.js +0 -64
  124. package/lib/reanimated2/animation/util.js +0 -183
  125. package/lib/reanimated2/commonTypes.js +0 -8
  126. package/lib/reanimated2/component/FlatList.js +0 -30
  127. package/lib/reanimated2/component/Image.js +0 -4
  128. package/lib/reanimated2/component/ScrollView.js +0 -4
  129. package/lib/reanimated2/component/Text.js +0 -4
  130. package/lib/reanimated2/component/View.js +0 -4
  131. package/lib/reanimated2/core.js +0 -269
  132. package/lib/reanimated2/frameCallback/FrameCallbackRegistryJS.js +0 -32
  133. package/lib/reanimated2/frameCallback/FrameCallbackRegistryUI.js +0 -76
  134. package/lib/reanimated2/globals.d.ts +0 -91
  135. package/lib/reanimated2/hook/Hooks.js +0 -9
  136. package/lib/reanimated2/hook/commonTypes.js +0 -1
  137. package/lib/reanimated2/hook/index.js +0 -12
  138. package/lib/reanimated2/hook/useAnimatedGestureHandler.js +0 -49
  139. package/lib/reanimated2/hook/useAnimatedKeyboard.js +0 -31
  140. package/lib/reanimated2/hook/useAnimatedReaction.js +0 -37
  141. package/lib/reanimated2/hook/useAnimatedRef.js +0 -25
  142. package/lib/reanimated2/hook/useAnimatedScrollHandler.js +0 -41
  143. package/lib/reanimated2/hook/useAnimatedSensor.js +0 -66
  144. package/lib/reanimated2/hook/useAnimatedStyle.js +0 -393
  145. package/lib/reanimated2/hook/useDerivedValue.js +0 -36
  146. package/lib/reanimated2/hook/useFrameCallback.js +0 -23
  147. package/lib/reanimated2/hook/useScrollViewOffset.js +0 -27
  148. package/lib/reanimated2/hook/useSharedValue.js +0 -17
  149. package/lib/reanimated2/hook/utils.js +0 -165
  150. package/lib/reanimated2/index.js +0 -12
  151. package/lib/reanimated2/interpolateColor.js +0 -157
  152. package/lib/reanimated2/interpolation.js +0 -127
  153. package/lib/reanimated2/jestUtils.js +0 -175
  154. package/lib/reanimated2/js-reanimated/JSReanimated.js +0 -106
  155. package/lib/reanimated2/js-reanimated/Mapper.js +0 -43
  156. package/lib/reanimated2/js-reanimated/MapperRegistry.js +0 -101
  157. package/lib/reanimated2/js-reanimated/MutableValue.js +0 -29
  158. package/lib/reanimated2/js-reanimated/commonTypes.js +0 -1
  159. package/lib/reanimated2/js-reanimated/global.js +0 -36
  160. package/lib/reanimated2/js-reanimated/index.js +0 -35
  161. package/lib/reanimated2/layoutReanimation/LayoutAnimationRepository.js +0 -67
  162. package/lib/reanimated2/layoutReanimation/animationBuilder/BaseAnimationBuilder.js +0 -69
  163. package/lib/reanimated2/layoutReanimation/animationBuilder/ComplexAnimationBuilder.js +0 -133
  164. package/lib/reanimated2/layoutReanimation/animationBuilder/Keyframe.js +0 -194
  165. package/lib/reanimated2/layoutReanimation/animationBuilder/commonTypes.js +0 -1
  166. package/lib/reanimated2/layoutReanimation/animationBuilder/index.js +0 -3
  167. package/lib/reanimated2/layoutReanimation/defaultAnimations/Bounce.js +0 -374
  168. package/lib/reanimated2/layoutReanimation/defaultAnimations/Default.js +0 -36
  169. package/lib/reanimated2/layoutReanimation/defaultAnimations/Fade.js +0 -275
  170. package/lib/reanimated2/layoutReanimation/defaultAnimations/Flip.js +0 -385
  171. package/lib/reanimated2/layoutReanimation/defaultAnimations/Lightspeed.js +0 -136
  172. package/lib/reanimated2/layoutReanimation/defaultAnimations/Pinwheel.js +0 -81
  173. package/lib/reanimated2/layoutReanimation/defaultAnimations/Roll.js +0 -120
  174. package/lib/reanimated2/layoutReanimation/defaultAnimations/Rotate.js +0 -273
  175. package/lib/reanimated2/layoutReanimation/defaultAnimations/Slide.js +0 -201
  176. package/lib/reanimated2/layoutReanimation/defaultAnimations/Stretch.js +0 -101
  177. package/lib/reanimated2/layoutReanimation/defaultAnimations/Zoom.js +0 -457
  178. package/lib/reanimated2/layoutReanimation/defaultAnimations/index.js +0 -10
  179. package/lib/reanimated2/layoutReanimation/defaultTransitions/CurvedTransition.js +0 -90
  180. package/lib/reanimated2/layoutReanimation/defaultTransitions/EntryExitTransition.js +0 -132
  181. package/lib/reanimated2/layoutReanimation/defaultTransitions/FadingTransition.js +0 -37
  182. package/lib/reanimated2/layoutReanimation/defaultTransitions/JumpingTransition.js +0 -41
  183. package/lib/reanimated2/layoutReanimation/defaultTransitions/LinearTransition.js +0 -34
  184. package/lib/reanimated2/layoutReanimation/defaultTransitions/SequencedTransition.js +0 -46
  185. package/lib/reanimated2/layoutReanimation/defaultTransitions/index.js +0 -6
  186. package/lib/reanimated2/layoutReanimation/index.js +0 -4
  187. package/lib/reanimated2/mock.js +0 -75
  188. package/lib/reanimated2/platform-specific/RNRenderer.js +0 -3
  189. package/lib/reanimated2/platform-specific/RNRenderer.web.js +0 -3
  190. package/lib/reanimated2/platform-specific/checkVersion.js +0 -28
  191. package/lib/reanimated2/platform-specific/checkVersion.web.js +0 -6
  192. package/lib/reanimated2/utils.js +0 -16
  193. package/lib/setAndForwardRef.js +0 -19
  194. package/lib/types/lib/Animated.d.ts +0 -8
  195. package/lib/types/lib/ConfigHelper.d.ts +0 -12
  196. package/lib/types/lib/ReanimatedEventEmitter.d.ts +0 -3
  197. package/lib/types/lib/ReanimatedModule.d.ts +0 -2
  198. package/lib/types/lib/ReanimatedModule.macos.d.ts +0 -2
  199. package/lib/types/lib/ReanimatedModule.native.d.ts +0 -2
  200. package/lib/types/lib/ReanimatedModule.windows.d.ts +0 -2
  201. package/lib/types/lib/ReanimatedModuleCompat.d.ts +0 -14
  202. package/lib/types/lib/createAnimatedComponent.d.ts +0 -33
  203. package/lib/types/lib/index.d.ts +0 -4
  204. package/lib/types/lib/index.web.d.ts +0 -4
  205. package/lib/types/lib/reanimated2/Bezier.d.ts +0 -6
  206. package/lib/types/lib/reanimated2/Colors.d.ts +0 -33
  207. package/lib/types/lib/reanimated2/Easing.d.ts +0 -172
  208. package/lib/types/lib/reanimated2/NativeMethods.d.ts +0 -7
  209. package/lib/types/lib/reanimated2/NativeReanimated/NativeReanimated.d.ts +0 -22
  210. package/lib/types/lib/reanimated2/NativeReanimated/index.d.ts +0 -3
  211. package/lib/types/lib/reanimated2/PlatformChecker.d.ts +0 -5
  212. package/lib/types/lib/reanimated2/PropAdapters.d.ts +0 -4
  213. package/lib/types/lib/reanimated2/UpdateProps.d.ts +0 -9
  214. package/lib/types/lib/reanimated2/ViewDescriptorsSet.d.ts +0 -20
  215. package/lib/types/lib/reanimated2/WorkletEventHandler.d.ts +0 -13
  216. package/lib/types/lib/reanimated2/__mocks__/MutableValue.d.ts +0 -5
  217. package/lib/types/lib/reanimated2/__mocks__/NativeReanimated.d.ts +0 -13
  218. package/lib/types/lib/reanimated2/animation/commonTypes.d.ts +0 -27
  219. package/lib/types/lib/reanimated2/animation/decay.d.ts +0 -19
  220. package/lib/types/lib/reanimated2/animation/delay.d.ts +0 -7
  221. package/lib/types/lib/reanimated2/animation/index.d.ts +0 -9
  222. package/lib/types/lib/reanimated2/animation/repeat.d.ts +0 -12
  223. package/lib/types/lib/reanimated2/animation/sequence.d.ts +0 -7
  224. package/lib/types/lib/reanimated2/animation/spring.d.ts +0 -22
  225. package/lib/types/lib/reanimated2/animation/styleAnimation.d.ts +0 -7
  226. package/lib/types/lib/reanimated2/animation/timing.d.ts +0 -21
  227. package/lib/types/lib/reanimated2/animation/util.d.ts +0 -9
  228. package/lib/types/lib/reanimated2/commonTypes.d.ts +0 -99
  229. package/lib/types/lib/reanimated2/component/FlatList.d.ts +0 -9
  230. package/lib/types/lib/reanimated2/component/Image.d.ts +0 -3
  231. package/lib/types/lib/reanimated2/component/ScrollView.d.ts +0 -3
  232. package/lib/types/lib/reanimated2/component/Text.d.ts +0 -3
  233. package/lib/types/lib/reanimated2/component/View.d.ts +0 -3
  234. package/lib/types/lib/reanimated2/core.d.ts +0 -24
  235. package/lib/types/lib/reanimated2/frameCallback/FrameCallbackRegistryJS.d.ts +0 -8
  236. package/lib/types/lib/reanimated2/frameCallback/FrameCallbackRegistryUI.d.ts +0 -20
  237. package/lib/types/lib/reanimated2/hook/Hooks.d.ts +0 -5
  238. package/lib/types/lib/reanimated2/hook/commonTypes.d.ts +0 -14
  239. package/lib/types/lib/reanimated2/hook/index.d.ts +0 -14
  240. package/lib/types/lib/reanimated2/hook/useAnimatedGestureHandler.d.ts +0 -35
  241. package/lib/types/lib/reanimated2/hook/useAnimatedKeyboard.d.ts +0 -2
  242. package/lib/types/lib/reanimated2/hook/useAnimatedReaction.d.ts +0 -12
  243. package/lib/types/lib/reanimated2/hook/useAnimatedRef.d.ts +0 -3
  244. package/lib/types/lib/reanimated2/hook/useAnimatedScrollHandler.d.ts +0 -20
  245. package/lib/types/lib/reanimated2/hook/useAnimatedSensor.d.ts +0 -18
  246. package/lib/types/lib/reanimated2/hook/useAnimatedStyle.d.ts +0 -11
  247. package/lib/types/lib/reanimated2/hook/useDerivedValue.d.ts +0 -4
  248. package/lib/types/lib/reanimated2/hook/useFrameCallback.d.ts +0 -7
  249. package/lib/types/lib/reanimated2/hook/useScrollViewOffset.d.ts +0 -4
  250. package/lib/types/lib/reanimated2/hook/useSharedValue.d.ts +0 -2
  251. package/lib/types/lib/reanimated2/hook/utils.d.ts +0 -28
  252. package/lib/types/lib/reanimated2/index.d.ts +0 -12
  253. package/lib/types/lib/reanimated2/interpolateColor.d.ts +0 -32
  254. package/lib/types/lib/reanimated2/interpolation.d.ts +0 -14
  255. package/lib/types/lib/reanimated2/jestUtils.d.ts +0 -12
  256. package/lib/types/lib/reanimated2/js-reanimated/JSReanimated.d.ts +0 -32
  257. package/lib/types/lib/reanimated2/js-reanimated/Mapper.d.ts +0 -14
  258. package/lib/types/lib/reanimated2/js-reanimated/MapperRegistry.d.ts +0 -14
  259. package/lib/types/lib/reanimated2/js-reanimated/MutableValue.d.ts +0 -14
  260. package/lib/types/lib/reanimated2/js-reanimated/commonTypes.d.ts +0 -44
  261. package/lib/types/lib/reanimated2/js-reanimated/global.d.ts +0 -2
  262. package/lib/types/lib/reanimated2/js-reanimated/index.d.ts +0 -15
  263. package/lib/types/lib/reanimated2/layoutReanimation/LayoutAnimationRepository.d.ts +0 -1
  264. package/lib/types/lib/reanimated2/layoutReanimation/animationBuilder/BaseAnimationBuilder.d.ts +0 -22
  265. package/lib/types/lib/reanimated2/layoutReanimation/animationBuilder/ComplexAnimationBuilder.d.ts +0 -38
  266. package/lib/types/lib/reanimated2/layoutReanimation/animationBuilder/Keyframe.d.ts +0 -25
  267. package/lib/types/lib/reanimated2/layoutReanimation/animationBuilder/commonTypes.d.ts +0 -81
  268. package/lib/types/lib/reanimated2/layoutReanimation/animationBuilder/index.d.ts +0 -4
  269. package/lib/types/lib/reanimated2/layoutReanimation/defaultAnimations/Bounce.d.ts +0 -62
  270. package/lib/types/lib/reanimated2/layoutReanimation/defaultAnimations/Default.d.ts +0 -4
  271. package/lib/types/lib/reanimated2/layoutReanimation/defaultAnimations/Fade.d.ts +0 -42
  272. package/lib/types/lib/reanimated2/layoutReanimation/defaultAnimations/Flip.d.ts +0 -50
  273. package/lib/types/lib/reanimated2/layoutReanimation/defaultAnimations/Lightspeed.d.ts +0 -18
  274. package/lib/types/lib/reanimated2/layoutReanimation/defaultAnimations/Pinwheel.d.ts +0 -10
  275. package/lib/types/lib/reanimated2/layoutReanimation/defaultAnimations/Roll.d.ts +0 -18
  276. package/lib/types/lib/reanimated2/layoutReanimation/defaultAnimations/Rotate.d.ts +0 -34
  277. package/lib/types/lib/reanimated2/layoutReanimation/defaultAnimations/Slide.d.ts +0 -34
  278. package/lib/types/lib/reanimated2/layoutReanimation/defaultAnimations/Stretch.d.ts +0 -18
  279. package/lib/types/lib/reanimated2/layoutReanimation/defaultAnimations/Zoom.d.ts +0 -66
  280. package/lib/types/lib/reanimated2/layoutReanimation/defaultAnimations/index.d.ts +0 -10
  281. package/lib/types/lib/reanimated2/layoutReanimation/defaultTransitions/CurvedTransition.d.ts +0 -19
  282. package/lib/types/lib/reanimated2/layoutReanimation/defaultTransitions/EntryExitTransition.d.ts +0 -13
  283. package/lib/types/lib/reanimated2/layoutReanimation/defaultTransitions/FadingTransition.d.ts +0 -6
  284. package/lib/types/lib/reanimated2/layoutReanimation/defaultTransitions/JumpingTransition.d.ts +0 -6
  285. package/lib/types/lib/reanimated2/layoutReanimation/defaultTransitions/LinearTransition.d.ts +0 -7
  286. package/lib/types/lib/reanimated2/layoutReanimation/defaultTransitions/SequencedTransition.d.ts +0 -9
  287. package/lib/types/lib/reanimated2/layoutReanimation/defaultTransitions/index.d.ts +0 -6
  288. package/lib/types/lib/reanimated2/layoutReanimation/index.d.ts +0 -4
  289. package/lib/types/lib/reanimated2/mock.d.ts +0 -61
  290. package/lib/types/lib/reanimated2/platform-specific/RNRenderer.d.ts +0 -1
  291. package/lib/types/lib/reanimated2/platform-specific/RNRenderer.web.d.ts +0 -0
  292. package/lib/types/lib/reanimated2/platform-specific/checkVersion.d.ts +0 -4
  293. package/lib/types/lib/reanimated2/platform-specific/checkVersion.web.d.ts +0 -5
  294. package/lib/types/lib/reanimated2/utils.d.ts +0 -11
  295. package/lib/types/lib/setAndForwardRef.d.ts +0 -40
@@ -1,71 +0,0 @@
1
- import { defineAnimation } from './util';
2
- import { Platform } from 'react-native';
3
- export function withDecay(userConfig, callback) {
4
- 'worklet';
5
- return defineAnimation(0, () => {
6
- 'worklet';
7
- var _a;
8
- const config = {
9
- deceleration: 0.998,
10
- velocityFactor: Platform.OS !== 'web' ? 1 : 1000,
11
- velocity: 0,
12
- };
13
- if (userConfig) {
14
- Object.keys(userConfig).forEach((key) => (config[key] = userConfig[key]));
15
- }
16
- const VELOCITY_EPS = Platform.OS !== 'web' ? 1 : 1 / 20;
17
- const SLOPE_FACTOR = 0.1;
18
- function decay(animation, now) {
19
- const { lastTimestamp, startTimestamp, initialVelocity, current, velocity, } = animation;
20
- const deltaTime = Math.min(now - lastTimestamp, 64);
21
- const v = velocity *
22
- Math.exp(-(1 - config.deceleration) * (now - startTimestamp) * SLOPE_FACTOR);
23
- animation.current =
24
- current + (v * config.velocityFactor * deltaTime) / 1000; // /1000 because time is in ms not in s
25
- animation.velocity = v;
26
- animation.lastTimestamp = now;
27
- if (config.clamp) {
28
- if (initialVelocity < 0 && animation.current <= config.clamp[0]) {
29
- animation.current = config.clamp[0];
30
- return true;
31
- }
32
- else if (initialVelocity > 0 &&
33
- animation.current >= config.clamp[1]) {
34
- animation.current = config.clamp[1];
35
- return true;
36
- }
37
- }
38
- return Math.abs(v) < VELOCITY_EPS;
39
- }
40
- function validateConfig() {
41
- if (config.clamp) {
42
- if (!Array.isArray(config.clamp)) {
43
- throw Error(`config.clamp must be an array but is ${typeof config.clamp}`);
44
- }
45
- if (config.clamp.length !== 2) {
46
- throw Error(`clamp array must contain 2 items but is given ${config.clamp.length}`);
47
- }
48
- }
49
- if (config.velocityFactor <= 0) {
50
- throw Error(`config.velocityFactor must be greather then 0 but is ${config.velocityFactor}`);
51
- }
52
- }
53
- function onStart(animation, value, now) {
54
- animation.current = value;
55
- animation.lastTimestamp = now;
56
- animation.startTimestamp = now;
57
- animation.initialVelocity = config.velocity;
58
- validateConfig();
59
- }
60
- return {
61
- onFrame: decay,
62
- onStart,
63
- callback,
64
- velocity: (_a = config.velocity) !== null && _a !== void 0 ? _a : 0,
65
- initialVelocity: 0,
66
- current: 0,
67
- lastTimestamp: 0,
68
- startTimestamp: 0,
69
- };
70
- });
71
- }
@@ -1,64 +0,0 @@
1
- import { defineAnimation } from './util';
2
- export function withDelay(delayMs, _nextAnimation) {
3
- 'worklet';
4
- return defineAnimation(_nextAnimation, () => {
5
- 'worklet';
6
- const nextAnimation = typeof _nextAnimation === 'function' ? _nextAnimation() : _nextAnimation;
7
- function delay(animation, now) {
8
- const { startTime, started, previousAnimation } = animation;
9
- if (now - startTime > delayMs) {
10
- if (!started) {
11
- nextAnimation.onStart(nextAnimation, animation.current, now, previousAnimation);
12
- animation.previousAnimation = null;
13
- animation.started = true;
14
- }
15
- const finished = nextAnimation.onFrame(nextAnimation, now);
16
- animation.current = nextAnimation.current;
17
- return finished;
18
- }
19
- else if (previousAnimation) {
20
- const finished = previousAnimation.finished ||
21
- previousAnimation.onFrame(previousAnimation, now);
22
- animation.current = previousAnimation.current;
23
- if (finished) {
24
- animation.previousAnimation = null;
25
- }
26
- }
27
- return false;
28
- }
29
- function onStart(animation, value, now, previousAnimation) {
30
- animation.startTime = now;
31
- animation.started = false;
32
- animation.current = value;
33
- if (previousAnimation === animation) {
34
- animation.previousAnimation = previousAnimation.previousAnimation;
35
- }
36
- else {
37
- animation.previousAnimation = previousAnimation;
38
- }
39
- }
40
- const callback = (finished) => {
41
- if (nextAnimation.callback) {
42
- nextAnimation.callback(finished);
43
- }
44
- };
45
- return {
46
- isHigherOrder: true,
47
- onFrame: delay,
48
- onStart,
49
- current: nextAnimation.current,
50
- callback,
51
- previousAnimation: null,
52
- startTime: 0,
53
- started: false,
54
- };
55
- });
56
- }
57
- /**
58
- * @deprecated Kept for backward compatibility. Will be removed soon.
59
- */
60
- export function delay(delayMs, _nextAnimation) {
61
- 'worklet';
62
- console.warn('Method `delay` is deprecated. Please use `withDelay` instead');
63
- return withDelay(delayMs, _nextAnimation);
64
- }
@@ -1,8 +0,0 @@
1
- export { cancelAnimation, defineAnimation, initialUpdaterRun } from './util';
2
- export { withTiming } from './timing';
3
- export { withSpring } from './spring';
4
- export { withDecay } from './decay';
5
- export { withDelay } from './delay';
6
- export { withRepeat } from './repeat';
7
- export { withSequence } from './sequence';
8
- export { withStyleAnimation } from './styleAnimation';
@@ -1,69 +0,0 @@
1
- import { defineAnimation } from './util';
2
- export function withRepeat(_nextAnimation, numberOfReps = 2, reverse = false, callback) {
3
- 'worklet';
4
- return defineAnimation(_nextAnimation, () => {
5
- 'worklet';
6
- const nextAnimation = typeof _nextAnimation === 'function' ? _nextAnimation() : _nextAnimation;
7
- function repeat(animation, now) {
8
- const finished = nextAnimation.onFrame(nextAnimation, now);
9
- animation.current = nextAnimation.current;
10
- if (finished) {
11
- animation.reps += 1;
12
- // call inner animation's callback on every repetition
13
- // as the second argument the animation's current value is passed
14
- if (nextAnimation.callback) {
15
- nextAnimation.callback(true /* finished */, animation.current);
16
- }
17
- if (numberOfReps > 0 && animation.reps >= numberOfReps) {
18
- return true;
19
- }
20
- const startValue = reverse
21
- ? nextAnimation.current
22
- : animation.startValue;
23
- if (reverse) {
24
- nextAnimation.toValue = animation.startValue;
25
- animation.startValue = startValue;
26
- }
27
- nextAnimation.onStart(nextAnimation, startValue, now, nextAnimation.previousAnimation);
28
- return false;
29
- }
30
- return false;
31
- }
32
- const repCallback = (finished) => {
33
- if (callback) {
34
- callback(finished);
35
- }
36
- // when cancelled call inner animation's callback
37
- if (!finished && nextAnimation.callback) {
38
- nextAnimation.callback(false /* finished */);
39
- }
40
- };
41
- function onStart(animation, value, now, previousAnimation) {
42
- animation.startValue = value;
43
- animation.reps = 0;
44
- nextAnimation.onStart(nextAnimation, value, now, previousAnimation);
45
- }
46
- return {
47
- isHigherOrder: true,
48
- onFrame: repeat,
49
- onStart,
50
- reps: 0,
51
- current: nextAnimation.current,
52
- callback: repCallback,
53
- startValue: 0,
54
- };
55
- });
56
- }
57
- /**
58
- * @deprecated Kept for backward compatibility. Will be removed soon.
59
- */
60
- export function repeat(_nextAnimation, numberOfReps = 2, reverse = false, callback) {
61
- 'worklet';
62
- console.warn('Method `repeat` is deprecated. Please use `withRepeat` instead');
63
- return withRepeat(_nextAnimation, numberOfReps, reverse, callback);
64
- }
65
- export function loop(nextAnimation, numberOfLoops = 1) {
66
- 'worklet';
67
- console.warn('Method `loop` is deprecated. Please use `withRepeat` instead');
68
- return repeat(nextAnimation, Math.round(numberOfLoops * 2), true);
69
- }
@@ -1,69 +0,0 @@
1
- import { defineAnimation } from './util';
2
- export function withSequence(..._animations) {
3
- 'worklet';
4
- return defineAnimation(_animations[0], () => {
5
- 'worklet';
6
- const animations = _animations.map((a) => {
7
- const result = typeof a === 'function' ? a() : a;
8
- result.finished = false;
9
- return result;
10
- });
11
- const firstAnimation = animations[0];
12
- const callback = (finished) => {
13
- if (finished) {
14
- // we want to call the callback after every single animation
15
- // not after all of them
16
- return;
17
- }
18
- // this is going to be called only if sequence has been cancelled
19
- animations.forEach((animation) => {
20
- if (typeof animation.callback === 'function' && !animation.finished) {
21
- animation.callback(finished);
22
- }
23
- });
24
- };
25
- function sequence(animation, now) {
26
- const currentAnim = animations[animation.animationIndex];
27
- const finished = currentAnim.onFrame(currentAnim, now);
28
- animation.current = currentAnim.current;
29
- if (finished) {
30
- // we want to call the callback after every single animation
31
- if (currentAnim.callback) {
32
- currentAnim.callback(true /* finished */);
33
- }
34
- currentAnim.finished = true;
35
- animation.animationIndex += 1;
36
- if (animation.animationIndex < animations.length) {
37
- const nextAnim = animations[animation.animationIndex];
38
- nextAnim.onStart(nextAnim, currentAnim.current, now, currentAnim);
39
- return false;
40
- }
41
- return true;
42
- }
43
- return false;
44
- }
45
- function onStart(animation, value, now, previousAnimation) {
46
- animation.animationIndex = 0;
47
- if (previousAnimation === undefined) {
48
- previousAnimation = animations[animations.length - 1];
49
- }
50
- firstAnimation.onStart(firstAnimation, value, now, previousAnimation);
51
- }
52
- return {
53
- isHigherOrder: true,
54
- onFrame: sequence,
55
- onStart,
56
- animationIndex: 0,
57
- current: firstAnimation.current,
58
- callback,
59
- };
60
- });
61
- }
62
- /**
63
- * @deprecated Kept for backward compatibility. Will be removed soon.
64
- */
65
- export function sequence(..._animations) {
66
- 'worklet';
67
- console.warn('Method `sequence` is deprecated. Please use `withSequence` instead');
68
- return withSequence(..._animations);
69
- }
@@ -1,103 +0,0 @@
1
- import { defineAnimation } from './util';
2
- export function withSpring(toValue, userConfig, callback) {
3
- 'worklet';
4
- return defineAnimation(toValue, () => {
5
- 'worklet';
6
- // TODO: figure out why we can't use spread or Object.assign here
7
- // when user config is "frozen object" we can't enumerate it (perhaps
8
- // something is wrong with the object prototype).
9
- const config = {
10
- damping: 10,
11
- mass: 1,
12
- stiffness: 100,
13
- overshootClamping: false,
14
- restDisplacementThreshold: 0.01,
15
- restSpeedThreshold: 2,
16
- velocity: 0,
17
- };
18
- if (userConfig) {
19
- Object.keys(userConfig).forEach((key) => (config[key] = userConfig[key]));
20
- }
21
- function spring(animation, now) {
22
- const { toValue, lastTimestamp, current, velocity } = animation;
23
- const deltaTime = Math.min(now - lastTimestamp, 64);
24
- animation.lastTimestamp = now;
25
- const c = config.damping;
26
- const m = config.mass;
27
- const k = config.stiffness;
28
- const v0 = -velocity;
29
- const x0 = toValue - current;
30
- const zeta = c / (2 * Math.sqrt(k * m)); // damping ratio
31
- const omega0 = Math.sqrt(k / m); // undamped angular frequency of the oscillator (rad/ms)
32
- const omega1 = omega0 * Math.sqrt(1 - Math.pow(zeta, 2)); // exponential decay
33
- const t = deltaTime / 1000;
34
- const sin1 = Math.sin(omega1 * t);
35
- const cos1 = Math.cos(omega1 * t);
36
- // under damped
37
- const underDampedEnvelope = Math.exp(-zeta * omega0 * t);
38
- const underDampedFrag1 = underDampedEnvelope *
39
- (sin1 * ((v0 + zeta * omega0 * x0) / omega1) + x0 * cos1);
40
- const underDampedPosition = toValue - underDampedFrag1;
41
- // This looks crazy -- it's actually just the derivative of the oscillation function
42
- const underDampedVelocity = zeta * omega0 * underDampedFrag1 -
43
- underDampedEnvelope *
44
- (cos1 * (v0 + zeta * omega0 * x0) - omega1 * x0 * sin1);
45
- // critically damped
46
- const criticallyDampedEnvelope = Math.exp(-omega0 * t);
47
- const criticallyDampedPosition = toValue - criticallyDampedEnvelope * (x0 + (v0 + omega0 * x0) * t);
48
- const criticallyDampedVelocity = criticallyDampedEnvelope *
49
- (v0 * (t * omega0 - 1) + t * x0 * omega0 * omega0);
50
- const isOvershooting = () => {
51
- if (config.overshootClamping && config.stiffness !== 0) {
52
- return current < toValue
53
- ? animation.current > toValue
54
- : animation.current < toValue;
55
- }
56
- else {
57
- return false;
58
- }
59
- };
60
- const isVelocity = Math.abs(velocity) < config.restSpeedThreshold;
61
- const isDisplacement = config.stiffness === 0 ||
62
- Math.abs(toValue - current) < config.restDisplacementThreshold;
63
- if (zeta < 1) {
64
- animation.current = underDampedPosition;
65
- animation.velocity = underDampedVelocity;
66
- }
67
- else {
68
- animation.current = criticallyDampedPosition;
69
- animation.velocity = criticallyDampedVelocity;
70
- }
71
- if (isOvershooting() || (isVelocity && isDisplacement)) {
72
- if (config.stiffness !== 0) {
73
- animation.velocity = 0;
74
- animation.current = toValue;
75
- }
76
- // clear lastTimestamp to avoid using stale value by the next spring animation that starts after this one
77
- animation.lastTimestamp = 0;
78
- return true;
79
- }
80
- return false;
81
- }
82
- function onStart(animation, value, now, previousAnimation) {
83
- animation.current = value;
84
- if (previousAnimation) {
85
- animation.velocity =
86
- previousAnimation.velocity || animation.velocity || 0;
87
- animation.lastTimestamp = previousAnimation.lastTimestamp || now;
88
- }
89
- else {
90
- animation.lastTimestamp = now;
91
- }
92
- }
93
- return {
94
- onFrame: spring,
95
- onStart,
96
- toValue,
97
- velocity: config.velocity || 0,
98
- current: toValue,
99
- callback,
100
- lastTimestamp: 0,
101
- };
102
- });
103
- }
@@ -1,174 +0,0 @@
1
- import { defineAnimation } from './util';
2
- import { withTiming } from './timing';
3
- import { ColorProperties } from '../UpdateProps';
4
- import { processColor } from '../Colors';
5
- // resolves path to value for nested objects
6
- // if path cannot be resolved returns undefined
7
- export function resolvePath(obj, path) {
8
- 'worklet';
9
- const keys = Array.isArray(path) ? path : [path];
10
- return keys.reduce((acc, current) => {
11
- if (Array.isArray(acc) && typeof current === 'number') {
12
- return acc[current];
13
- }
14
- else if (typeof acc === 'object' && current in acc) {
15
- return acc[current];
16
- }
17
- return undefined;
18
- }, obj);
19
- }
20
- export function setPath(obj, path, value) {
21
- 'worklet';
22
- const keys = Array.isArray(path) ? path : [path];
23
- let currObj = obj;
24
- for (let i = 0; i < keys.length - 1; i++) {
25
- // creates entry if there isn't one
26
- currObj = currObj;
27
- if (!(keys[i] in currObj)) {
28
- // if next key is a number create an array
29
- if (typeof keys[i + 1] === 'number') {
30
- currObj[keys[i]] = [];
31
- }
32
- else {
33
- currObj[keys[i]] = {};
34
- }
35
- }
36
- currObj = currObj[keys[i]];
37
- }
38
- currObj[keys[keys.length - 1]] =
39
- value;
40
- }
41
- export function withStyleAnimation(styleAnimations) {
42
- 'worklet';
43
- return defineAnimation({}, () => {
44
- 'worklet';
45
- const onFrame = (animation, now) => {
46
- let stillGoing = false;
47
- const entriesToCheck = [
48
- { value: animation.styleAnimations, path: [] },
49
- ];
50
- while (entriesToCheck.length > 0) {
51
- const currentEntry = entriesToCheck.pop();
52
- if (Array.isArray(currentEntry.value)) {
53
- for (let index = 0; index < currentEntry.value.length; index++) {
54
- entriesToCheck.push({
55
- value: currentEntry.value[index],
56
- path: currentEntry.path.concat(index),
57
- });
58
- }
59
- }
60
- else if (typeof currentEntry.value === 'object' &&
61
- currentEntry.value.onFrame === undefined) {
62
- // nested object
63
- for (const key of Object.keys(currentEntry.value)) {
64
- entriesToCheck.push({
65
- value: currentEntry.value[key],
66
- path: currentEntry.path.concat(key),
67
- });
68
- }
69
- }
70
- else {
71
- const currentStyleAnimation = currentEntry.value;
72
- if (currentStyleAnimation.finished) {
73
- continue;
74
- }
75
- const finished = currentStyleAnimation.onFrame(currentStyleAnimation, now);
76
- if (finished) {
77
- currentStyleAnimation.finished = true;
78
- if (currentStyleAnimation.callback) {
79
- currentStyleAnimation.callback(true);
80
- }
81
- }
82
- else {
83
- stillGoing = true;
84
- }
85
- if (ColorProperties.includes(currentEntry.path[0])) {
86
- currentStyleAnimation.current = processColor(currentStyleAnimation.current);
87
- }
88
- setPath(animation.current, currentEntry.path, currentStyleAnimation.current);
89
- }
90
- }
91
- return !stillGoing;
92
- };
93
- const onStart = (animation, value, now, previousAnimation) => {
94
- const entriesToCheck = [{ value: styleAnimations, path: [] }];
95
- while (entriesToCheck.length > 0) {
96
- const currentEntry = entriesToCheck.pop();
97
- if (Array.isArray(currentEntry.value)) {
98
- for (let index = 0; index < currentEntry.value.length; index++) {
99
- entriesToCheck.push({
100
- value: currentEntry.value[index],
101
- path: currentEntry.path.concat(index),
102
- });
103
- }
104
- }
105
- else if (typeof currentEntry.value === 'object' &&
106
- currentEntry.value.onStart === undefined) {
107
- for (const key of Object.keys(currentEntry.value)) {
108
- entriesToCheck.push({
109
- value: currentEntry.value[key],
110
- path: currentEntry.path.concat(key),
111
- });
112
- }
113
- }
114
- else {
115
- const prevAnimation = resolvePath(previousAnimation === null || previousAnimation === void 0 ? void 0 : previousAnimation.styleAnimations, currentEntry.path);
116
- let prevVal = resolvePath(value, currentEntry.path);
117
- if (prevAnimation && !prevVal) {
118
- prevVal = prevAnimation.current;
119
- }
120
- if (prevVal === undefined) {
121
- console.warn(`Initial values for animation are missing for property ${currentEntry.path.join('.')}`);
122
- }
123
- setPath(animation.current, currentEntry.path, prevVal);
124
- let currentAnimation;
125
- if (typeof currentEntry.value !== 'object' ||
126
- !currentEntry.value.onStart) {
127
- currentAnimation = withTiming(currentEntry.value, { duration: 0 });
128
- setPath(animation.styleAnimations, currentEntry.path, currentAnimation);
129
- }
130
- else {
131
- currentAnimation = currentEntry.value;
132
- }
133
- currentAnimation.onStart(currentAnimation, prevVal, now, prevAnimation);
134
- }
135
- }
136
- };
137
- const callback = (finished) => {
138
- if (!finished) {
139
- const animationsToCheck = [
140
- styleAnimations,
141
- ];
142
- while (animationsToCheck.length > 0) {
143
- const currentAnimation = animationsToCheck.pop();
144
- if (Array.isArray(currentAnimation)) {
145
- for (const element of currentAnimation) {
146
- animationsToCheck.push(element);
147
- }
148
- }
149
- else if (typeof currentAnimation === 'object' &&
150
- currentAnimation.onStart === undefined) {
151
- for (const value of Object.values(currentAnimation)) {
152
- animationsToCheck.push(value);
153
- }
154
- }
155
- else {
156
- const currentStyleAnimation = currentAnimation;
157
- if (!currentStyleAnimation.finished &&
158
- currentStyleAnimation.callback) {
159
- currentStyleAnimation.callback(false);
160
- }
161
- }
162
- }
163
- }
164
- };
165
- return {
166
- isHigherOrder: true,
167
- onFrame,
168
- onStart,
169
- current: {},
170
- styleAnimations,
171
- callback,
172
- };
173
- });
174
- }
@@ -1,64 +0,0 @@
1
- import { Easing } from '../Easing';
2
- import { defineAnimation } from './util';
3
- export function withTiming(toValue, userConfig, callback) {
4
- 'worklet';
5
- return defineAnimation(toValue, () => {
6
- 'worklet';
7
- const config = {
8
- duration: 300,
9
- easing: Easing.inOut(Easing.quad),
10
- };
11
- if (userConfig) {
12
- Object.keys(userConfig).forEach((key) => (config[key] = userConfig[key]));
13
- }
14
- function timing(animation, now) {
15
- const { toValue, startTime, startValue } = animation;
16
- const runtime = now - startTime;
17
- if (runtime >= config.duration) {
18
- // reset startTime to avoid reusing finished animation config in `start` method
19
- animation.startTime = 0;
20
- animation.current = toValue;
21
- return true;
22
- }
23
- const progress = animation.easing(runtime / config.duration);
24
- animation.current =
25
- startValue + (toValue - startValue) * progress;
26
- return false;
27
- }
28
- function onStart(animation, value, now, previousAnimation) {
29
- if (previousAnimation &&
30
- previousAnimation.type === 'timing' &&
31
- previousAnimation.toValue === toValue &&
32
- previousAnimation.startTime) {
33
- // to maintain continuity of timing animations we check if we are starting
34
- // new timing over the old one with the same parameters. If so, we want
35
- // to copy animation timeline properties
36
- animation.startTime = previousAnimation.startTime;
37
- animation.startValue = previousAnimation.startValue;
38
- }
39
- else {
40
- animation.startTime = now;
41
- animation.startValue = value;
42
- }
43
- animation.current = value;
44
- if (typeof config.easing === 'object') {
45
- animation.easing = config.easing.factory();
46
- }
47
- else {
48
- animation.easing = config.easing;
49
- }
50
- }
51
- return {
52
- type: 'timing',
53
- onFrame: timing,
54
- onStart: onStart,
55
- progress: 0,
56
- toValue,
57
- startValue: 0,
58
- startTime: 0,
59
- easing: () => 0,
60
- current: toValue,
61
- callback,
62
- };
63
- });
64
- }