react-native-reanimated 2.3.0-alpha.1 → 2.3.0-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (328) hide show
  1. package/Common/cpp/LayoutAnimations/LayoutAnimationsProxy.cpp +15 -8
  2. package/Common/cpp/NativeModules/NativeReanimatedModule.cpp +170 -166
  3. package/Common/cpp/NativeModules/NativeReanimatedModuleSpec.cpp +36 -34
  4. package/Common/cpp/Registries/EventHandlerRegistry.cpp +13 -6
  5. package/Common/cpp/Registries/MapperRegistry.cpp +19 -15
  6. package/Common/cpp/Registries/WorkletsCache.cpp +19 -9
  7. package/Common/cpp/SharedItems/FrozenObject.cpp +19 -8
  8. package/Common/cpp/SharedItems/MutableValue.cpp +38 -25
  9. package/Common/cpp/SharedItems/MutableValueSetterProxy.cpp +11 -7
  10. package/Common/cpp/SharedItems/RemoteObject.cpp +9 -5
  11. package/Common/cpp/SharedItems/ShareableValue.cpp +216 -143
  12. package/Common/cpp/Tools/JSIStoreValueUser.cpp +36 -24
  13. package/Common/cpp/Tools/Mapper.cpp +41 -29
  14. package/Common/cpp/Tools/RuntimeDecorator.cpp +103 -84
  15. package/Common/cpp/Tools/Scheduler.cpp +14 -6
  16. package/Common/cpp/Tools/WorkletEventHandler.cpp +1 -1
  17. package/Common/cpp/headers/LayoutAnimations/LayoutAnimationsProxy.h +12 -11
  18. package/Common/cpp/headers/NativeModules/NativeReanimatedModule.h +45 -34
  19. package/Common/cpp/headers/NativeModules/NativeReanimatedModuleSpec.h +28 -16
  20. package/Common/cpp/headers/Registries/EventHandlerRegistry.h +14 -8
  21. package/Common/cpp/headers/Registries/MapperRegistry.h +4 -4
  22. package/Common/cpp/headers/Registries/WorkletsCache.h +9 -7
  23. package/Common/cpp/headers/SharedItems/FrozenObject.h +15 -11
  24. package/Common/cpp/headers/SharedItems/HostFunctionHandler.h +6 -4
  25. package/Common/cpp/headers/SharedItems/MutableValue.h +21 -12
  26. package/Common/cpp/headers/SharedItems/MutableValueSetterProxy.h +10 -7
  27. package/Common/cpp/headers/SharedItems/RemoteObject.h +16 -8
  28. package/Common/cpp/headers/SharedItems/RuntimeManager.h +39 -21
  29. package/Common/cpp/headers/SharedItems/ShareableValue.h +31 -27
  30. package/Common/cpp/headers/SharedItems/SharedParent.h +7 -4
  31. package/Common/cpp/headers/SharedItems/ValueWrapper.h +80 -61
  32. package/Common/cpp/headers/SpecTools/ErrorHandler.h +17 -19
  33. package/Common/cpp/headers/Tools/JSIStoreValueUser.h +18 -13
  34. package/Common/cpp/headers/Tools/Mapper.h +24 -18
  35. package/Common/cpp/headers/Tools/PlatformDepMethodsHolder.h +12 -7
  36. package/Common/cpp/headers/Tools/ReanimatedHiddenHeaders.h +7 -7
  37. package/Common/cpp/headers/Tools/RuntimeDecorator.h +29 -23
  38. package/Common/cpp/headers/Tools/Scheduler.h +28 -33
  39. package/Common/cpp/headers/Tools/WorkletEventHandler.h +9 -7
  40. package/Common/cpp/hidden_headers/Logger.h +14 -14
  41. package/Common/cpp/hidden_headers/LoggerInterface.h +8 -9
  42. package/Common/cpp/hidden_headers/SpeedChecker.h +7 -8
  43. package/README.md +1 -1
  44. package/RNReanimated.podspec +4 -4
  45. package/android/build.gradle +80 -3
  46. package/android/react-native-reanimated-63-hermes.aar +0 -0
  47. package/android/react-native-reanimated-63-jsc.aar +0 -0
  48. package/android/react-native-reanimated-64-hermes.aar +0 -0
  49. package/android/react-native-reanimated-64-jsc.aar +0 -0
  50. package/android/react-native-reanimated-65-hermes.aar +0 -0
  51. package/android/react-native-reanimated-65-jsc.aar +0 -0
  52. package/android/react-native-reanimated-66-hermes.aar +0 -0
  53. package/android/react-native-reanimated-66-jsc.aar +0 -0
  54. package/ios/LayoutReanimation/REAAnimationsManager.h +19 -10
  55. package/ios/LayoutReanimation/REAAnimationsManager.m +195 -200
  56. package/ios/LayoutReanimation/REASnapshot.h +13 -0
  57. package/ios/LayoutReanimation/REASnapshot.m +29 -0
  58. package/ios/LayoutReanimation/REAUIManager.h +16 -0
  59. package/ios/LayoutReanimation/REAUIManager.mm +348 -0
  60. package/ios/Nodes/REAAlwaysNode.m +14 -15
  61. package/ios/Nodes/REABezierNode.m +8 -7
  62. package/ios/Nodes/REABlockNode.m +1 -1
  63. package/ios/Nodes/REACallFuncNode.h +0 -1
  64. package/ios/Nodes/REACallFuncNode.m +10 -8
  65. package/ios/Nodes/REAClockNodes.m +22 -20
  66. package/ios/Nodes/REAConcatNode.h +0 -1
  67. package/ios/Nodes/REAConcatNode.m +2 -2
  68. package/ios/Nodes/REACondNode.m +7 -5
  69. package/ios/Nodes/READebugNode.m +5 -4
  70. package/ios/Nodes/REAEventNode.m +1 -1
  71. package/ios/Nodes/REAFunctionNode.h +0 -1
  72. package/ios/Nodes/REAFunctionNode.m +2 -2
  73. package/ios/Nodes/REAJSCallNode.m +4 -5
  74. package/ios/Nodes/REANode.h +3 -4
  75. package/ios/Nodes/REANode.m +9 -11
  76. package/ios/Nodes/REAOperatorNode.m +68 -67
  77. package/ios/Nodes/REAParamNode.h +1 -3
  78. package/ios/Nodes/REAParamNode.m +15 -17
  79. package/ios/Nodes/REAPropsNode.h +1 -3
  80. package/ios/Nodes/REAPropsNode.m +19 -22
  81. package/ios/Nodes/REASetNode.h +0 -1
  82. package/ios/Nodes/REASetNode.m +7 -5
  83. package/ios/Nodes/REAStyleNode.h +0 -1
  84. package/ios/Nodes/REAStyleNode.m +2 -4
  85. package/ios/Nodes/REATransformNode.h +0 -1
  86. package/ios/Nodes/REATransformNode.m +3 -5
  87. package/ios/Nodes/REAValueNode.m +5 -7
  88. package/ios/REAEventDispatcher.m +3 -3
  89. package/ios/REAModule.h +0 -2
  90. package/ios/REAModule.m +29 -40
  91. package/ios/REANodesManager.h +11 -19
  92. package/ios/REANodesManager.m +105 -130
  93. package/ios/REAUtils.h +5 -3
  94. package/ios/Transitioning/RCTConvert+REATransition.m +45 -29
  95. package/ios/Transitioning/REAAllTransitions.h +2 -2
  96. package/ios/Transitioning/REAAllTransitions.m +14 -25
  97. package/ios/Transitioning/REATransition.h +8 -7
  98. package/ios/Transitioning/REATransition.m +19 -16
  99. package/ios/Transitioning/REATransitionAnimation.h +1 -1
  100. package/ios/Transitioning/REATransitionAnimation.m +2 -3
  101. package/ios/Transitioning/REATransitionManager.m +3 -3
  102. package/ios/native/NativeMethods.h +15 -5
  103. package/ios/native/NativeProxy.h +4 -3
  104. package/ios/native/NativeProxy.mm +19 -5
  105. package/ios/native/REAIOSErrorHandler.h +13 -10
  106. package/ios/native/REAIOSLogger.h +8 -8
  107. package/ios/native/REAIOSScheduler.h +5 -5
  108. package/ios/native/REAIOSScheduler.mm +7 -5
  109. package/ios/native/REAInitializer.h +37 -0
  110. package/ios/native/REAInitializer.mm +63 -0
  111. package/ios/native/UIResponder+Reanimated.mm +9 -48
  112. package/lib/ConfigHelper.js +1 -0
  113. package/lib/ReanimatedModule.native.js +10 -2
  114. package/lib/createAnimatedComponent.js +64 -30
  115. package/lib/reanimated1/core/AnimatedAlways.js +1 -1
  116. package/lib/reanimated1/core/AnimatedBezier.js +1 -1
  117. package/lib/reanimated1/core/AnimatedBlock.js +1 -1
  118. package/lib/reanimated1/core/AnimatedCall.js +1 -1
  119. package/lib/reanimated1/core/AnimatedCallFunc.js +1 -1
  120. package/lib/reanimated1/core/AnimatedConcat.js +1 -1
  121. package/lib/reanimated1/core/AnimatedCond.js +1 -1
  122. package/lib/reanimated1/core/AnimatedDebug.js +1 -1
  123. package/lib/reanimated1/core/AnimatedEvent.js +1 -1
  124. package/lib/reanimated1/core/AnimatedFunction.js +1 -1
  125. package/lib/reanimated1/core/AnimatedOperator.js +1 -1
  126. package/lib/reanimated1/core/AnimatedParam.js +1 -1
  127. package/lib/reanimated1/core/AnimatedProps.js +2 -2
  128. package/lib/reanimated1/core/AnimatedSet.js +1 -1
  129. package/lib/reanimated1/core/AnimatedStartClock.js +1 -1
  130. package/lib/reanimated1/core/AnimatedStopClock.js +1 -1
  131. package/lib/reanimated1/core/AnimatedStyle.js +1 -1
  132. package/lib/reanimated1/core/AnimatedTransform.js +1 -1
  133. package/lib/reanimated1/core/Core.test.js +30 -0
  134. package/lib/reanimated1/core/InternalAnimatedValue.js +1 -1
  135. package/lib/reanimated1/core/__mocks__/AnimatedProps.js +1 -1
  136. package/lib/reanimated1/derived/interpolate.js +1 -1
  137. package/lib/reanimated2/Colors.js +16 -12
  138. package/lib/reanimated2/NativeMethods.js +3 -14
  139. package/lib/reanimated2/{NativeReanimated.native.js → NativeReanimated/NativeReanimated.js} +19 -24
  140. package/lib/reanimated2/NativeReanimated/index.js +15 -0
  141. package/lib/reanimated2/PlatformChecker.js +16 -0
  142. package/lib/reanimated2/PropAdapters.js +14 -4
  143. package/lib/reanimated2/UpdateProps.js +14 -11
  144. package/lib/reanimated2/ViewDescriptorsSet.js +73 -0
  145. package/lib/reanimated2/WorkletEventHandler.js +15 -13
  146. package/lib/reanimated2/animation/commonTypes.js +1 -0
  147. package/lib/reanimated2/animation/decay.js +71 -0
  148. package/lib/reanimated2/animation/delay.js +64 -0
  149. package/lib/reanimated2/animation/index.js +8 -0
  150. package/lib/reanimated2/animation/repeat.js +69 -0
  151. package/lib/reanimated2/animation/sequence.js +72 -0
  152. package/lib/reanimated2/animation/spring.js +101 -0
  153. package/lib/reanimated2/animation/styleAnimation.js +166 -0
  154. package/lib/reanimated2/animation/timing.js +64 -0
  155. package/lib/reanimated2/animation/util.js +157 -0
  156. package/lib/reanimated2/commonTypes.js +1 -0
  157. package/lib/reanimated2/core.js +35 -39
  158. package/lib/reanimated2/globals.d.ts +47 -1
  159. package/lib/reanimated2/hook/Hooks.js +9 -0
  160. package/lib/reanimated2/hook/commonTypes.js +1 -0
  161. package/lib/reanimated2/hook/index.js +8 -0
  162. package/lib/reanimated2/hook/useAnimatedGestureHandler.js +50 -0
  163. package/lib/reanimated2/hook/useAnimatedReaction.js +37 -0
  164. package/lib/reanimated2/hook/useAnimatedRef.js +25 -0
  165. package/lib/reanimated2/hook/useAnimatedScrollHandler.js +41 -0
  166. package/lib/reanimated2/hook/useAnimatedStyle.js +376 -0
  167. package/lib/reanimated2/hook/useDerivedValue.js +36 -0
  168. package/lib/reanimated2/hook/useSharedValue.js +17 -0
  169. package/lib/reanimated2/hook/utils.js +175 -0
  170. package/lib/reanimated2/index.js +3 -2
  171. package/lib/reanimated2/interpolation.js +95 -86
  172. package/lib/reanimated2/jestUtils.js +0 -12
  173. package/lib/reanimated2/js-reanimated/JSReanimated.js +9 -10
  174. package/lib/reanimated2/js-reanimated/index.js +57 -1
  175. package/lib/reanimated2/layoutReanimation/LayoutAnimationRepository.js +58 -0
  176. package/lib/reanimated2/layoutReanimation/animationBuilder/BaseAnimationBuilder.js +69 -0
  177. package/lib/reanimated2/layoutReanimation/animationBuilder/ComplexAnimationBuilder.js +125 -0
  178. package/lib/reanimated2/layoutReanimation/animationBuilder/Keyframe.js +193 -0
  179. package/lib/reanimated2/layoutReanimation/animationBuilder/commonTypes.js +1 -0
  180. package/lib/reanimated2/layoutReanimation/animationBuilder/index.js +3 -0
  181. package/lib/reanimated2/layoutReanimation/defaultAnimations/Bounce.js +325 -207
  182. package/lib/reanimated2/layoutReanimation/defaultAnimations/Default.js +36 -0
  183. package/lib/reanimated2/layoutReanimation/defaultAnimations/Fade.js +235 -187
  184. package/lib/reanimated2/layoutReanimation/defaultAnimations/Flip.js +327 -269
  185. package/lib/reanimated2/layoutReanimation/defaultAnimations/Lightspeed.js +146 -0
  186. package/lib/reanimated2/layoutReanimation/defaultAnimations/Pinwheel.js +85 -0
  187. package/lib/reanimated2/layoutReanimation/defaultAnimations/Roll.js +119 -0
  188. package/lib/reanimated2/layoutReanimation/defaultAnimations/Rotate.js +289 -0
  189. package/lib/reanimated2/layoutReanimation/defaultAnimations/Slide.js +159 -121
  190. package/lib/reanimated2/layoutReanimation/defaultAnimations/Stretch.js +83 -65
  191. package/lib/reanimated2/layoutReanimation/defaultAnimations/Zoom.js +371 -277
  192. package/lib/reanimated2/layoutReanimation/defaultAnimations/index.js +4 -0
  193. package/lib/reanimated2/layoutReanimation/defaultTransitions/CurvedTransition.js +78 -0
  194. package/lib/reanimated2/layoutReanimation/defaultTransitions/EntryExitTransition.js +128 -0
  195. package/lib/reanimated2/layoutReanimation/defaultTransitions/FadingTransition.js +37 -0
  196. package/lib/reanimated2/layoutReanimation/defaultTransitions/JumpingTransition.js +41 -0
  197. package/lib/reanimated2/layoutReanimation/defaultTransitions/LinearTransition.js +34 -0
  198. package/lib/reanimated2/layoutReanimation/defaultTransitions/SequencedTransition.js +46 -0
  199. package/lib/reanimated2/layoutReanimation/defaultTransitions/index.js +6 -0
  200. package/lib/reanimated2/layoutReanimation/index.js +3 -2
  201. package/lib/reanimated2/platform-specific/RNRenderer.web.js +2 -0
  202. package/lib/reanimated2/utils.js +9 -0
  203. package/libSo/fbjni/jni/arm64-v8a/libfbjni.so +0 -0
  204. package/libSo/fbjni/jni/armeabi-v7a/libfbjni.so +0 -0
  205. package/libSo/fbjni/jni/x86/libfbjni.so +0 -0
  206. package/libSo/fbjni/jni/x86_64/libfbjni.so +0 -0
  207. package/package.json +21 -10
  208. package/plugin.js +244 -85
  209. package/react-native-reanimated.d.ts +531 -453
  210. package/src/ConfigHelper.js +1 -0
  211. package/src/ReanimatedModule.native.js +10 -2
  212. package/src/createAnimatedComponent.js +64 -30
  213. package/src/reanimated1/core/AnimatedAlways.js +1 -1
  214. package/src/reanimated1/core/AnimatedBezier.js +1 -1
  215. package/src/reanimated1/core/AnimatedBlock.js +1 -1
  216. package/src/reanimated1/core/AnimatedCall.js +1 -1
  217. package/src/reanimated1/core/AnimatedCallFunc.js +1 -1
  218. package/src/reanimated1/core/AnimatedConcat.js +1 -1
  219. package/src/reanimated1/core/AnimatedCond.js +1 -1
  220. package/src/reanimated1/core/AnimatedDebug.js +1 -1
  221. package/src/reanimated1/core/AnimatedEvent.js +1 -1
  222. package/src/reanimated1/core/AnimatedFunction.js +1 -1
  223. package/src/reanimated1/core/AnimatedOperator.js +1 -1
  224. package/src/reanimated1/core/AnimatedParam.js +1 -1
  225. package/src/reanimated1/core/AnimatedProps.js +2 -2
  226. package/src/reanimated1/core/AnimatedSet.js +1 -1
  227. package/src/reanimated1/core/AnimatedStartClock.js +1 -1
  228. package/src/reanimated1/core/AnimatedStopClock.js +1 -1
  229. package/src/reanimated1/core/AnimatedStyle.js +1 -1
  230. package/src/reanimated1/core/AnimatedTransform.js +1 -1
  231. package/src/reanimated1/core/Core.test.js +30 -0
  232. package/src/reanimated1/core/InternalAnimatedValue.js +1 -1
  233. package/src/reanimated1/core/__mocks__/AnimatedProps.js +1 -1
  234. package/src/reanimated1/derived/interpolate.js +1 -1
  235. package/src/reanimated2/Colors.ts +30 -27
  236. package/src/reanimated2/Easing.ts +3 -1
  237. package/src/reanimated2/NativeMethods.ts +26 -16
  238. package/src/reanimated2/NativeReanimated/NativeReanimated.ts +78 -0
  239. package/src/reanimated2/NativeReanimated/index.ts +18 -0
  240. package/src/reanimated2/PlatformChecker.ts +21 -0
  241. package/src/reanimated2/PropAdapters.ts +52 -34
  242. package/src/reanimated2/UpdateProps.ts +40 -20
  243. package/src/reanimated2/ViewDescriptorsSet.ts +108 -0
  244. package/src/reanimated2/WorkletEventHandler.ts +41 -23
  245. package/src/reanimated2/animation/commonTypes.ts +48 -0
  246. package/src/reanimated2/animation/decay.ts +141 -0
  247. package/src/reanimated2/animation/delay.ts +103 -0
  248. package/src/reanimated2/animation/index.ts +16 -0
  249. package/src/reanimated2/animation/repeat.ts +128 -0
  250. package/src/reanimated2/animation/sequence.ts +110 -0
  251. package/src/reanimated2/animation/spring.ts +165 -0
  252. package/src/reanimated2/animation/styleAnimation.ts +253 -0
  253. package/src/reanimated2/animation/timing.ts +109 -0
  254. package/src/reanimated2/animation/util.ts +242 -0
  255. package/src/reanimated2/commonTypes.ts +81 -0
  256. package/src/reanimated2/core.ts +128 -82
  257. package/src/reanimated2/globals.d.ts +47 -1
  258. package/src/reanimated2/hook/Hooks.ts +16 -0
  259. package/src/reanimated2/hook/commonTypes.ts +12 -0
  260. package/src/reanimated2/hook/index.ts +25 -0
  261. package/src/reanimated2/hook/useAnimatedGestureHandler.ts +110 -0
  262. package/src/reanimated2/hook/useAnimatedReaction.ts +49 -0
  263. package/src/reanimated2/hook/useAnimatedRef.ts +34 -0
  264. package/src/reanimated2/hook/useAnimatedScrollHandler.ts +83 -0
  265. package/src/reanimated2/hook/useAnimatedStyle.ts +538 -0
  266. package/src/reanimated2/hook/useDerivedValue.ts +48 -0
  267. package/src/reanimated2/hook/useSharedValue.ts +22 -0
  268. package/src/reanimated2/hook/utils.ts +259 -0
  269. package/src/reanimated2/index.ts +3 -2
  270. package/src/reanimated2/interpolation.ts +170 -101
  271. package/src/reanimated2/jestUtils.ts +0 -12
  272. package/src/reanimated2/js-reanimated/JSReanimated.ts +47 -22
  273. package/src/reanimated2/js-reanimated/Mapper.ts +1 -1
  274. package/src/reanimated2/js-reanimated/index.ts +71 -0
  275. package/src/reanimated2/layoutReanimation/LayoutAnimationRepository.tsx +62 -0
  276. package/src/reanimated2/layoutReanimation/animationBuilder/BaseAnimationBuilder.ts +91 -0
  277. package/src/reanimated2/layoutReanimation/animationBuilder/ComplexAnimationBuilder.ts +169 -0
  278. package/src/reanimated2/layoutReanimation/animationBuilder/Keyframe.ts +263 -0
  279. package/src/reanimated2/layoutReanimation/animationBuilder/commonTypes.ts +78 -0
  280. package/src/reanimated2/layoutReanimation/animationBuilder/index.ts +16 -0
  281. package/src/reanimated2/layoutReanimation/defaultAnimations/Bounce.ts +243 -121
  282. package/src/reanimated2/layoutReanimation/defaultAnimations/Default.ts +43 -0
  283. package/src/reanimated2/layoutReanimation/defaultAnimations/Fade.ts +95 -53
  284. package/src/reanimated2/layoutReanimation/defaultAnimations/Flip.ts +114 -64
  285. package/src/reanimated2/layoutReanimation/defaultAnimations/Lightspeed.ts +179 -0
  286. package/src/reanimated2/layoutReanimation/defaultAnimations/Pinwheel.ts +93 -0
  287. package/src/reanimated2/layoutReanimation/defaultAnimations/Roll.ts +132 -0
  288. package/src/reanimated2/layoutReanimation/defaultAnimations/Rotate.ts +333 -0
  289. package/src/reanimated2/layoutReanimation/defaultAnimations/Slide.ts +84 -50
  290. package/src/reanimated2/layoutReanimation/defaultAnimations/Stretch.ts +41 -23
  291. package/src/reanimated2/layoutReanimation/defaultAnimations/Zoom.ts +234 -154
  292. package/src/reanimated2/layoutReanimation/defaultAnimations/index.ts +4 -0
  293. package/src/reanimated2/layoutReanimation/defaultTransitions/CurvedTransition.ts +104 -0
  294. package/src/reanimated2/layoutReanimation/defaultTransitions/EntryExitTransition.ts +213 -0
  295. package/src/reanimated2/layoutReanimation/defaultTransitions/FadingTransition.ts +60 -0
  296. package/src/reanimated2/layoutReanimation/defaultTransitions/JumpingTransition.ts +58 -0
  297. package/src/reanimated2/layoutReanimation/defaultTransitions/LinearTransition.ts +41 -0
  298. package/src/reanimated2/layoutReanimation/defaultTransitions/SequencedTransition.ts +78 -0
  299. package/src/reanimated2/layoutReanimation/defaultTransitions/index.ts +6 -0
  300. package/src/reanimated2/layoutReanimation/index.ts +3 -2
  301. package/src/reanimated2/platform-specific/RNRenderer.web.ts +2 -0
  302. package/src/reanimated2/utils.ts +21 -0
  303. package/android/react-native-reanimated-62-hermes.aar +0 -0
  304. package/android/react-native-reanimated-62-jsc.aar +0 -0
  305. package/ios/LayoutReanimation/REAAnimationRootView.h +0 -12
  306. package/ios/LayoutReanimation/REAAnimationRootView.m +0 -16
  307. package/ios/LayoutReanimation/REAAnimationRootViewManager.h +0 -9
  308. package/ios/LayoutReanimation/REAAnimationRootViewManager.m +0 -49
  309. package/ios/LayoutReanimation/REAReactBatchObserver.h +0 -20
  310. package/ios/LayoutReanimation/REAReactBatchObserver.m +0 -125
  311. package/ios/LayoutReanimation/REASnapshooter.h +0 -19
  312. package/ios/LayoutReanimation/REASnapshooter.m +0 -64
  313. package/ios/LayoutReanimation/REAViewTraverser.h +0 -13
  314. package/ios/LayoutReanimation/REAViewTraverser.m +0 -40
  315. package/lib/reanimated2/Hooks.js +0 -732
  316. package/lib/reanimated2/NativeReanimated.js +0 -4
  317. package/lib/reanimated2/animations.js +0 -713
  318. package/lib/reanimated2/js-reanimated/index.web.js +0 -20
  319. package/lib/reanimated2/layoutReanimation/AnimatedRoot.js +0 -55
  320. package/lib/reanimated2/layoutReanimation/defaultAnimationsBuilder.js +0 -374
  321. package/src/reanimated2/Hooks.ts +0 -918
  322. package/src/reanimated2/NativeReanimated.native.ts +0 -61
  323. package/src/reanimated2/NativeReanimated.ts +0 -5
  324. package/src/reanimated2/animations.ts +0 -868
  325. package/src/reanimated2/js-reanimated/index.js +0 -0
  326. package/src/reanimated2/js-reanimated/index.web.ts +0 -29
  327. package/src/reanimated2/layoutReanimation/AnimatedRoot.tsx +0 -68
  328. package/src/reanimated2/layoutReanimation/defaultAnimationsBuilder.ts +0 -440
@@ -1,20 +1,27 @@
1
1
  #include "LayoutAnimationsProxy.h"
2
+ #include "FrozenObject.h"
2
3
  #include "MutableValue.h"
3
- #include "ValueWrapper.h"
4
4
  #include "ShareableValue.h"
5
- #include "FrozenObject.h"
5
+ #include "ValueWrapper.h"
6
6
 
7
7
  namespace reanimated {
8
8
 
9
9
  const long long idOffset = 1e9;
10
10
 
11
- LayoutAnimationsProxy::LayoutAnimationsProxy(std::function<void(int, jsi::Object newProps)> _notifyAboutProgress, std::function<void(int, bool)> _notifyAboutEnd): notifyAboutProgress(std::move(_notifyAboutProgress)), notifyAboutEnd(std::move(_notifyAboutEnd)) {
12
- }
11
+ LayoutAnimationsProxy::LayoutAnimationsProxy(
12
+ std::function<void(int, jsi::Object newProps)> _notifyAboutProgress,
13
+ std::function<void(int, bool)> _notifyAboutEnd)
14
+ : notifyAboutProgress(std::move(_notifyAboutProgress)),
15
+ notifyAboutEnd(std::move(_notifyAboutEnd)) {}
13
16
 
14
- void LayoutAnimationsProxy::startObserving(int tag, std::shared_ptr<MutableValue> sv, jsi::Runtime &rt) {
17
+ void LayoutAnimationsProxy::startObserving(
18
+ int tag,
19
+ std::shared_ptr<MutableValue> sv,
20
+ jsi::Runtime &rt) {
15
21
  observedValues[tag] = sv;
16
- sv->addListener(tag + idOffset, [sv, tag, this, &rt](){
17
- std::shared_ptr<FrozenObject> newValue = ValueWrapper::asFrozenObject(sv->value->valueContainer);
22
+ sv->addListener(tag + idOffset, [sv, tag, this, &rt]() {
23
+ std::shared_ptr<FrozenObject> newValue =
24
+ ValueWrapper::asFrozenObject(sv->value->valueContainer);
18
25
  this->notifyAboutProgress(tag, newValue->shallowClone(rt));
19
26
  });
20
27
  }
@@ -33,4 +40,4 @@ void LayoutAnimationsProxy::notifyAboutCancellation(int tag) {
33
40
  this->notifyAboutEnd(tag, false);
34
41
  }
35
42
 
36
- }
43
+ } // namespace reanimated
@@ -1,159 +1,165 @@
1
1
  #include "NativeReanimatedModule.h"
2
- #include "ShareableValue.h"
3
- #include "MapperRegistry.h"
4
- #include "Mapper.h"
5
- #include "RuntimeDecorator.h"
6
- #include "EventHandlerRegistry.h"
7
- #include "WorkletEventHandler.h"
8
- #include "FrozenObject.h"
9
2
  #include <functional>
10
- #include <thread>
11
3
  #include <memory>
4
+ #include <thread>
5
+ #include "EventHandlerRegistry.h"
6
+ #include "FrozenObject.h"
12
7
  #include "JSIStoreValueUser.h"
8
+ #include "Mapper.h"
9
+ #include "MapperRegistry.h"
13
10
  #include "ReanimatedHiddenHeaders.h"
11
+ #include "RuntimeDecorator.h"
12
+ #include "ShareableValue.h"
13
+ #include "WorkletEventHandler.h"
14
14
 
15
15
  using namespace facebook;
16
16
 
17
- namespace reanimated
18
- {
19
-
20
- void extractMutables(jsi::Runtime &rt,
21
- std::shared_ptr<ShareableValue> sv,
22
- std::vector<std::shared_ptr<MutableValue>> &res)
23
- {
24
- switch (sv->type)
25
- {
26
- case ValueType::MutableValueType: {
27
- auto& mutableValue = ValueWrapper::asMutableValue(sv->valueContainer);
28
- res.push_back(mutableValue);
29
- break;
30
- }
31
- case ValueType::FrozenArrayType:
32
- for (auto &it : ValueWrapper::asFrozenArray(sv->valueContainer))
33
- {
34
- extractMutables(rt, it, res);
35
- }
36
- break;
37
- case ValueType::RemoteObjectType:
38
- case ValueType::FrozenObjectType:
39
- for (auto &it : ValueWrapper::asFrozenObject(sv->valueContainer)->map)
40
- {
41
- extractMutables(rt, it.second, res);
17
+ namespace reanimated {
18
+
19
+ void extractMutables(
20
+ jsi::Runtime &rt,
21
+ std::shared_ptr<ShareableValue> sv,
22
+ std::vector<std::shared_ptr<MutableValue>> &res) {
23
+ switch (sv->type) {
24
+ case ValueType::MutableValueType: {
25
+ auto &mutableValue = ValueWrapper::asMutableValue(sv->valueContainer);
26
+ res.push_back(mutableValue);
27
+ break;
42
28
  }
43
- break;
44
- default:
45
- break;
29
+ case ValueType::FrozenArrayType:
30
+ for (auto &it : ValueWrapper::asFrozenArray(sv->valueContainer)) {
31
+ extractMutables(rt, it, res);
32
+ }
33
+ break;
34
+ case ValueType::RemoteObjectType:
35
+ case ValueType::FrozenObjectType:
36
+ for (auto &it : ValueWrapper::asFrozenObject(sv->valueContainer)->map) {
37
+ extractMutables(rt, it.second, res);
38
+ }
39
+ break;
40
+ default:
41
+ break;
46
42
  }
47
43
  }
48
44
 
49
- std::vector<std::shared_ptr<MutableValue>> extractMutablesFromArray(jsi::Runtime &rt, const jsi::Array &array, NativeReanimatedModule *module)
50
- {
45
+ std::vector<std::shared_ptr<MutableValue>> extractMutablesFromArray(
46
+ jsi::Runtime &rt,
47
+ const jsi::Array &array,
48
+ NativeReanimatedModule *module) {
51
49
  std::vector<std::shared_ptr<MutableValue>> res;
52
- for (size_t i = 0, size = array.size(rt); i < size; i++)
53
- {
54
- auto shareable = ShareableValue::adapt(rt, array.getValueAtIndex(rt, i), module);
50
+ for (size_t i = 0, size = array.size(rt); i < size; i++) {
51
+ auto shareable =
52
+ ShareableValue::adapt(rt, array.getValueAtIndex(rt, i), module);
55
53
  extractMutables(rt, shareable, res);
56
54
  }
57
55
  return res;
58
56
  }
59
57
 
60
- NativeReanimatedModule::NativeReanimatedModule(std::shared_ptr<CallInvoker> jsInvoker,
61
- std::shared_ptr<Scheduler> scheduler,
62
- std::shared_ptr<jsi::Runtime> rt,
63
- std::shared_ptr<ErrorHandler> errorHandler,
64
- std::function<jsi::Value(jsi::Runtime &, const int, const jsi::String &)> propObtainer,
65
- std::shared_ptr<LayoutAnimationsProxy> layoutAnimationsProxy,
66
- PlatformDepMethodsHolder platformDepMethodsHolder) :
67
- NativeReanimatedModuleSpec(jsInvoker),
68
- RuntimeManager(rt, errorHandler, scheduler, RuntimeType::UI),
69
- mapperRegistry(std::make_shared<MapperRegistry>()),
70
- eventHandlerRegistry(std::make_shared<EventHandlerRegistry>()),
71
- requestRender(platformDepMethodsHolder.requestRender),
72
- propObtainer(propObtainer)
73
- {
74
-
58
+ NativeReanimatedModule::NativeReanimatedModule(
59
+ std::shared_ptr<CallInvoker> jsInvoker,
60
+ std::shared_ptr<Scheduler> scheduler,
61
+ std::shared_ptr<jsi::Runtime> rt,
62
+ std::shared_ptr<ErrorHandler> errorHandler,
63
+ std::function<jsi::Value(jsi::Runtime &, const int, const jsi::String &)>
64
+ propObtainer,
65
+ std::shared_ptr<LayoutAnimationsProxy> layoutAnimationsProxy,
66
+ PlatformDepMethodsHolder platformDepMethodsHolder)
67
+ : NativeReanimatedModuleSpec(jsInvoker),
68
+ RuntimeManager(rt, errorHandler, scheduler, RuntimeType::UI),
69
+ mapperRegistry(std::make_shared<MapperRegistry>()),
70
+ eventHandlerRegistry(std::make_shared<EventHandlerRegistry>()),
71
+ requestRender(platformDepMethodsHolder.requestRender),
72
+ propObtainer(propObtainer) {
75
73
  auto requestAnimationFrame = [=](FrameCallback callback) {
76
74
  frameCallbacks.push_back(callback);
77
75
  maybeRequestRender();
78
76
  };
79
-
77
+
80
78
  this->layoutAnimationsProxy = layoutAnimationsProxy;
81
-
82
- RuntimeDecorator::decorateUIRuntime(*runtime,
83
- platformDepMethodsHolder.updaterFunction,
84
- requestAnimationFrame,
85
- platformDepMethodsHolder.scrollToFunction,
86
- platformDepMethodsHolder.measuringFunction,
87
- platformDepMethodsHolder.getCurrentTime,
88
- layoutAnimationsProxy);
89
- onRenderCallback = [this](double timestampMs) {
79
+
80
+ RuntimeDecorator::decorateUIRuntime(
81
+ *runtime,
82
+ platformDepMethodsHolder.updaterFunction,
83
+ requestAnimationFrame,
84
+ platformDepMethodsHolder.scrollToFunction,
85
+ platformDepMethodsHolder.measuringFunction,
86
+ platformDepMethodsHolder.getCurrentTime,
87
+ layoutAnimationsProxy);
88
+ onRenderCallback = [this](double timestampMs) {
90
89
  this->renderRequested = false;
91
90
  this->onRender(timestampMs);
92
91
  };
93
92
  updaterFunction = platformDepMethodsHolder.updaterFunction;
94
93
  }
95
94
 
96
- void NativeReanimatedModule::installCoreFunctions(jsi::Runtime &rt, const jsi::Value &valueSetter)
97
- {
95
+ void NativeReanimatedModule::installCoreFunctions(
96
+ jsi::Runtime &rt,
97
+ const jsi::Value &valueSetter) {
98
98
  this->valueSetter = ShareableValue::adapt(rt, valueSetter, this);
99
99
  }
100
100
 
101
- jsi::Value NativeReanimatedModule::makeShareable(jsi::Runtime &rt, const jsi::Value &value)
102
- {
101
+ jsi::Value NativeReanimatedModule::makeShareable(
102
+ jsi::Runtime &rt,
103
+ const jsi::Value &value) {
103
104
  return ShareableValue::adapt(rt, value, this)->getValue(rt);
104
105
  }
105
106
 
106
- jsi::Value NativeReanimatedModule::makeMutable(jsi::Runtime &rt, const jsi::Value &value)
107
- {
108
- return ShareableValue::adapt(rt, value, this, ValueType::MutableValueType)->getValue(rt);
107
+ jsi::Value NativeReanimatedModule::makeMutable(
108
+ jsi::Runtime &rt,
109
+ const jsi::Value &value) {
110
+ return ShareableValue::adapt(rt, value, this, ValueType::MutableValueType)
111
+ ->getValue(rt);
109
112
  }
110
113
 
111
- jsi::Value NativeReanimatedModule::makeRemote(jsi::Runtime &rt, const jsi::Value &value)
112
- {
113
- return ShareableValue::adapt(rt, value, this, ValueType::RemoteObjectType)->getValue(rt);
114
+ jsi::Value NativeReanimatedModule::makeRemote(
115
+ jsi::Runtime &rt,
116
+ const jsi::Value &value) {
117
+ return ShareableValue::adapt(rt, value, this, ValueType::RemoteObjectType)
118
+ ->getValue(rt);
114
119
  }
115
120
 
116
121
  jsi::Value NativeReanimatedModule::startMapper(
117
- jsi::Runtime &rt,
118
- const jsi::Value &worklet,
119
- const jsi::Value &inputs,
120
- const jsi::Value &outputs,
121
- const jsi::Value &updater,
122
- const jsi::Value &tag,
123
- const jsi::Value &name
124
- )
125
- {
122
+ jsi::Runtime &rt,
123
+ const jsi::Value &worklet,
124
+ const jsi::Value &inputs,
125
+ const jsi::Value &outputs,
126
+ const jsi::Value &updater,
127
+ const jsi::Value &viewDescriptors) {
126
128
  static unsigned long MAPPER_ID = 1;
127
129
 
128
130
  unsigned long newMapperId = MAPPER_ID++;
129
131
  auto mapperShareable = ShareableValue::adapt(rt, worklet, this);
130
- auto inputMutables = extractMutablesFromArray(rt, inputs.asObject(rt).asArray(rt), this);
131
- auto outputMutables = extractMutablesFromArray(rt, outputs.asObject(rt).asArray(rt), this);
132
-
132
+ auto inputMutables =
133
+ extractMutablesFromArray(rt, inputs.asObject(rt).asArray(rt), this);
134
+ auto outputMutables =
135
+ extractMutablesFromArray(rt, outputs.asObject(rt).asArray(rt), this);
136
+
133
137
  int optimalizationLvl = 0;
134
- auto optimalization = updater.asObject(rt).getProperty(rt, "__optimalization");
135
- if(optimalization.isNumber()) {
138
+ auto optimalization =
139
+ updater.asObject(rt).getProperty(rt, "__optimalization");
140
+ if (optimalization.isNumber()) {
136
141
  optimalizationLvl = optimalization.asNumber();
137
142
  }
138
143
  auto updaterSV = ShareableValue::adapt(rt, updater, this);
139
- const int tagInt = tag.asNumber();
140
- const std::string nameStr = name.asString(rt).utf8(rt);
144
+ auto viewDescriptorsSV = ShareableValue::adapt(rt, viewDescriptors, this);
141
145
 
142
146
  scheduler->scheduleOnUI([=] {
143
- auto mapperFunction = mapperShareable->getValue(*runtime).asObject(*runtime).asFunction(*runtime);
144
- std::shared_ptr<jsi::Function> mapperFunctionPointer = std::make_shared<jsi::Function>(std::move(mapperFunction));
145
-
147
+ auto mapperFunction =
148
+ mapperShareable->getValue(*runtime).asObject(*runtime).asFunction(
149
+ *runtime);
150
+ std::shared_ptr<jsi::Function> mapperFunctionPointer =
151
+ std::make_shared<jsi::Function>(std::move(mapperFunction));
152
+
146
153
  std::shared_ptr<Mapper> mapperPointer = std::make_shared<Mapper>(
147
- this,
148
- newMapperId,
149
- mapperFunctionPointer,
150
- inputMutables,
151
- outputMutables,
152
- updaterSV,
153
- tagInt,
154
- nameStr,
155
- optimalizationLvl
156
- );
154
+ this,
155
+ newMapperId,
156
+ mapperFunctionPointer,
157
+ inputMutables,
158
+ outputMutables);
159
+ if (optimalizationLvl > 0) {
160
+ mapperPointer->enableFastMode(
161
+ optimalizationLvl, updaterSV, viewDescriptorsSV);
162
+ }
157
163
  mapperRegistry->startMapper(mapperPointer);
158
164
  maybeRequestRender();
159
165
  });
@@ -161,8 +167,9 @@ jsi::Value NativeReanimatedModule::startMapper(
161
167
  return jsi::Value((double)newMapperId);
162
168
  }
163
169
 
164
- void NativeReanimatedModule::stopMapper(jsi::Runtime &rt, const jsi::Value &mapperId)
165
- {
170
+ void NativeReanimatedModule::stopMapper(
171
+ jsi::Runtime &rt,
172
+ const jsi::Value &mapperId) {
166
173
  unsigned long id = mapperId.asNumber();
167
174
  scheduler->scheduleOnUI([=] {
168
175
  mapperRegistry->stopMapper(id);
@@ -170,8 +177,10 @@ void NativeReanimatedModule::stopMapper(jsi::Runtime &rt, const jsi::Value &mapp
170
177
  });
171
178
  }
172
179
 
173
- jsi::Value NativeReanimatedModule::registerEventHandler(jsi::Runtime &rt, const jsi::Value &eventHash, const jsi::Value &worklet)
174
- {
180
+ jsi::Value NativeReanimatedModule::registerEventHandler(
181
+ jsi::Runtime &rt,
182
+ const jsi::Value &eventHash,
183
+ const jsi::Value &worklet) {
175
184
  static unsigned long EVENT_HANDLER_ID = 1;
176
185
 
177
186
  unsigned long newRegistrationId = EVENT_HANDLER_ID++;
@@ -179,37 +188,45 @@ jsi::Value NativeReanimatedModule::registerEventHandler(jsi::Runtime &rt, const
179
188
  auto handlerShareable = ShareableValue::adapt(rt, worklet, this);
180
189
 
181
190
  scheduler->scheduleOnUI([=] {
182
- auto handlerFunction = handlerShareable->getValue(*runtime).asObject(*runtime).asFunction(*runtime);
183
- auto handler = std::make_shared<WorkletEventHandler>(newRegistrationId, eventName, std::move(handlerFunction));
191
+ auto handlerFunction =
192
+ handlerShareable->getValue(*runtime).asObject(*runtime).asFunction(
193
+ *runtime);
194
+ auto handler = std::make_shared<WorkletEventHandler>(
195
+ newRegistrationId, eventName, std::move(handlerFunction));
184
196
  eventHandlerRegistry->registerEventHandler(handler);
185
197
  });
186
198
 
187
199
  return jsi::Value((double)newRegistrationId);
188
200
  }
189
201
 
190
- void NativeReanimatedModule::unregisterEventHandler(jsi::Runtime &rt, const jsi::Value &registrationId)
191
- {
202
+ void NativeReanimatedModule::unregisterEventHandler(
203
+ jsi::Runtime &rt,
204
+ const jsi::Value &registrationId) {
192
205
  unsigned long id = registrationId.asNumber();
193
- scheduler->scheduleOnUI([=] {
194
- eventHandlerRegistry->unregisterEventHandler(id);
195
- });
206
+ scheduler->scheduleOnUI(
207
+ [=] { eventHandlerRegistry->unregisterEventHandler(id); });
196
208
  }
197
209
 
198
- jsi::Value NativeReanimatedModule::getViewProp(jsi::Runtime &rt, const jsi::Value &viewTag, const jsi::Value &propName, const jsi::Value &callback)
199
- {
200
-
210
+ jsi::Value NativeReanimatedModule::getViewProp(
211
+ jsi::Runtime &rt,
212
+ const jsi::Value &viewTag,
213
+ const jsi::Value &propName,
214
+ const jsi::Value &callback) {
201
215
  const int viewTagInt = (int)viewTag.asNumber();
202
216
  std::string propNameStr = propName.asString(rt).utf8(rt);
203
217
  jsi::Function fun = callback.getObject(rt).asFunction(rt);
204
- std::shared_ptr<jsi::Function> funPtr = std::make_shared<jsi::Function>(std::move(fun));
218
+ std::shared_ptr<jsi::Function> funPtr =
219
+ std::make_shared<jsi::Function>(std::move(fun));
205
220
 
206
221
  scheduler->scheduleOnUI([&rt, viewTagInt, funPtr, this, propNameStr]() {
207
- const jsi::String propNameValue = jsi::String::createFromUtf8(rt, propNameStr);
222
+ const jsi::String propNameValue =
223
+ jsi::String::createFromUtf8(rt, propNameStr);
208
224
  jsi::Value result = propObtainer(rt, viewTagInt, propNameValue);
209
225
  std::string resultStr = result.asString(rt).utf8(rt);
210
226
 
211
227
  scheduler->scheduleOnJS([&rt, resultStr, funPtr]() {
212
- const jsi::String resultValue = jsi::String::createFromUtf8(rt, resultStr);
228
+ const jsi::String resultValue =
229
+ jsi::String::createFromUtf8(rt, resultStr);
213
230
  funPtr->call(rt, resultValue);
214
231
  });
215
232
  });
@@ -217,72 +234,59 @@ jsi::Value NativeReanimatedModule::getViewProp(jsi::Runtime &rt, const jsi::Valu
217
234
  return jsi::Value::undefined();
218
235
  }
219
236
 
220
- void NativeReanimatedModule::onEvent(std::string eventName, std::string eventAsString)
221
- {
222
- try
223
- {
224
- eventHandlerRegistry->processEvent(*runtime, eventName, eventAsString);
225
- mapperRegistry->execute(*runtime);
226
- if (mapperRegistry->needRunOnRender())
227
- {
228
- maybeRequestRender();
229
- }
237
+ void NativeReanimatedModule::onEvent(
238
+ std::string eventName,
239
+ std::string eventAsString) {
240
+ try {
241
+ eventHandlerRegistry->processEvent(*runtime, eventName, eventAsString);
242
+ mapperRegistry->execute(*runtime);
243
+ if (mapperRegistry->needRunOnRender()) {
244
+ maybeRequestRender();
230
245
  }
231
- catch(std::exception &e) {
232
- std::string str = e.what();
233
- this->errorHandler->setError(str);
234
- this->errorHandler->raise();
235
- } catch(...) {
236
- std::string str = "OnEvent error";
237
- this->errorHandler->setError(str);
238
- this->errorHandler->raise();
246
+ } catch (std::exception &e) {
247
+ std::string str = e.what();
248
+ this->errorHandler->setError(str);
249
+ this->errorHandler->raise();
250
+ } catch (...) {
251
+ std::string str = "OnEvent error";
252
+ this->errorHandler->setError(str);
253
+ this->errorHandler->raise();
239
254
  }
240
255
  }
241
256
 
242
- bool NativeReanimatedModule::isAnyHandlerWaitingForEvent(std::string eventName) {
257
+ bool NativeReanimatedModule::isAnyHandlerWaitingForEvent(
258
+ std::string eventName) {
243
259
  return eventHandlerRegistry->isAnyHandlerWaitingForEvent(eventName);
244
260
  }
245
261
 
246
-
247
- void NativeReanimatedModule::maybeRequestRender()
248
- {
249
- if (!renderRequested)
250
- {
262
+ void NativeReanimatedModule::maybeRequestRender() {
263
+ if (!renderRequested) {
251
264
  renderRequested = true;
252
265
  requestRender(onRenderCallback, *this->runtime);
253
266
  }
254
267
  }
255
268
 
256
- void NativeReanimatedModule::onRender(double timestampMs)
257
- {
258
- try
259
- {
260
- std::vector<FrameCallback> callbacks = frameCallbacks;
261
- frameCallbacks.clear();
262
- for (auto& callback : callbacks)
263
- {
264
- callback(timestampMs);
265
- }
266
- mapperRegistry->execute(*runtime);
269
+ void NativeReanimatedModule::onRender(double timestampMs) {
270
+ try {
271
+ std::vector<FrameCallback> callbacks = frameCallbacks;
272
+ frameCallbacks.clear();
273
+ for (auto &callback : callbacks) {
274
+ callback(timestampMs);
275
+ }
276
+ mapperRegistry->execute(*runtime);
267
277
 
268
- if (mapperRegistry->needRunOnRender())
269
- {
278
+ if (mapperRegistry->needRunOnRender()) {
270
279
  maybeRequestRender();
271
280
  }
272
- } catch(std::exception &e) {
281
+ } catch (std::exception &e) {
273
282
  std::string str = e.what();
274
283
  this->errorHandler->setError(str);
275
284
  this->errorHandler->raise();
276
- } catch(...) {
285
+ } catch (...) {
277
286
  std::string str = "OnRender error";
278
287
  this->errorHandler->setError(str);
279
288
  this->errorHandler->raise();
280
289
  }
281
290
  }
282
291
 
283
- NativeReanimatedModule::~NativeReanimatedModule()
284
- {
285
- StoreUser::clearStore();
286
- }
287
-
288
292
  } // namespace reanimated
@@ -2,13 +2,14 @@
2
2
 
3
3
  namespace reanimated {
4
4
 
5
- static jsi::Value __hostFunction_NativeReanimatedModuleSpec_installCoreFunctions(
5
+ static jsi::Value
6
+ __hostFunction_NativeReanimatedModuleSpec_installCoreFunctions(
6
7
  jsi::Runtime &rt,
7
8
  TurboModule &turboModule,
8
9
  const jsi::Value *args,
9
10
  size_t count) {
10
11
  static_cast<NativeReanimatedModuleSpec *>(&turboModule)
11
- ->installCoreFunctions(rt, std::move(args[0]));
12
+ ->installCoreFunctions(rt, std::move(args[0]));
12
13
  return jsi::Value::undefined();
13
14
  }
14
15
 
@@ -20,7 +21,7 @@ static jsi::Value __hostFunction_NativeReanimatedModuleSpec_makeShareable(
20
21
  const jsi::Value *args,
21
22
  size_t count) {
22
23
  return static_cast<NativeReanimatedModuleSpec *>(&turboModule)
23
- ->makeShareable(rt, std::move(args[0]));
24
+ ->makeShareable(rt, std::move(args[0]));
24
25
  }
25
26
 
26
27
  static jsi::Value __hostFunction_NativeReanimatedModuleSpec_makeMutable(
@@ -29,7 +30,7 @@ static jsi::Value __hostFunction_NativeReanimatedModuleSpec_makeMutable(
29
30
  const jsi::Value *args,
30
31
  size_t count) {
31
32
  return static_cast<NativeReanimatedModuleSpec *>(&turboModule)
32
- ->makeMutable(rt, std::move(args[0]));
33
+ ->makeMutable(rt, std::move(args[0]));
33
34
  }
34
35
 
35
36
  static jsi::Value __hostFunction_NativeReanimatedModuleSpec_makeRemote(
@@ -38,7 +39,7 @@ static jsi::Value __hostFunction_NativeReanimatedModuleSpec_makeRemote(
38
39
  const jsi::Value *args,
39
40
  size_t count) {
40
41
  return static_cast<NativeReanimatedModuleSpec *>(&turboModule)
41
- ->makeRemote(rt, std::move(args[0]));
42
+ ->makeRemote(rt, std::move(args[0]));
42
43
  }
43
44
 
44
45
  static jsi::Value __hostFunction_NativeReanimatedModuleSpec_startMapper(
@@ -47,13 +48,13 @@ static jsi::Value __hostFunction_NativeReanimatedModuleSpec_startMapper(
47
48
  const jsi::Value *args,
48
49
  size_t count) {
49
50
  return static_cast<NativeReanimatedModuleSpec *>(&turboModule)
50
- ->startMapper(rt,
51
- std::move(args[0]),
52
- std::move(args[1]),
53
- std::move(args[2]),
54
- std::move(args[3]),
55
- std::move(args[4]),
56
- std::move(args[5]));
51
+ ->startMapper(
52
+ rt,
53
+ std::move(args[0]),
54
+ std::move(args[1]),
55
+ std::move(args[2]),
56
+ std::move(args[3]),
57
+ std::move(args[4]));
57
58
  }
58
59
 
59
60
  static jsi::Value __hostFunction_NativeReanimatedModuleSpec_stopMapper(
@@ -66,7 +67,8 @@ static jsi::Value __hostFunction_NativeReanimatedModuleSpec_stopMapper(
66
67
  return jsi::Value::undefined();
67
68
  }
68
69
 
69
- static jsi::Value __hostFunction_NativeReanimatedModuleSpec_registerEventHandler(
70
+ static jsi::Value
71
+ __hostFunction_NativeReanimatedModuleSpec_registerEventHandler(
70
72
  jsi::Runtime &rt,
71
73
  TurboModule &turboModule,
72
74
  const jsi::Value *args,
@@ -75,7 +77,8 @@ static jsi::Value __hostFunction_NativeReanimatedModuleSpec_registerEventHandler
75
77
  ->registerEventHandler(rt, std::move(args[0]), std::move(args[1]));
76
78
  }
77
79
 
78
- static jsi::Value __hostFunction_NativeReanimatedModuleSpec_unregisterEventHandler(
80
+ static jsi::Value
81
+ __hostFunction_NativeReanimatedModuleSpec_unregisterEventHandler(
79
82
  jsi::Runtime &rt,
80
83
  TurboModule &turboModule,
81
84
  const jsi::Value *args,
@@ -91,37 +94,36 @@ static jsi::Value __hostFunction_NativeReanimatedModuleSpec_getViewProp(
91
94
  const jsi::Value *args,
92
95
  size_t count) {
93
96
  static_cast<NativeReanimatedModuleSpec *>(&turboModule)
94
- ->getViewProp(rt, std::move(args[0]), std::move(args[1]), std::move(args[2]));
95
- return jsi::Value::undefined();
97
+ ->getViewProp(
98
+ rt, std::move(args[0]), std::move(args[1]), std::move(args[2]));
99
+ return jsi::Value::undefined();
96
100
  }
97
101
 
98
- NativeReanimatedModuleSpec::NativeReanimatedModuleSpec(std::shared_ptr<CallInvoker> jsInvoker)
102
+ NativeReanimatedModuleSpec::NativeReanimatedModuleSpec(
103
+ std::shared_ptr<CallInvoker> jsInvoker)
99
104
  : TurboModule("NativeReanimated", jsInvoker) {
100
105
  methodMap_["installCoreFunctions"] = MethodMetadata{
101
- 1, __hostFunction_NativeReanimatedModuleSpec_installCoreFunctions};
102
-
106
+ 1, __hostFunction_NativeReanimatedModuleSpec_installCoreFunctions};
103
107
 
104
108
  methodMap_["makeShareable"] = MethodMetadata{
105
109
  1, __hostFunction_NativeReanimatedModuleSpec_makeShareable};
106
- methodMap_["makeMutable"] = MethodMetadata{
107
- 1, __hostFunction_NativeReanimatedModuleSpec_makeMutable};
108
- methodMap_["makeRemote"] = MethodMetadata{
109
- 1, __hostFunction_NativeReanimatedModuleSpec_makeRemote};
110
-
110
+ methodMap_["makeMutable"] =
111
+ MethodMetadata{1, __hostFunction_NativeReanimatedModuleSpec_makeMutable};
112
+ methodMap_["makeRemote"] =
113
+ MethodMetadata{1, __hostFunction_NativeReanimatedModuleSpec_makeRemote};
111
114
 
112
- methodMap_["startMapper"] = MethodMetadata{
113
- 6, __hostFunction_NativeReanimatedModuleSpec_startMapper};
114
- methodMap_["stopMapper"] = MethodMetadata{
115
- 1, __hostFunction_NativeReanimatedModuleSpec_stopMapper};
115
+ methodMap_["startMapper"] =
116
+ MethodMetadata{5, __hostFunction_NativeReanimatedModuleSpec_startMapper};
117
+ methodMap_["stopMapper"] =
118
+ MethodMetadata{1, __hostFunction_NativeReanimatedModuleSpec_stopMapper};
116
119
 
117
120
  methodMap_["registerEventHandler"] = MethodMetadata{
118
- 2, __hostFunction_NativeReanimatedModuleSpec_registerEventHandler};
121
+ 2, __hostFunction_NativeReanimatedModuleSpec_registerEventHandler};
119
122
  methodMap_["unregisterEventHandler"] = MethodMetadata{
120
- 1, __hostFunction_NativeReanimatedModuleSpec_unregisterEventHandler};
121
-
122
- methodMap_["getViewProp"] = MethodMetadata{
123
- 3, __hostFunction_NativeReanimatedModuleSpec_getViewProp};
124
- }
123
+ 1, __hostFunction_NativeReanimatedModuleSpec_unregisterEventHandler};
125
124
 
125
+ methodMap_["getViewProp"] =
126
+ MethodMetadata{3, __hostFunction_NativeReanimatedModuleSpec_getViewProp};
126
127
  }
127
128
 
129
+ } // namespace reanimated