react-native-reanimated 2.3.0-alpha.3 → 2.3.0-beta.4

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 (264) hide show
  1. package/Common/cpp/LayoutAnimations/LayoutAnimationsProxy.cpp +15 -8
  2. package/Common/cpp/NativeModules/NativeReanimatedModule.cpp +176 -154
  3. package/Common/cpp/NativeModules/NativeReanimatedModuleSpec.cpp +49 -33
  4. package/Common/cpp/Registries/EventHandlerRegistry.cpp +14 -7
  5. package/Common/cpp/Registries/MapperRegistry.cpp +24 -20
  6. package/Common/cpp/Registries/WorkletsCache.cpp +19 -9
  7. package/Common/cpp/SharedItems/FrozenObject.cpp +17 -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 +211 -160
  12. package/Common/cpp/Tools/FeaturesConfig.cpp +5 -0
  13. package/Common/cpp/Tools/JSIStoreValueUser.cpp +25 -6
  14. package/Common/cpp/Tools/Mapper.cpp +30 -30
  15. package/Common/cpp/Tools/RuntimeDecorator.cpp +124 -86
  16. package/Common/cpp/Tools/Scheduler.cpp +6 -5
  17. package/Common/cpp/Tools/WorkletEventHandler.cpp +4 -2
  18. package/Common/cpp/headers/LayoutAnimations/LayoutAnimationsProxy.h +12 -11
  19. package/Common/cpp/headers/NativeModules/NativeReanimatedModule.h +50 -31
  20. package/Common/cpp/headers/NativeModules/NativeReanimatedModuleSpec.h +34 -16
  21. package/Common/cpp/headers/Registries/EventHandlerRegistry.h +15 -8
  22. package/Common/cpp/headers/Registries/MapperRegistry.h +5 -4
  23. package/Common/cpp/headers/Registries/WorkletsCache.h +9 -7
  24. package/Common/cpp/headers/SharedItems/FrozenObject.h +19 -11
  25. package/Common/cpp/headers/SharedItems/HostFunctionHandler.h +8 -4
  26. package/Common/cpp/headers/SharedItems/MutableValue.h +23 -12
  27. package/Common/cpp/headers/SharedItems/MutableValueSetterProxy.h +12 -7
  28. package/Common/cpp/headers/SharedItems/RemoteObject.h +19 -8
  29. package/Common/cpp/headers/SharedItems/RuntimeManager.h +26 -25
  30. package/Common/cpp/headers/SharedItems/ShareableValue.h +32 -27
  31. package/Common/cpp/headers/SharedItems/SharedParent.h +10 -7
  32. package/Common/cpp/headers/SharedItems/ValueWrapper.h +95 -72
  33. package/Common/cpp/headers/SpecTools/ErrorHandler.h +18 -19
  34. package/Common/cpp/headers/Tools/FeaturesConfig.h +19 -0
  35. package/Common/cpp/headers/Tools/JSIStoreValueUser.h +13 -16
  36. package/Common/cpp/headers/Tools/Mapper.h +19 -16
  37. package/Common/cpp/headers/Tools/PlatformDepMethodsHolder.h +17 -7
  38. package/Common/cpp/headers/Tools/ReanimatedHiddenHeaders.h +7 -11
  39. package/Common/cpp/headers/Tools/RuntimeDecorator.h +36 -27
  40. package/Common/cpp/headers/Tools/Scheduler.h +30 -35
  41. package/Common/cpp/headers/Tools/WorkletEventHandler.h +11 -8
  42. package/Common/cpp/hidden_headers/Logger.h +14 -14
  43. package/Common/cpp/hidden_headers/LoggerInterface.h +8 -9
  44. package/Common/cpp/hidden_headers/SpeedChecker.h +7 -8
  45. package/README.md +1 -1
  46. package/RNReanimated.podspec +24 -6
  47. package/android/build.gradle +38 -29
  48. package/android/react-native-reanimated-63-hermes.aar +0 -0
  49. package/android/react-native-reanimated-63-jsc.aar +0 -0
  50. package/android/react-native-reanimated-64-hermes.aar +0 -0
  51. package/android/react-native-reanimated-64-jsc.aar +0 -0
  52. package/android/react-native-reanimated-65-hermes.aar +0 -0
  53. package/android/react-native-reanimated-65-jsc.aar +0 -0
  54. package/android/react-native-reanimated-66-hermes.aar +0 -0
  55. package/android/react-native-reanimated-66-jsc.aar +0 -0
  56. package/android/react-native-reanimated-67-hermes.aar +0 -0
  57. package/android/react-native-reanimated-67-jsc.aar +0 -0
  58. package/ios/LayoutReanimation/REAAnimationsManager.h +10 -8
  59. package/ios/LayoutReanimation/REAAnimationsManager.m +91 -87
  60. package/ios/LayoutReanimation/REASnapshot.h +2 -2
  61. package/ios/LayoutReanimation/REASnapshot.m +8 -7
  62. package/ios/LayoutReanimation/REAUIManager.h +4 -4
  63. package/ios/LayoutReanimation/REAUIManager.mm +116 -70
  64. package/ios/Nodes/REAAlwaysNode.m +14 -15
  65. package/ios/Nodes/REABezierNode.m +8 -7
  66. package/ios/Nodes/REABlockNode.m +1 -1
  67. package/ios/Nodes/REACallFuncNode.h +0 -1
  68. package/ios/Nodes/REACallFuncNode.m +10 -8
  69. package/ios/Nodes/REAClockNodes.m +22 -20
  70. package/ios/Nodes/REAConcatNode.h +0 -1
  71. package/ios/Nodes/REAConcatNode.m +2 -2
  72. package/ios/Nodes/REACondNode.m +7 -5
  73. package/ios/Nodes/READebugNode.m +5 -4
  74. package/ios/Nodes/REAEventNode.m +1 -1
  75. package/ios/Nodes/REAFunctionNode.h +0 -1
  76. package/ios/Nodes/REAFunctionNode.m +2 -2
  77. package/ios/Nodes/REAJSCallNode.m +4 -5
  78. package/ios/Nodes/REANode.h +3 -4
  79. package/ios/Nodes/REANode.m +9 -11
  80. package/ios/Nodes/REAOperatorNode.m +68 -67
  81. package/ios/Nodes/REAParamNode.h +1 -3
  82. package/ios/Nodes/REAParamNode.m +15 -17
  83. package/ios/Nodes/REAPropsNode.h +1 -3
  84. package/ios/Nodes/REAPropsNode.m +19 -22
  85. package/ios/Nodes/REASetNode.h +0 -1
  86. package/ios/Nodes/REASetNode.m +7 -5
  87. package/ios/Nodes/REAStyleNode.h +0 -1
  88. package/ios/Nodes/REAStyleNode.m +2 -4
  89. package/ios/Nodes/REATransformNode.h +0 -1
  90. package/ios/Nodes/REATransformNode.m +3 -5
  91. package/ios/Nodes/REAValueNode.m +5 -7
  92. package/ios/REAEventDispatcher.m +4 -4
  93. package/ios/REAModule.h +0 -2
  94. package/ios/REAModule.m +29 -38
  95. package/ios/REANodesManager.h +11 -19
  96. package/ios/REANodesManager.m +106 -130
  97. package/ios/REAUtils.h +5 -3
  98. package/ios/RNGestureHandlerStateManager.h +5 -0
  99. package/ios/Transitioning/RCTConvert+REATransition.m +45 -29
  100. package/ios/Transitioning/REAAllTransitions.h +2 -2
  101. package/ios/Transitioning/REAAllTransitions.m +14 -25
  102. package/ios/Transitioning/REATransition.h +8 -7
  103. package/ios/Transitioning/REATransition.m +19 -16
  104. package/ios/Transitioning/REATransitionAnimation.h +1 -1
  105. package/ios/Transitioning/REATransitionAnimation.m +2 -3
  106. package/ios/Transitioning/REATransitionManager.m +3 -3
  107. package/ios/native/NativeMethods.h +20 -5
  108. package/ios/native/NativeMethods.mm +14 -6
  109. package/ios/native/NativeProxy.h +4 -2
  110. package/ios/native/NativeProxy.mm +84 -63
  111. package/ios/native/REAIOSErrorHandler.h +13 -10
  112. package/ios/native/REAIOSErrorHandler.mm +19 -15
  113. package/ios/native/REAIOSLogger.h +8 -8
  114. package/ios/native/REAIOSLogger.mm +10 -6
  115. package/ios/native/REAIOSScheduler.h +5 -5
  116. package/ios/native/REAIOSScheduler.mm +17 -10
  117. package/ios/native/REAInitializer.h +5 -7
  118. package/ios/native/REAInitializer.mm +43 -31
  119. package/ios/native/UIResponder+Reanimated.mm +2 -2
  120. package/lib/Animated.js +9 -1
  121. package/lib/ConfigHelper.js +121 -138
  122. package/lib/ReanimatedEventEmitter.js +0 -1
  123. package/lib/ReanimatedModule.js +0 -1
  124. package/lib/ReanimatedModule.macos.js +0 -1
  125. package/lib/ReanimatedModule.native.js +5 -6
  126. package/lib/ReanimatedModule.windows.js +0 -1
  127. package/lib/ReanimatedModuleCompat.js +64 -35
  128. package/lib/createAnimatedComponent.js +468 -487
  129. package/lib/index.js +9 -1
  130. package/lib/reanimated2/NativeMethods.js +7 -12
  131. package/lib/reanimated2/NativeReanimated/NativeReanimated.js +37 -0
  132. package/lib/reanimated2/NativeReanimated/index.js +15 -0
  133. package/lib/reanimated2/PropAdapters.js +0 -1
  134. package/lib/reanimated2/UpdateProps.js +6 -7
  135. package/lib/reanimated2/ViewDescriptorsSet.js +4 -4
  136. package/lib/reanimated2/WorkletEventHandler.js +15 -13
  137. package/lib/reanimated2/animation/delay.js +8 -2
  138. package/lib/reanimated2/animation/spring.js +2 -0
  139. package/lib/reanimated2/animation/styleAnimation.js +7 -3
  140. package/lib/reanimated2/animation/util.js +25 -2
  141. package/lib/reanimated2/core.js +41 -17
  142. package/lib/reanimated2/globals.d.ts +21 -1
  143. package/lib/reanimated2/hook/useAnimatedRef.js +1 -1
  144. package/lib/reanimated2/hook/useAnimatedStyle.js +3 -3
  145. package/lib/reanimated2/index.js +1 -0
  146. package/lib/reanimated2/interpolation.js +95 -87
  147. package/lib/reanimated2/js-reanimated/JSReanimated.js +13 -10
  148. package/lib/reanimated2/js-reanimated/Mapper.js +4 -3
  149. package/lib/reanimated2/js-reanimated/MapperRegistry.js +3 -6
  150. package/lib/reanimated2/js-reanimated/MutableValue.js +0 -2
  151. package/lib/reanimated2/js-reanimated/index.js +10 -8
  152. package/lib/reanimated2/layoutReanimation/LayoutAnimationRepository.js +33 -2
  153. package/lib/reanimated2/layoutReanimation/animationBuilder/BaseAnimationBuilder.js +27 -124
  154. package/lib/reanimated2/layoutReanimation/animationBuilder/ComplexAnimationBuilder.js +125 -0
  155. package/lib/reanimated2/layoutReanimation/animationBuilder/index.js +1 -2
  156. package/lib/reanimated2/layoutReanimation/defaultAnimations/Bounce.js +115 -45
  157. package/lib/reanimated2/layoutReanimation/defaultAnimations/Default.js +7 -2
  158. package/lib/reanimated2/layoutReanimation/defaultAnimations/Fade.js +21 -21
  159. package/lib/reanimated2/layoutReanimation/defaultAnimations/Flip.js +25 -25
  160. package/lib/reanimated2/layoutReanimation/defaultAnimations/Lightspeed.js +19 -17
  161. package/lib/reanimated2/layoutReanimation/defaultAnimations/Pinwheel.js +5 -5
  162. package/lib/reanimated2/layoutReanimation/defaultAnimations/Roll.js +9 -9
  163. package/lib/reanimated2/layoutReanimation/defaultAnimations/Rotate.js +17 -17
  164. package/lib/reanimated2/layoutReanimation/defaultAnimations/Slide.js +19 -19
  165. package/lib/reanimated2/layoutReanimation/defaultAnimations/Stretch.js +9 -9
  166. package/lib/reanimated2/layoutReanimation/defaultAnimations/Zoom.js +33 -33
  167. package/lib/reanimated2/layoutReanimation/defaultTransitions/CurvedTransition.js +78 -0
  168. package/lib/reanimated2/layoutReanimation/defaultTransitions/EntryExitTransition.js +128 -0
  169. package/lib/reanimated2/layoutReanimation/defaultTransitions/FadingTransition.js +37 -0
  170. package/lib/reanimated2/layoutReanimation/defaultTransitions/JumpingTransition.js +41 -0
  171. package/lib/reanimated2/layoutReanimation/defaultTransitions/LinearTransition.js +34 -0
  172. package/lib/reanimated2/layoutReanimation/defaultTransitions/SequencedTransition.js +46 -0
  173. package/lib/reanimated2/layoutReanimation/defaultTransitions/index.js +6 -0
  174. package/lib/reanimated2/layoutReanimation/index.js +1 -0
  175. package/lib/reanimated2/mock.js +3 -1
  176. package/lib/reanimated2/utils.js +9 -0
  177. package/lib/setAndForwardRef.js +14 -48
  178. package/libSo/fbjni/jni/arm64-v8a/libfbjni.so +0 -0
  179. package/libSo/fbjni/jni/armeabi-v7a/libfbjni.so +0 -0
  180. package/libSo/fbjni/jni/x86/libfbjni.so +0 -0
  181. package/libSo/fbjni/jni/x86_64/libfbjni.so +0 -0
  182. package/mock.js +1 -1
  183. package/package.json +28 -17
  184. package/plugin.js +220 -39
  185. package/react-native-reanimated.d.ts +542 -547
  186. package/src/Animated.js +9 -1
  187. package/src/{ConfigHelper.js → ConfigHelper.ts} +15 -7
  188. package/src/{ReanimatedEventEmitter.js → ReanimatedEventEmitter.ts} +0 -0
  189. package/src/{ReanimatedModule.js → ReanimatedModule.macos.ts} +0 -0
  190. package/src/{ReanimatedModule.native.js → ReanimatedModule.native.ts} +0 -0
  191. package/src/{ReanimatedModule.macos.js → ReanimatedModule.ts} +0 -0
  192. package/src/{ReanimatedModule.windows.js → ReanimatedModule.windows.ts} +0 -0
  193. package/src/ReanimatedModuleCompat.ts +51 -0
  194. package/src/{createAnimatedComponent.js → createAnimatedComponent.tsx} +285 -126
  195. package/src/reanimated2/NativeMethods.ts +34 -13
  196. package/src/reanimated2/NativeReanimated/NativeReanimated.ts +72 -0
  197. package/src/reanimated2/NativeReanimated/index.ts +18 -0
  198. package/src/reanimated2/PropAdapters.ts +0 -1
  199. package/src/reanimated2/UpdateProps.ts +31 -15
  200. package/src/reanimated2/ViewDescriptorsSet.ts +15 -12
  201. package/src/reanimated2/WorkletEventHandler.ts +41 -23
  202. package/src/reanimated2/animation/commonTypes.ts +4 -4
  203. package/src/reanimated2/animation/decay.ts +2 -2
  204. package/src/reanimated2/animation/delay.ts +11 -5
  205. package/src/reanimated2/animation/index.ts +7 -7
  206. package/src/reanimated2/animation/repeat.ts +4 -4
  207. package/src/reanimated2/animation/sequence.ts +2 -2
  208. package/src/reanimated2/animation/spring.ts +6 -5
  209. package/src/reanimated2/animation/styleAnimation.ts +27 -15
  210. package/src/reanimated2/animation/timing.ts +5 -5
  211. package/src/reanimated2/animation/util.ts +47 -8
  212. package/src/reanimated2/commonTypes.ts +3 -0
  213. package/src/reanimated2/core.ts +80 -34
  214. package/src/reanimated2/globals.d.ts +21 -1
  215. package/src/reanimated2/hook/useAnimatedGestureHandler.ts +1 -1
  216. package/src/reanimated2/hook/useAnimatedRef.ts +13 -15
  217. package/src/reanimated2/hook/useAnimatedScrollHandler.ts +3 -3
  218. package/src/reanimated2/hook/useAnimatedStyle.ts +7 -7
  219. package/src/reanimated2/hook/utils.ts +4 -3
  220. package/src/reanimated2/index.ts +1 -0
  221. package/src/reanimated2/interpolation.ts +170 -103
  222. package/src/reanimated2/js-reanimated/JSReanimated.ts +37 -23
  223. package/src/reanimated2/js-reanimated/Mapper.ts +22 -9
  224. package/src/reanimated2/js-reanimated/MapperRegistry.ts +22 -19
  225. package/src/reanimated2/js-reanimated/MutableValue.ts +11 -11
  226. package/src/reanimated2/js-reanimated/index.ts +31 -14
  227. package/src/reanimated2/layoutReanimation/LayoutAnimationRepository.ts +75 -0
  228. package/src/reanimated2/layoutReanimation/animationBuilder/BaseAnimationBuilder.ts +29 -159
  229. package/src/reanimated2/layoutReanimation/animationBuilder/ComplexAnimationBuilder.ts +169 -0
  230. package/src/reanimated2/layoutReanimation/animationBuilder/Keyframe.ts +2 -2
  231. package/src/reanimated2/layoutReanimation/animationBuilder/commonTypes.ts +3 -9
  232. package/src/reanimated2/layoutReanimation/animationBuilder/index.ts +1 -5
  233. package/src/reanimated2/layoutReanimation/defaultAnimations/Bounce.ts +162 -82
  234. package/src/reanimated2/layoutReanimation/defaultAnimations/Default.ts +7 -2
  235. package/src/reanimated2/layoutReanimation/defaultAnimations/Fade.ts +32 -32
  236. package/src/reanimated2/layoutReanimation/defaultAnimations/Flip.ts +38 -38
  237. package/src/reanimated2/layoutReanimation/defaultAnimations/Lightspeed.ts +34 -32
  238. package/src/reanimated2/layoutReanimation/defaultAnimations/Pinwheel.ts +8 -8
  239. package/src/reanimated2/layoutReanimation/defaultAnimations/Roll.ts +14 -14
  240. package/src/reanimated2/layoutReanimation/defaultAnimations/Rotate.ts +26 -26
  241. package/src/reanimated2/layoutReanimation/defaultAnimations/Slide.ts +28 -28
  242. package/src/reanimated2/layoutReanimation/defaultAnimations/Stretch.ts +14 -14
  243. package/src/reanimated2/layoutReanimation/defaultAnimations/Zoom.ts +50 -50
  244. package/src/reanimated2/layoutReanimation/defaultTransitions/CurvedTransition.ts +104 -0
  245. package/src/reanimated2/layoutReanimation/defaultTransitions/EntryExitTransition.ts +213 -0
  246. package/src/reanimated2/layoutReanimation/defaultTransitions/FadingTransition.ts +60 -0
  247. package/src/reanimated2/layoutReanimation/defaultTransitions/JumpingTransition.ts +58 -0
  248. package/src/reanimated2/layoutReanimation/defaultTransitions/LinearTransition.ts +41 -0
  249. package/src/reanimated2/layoutReanimation/defaultTransitions/SequencedTransition.ts +78 -0
  250. package/src/reanimated2/layoutReanimation/defaultTransitions/index.ts +6 -0
  251. package/src/reanimated2/layoutReanimation/index.ts +1 -0
  252. package/src/reanimated2/mock.ts +3 -1
  253. package/src/reanimated2/utils.ts +21 -0
  254. package/src/{setAndForwardRef.js → setAndForwardRef.ts} +12 -2
  255. package/android/react-native-reanimated-62-hermes.aar +0 -0
  256. package/android/react-native-reanimated-62-jsc.aar +0 -0
  257. package/lib/reanimated2/NativeReanimated.js +0 -48
  258. package/lib/reanimated2/layoutReanimation/animationBuilder/BaseBounceAnimationBuilder.js +0 -55
  259. package/lib/reanimated2/layoutReanimation/animationBuilder/LayoutAnimationBuilder.js +0 -165
  260. package/src/ReanimatedModuleCompat.js +0 -37
  261. package/src/reanimated2/NativeReanimated.ts +0 -70
  262. package/src/reanimated2/layoutReanimation/LayoutAnimationRepository.tsx +0 -41
  263. package/src/reanimated2/layoutReanimation/animationBuilder/BaseBounceAnimationBuilder.ts +0 -82
  264. package/src/reanimated2/layoutReanimation/animationBuilder/LayoutAnimationBuilder.ts +0 -217
@@ -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,77 +1,76 @@
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 "FeaturesConfig.h"
7
+ #include "FrozenObject.h"
12
8
  #include "JSIStoreValueUser.h"
9
+ #include "Mapper.h"
10
+ #include "MapperRegistry.h"
13
11
  #include "ReanimatedHiddenHeaders.h"
12
+ #include "RuntimeDecorator.h"
13
+ #include "ShareableValue.h"
14
+ #include "WorkletEventHandler.h"
14
15
 
15
16
  using namespace facebook;
16
17
 
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);
18
+ namespace reanimated {
19
+
20
+ void extractMutables(
21
+ jsi::Runtime &rt,
22
+ std::shared_ptr<ShareableValue> sv,
23
+ std::vector<std::shared_ptr<MutableValue>> &res) {
24
+ switch (sv->type) {
25
+ case ValueType::MutableValueType: {
26
+ auto &mutableValue = ValueWrapper::asMutableValue(sv->valueContainer);
27
+ res.push_back(mutableValue);
28
+ break;
35
29
  }
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);
42
- }
43
- break;
44
- default:
45
- break;
30
+ case ValueType::FrozenArrayType:
31
+ for (auto &it : ValueWrapper::asFrozenArray(sv->valueContainer)) {
32
+ extractMutables(rt, it, res);
33
+ }
34
+ break;
35
+ case ValueType::RemoteObjectType:
36
+ case ValueType::FrozenObjectType:
37
+ for (auto &it : ValueWrapper::asFrozenObject(sv->valueContainer)->map) {
38
+ extractMutables(rt, it.second, res);
39
+ }
40
+ break;
41
+ default:
42
+ break;
46
43
  }
47
44
  }
48
45
 
49
- std::vector<std::shared_ptr<MutableValue>> extractMutablesFromArray(jsi::Runtime &rt, const jsi::Array &array, NativeReanimatedModule *module)
50
- {
46
+ std::vector<std::shared_ptr<MutableValue>> extractMutablesFromArray(
47
+ jsi::Runtime &rt,
48
+ const jsi::Array &array,
49
+ NativeReanimatedModule *module) {
51
50
  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);
51
+ for (size_t i = 0, size = array.size(rt); i < size; i++) {
52
+ auto shareable =
53
+ ShareableValue::adapt(rt, array.getValueAtIndex(rt, i), module);
55
54
  extractMutables(rt, shareable, res);
56
55
  }
57
56
  return res;
58
57
  }
59
58
 
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
-
59
+ NativeReanimatedModule::NativeReanimatedModule(
60
+ 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 &)>
65
+ propObtainer,
66
+ std::shared_ptr<LayoutAnimationsProxy> layoutAnimationsProxy,
67
+ PlatformDepMethodsHolder platformDepMethodsHolder)
68
+ : NativeReanimatedModuleSpec(jsInvoker),
69
+ RuntimeManager(rt, errorHandler, scheduler, RuntimeType::UI),
70
+ mapperRegistry(std::make_shared<MapperRegistry>()),
71
+ eventHandlerRegistry(std::make_shared<EventHandlerRegistry>()),
72
+ requestRender(platformDepMethodsHolder.requestRender),
73
+ propObtainer(propObtainer) {
75
74
  auto requestAnimationFrame = [=](FrameCallback callback) {
76
75
  frameCallbacks.push_back(callback);
77
76
  maybeRequestRender();
@@ -79,86 +78,100 @@ NativeReanimatedModule::NativeReanimatedModule(std::shared_ptr<CallInvoker> jsIn
79
78
 
80
79
  this->layoutAnimationsProxy = layoutAnimationsProxy;
81
80
 
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) {
81
+ RuntimeDecorator::decorateUIRuntime(
82
+ *runtime,
83
+ platformDepMethodsHolder.updaterFunction,
84
+ requestAnimationFrame,
85
+ platformDepMethodsHolder.scrollToFunction,
86
+ platformDepMethodsHolder.measuringFunction,
87
+ platformDepMethodsHolder.getCurrentTime,
88
+ platformDepMethodsHolder.setGestureStateFunction,
89
+ layoutAnimationsProxy);
90
+ onRenderCallback = [this](double timestampMs) {
90
91
  this->renderRequested = false;
91
92
  this->onRender(timestampMs);
92
93
  };
93
94
  updaterFunction = platformDepMethodsHolder.updaterFunction;
94
95
  }
95
96
 
96
- void NativeReanimatedModule::installCoreFunctions(jsi::Runtime &rt, const jsi::Value &valueSetter)
97
- {
97
+ void NativeReanimatedModule::installCoreFunctions(
98
+ jsi::Runtime &rt,
99
+ const jsi::Value &valueSetter) {
98
100
  this->valueSetter = ShareableValue::adapt(rt, valueSetter, this);
99
101
  }
100
102
 
101
- jsi::Value NativeReanimatedModule::makeShareable(jsi::Runtime &rt, const jsi::Value &value)
102
- {
103
+ jsi::Value NativeReanimatedModule::makeShareable(
104
+ jsi::Runtime &rt,
105
+ const jsi::Value &value) {
103
106
  return ShareableValue::adapt(rt, value, this)->getValue(rt);
104
107
  }
105
108
 
106
- jsi::Value NativeReanimatedModule::makeMutable(jsi::Runtime &rt, const jsi::Value &value)
107
- {
108
- return ShareableValue::adapt(rt, value, this, ValueType::MutableValueType)->getValue(rt);
109
+ jsi::Value NativeReanimatedModule::makeMutable(
110
+ jsi::Runtime &rt,
111
+ const jsi::Value &value) {
112
+ return ShareableValue::adapt(rt, value, this, ValueType::MutableValueType)
113
+ ->getValue(rt);
109
114
  }
110
115
 
111
- jsi::Value NativeReanimatedModule::makeRemote(jsi::Runtime &rt, const jsi::Value &value)
112
- {
113
- return ShareableValue::adapt(rt, value, this, ValueType::RemoteObjectType)->getValue(rt);
116
+ jsi::Value NativeReanimatedModule::makeRemote(
117
+ jsi::Runtime &rt,
118
+ const jsi::Value &value) {
119
+ return ShareableValue::adapt(rt, value, this, ValueType::RemoteObjectType)
120
+ ->getValue(rt);
114
121
  }
115
122
 
116
123
  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 &viewDescriptors)
123
- {
124
+ jsi::Runtime &rt,
125
+ const jsi::Value &worklet,
126
+ const jsi::Value &inputs,
127
+ const jsi::Value &outputs,
128
+ const jsi::Value &updater,
129
+ const jsi::Value &viewDescriptors) {
124
130
  static unsigned long MAPPER_ID = 1;
125
131
 
126
132
  unsigned long newMapperId = MAPPER_ID++;
127
133
  auto mapperShareable = ShareableValue::adapt(rt, worklet, this);
128
- auto inputMutables = extractMutablesFromArray(rt, inputs.asObject(rt).asArray(rt), this);
129
- auto outputMutables = extractMutablesFromArray(rt, outputs.asObject(rt).asArray(rt), this);
134
+ auto inputMutables =
135
+ extractMutablesFromArray(rt, inputs.asObject(rt).asArray(rt), this);
136
+ auto outputMutables =
137
+ extractMutablesFromArray(rt, outputs.asObject(rt).asArray(rt), this);
130
138
 
131
139
  int optimalizationLvl = 0;
132
- auto optimalization = updater.asObject(rt).getProperty(rt, "__optimalization");
133
- if(optimalization.isNumber()) {
140
+ auto optimalization =
141
+ updater.asObject(rt).getProperty(rt, "__optimalization");
142
+ if (optimalization.isNumber()) {
134
143
  optimalizationLvl = optimalization.asNumber();
135
144
  }
136
145
  auto updaterSV = ShareableValue::adapt(rt, updater, this);
137
146
  auto viewDescriptorsSV = ShareableValue::adapt(rt, viewDescriptors, this);
138
147
 
139
148
  scheduler->scheduleOnUI([=] {
140
- auto mapperFunction = mapperShareable->getValue(*runtime).asObject(*runtime).asFunction(*runtime);
141
- std::shared_ptr<jsi::Function> mapperFunctionPointer = std::make_shared<jsi::Function>(std::move(mapperFunction));
149
+ auto mapperFunction =
150
+ mapperShareable->getValue(*runtime).asObject(*runtime).asFunction(
151
+ *runtime);
152
+ std::shared_ptr<jsi::Function> mapperFunctionPointer =
153
+ std::make_shared<jsi::Function>(std::move(mapperFunction));
142
154
 
143
155
  std::shared_ptr<Mapper> mapperPointer = std::make_shared<Mapper>(
144
- this,
145
- newMapperId,
146
- mapperFunctionPointer,
147
- inputMutables,
148
- outputMutables
149
- );
150
- if(optimalizationLvl > 0) {
151
- mapperPointer->enableFastMode(optimalizationLvl, updaterSV, viewDescriptorsSV);
156
+ this,
157
+ newMapperId,
158
+ mapperFunctionPointer,
159
+ inputMutables,
160
+ outputMutables);
161
+ if (optimalizationLvl > 0) {
162
+ mapperPointer->enableFastMode(
163
+ optimalizationLvl, updaterSV, viewDescriptorsSV);
152
164
  }
153
165
  mapperRegistry->startMapper(mapperPointer);
154
166
  maybeRequestRender();
155
167
  });
156
168
 
157
- return jsi::Value((double)newMapperId);
169
+ return jsi::Value(static_cast<double>(newMapperId));
158
170
  }
159
171
 
160
- void NativeReanimatedModule::stopMapper(jsi::Runtime &rt, const jsi::Value &mapperId)
161
- {
172
+ void NativeReanimatedModule::stopMapper(
173
+ jsi::Runtime &rt,
174
+ const jsi::Value &mapperId) {
162
175
  unsigned long id = mapperId.asNumber();
163
176
  scheduler->scheduleOnUI([=] {
164
177
  mapperRegistry->stopMapper(id);
@@ -166,8 +179,10 @@ void NativeReanimatedModule::stopMapper(jsi::Runtime &rt, const jsi::Value &mapp
166
179
  });
167
180
  }
168
181
 
169
- jsi::Value NativeReanimatedModule::registerEventHandler(jsi::Runtime &rt, const jsi::Value &eventHash, const jsi::Value &worklet)
170
- {
182
+ jsi::Value NativeReanimatedModule::registerEventHandler(
183
+ jsi::Runtime &rt,
184
+ const jsi::Value &eventHash,
185
+ const jsi::Value &worklet) {
171
186
  static unsigned long EVENT_HANDLER_ID = 1;
172
187
 
173
188
  unsigned long newRegistrationId = EVENT_HANDLER_ID++;
@@ -175,37 +190,45 @@ jsi::Value NativeReanimatedModule::registerEventHandler(jsi::Runtime &rt, const
175
190
  auto handlerShareable = ShareableValue::adapt(rt, worklet, this);
176
191
 
177
192
  scheduler->scheduleOnUI([=] {
178
- auto handlerFunction = handlerShareable->getValue(*runtime).asObject(*runtime).asFunction(*runtime);
179
- auto handler = std::make_shared<WorkletEventHandler>(newRegistrationId, eventName, std::move(handlerFunction));
193
+ auto handlerFunction =
194
+ handlerShareable->getValue(*runtime).asObject(*runtime).asFunction(
195
+ *runtime);
196
+ auto handler = std::make_shared<WorkletEventHandler>(
197
+ newRegistrationId, eventName, std::move(handlerFunction));
180
198
  eventHandlerRegistry->registerEventHandler(handler);
181
199
  });
182
200
 
183
- return jsi::Value((double)newRegistrationId);
201
+ return jsi::Value(static_cast<double>(newRegistrationId));
184
202
  }
185
203
 
186
- void NativeReanimatedModule::unregisterEventHandler(jsi::Runtime &rt, const jsi::Value &registrationId)
187
- {
204
+ void NativeReanimatedModule::unregisterEventHandler(
205
+ jsi::Runtime &rt,
206
+ const jsi::Value &registrationId) {
188
207
  unsigned long id = registrationId.asNumber();
189
- scheduler->scheduleOnUI([=] {
190
- eventHandlerRegistry->unregisterEventHandler(id);
191
- });
208
+ scheduler->scheduleOnUI(
209
+ [=] { eventHandlerRegistry->unregisterEventHandler(id); });
192
210
  }
193
211
 
194
- jsi::Value NativeReanimatedModule::getViewProp(jsi::Runtime &rt, const jsi::Value &viewTag, const jsi::Value &propName, const jsi::Value &callback)
195
- {
196
-
197
- const int viewTagInt = (int)viewTag.asNumber();
212
+ jsi::Value NativeReanimatedModule::getViewProp(
213
+ jsi::Runtime &rt,
214
+ const jsi::Value &viewTag,
215
+ const jsi::Value &propName,
216
+ const jsi::Value &callback) {
217
+ const int viewTagInt = static_cast<int>(viewTag.asNumber());
198
218
  std::string propNameStr = propName.asString(rt).utf8(rt);
199
219
  jsi::Function fun = callback.getObject(rt).asFunction(rt);
200
- std::shared_ptr<jsi::Function> funPtr = std::make_shared<jsi::Function>(std::move(fun));
220
+ std::shared_ptr<jsi::Function> funPtr =
221
+ std::make_shared<jsi::Function>(std::move(fun));
201
222
 
202
223
  scheduler->scheduleOnUI([&rt, viewTagInt, funPtr, this, propNameStr]() {
203
- const jsi::String propNameValue = jsi::String::createFromUtf8(rt, propNameStr);
224
+ const jsi::String propNameValue =
225
+ jsi::String::createFromUtf8(rt, propNameStr);
204
226
  jsi::Value result = propObtainer(rt, viewTagInt, propNameValue);
205
227
  std::string resultStr = result.asString(rt).utf8(rt);
206
228
 
207
229
  scheduler->scheduleOnJS([&rt, resultStr, funPtr]() {
208
- const jsi::String resultValue = jsi::String::createFromUtf8(rt, resultStr);
230
+ const jsi::String resultValue =
231
+ jsi::String::createFromUtf8(rt, resultStr);
209
232
  funPtr->call(rt, resultValue);
210
233
  });
211
234
  });
@@ -213,63 +236,62 @@ jsi::Value NativeReanimatedModule::getViewProp(jsi::Runtime &rt, const jsi::Valu
213
236
  return jsi::Value::undefined();
214
237
  }
215
238
 
216
- void NativeReanimatedModule::onEvent(std::string eventName, std::string eventAsString)
217
- {
218
- try
219
- {
220
- eventHandlerRegistry->processEvent(*runtime, eventName, eventAsString);
221
- mapperRegistry->execute(*runtime);
222
- if (mapperRegistry->needRunOnRender())
223
- {
224
- maybeRequestRender();
225
- }
239
+ jsi::Value NativeReanimatedModule::enableLayoutAnimations(
240
+ jsi::Runtime &rt,
241
+ const jsi::Value &config) {
242
+ FeaturesConfig::setLayoutAnimationEnabled(config.getBool());
243
+ return jsi::Value::undefined();
244
+ }
245
+
246
+ void NativeReanimatedModule::onEvent(
247
+ std::string eventName,
248
+ std::string eventAsString) {
249
+ try {
250
+ eventHandlerRegistry->processEvent(*runtime, eventName, eventAsString);
251
+ mapperRegistry->execute(*runtime);
252
+ if (mapperRegistry->needRunOnRender()) {
253
+ maybeRequestRender();
226
254
  }
227
- catch(std::exception &e) {
228
- std::string str = e.what();
229
- this->errorHandler->setError(str);
230
- this->errorHandler->raise();
231
- } catch(...) {
232
- std::string str = "OnEvent error";
233
- this->errorHandler->setError(str);
234
- this->errorHandler->raise();
255
+ } catch (std::exception &e) {
256
+ std::string str = e.what();
257
+ this->errorHandler->setError(str);
258
+ this->errorHandler->raise();
259
+ } catch (...) {
260
+ std::string str = "OnEvent error";
261
+ this->errorHandler->setError(str);
262
+ this->errorHandler->raise();
235
263
  }
236
264
  }
237
265
 
238
- bool NativeReanimatedModule::isAnyHandlerWaitingForEvent(std::string eventName) {
266
+ bool NativeReanimatedModule::isAnyHandlerWaitingForEvent(
267
+ std::string eventName) {
239
268
  return eventHandlerRegistry->isAnyHandlerWaitingForEvent(eventName);
240
269
  }
241
270
 
242
-
243
- void NativeReanimatedModule::maybeRequestRender()
244
- {
245
- if (!renderRequested)
246
- {
271
+ void NativeReanimatedModule::maybeRequestRender() {
272
+ if (!renderRequested) {
247
273
  renderRequested = true;
248
274
  requestRender(onRenderCallback, *this->runtime);
249
275
  }
250
276
  }
251
277
 
252
- void NativeReanimatedModule::onRender(double timestampMs)
253
- {
254
- try
255
- {
256
- std::vector<FrameCallback> callbacks = frameCallbacks;
257
- frameCallbacks.clear();
258
- for (auto& callback : callbacks)
259
- {
260
- callback(timestampMs);
261
- }
262
- mapperRegistry->execute(*runtime);
278
+ void NativeReanimatedModule::onRender(double timestampMs) {
279
+ try {
280
+ std::vector<FrameCallback> callbacks = frameCallbacks;
281
+ frameCallbacks.clear();
282
+ for (auto &callback : callbacks) {
283
+ callback(timestampMs);
284
+ }
285
+ mapperRegistry->execute(*runtime);
263
286
 
264
- if (mapperRegistry->needRunOnRender())
265
- {
287
+ if (mapperRegistry->needRunOnRender()) {
266
288
  maybeRequestRender();
267
289
  }
268
- } catch(std::exception &e) {
290
+ } catch (std::exception &e) {
269
291
  std::string str = e.what();
270
292
  this->errorHandler->setError(str);
271
293
  this->errorHandler->raise();
272
- } catch(...) {
294
+ } catch (...) {
273
295
  std::string str = "OnRender error";
274
296
  this->errorHandler->setError(str);
275
297
  this->errorHandler->raise();
@@ -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,12 +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]));
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]));
56
58
  }
57
59
 
58
60
  static jsi::Value __hostFunction_NativeReanimatedModuleSpec_stopMapper(
@@ -65,7 +67,8 @@ static jsi::Value __hostFunction_NativeReanimatedModuleSpec_stopMapper(
65
67
  return jsi::Value::undefined();
66
68
  }
67
69
 
68
- static jsi::Value __hostFunction_NativeReanimatedModuleSpec_registerEventHandler(
70
+ static jsi::Value
71
+ __hostFunction_NativeReanimatedModuleSpec_registerEventHandler(
69
72
  jsi::Runtime &rt,
70
73
  TurboModule &turboModule,
71
74
  const jsi::Value *args,
@@ -74,7 +77,8 @@ static jsi::Value __hostFunction_NativeReanimatedModuleSpec_registerEventHandler
74
77
  ->registerEventHandler(rt, std::move(args[0]), std::move(args[1]));
75
78
  }
76
79
 
77
- static jsi::Value __hostFunction_NativeReanimatedModuleSpec_unregisterEventHandler(
80
+ static jsi::Value
81
+ __hostFunction_NativeReanimatedModuleSpec_unregisterEventHandler(
78
82
  jsi::Runtime &rt,
79
83
  TurboModule &turboModule,
80
84
  const jsi::Value *args,
@@ -90,37 +94,49 @@ static jsi::Value __hostFunction_NativeReanimatedModuleSpec_getViewProp(
90
94
  const jsi::Value *args,
91
95
  size_t count) {
92
96
  static_cast<NativeReanimatedModuleSpec *>(&turboModule)
93
- ->getViewProp(rt, std::move(args[0]), std::move(args[1]), std::move(args[2]));
94
- 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();
100
+ }
101
+
102
+ static jsi::Value
103
+ __hostFunction_NativeReanimatedModuleSpec_enableLayoutAnimations(
104
+ jsi::Runtime &rt,
105
+ TurboModule &turboModule,
106
+ const jsi::Value *args,
107
+ size_t count) {
108
+ static_cast<NativeReanimatedModuleSpec *>(&turboModule)
109
+ ->enableLayoutAnimations(rt, std::move(args[0]));
110
+ return jsi::Value::undefined();
95
111
  }
96
112
 
97
- NativeReanimatedModuleSpec::NativeReanimatedModuleSpec(std::shared_ptr<CallInvoker> jsInvoker)
113
+ NativeReanimatedModuleSpec::NativeReanimatedModuleSpec(
114
+ std::shared_ptr<CallInvoker> jsInvoker)
98
115
  : TurboModule("NativeReanimated", jsInvoker) {
99
116
  methodMap_["installCoreFunctions"] = MethodMetadata{
100
- 1, __hostFunction_NativeReanimatedModuleSpec_installCoreFunctions};
101
-
117
+ 1, __hostFunction_NativeReanimatedModuleSpec_installCoreFunctions};
102
118
 
103
119
  methodMap_["makeShareable"] = MethodMetadata{
104
120
  1, __hostFunction_NativeReanimatedModuleSpec_makeShareable};
105
- methodMap_["makeMutable"] = MethodMetadata{
106
- 1, __hostFunction_NativeReanimatedModuleSpec_makeMutable};
107
- methodMap_["makeRemote"] = MethodMetadata{
108
- 1, __hostFunction_NativeReanimatedModuleSpec_makeRemote};
109
-
121
+ methodMap_["makeMutable"] =
122
+ MethodMetadata{1, __hostFunction_NativeReanimatedModuleSpec_makeMutable};
123
+ methodMap_["makeRemote"] =
124
+ MethodMetadata{1, __hostFunction_NativeReanimatedModuleSpec_makeRemote};
110
125
 
111
- methodMap_["startMapper"] = MethodMetadata{
112
- 5, __hostFunction_NativeReanimatedModuleSpec_startMapper};
113
- methodMap_["stopMapper"] = MethodMetadata{
114
- 1, __hostFunction_NativeReanimatedModuleSpec_stopMapper};
126
+ methodMap_["startMapper"] =
127
+ MethodMetadata{5, __hostFunction_NativeReanimatedModuleSpec_startMapper};
128
+ methodMap_["stopMapper"] =
129
+ MethodMetadata{1, __hostFunction_NativeReanimatedModuleSpec_stopMapper};
115
130
 
116
131
  methodMap_["registerEventHandler"] = MethodMetadata{
117
- 2, __hostFunction_NativeReanimatedModuleSpec_registerEventHandler};
132
+ 2, __hostFunction_NativeReanimatedModuleSpec_registerEventHandler};
118
133
  methodMap_["unregisterEventHandler"] = MethodMetadata{
119
- 1, __hostFunction_NativeReanimatedModuleSpec_unregisterEventHandler};
120
-
121
- methodMap_["getViewProp"] = MethodMetadata{
122
- 3, __hostFunction_NativeReanimatedModuleSpec_getViewProp};
123
- }
134
+ 1, __hostFunction_NativeReanimatedModuleSpec_unregisterEventHandler};
124
135
 
136
+ methodMap_["getViewProp"] =
137
+ MethodMetadata{3, __hostFunction_NativeReanimatedModuleSpec_getViewProp};
138
+ methodMap_["enableLayoutAnimations"] = MethodMetadata{
139
+ 2, __hostFunction_NativeReanimatedModuleSpec_enableLayoutAnimations};
125
140
  }
126
141
 
142
+ } // namespace reanimated