react-native-reanimated 3.6.0 → 3.6.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 (263) hide show
  1. package/lib/module/createAnimatedComponent/createAnimatedComponent.js +12 -0
  2. package/lib/module/createAnimatedComponent/createAnimatedComponent.js.map +1 -1
  3. package/lib/module/createAnimatedComponent/setAndForwardRef.js +2 -0
  4. package/lib/module/createAnimatedComponent/setAndForwardRef.js.map +1 -1
  5. package/lib/module/reanimated2/Easing.js +3 -3
  6. package/lib/module/reanimated2/Easing.js.map +1 -1
  7. package/lib/module/reanimated2/PlatformChecker.js.map +1 -1
  8. package/lib/module/reanimated2/animation/decay/decay.js +9 -0
  9. package/lib/module/reanimated2/animation/decay/decay.js.map +1 -1
  10. package/lib/module/reanimated2/animation/decay/utils.js +13 -0
  11. package/lib/module/reanimated2/animation/decay/utils.js.map +1 -1
  12. package/lib/module/reanimated2/animation/delay.js +9 -0
  13. package/lib/module/reanimated2/animation/delay.js.map +1 -1
  14. package/lib/module/reanimated2/animation/repeat.js +11 -0
  15. package/lib/module/reanimated2/animation/repeat.js.map +1 -1
  16. package/lib/module/reanimated2/animation/sequence.js +10 -0
  17. package/lib/module/reanimated2/animation/sequence.js.map +1 -1
  18. package/lib/module/reanimated2/animation/spring.js +9 -0
  19. package/lib/module/reanimated2/animation/spring.js.map +1 -1
  20. package/lib/module/reanimated2/animation/springUtils.js +16 -0
  21. package/lib/module/reanimated2/animation/springUtils.js.map +1 -1
  22. package/lib/module/reanimated2/animation/timing.js +18 -0
  23. package/lib/module/reanimated2/animation/timing.js.map +1 -1
  24. package/lib/module/reanimated2/animation/util.js +7 -0
  25. package/lib/module/reanimated2/animation/util.js.map +1 -1
  26. package/lib/module/reanimated2/commonTypes.js +30 -7
  27. package/lib/module/reanimated2/commonTypes.js.map +1 -1
  28. package/lib/module/reanimated2/component/FlatList.js.map +1 -1
  29. package/lib/module/reanimated2/component/LayoutAnimationConfig.js +7 -0
  30. package/lib/module/reanimated2/component/LayoutAnimationConfig.js.map +1 -1
  31. package/lib/module/reanimated2/component/ScrollView.js.map +1 -1
  32. package/lib/module/reanimated2/globals.d.js.map +1 -1
  33. package/lib/module/reanimated2/helperTypes.js.map +1 -1
  34. package/lib/module/reanimated2/hook/useAnimatedKeyboard.js +8 -0
  35. package/lib/module/reanimated2/hook/useAnimatedKeyboard.js.map +1 -1
  36. package/lib/module/reanimated2/hook/useAnimatedProps.js +9 -0
  37. package/lib/module/reanimated2/hook/useAnimatedProps.js.map +1 -1
  38. package/lib/module/reanimated2/hook/useAnimatedReaction.js +6 -4
  39. package/lib/module/reanimated2/hook/useAnimatedReaction.js.map +1 -1
  40. package/lib/module/reanimated2/hook/useAnimatedRef.js +7 -0
  41. package/lib/module/reanimated2/hook/useAnimatedRef.js.map +1 -1
  42. package/lib/module/reanimated2/hook/useAnimatedScrollHandler.js +10 -2
  43. package/lib/module/reanimated2/hook/useAnimatedScrollHandler.js.map +1 -1
  44. package/lib/module/reanimated2/hook/useAnimatedSensor.js +10 -0
  45. package/lib/module/reanimated2/hook/useAnimatedSensor.js.map +1 -1
  46. package/lib/module/reanimated2/hook/useAnimatedStyle.js +8 -0
  47. package/lib/module/reanimated2/hook/useAnimatedStyle.js.map +1 -1
  48. package/lib/module/reanimated2/hook/useDerivedValue.js +14 -8
  49. package/lib/module/reanimated2/hook/useDerivedValue.js.map +1 -1
  50. package/lib/module/reanimated2/hook/useEvent.js +7 -6
  51. package/lib/module/reanimated2/hook/useEvent.js.map +1 -1
  52. package/lib/module/reanimated2/hook/useFrameCallback.js +17 -0
  53. package/lib/module/reanimated2/hook/useFrameCallback.js.map +1 -1
  54. package/lib/module/reanimated2/hook/useHandler.js +8 -2
  55. package/lib/module/reanimated2/hook/useHandler.js.map +1 -1
  56. package/lib/module/reanimated2/hook/useReducedMotion.js +9 -0
  57. package/lib/module/reanimated2/hook/useReducedMotion.js.map +1 -1
  58. package/lib/module/reanimated2/hook/useScrollViewOffset.js +8 -0
  59. package/lib/module/reanimated2/hook/useScrollViewOffset.js.map +1 -1
  60. package/lib/module/reanimated2/hook/useSharedValue.js +11 -3
  61. package/lib/module/reanimated2/hook/useSharedValue.js.map +1 -1
  62. package/lib/module/reanimated2/hook/useWorkletCallback.js +3 -0
  63. package/lib/module/reanimated2/hook/useWorkletCallback.js.map +1 -1
  64. package/lib/module/reanimated2/index.js +1 -1
  65. package/lib/module/reanimated2/index.js.map +1 -1
  66. package/lib/module/reanimated2/interpolateColor.js +21 -0
  67. package/lib/module/reanimated2/interpolateColor.js.map +1 -1
  68. package/lib/module/reanimated2/interpolation.js +51 -21
  69. package/lib/module/reanimated2/interpolation.js.map +1 -1
  70. package/lib/module/reanimated2/layoutReanimation/animationBuilder/BaseAnimationBuilder.js +29 -2
  71. package/lib/module/reanimated2/layoutReanimation/animationBuilder/BaseAnimationBuilder.js.map +1 -1
  72. package/lib/module/reanimated2/layoutReanimation/animationBuilder/ComplexAnimationBuilder.js +67 -2
  73. package/lib/module/reanimated2/layoutReanimation/animationBuilder/ComplexAnimationBuilder.js.map +1 -1
  74. package/lib/module/reanimated2/layoutReanimation/animationBuilder/Keyframe.js +6 -3
  75. package/lib/module/reanimated2/layoutReanimation/animationBuilder/Keyframe.js.map +1 -1
  76. package/lib/module/reanimated2/layoutReanimation/animationBuilder/commonTypes.js +4 -0
  77. package/lib/module/reanimated2/layoutReanimation/animationBuilder/commonTypes.js.map +1 -1
  78. package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Bounce.js +80 -0
  79. package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Bounce.js.map +1 -1
  80. package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Fade.js +79 -0
  81. package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Fade.js.map +1 -1
  82. package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Flip.js +96 -0
  83. package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Flip.js.map +1 -1
  84. package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Lightspeed.js +31 -0
  85. package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Lightspeed.js.map +1 -1
  86. package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Pinwheel.js +15 -0
  87. package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Pinwheel.js.map +1 -1
  88. package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Roll.js +31 -0
  89. package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Roll.js.map +1 -1
  90. package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Rotate.js +63 -0
  91. package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Rotate.js.map +1 -1
  92. package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Slide.js +64 -0
  93. package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Slide.js.map +1 -1
  94. package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Stretch.js +32 -0
  95. package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Stretch.js.map +1 -1
  96. package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Zoom.js +128 -0
  97. package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Zoom.js.map +1 -1
  98. package/lib/module/reanimated2/layoutReanimation/defaultTransitions/CurvedTransition.js +8 -0
  99. package/lib/module/reanimated2/layoutReanimation/defaultTransitions/CurvedTransition.js.map +1 -1
  100. package/lib/module/reanimated2/layoutReanimation/defaultTransitions/EntryExitTransition.js +9 -0
  101. package/lib/module/reanimated2/layoutReanimation/defaultTransitions/EntryExitTransition.js.map +1 -1
  102. package/lib/module/reanimated2/layoutReanimation/defaultTransitions/FadingTransition.js +8 -0
  103. package/lib/module/reanimated2/layoutReanimation/defaultTransitions/FadingTransition.js.map +1 -1
  104. package/lib/module/reanimated2/layoutReanimation/defaultTransitions/JumpingTransition.js +8 -0
  105. package/lib/module/reanimated2/layoutReanimation/defaultTransitions/JumpingTransition.js.map +1 -1
  106. package/lib/module/reanimated2/layoutReanimation/defaultTransitions/LinearTransition.js +10 -3
  107. package/lib/module/reanimated2/layoutReanimation/defaultTransitions/LinearTransition.js.map +1 -1
  108. package/lib/module/reanimated2/layoutReanimation/defaultTransitions/SequencedTransition.js +8 -0
  109. package/lib/module/reanimated2/layoutReanimation/defaultTransitions/SequencedTransition.js.map +1 -1
  110. package/lib/module/reanimated2/layoutReanimation/sharedTransitions/SharedTransition.js +49 -3
  111. package/lib/module/reanimated2/layoutReanimation/sharedTransitions/SharedTransition.js.map +1 -1
  112. package/lib/module/reanimated2/layoutReanimation/web/createAnimation.js +4 -4
  113. package/lib/module/reanimated2/layoutReanimation/web/createAnimation.js.map +1 -1
  114. package/lib/module/reanimated2/platform-specific/checkCppVersion.js +0 -2
  115. package/lib/module/reanimated2/platform-specific/checkCppVersion.js.map +1 -1
  116. package/lib/module/reanimated2/platform-specific/jsVersion.js +1 -1
  117. package/lib/module/reanimated2/platform-specific/jsVersion.js.map +1 -1
  118. package/lib/module/reanimated2/platformFunctions/dispatchCommand.js +9 -0
  119. package/lib/module/reanimated2/platformFunctions/dispatchCommand.js.map +1 -1
  120. package/lib/module/reanimated2/platformFunctions/getRelativeCoords.js +14 -4
  121. package/lib/module/reanimated2/platformFunctions/getRelativeCoords.js.map +1 -1
  122. package/lib/module/reanimated2/platformFunctions/measure.js +7 -0
  123. package/lib/module/reanimated2/platformFunctions/measure.js.map +1 -1
  124. package/lib/module/reanimated2/platformFunctions/scrollTo.js +9 -0
  125. package/lib/module/reanimated2/platformFunctions/scrollTo.js.map +1 -1
  126. package/lib/module/reanimated2/platformFunctions/setNativeProps.js +8 -0
  127. package/lib/module/reanimated2/platformFunctions/setNativeProps.js.map +1 -1
  128. package/lib/module/reanimated2/runtimes.js +8 -0
  129. package/lib/module/reanimated2/runtimes.js.map +1 -1
  130. package/lib/module/reanimated2/threads.js +16 -6
  131. package/lib/module/reanimated2/threads.js.map +1 -1
  132. package/lib/typescript/createAnimatedComponent/createAnimatedComponent.d.ts +12 -0
  133. package/lib/typescript/reanimated2/Easing.d.ts +3 -3
  134. package/lib/typescript/reanimated2/animation/decay/decay.d.ts +8 -0
  135. package/lib/typescript/reanimated2/animation/decay/utils.d.ts +12 -0
  136. package/lib/typescript/reanimated2/animation/delay.d.ts +9 -0
  137. package/lib/typescript/reanimated2/animation/repeat.d.ts +11 -0
  138. package/lib/typescript/reanimated2/animation/sequence.d.ts +8 -0
  139. package/lib/typescript/reanimated2/animation/spring.d.ts +9 -0
  140. package/lib/typescript/reanimated2/animation/springUtils.d.ts +15 -0
  141. package/lib/typescript/reanimated2/animation/timing.d.ts +17 -0
  142. package/lib/typescript/reanimated2/animation/util.d.ts +6 -0
  143. package/lib/typescript/reanimated2/commonTypes.d.ts +25 -7
  144. package/lib/typescript/reanimated2/component/FlatList.d.ts +6 -0
  145. package/lib/typescript/reanimated2/component/LayoutAnimationConfig.d.ts +7 -0
  146. package/lib/typescript/reanimated2/component/ScrollView.d.ts +3 -2
  147. package/lib/typescript/reanimated2/helperTypes.d.ts +45 -3
  148. package/lib/typescript/reanimated2/hook/useAnimatedKeyboard.d.ts +7 -0
  149. package/lib/typescript/reanimated2/hook/useAnimatedProps.d.ts +9 -0
  150. package/lib/typescript/reanimated2/hook/useAnimatedReaction.d.ts +6 -4
  151. package/lib/typescript/reanimated2/hook/useAnimatedRef.d.ts +6 -0
  152. package/lib/typescript/reanimated2/hook/useAnimatedScrollHandler.d.ts +10 -0
  153. package/lib/typescript/reanimated2/hook/useAnimatedSensor.d.ts +8 -0
  154. package/lib/typescript/reanimated2/hook/useAnimatedStyle.d.ts +8 -0
  155. package/lib/typescript/reanimated2/hook/useDerivedValue.d.ts +9 -1
  156. package/lib/typescript/reanimated2/hook/useEvent.d.ts +8 -5
  157. package/lib/typescript/reanimated2/hook/useFrameCallback.d.ts +14 -0
  158. package/lib/typescript/reanimated2/hook/useHandler.d.ts +8 -0
  159. package/lib/typescript/reanimated2/hook/useReducedMotion.d.ts +8 -0
  160. package/lib/typescript/reanimated2/hook/useScrollViewOffset.d.ts +7 -0
  161. package/lib/typescript/reanimated2/hook/useSharedValue.d.ts +8 -1
  162. package/lib/typescript/reanimated2/hook/useWorkletCallback.d.ts +3 -0
  163. package/lib/typescript/reanimated2/index.d.ts +1 -1
  164. package/lib/typescript/reanimated2/interpolateColor.d.ts +17 -0
  165. package/lib/typescript/reanimated2/interpolation.d.ts +30 -2
  166. package/lib/typescript/reanimated2/layoutReanimation/animationBuilder/BaseAnimationBuilder.d.ts +25 -2
  167. package/lib/typescript/reanimated2/layoutReanimation/animationBuilder/ComplexAnimationBuilder.d.ts +56 -1
  168. package/lib/typescript/reanimated2/layoutReanimation/animationBuilder/commonTypes.d.ts +4 -0
  169. package/lib/typescript/reanimated2/layoutReanimation/defaultAnimations/Bounce.d.ts +70 -0
  170. package/lib/typescript/reanimated2/layoutReanimation/defaultAnimations/Fade.d.ts +70 -0
  171. package/lib/typescript/reanimated2/layoutReanimation/defaultAnimations/Flip.d.ts +84 -0
  172. package/lib/typescript/reanimated2/layoutReanimation/defaultAnimations/Lightspeed.d.ts +28 -0
  173. package/lib/typescript/reanimated2/layoutReanimation/defaultAnimations/Pinwheel.d.ts +14 -0
  174. package/lib/typescript/reanimated2/layoutReanimation/defaultAnimations/Roll.d.ts +28 -0
  175. package/lib/typescript/reanimated2/layoutReanimation/defaultAnimations/Rotate.d.ts +56 -0
  176. package/lib/typescript/reanimated2/layoutReanimation/defaultAnimations/Slide.d.ts +56 -0
  177. package/lib/typescript/reanimated2/layoutReanimation/defaultAnimations/Stretch.d.ts +28 -0
  178. package/lib/typescript/reanimated2/layoutReanimation/defaultAnimations/Zoom.d.ts +112 -0
  179. package/lib/typescript/reanimated2/layoutReanimation/defaultTransitions/CurvedTransition.d.ts +7 -0
  180. package/lib/typescript/reanimated2/layoutReanimation/defaultTransitions/EntryExitTransition.d.ts +8 -0
  181. package/lib/typescript/reanimated2/layoutReanimation/defaultTransitions/FadingTransition.d.ts +7 -0
  182. package/lib/typescript/reanimated2/layoutReanimation/defaultTransitions/JumpingTransition.d.ts +7 -0
  183. package/lib/typescript/reanimated2/layoutReanimation/defaultTransitions/LinearTransition.d.ts +10 -0
  184. package/lib/typescript/reanimated2/layoutReanimation/defaultTransitions/SequencedTransition.d.ts +7 -0
  185. package/lib/typescript/reanimated2/layoutReanimation/sharedTransitions/SharedTransition.d.ts +43 -1
  186. package/lib/typescript/reanimated2/layoutReanimation/web/createAnimation.d.ts +4 -4
  187. package/lib/typescript/reanimated2/platform-specific/jsVersion.d.ts +1 -1
  188. package/lib/typescript/reanimated2/platformFunctions/dispatchCommand.d.ts +8 -0
  189. package/lib/typescript/reanimated2/platformFunctions/getRelativeCoords.d.ts +11 -3
  190. package/lib/typescript/reanimated2/platformFunctions/measure.d.ts +7 -0
  191. package/lib/typescript/reanimated2/platformFunctions/scrollTo.d.ts +9 -0
  192. package/lib/typescript/reanimated2/platformFunctions/setNativeProps.d.ts +7 -0
  193. package/lib/typescript/reanimated2/runtimes.d.ts +8 -0
  194. package/lib/typescript/reanimated2/threads.d.ts +17 -2
  195. package/package.json +2 -1
  196. package/src/createAnimatedComponent/createAnimatedComponent.tsx +18 -0
  197. package/src/createAnimatedComponent/setAndForwardRef.ts +2 -0
  198. package/src/reanimated2/Easing.ts +3 -3
  199. package/src/reanimated2/PlatformChecker.ts +1 -1
  200. package/src/reanimated2/animation/decay/decay.ts +8 -0
  201. package/src/reanimated2/animation/decay/utils.ts +12 -0
  202. package/src/reanimated2/animation/delay.ts +9 -0
  203. package/src/reanimated2/animation/repeat.ts +11 -0
  204. package/src/reanimated2/animation/sequence.ts +8 -0
  205. package/src/reanimated2/animation/spring.ts +9 -0
  206. package/src/reanimated2/animation/springUtils.ts +15 -0
  207. package/src/reanimated2/animation/timing.ts +17 -0
  208. package/src/reanimated2/animation/util.ts +6 -0
  209. package/src/reanimated2/commonTypes.ts +25 -7
  210. package/src/reanimated2/component/FlatList.tsx +6 -0
  211. package/src/reanimated2/component/LayoutAnimationConfig.tsx +7 -0
  212. package/src/reanimated2/component/ScrollView.tsx +3 -1
  213. package/src/reanimated2/globals.d.ts +1 -1
  214. package/src/reanimated2/helperTypes.ts +45 -3
  215. package/src/reanimated2/hook/useAnimatedKeyboard.ts +7 -0
  216. package/src/reanimated2/hook/useAnimatedProps.ts +9 -0
  217. package/src/reanimated2/hook/useAnimatedReaction.ts +6 -4
  218. package/src/reanimated2/hook/useAnimatedRef.ts +6 -0
  219. package/src/reanimated2/hook/useAnimatedScrollHandler.ts +10 -0
  220. package/src/reanimated2/hook/useAnimatedSensor.ts +8 -0
  221. package/src/reanimated2/hook/useAnimatedStyle.ts +8 -0
  222. package/src/reanimated2/hook/useDerivedValue.ts +15 -7
  223. package/src/reanimated2/hook/useEvent.ts +9 -6
  224. package/src/reanimated2/hook/useFrameCallback.ts +14 -0
  225. package/src/reanimated2/hook/useHandler.ts +8 -0
  226. package/src/reanimated2/hook/useReducedMotion.ts +8 -0
  227. package/src/reanimated2/hook/useScrollViewOffset.ts +7 -0
  228. package/src/reanimated2/hook/useSharedValue.ts +12 -3
  229. package/src/reanimated2/hook/useWorkletCallback.ts +3 -0
  230. package/src/reanimated2/index.ts +1 -1
  231. package/src/reanimated2/interpolateColor.ts +17 -0
  232. package/src/reanimated2/interpolation.ts +48 -22
  233. package/src/reanimated2/layoutReanimation/animationBuilder/BaseAnimationBuilder.ts +26 -3
  234. package/src/reanimated2/layoutReanimation/animationBuilder/ComplexAnimationBuilder.ts +57 -2
  235. package/src/reanimated2/layoutReanimation/animationBuilder/Keyframe.ts +7 -6
  236. package/src/reanimated2/layoutReanimation/animationBuilder/commonTypes.ts +4 -0
  237. package/src/reanimated2/layoutReanimation/defaultAnimations/Bounce.ts +71 -0
  238. package/src/reanimated2/layoutReanimation/defaultAnimations/Fade.ts +70 -1
  239. package/src/reanimated2/layoutReanimation/defaultAnimations/Flip.ts +84 -0
  240. package/src/reanimated2/layoutReanimation/defaultAnimations/Lightspeed.ts +28 -0
  241. package/src/reanimated2/layoutReanimation/defaultAnimations/Pinwheel.ts +14 -0
  242. package/src/reanimated2/layoutReanimation/defaultAnimations/Roll.ts +28 -0
  243. package/src/reanimated2/layoutReanimation/defaultAnimations/Rotate.ts +56 -0
  244. package/src/reanimated2/layoutReanimation/defaultAnimations/Slide.ts +56 -0
  245. package/src/reanimated2/layoutReanimation/defaultAnimations/Stretch.ts +28 -0
  246. package/src/reanimated2/layoutReanimation/defaultAnimations/Zoom.ts +112 -0
  247. package/src/reanimated2/layoutReanimation/defaultTransitions/CurvedTransition.ts +7 -0
  248. package/src/reanimated2/layoutReanimation/defaultTransitions/EntryExitTransition.ts +8 -0
  249. package/src/reanimated2/layoutReanimation/defaultTransitions/FadingTransition.ts +7 -0
  250. package/src/reanimated2/layoutReanimation/defaultTransitions/JumpingTransition.ts +8 -0
  251. package/src/reanimated2/layoutReanimation/defaultTransitions/LinearTransition.ts +10 -3
  252. package/src/reanimated2/layoutReanimation/defaultTransitions/SequencedTransition.ts +7 -0
  253. package/src/reanimated2/layoutReanimation/sharedTransitions/SharedTransition.ts +45 -3
  254. package/src/reanimated2/layoutReanimation/web/createAnimation.ts +4 -4
  255. package/src/reanimated2/platform-specific/checkCppVersion.ts +0 -4
  256. package/src/reanimated2/platform-specific/jsVersion.ts +1 -1
  257. package/src/reanimated2/platformFunctions/dispatchCommand.ts +8 -0
  258. package/src/reanimated2/platformFunctions/getRelativeCoords.ts +12 -4
  259. package/src/reanimated2/platformFunctions/measure.ts +7 -0
  260. package/src/reanimated2/platformFunctions/scrollTo.ts +9 -0
  261. package/src/reanimated2/platformFunctions/setNativeProps.ts +7 -0
  262. package/src/reanimated2/runtimes.ts +8 -0
  263. package/src/reanimated2/threads.ts +18 -7
@@ -27,16 +27,58 @@ type RestProps<Props extends object> = {
27
27
  [K in keyof Omit<Props, keyof PickStyleProps<Props> | 'style'>]: Props[K] | SharedValue<Props[K]>;
28
28
  };
29
29
  type LayoutProps = {
30
+ /**
31
+ * Lets you animate the layout changes when components are added to or removed from the view hierarchy.
32
+ *
33
+ * You can use the predefined layout transitions (eg. `LinearTransition`, `FadingTransition`) or create your own ones.
34
+ *
35
+ * @see https://docs.swmansion.com/react-native-reanimated/docs/layout-animations/layout-transitions
36
+ */
30
37
  layout?: BaseAnimationBuilder | LayoutAnimationFunction | typeof BaseAnimationBuilder;
38
+ /**
39
+ * Lets you animate an element when it's added to or removed from the view hierarchy.
40
+ *
41
+ * You can use the predefined entering animations (eg. `FadeIn`, `SlideInLeft`) or create your own ones.
42
+ *
43
+ * @see https://docs.swmansion.com/react-native-reanimated/docs/layout-animations/entering-exiting-animations
44
+ */
31
45
  entering?: EntryOrExitLayoutType;
46
+ /**
47
+ * Lets you animate an element when it's added to or removed from the view hierarchy.
48
+ *
49
+ * You can use the predefined entering animations (eg. `FadeOut`, `SlideOutRight`) or create your own ones.
50
+ *
51
+ * @see https://docs.swmansion.com/react-native-reanimated/docs/layout-animations/entering-exiting-animations
52
+ */
32
53
  exiting?: EntryOrExitLayoutType;
33
54
  };
34
55
  type SharedTransitionProps = {
56
+ /**
57
+ * Lets you animate components between two navigation screens.
58
+ *
59
+ * Assign the same `sharedTransitionTag` to [animated components](https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/glossary#animated-component) on two different navigation screens to create a shared transition.
60
+ *
61
+ * @see https://docs.swmansion.com/react-native-reanimated/docs/shared-element-transitions/overview
62
+ * @experimental
63
+ */
35
64
  sharedTransitionTag?: string;
65
+ /**
66
+ * Lets you create a custom shared transition animation.
67
+ *
68
+ * Used alongside `SharedTransition.custom()` method.
69
+ *
70
+ * @see https://docs.swmansion.com/react-native-reanimated/docs/shared-element-transitions/overview
71
+ * @experimental
72
+ */
36
73
  sharedTransitionStyle?: SharedTransition;
37
74
  };
38
75
  type AnimatedPropsProp<Props extends object> = RestProps<Props> & AnimatedStyleProps<Props> & LayoutProps & SharedTransitionProps;
39
76
  export type AnimatedProps<Props extends object> = RestProps<Props> & AnimatedStyleProps<Props> & LayoutProps & SharedTransitionProps & {
77
+ /**
78
+ * Lets you animate component props.
79
+ *
80
+ * @see https://docs.swmansion.com/react-native-reanimated/docs/core/useAnimatedProps
81
+ */
40
82
  animatedProps?: Partial<AnimatedPropsProp<Props>>;
41
83
  };
42
84
  export type AnimatedPropsAdapterFunction = (props: Record<string, unknown>) => void;
@@ -52,11 +94,11 @@ export type AdaptTransforms<T> = {
52
94
  [P in keyof T]: Adaptable<T[P]>;
53
95
  };
54
96
  /**
55
- * @deprecated Please use `TransformArrayItem` type instead.
97
+ * @deprecated Please use {@link TransformArrayItem} type instead.
56
98
  */
57
99
  export type TransformStyleTypes = TransformArrayItem;
58
100
  /**
59
- * @deprecated Please use `AnimatedStyle` type instead.
101
+ * @deprecated Please use {@link AnimatedStyle} type instead.
60
102
  */
61
103
  export type AnimateStyle<Style = DefaultStyle> = AnimatedStyle<Style>;
62
104
  /**
@@ -68,7 +110,7 @@ export type StylesOrDefault<T> = 'style' extends keyof T ? MaybeSharedValueRecur
68
110
  */
69
111
  export type AnimatedStyleProp<T> = AnimatedStyle<T> | RegisteredStyle<AnimatedStyle<T>>;
70
112
  /**
71
- * @deprecated Please use `AnimatedProps` type instead.
113
+ * @deprecated Please use {@link AnimatedProps} type instead.
72
114
  */
73
115
  export type AnimateProps<Props extends object> = AnimatedProps<Props>;
74
116
  export {};
@@ -1,2 +1,9 @@
1
1
  import type { AnimatedKeyboardInfo, AnimatedKeyboardOptions } from '../commonTypes';
2
+ /**
3
+ * Lets you synchronously get the position and state of the keyboard.
4
+ *
5
+ * @param options - An additional keyboard configuration options.
6
+ * @returns An object with the current keyboard `height` and `state` as [shared values](https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/glossary#shared-value).
7
+ * @see https://docs.swmansion.com/react-native-reanimated/docs/device/useAnimatedKeyboard
8
+ */
2
9
  export declare function useAnimatedKeyboard(options?: AnimatedKeyboardOptions): AnimatedKeyboardInfo;
@@ -1,2 +1,11 @@
1
1
  import type { useAnimatedPropsType } from '../helperTypes';
2
+ /**
3
+ * Lets you create an animated props object which can be animated using shared values.
4
+ *
5
+ * @param updater - A function returning an object with properties you want to animate.
6
+ * @param dependencies - An optional array of dependencies. Only relevant when using Reanimated without the Babel plugin on the Web.
7
+ * @param adapters - An optional function or array of functions allowing to adopt prop naming between JS and the native side.
8
+ * @returns An animated props object which has to be passed to `animatedProps` property of an Animated component that you want to animate.
9
+ * @see https://docs.swmansion.com/react-native-reanimated/docs/core/useAnimatedProps
10
+ */
2
11
  export declare let useAnimatedProps: useAnimatedPropsType;
@@ -1,8 +1,10 @@
1
1
  import type { DependencyList } from './commonTypes';
2
2
  /**
3
- * @param prepare - worklet used for data preparation for the second parameter
4
- * @param react - worklet which takes data prepared by the one in the first parameter and performs certain actions
5
- * the first worklet defines the inputs, in other words on which shared values change will it be called.
6
- * the second one can modify any shared values but those which are mentioned in the first worklet. Beware of that, because this may result in endless loop and high cpu usage.
3
+ * Lets you to respond to changes in a [shared value](https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/glossary#shared-value). It's especially useful when comparing values previously stored in the shared value with the current one.
4
+ *
5
+ * @param prepare - A function that should return a value to which you'd like to react.
6
+ * @param react - A function that reacts to changes in the value returned by the `prepare` function.
7
+ * @param dependencies - an optional array of dependencies. Only relevant when using Reanimated without the Babel plugin on the Web.
8
+ * @see https://docs.swmansion.com/react-native-reanimated/docs/advanced/useAnimatedReaction
7
9
  */
8
10
  export declare function useAnimatedReaction<PreparedResult>(prepare: () => PreparedResult, react: (prepared: PreparedResult, previous: PreparedResult | null) => void, dependencies?: DependencyList): void;
@@ -1,3 +1,9 @@
1
1
  import type { Component } from 'react';
2
2
  import type { AnimatedRef } from './commonTypes';
3
+ /**
4
+ * Lets you get a reference of a view that you can use inside a worklet.
5
+ *
6
+ * @returns An object with a `.current` property which contains an instance of a component.
7
+ * @see https://docs.swmansion.com/react-native-reanimated/docs/core/useAnimatedRef
8
+ */
3
9
  export declare function useAnimatedRef<TComponent extends Component>(): AnimatedRef<TComponent>;
@@ -10,4 +10,14 @@ export interface ScrollHandlers<Context extends Record<string, unknown>> {
10
10
  }
11
11
  export type ScrollHandlerProcessed<Context extends Record<string, unknown> = Record<string, unknown>> = EventHandlerProcessed<RNNativeScrollEvent, Context>;
12
12
  export type ScrollHandlerInternal = EventHandlerInternal<RNNativeScrollEvent>;
13
+ /**
14
+ * Lets you run callbacks on ScrollView events. Supports `onScroll`, `onBeginDrag`, `onEndDrag`, `onMomentumBegin`, and `onMomentumEnd` events.
15
+ *
16
+ * These callbacks are automatically workletized and ran on the UI thread.
17
+ *
18
+ * @param handlers - An object containing event handlers.
19
+ * @param dependencies - An optional array of dependencies. Only relevant when using Reanimated without the Babel plugin on the Web.
20
+ * @returns An object you need to pass to `onScroll` prop on the `Animated.ScrollView` component.
21
+ * @see https://docs.swmansion.com/react-native-reanimated/docs/scroll/useAnimatedScrollHandler
22
+ */
13
23
  export declare function useAnimatedScrollHandler<Context extends Record<string, unknown>>(handlers: ScrollHandler<Context> | ScrollHandlers<Context>, dependencies?: DependencyList): ScrollHandlerProcessed<Context>;
@@ -1,4 +1,12 @@
1
1
  import type { SensorConfig, AnimatedSensor, Value3D, ValueRotation } from '../commonTypes';
2
2
  import { SensorType } from '../commonTypes';
3
+ /**
4
+ * Lets you create animations based on data from the device's sensors.
5
+ *
6
+ * @param sensorType - Type of the sensor to use. Configured with {@link SensorType} enum.
7
+ * @param config - The sensor configuration - {@link SensorConfig}.
8
+ * @returns An object containing the sensor measurements [shared value](https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/glossary#shared-value) and a function to unregister the sensor
9
+ * @see https://docs.swmansion.com/react-native-reanimated/docs/device/useAnimatedSensor
10
+ */
3
11
  export declare function useAnimatedSensor(sensorType: SensorType.ROTATION, userConfig?: Partial<SensorConfig>): AnimatedSensor<ValueRotation>;
4
12
  export declare function useAnimatedSensor(sensorType: Exclude<SensorType, SensorType.ROTATION>, userConfig?: Partial<SensorConfig>): AnimatedSensor<Value3D>;
@@ -1,2 +1,10 @@
1
1
  import type { DefaultStyle, DependencyList } from './commonTypes';
2
+ /**
3
+ * Lets you create a styles object, similar to StyleSheet styles, which can be animated using shared values.
4
+ *
5
+ * @param updater - A function returning an object with style properties you want to animate.
6
+ * @param dependencies - An optional array of dependencies. Only relevant when using Reanimated without the Babel plugin on the Web.
7
+ * @returns An animated style object which has to be passed to the `style` property of an Animated component you want to animate.
8
+ * @see https://docs.swmansion.com/react-native-reanimated/docs/core/useAnimatedStyle
9
+ */
2
10
  export declare function useAnimatedStyle<Style extends DefaultStyle>(updater: () => Style, dependencies?: DependencyList | null): Style;
@@ -1,4 +1,12 @@
1
1
  import type { SharedValue } from '../commonTypes';
2
2
  import type { DependencyList } from './commonTypes';
3
3
  export type DerivedValue<Value> = Readonly<SharedValue<Value>>;
4
- export declare function useDerivedValue<Value>(processor: () => Value, dependencies?: DependencyList): DerivedValue<Value>;
4
+ /**
5
+ * Lets you create new shared values based on existing ones while keeping them reactive.
6
+ *
7
+ * @param updater - A function called whenever at least one of the shared values or state used in the function body changes.
8
+ * @param dependencies - An optional array of dependencies. Only relevant when using Reanimated without the Babel plugin on the Web.
9
+ * @returns A new readonly shared value based on a value returned from the updater function
10
+ * @see https://docs.swmansion.com/react-native-reanimated/docs/core/useDerivedValue
11
+ */
12
+ export declare function useDerivedValue<Value>(updater: () => Value, dependencies?: DependencyList): DerivedValue<Value>;
@@ -5,12 +5,15 @@ import type { ReanimatedEvent } from './commonTypes';
5
5
  * Worklet to provide as an argument to `useEvent` hook.
6
6
  */
7
7
  export type EventHandler<Event extends object, Context extends Record<string, unknown> = never> = (event: ReanimatedEvent<Event>, context?: Context) => void;
8
- /**
9
- * Return type of `useEvent` hook.
10
- */
11
8
  export type EventHandlerProcessed<Event extends object, Context extends Record<string, unknown> = never> = (event: Event, context?: Context) => void;
9
+ export type EventHandlerInternal<Event extends object> = MutableRefObject<WorkletEventHandler<Event>>;
12
10
  /**
13
- * Real return type of `useEvent` hook - only meant to be used internally.
11
+ * Lets you run a function whenever a specified native event occurs.
12
+ *
13
+ * @param handler - A function that receives an event object with event data - {@link EventHandler}.
14
+ * @param eventNames - An array of event names the `handler` callback will react to.
15
+ * @param rebuild - Whether the event handler should be rebuilt. Defaults to `false`.
16
+ * @returns A function that will be called when the event occurs - {@link EventHandlerProcessed}.
17
+ * @see https://docs.swmansion.com/react-native-reanimated/docs/advanced/useEvent
14
18
  */
15
- export type EventHandlerInternal<Event extends object> = MutableRefObject<WorkletEventHandler<Event>>;
16
19
  export declare function useEvent<Event extends object, Context extends Record<string, unknown> = never>(handler: EventHandler<Event, Context>, eventNames?: string[], rebuild?: boolean): EventHandlerProcessed<Event, Context>;
@@ -1,7 +1,21 @@
1
1
  import type { FrameInfo } from '../frameCallback/FrameCallbackRegistryUI';
2
+ /**
3
+ * @param setActive - A function that lets you start the frame callback or stop it from running.
4
+ * @param isActive - A boolean indicating whether a callback is running.
5
+ * @param callbackId - A number indicating a unique identifier of the frame callback.
6
+ * @see https://docs.swmansion.com/react-native-reanimated/docs/advanced/useFrameCallback#returns
7
+ */
2
8
  export type FrameCallback = {
3
9
  setActive: (isActive: boolean) => void;
4
10
  isActive: boolean;
5
11
  callbackId: number;
6
12
  };
13
+ /**
14
+ * Lets you run a function on every frame update.
15
+ *
16
+ * @param callback - A function executed on every frame update.
17
+ * @param autostart - Whether the callback should start automatically. Defaults to `true`.
18
+ * @returns A frame callback object - {@link FrameCallback}.
19
+ * @see https://docs.swmansion.com/react-native-reanimated/docs/advanced/useFrameCallback
20
+ */
7
21
  export declare function useFrameCallback(callback: (frameInfo: FrameInfo) => void, autostart?: boolean): FrameCallback;
@@ -8,5 +8,13 @@ export interface UseHandlerContext<Context extends Record<string, unknown>> {
8
8
  doDependenciesDiffer: boolean;
9
9
  useWeb: boolean;
10
10
  }
11
+ /**
12
+ * Lets you find out whether the event handler dependencies have changed.
13
+ *
14
+ * @param handlers - An object of event handlers.
15
+ * @param dependencies - An optional array of dependencies.
16
+ * @returns An object containing a boolean indicating whether the dependencies have changed, and a boolean indicating whether the code is running on the web.
17
+ * @see https://docs.swmansion.com/react-native-reanimated/docs/advanced/useHandler
18
+ */
11
19
  export declare function useHandler<Event extends object, Context extends Record<string, unknown>>(handlers: GeneralHandlers<Event, Context>, dependencies?: DependencyList): UseHandlerContext<Context>;
12
20
  export {};
@@ -1 +1,9 @@
1
+ /**
2
+ * Lets you query the reduced motion system setting.
3
+ *
4
+ * Changing the reduced motion system setting doesn't cause your components to rerender.
5
+ *
6
+ * @returns A boolean indicating whether the reduced motion setting was enabled when the app started.
7
+ * @see https://docs.swmansion.com/react-native-reanimated/docs/device/useReducedMotion
8
+ */
1
9
  export declare function useReducedMotion(): boolean;
@@ -1,4 +1,11 @@
1
1
  import type { SharedValue } from '../commonTypes';
2
2
  import type { AnimatedScrollView } from '../component/ScrollView';
3
3
  import type { AnimatedRef } from './commonTypes';
4
+ /**
5
+ * Lets you synchronously get the current offset of a `ScrollView`.
6
+ *
7
+ * @param animatedRef - An [animated ref](https://docs.swmansion.com/react-native-reanimated/docs/core/useAnimatedRef) attached to an Animated.ScrollView component.
8
+ * @returns A shared value which holds the current offset of the `ScrollView`.
9
+ * @see https://docs.swmansion.com/react-native-reanimated/docs/scroll/useScrollViewOffset
10
+ */
4
11
  export declare function useScrollViewOffset(animatedRef: AnimatedRef<AnimatedScrollView>, initialRef?: SharedValue<number>): SharedValue<number>;
@@ -1,2 +1,9 @@
1
1
  import type { SharedValue } from '../commonTypes';
2
- export declare function useSharedValue<Value>(init: Value, oneWayReadsOnly?: boolean): SharedValue<Value>;
2
+ /**
3
+ * Lets you define [shared values](https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/glossary#shared-value) in your components.
4
+ *
5
+ * @param initialValue - The value you want to be initially stored to a `.value` property.
6
+ * @returns A shared value with a single `.value` property initially set to the `initialValue` - {@link SharedValue}.
7
+ * @see https://docs.swmansion.com/react-native-reanimated/docs/core/useSharedValue
8
+ */
9
+ export declare function useSharedValue<Value>(initialValue: Value, oneWayReadsOnly?: boolean): SharedValue<Value>;
@@ -1,2 +1,5 @@
1
1
  import type { DependencyList } from './commonTypes';
2
+ /**
3
+ * @deprecated don't use
4
+ */
2
5
  export declare function useWorkletCallback<Args extends unknown[], ReturnValue>(worklet: (...args: Args) => ReturnValue, deps?: DependencyList): (...args: Args) => ReturnValue;
@@ -10,7 +10,7 @@ export { Extrapolation, interpolate, clamp } from './interpolation';
10
10
  export type { InterpolationOptions, InterpolateConfig, InterpolateRGB, InterpolateHSV, } from './interpolateColor';
11
11
  export {
12
12
  /**
13
- * @deprecated Please use `Extrapolation` instead.
13
+ * @deprecated Please use {@link Extrapolation} instead.
14
14
  */
15
15
  Extrapolate, ColorSpace, interpolateColor, useInterpolateConfig, } from './interpolateColor';
16
16
  export type { EasingFunction, EasingFn, EasingFunctionFactory, EasingFactoryFn, } from './Easing';
@@ -4,6 +4,12 @@ import type { SharedValue } from './commonTypes';
4
4
  * @deprecated Please use Extrapolation instead
5
5
  */
6
6
  export declare const Extrapolate: typeof Extrapolation;
7
+ /**
8
+ * Options for color interpolation.
9
+ *
10
+ * @param gamma - Gamma value used in gamma correction. Defaults to `2.2`.
11
+ * @param useCorrectedHSVInterpolation - Whether to reduce the number of colors the interpolation has to go through. Defaults to `true`.
12
+ */
7
13
  export type InterpolationOptions = {
8
14
  gamma?: number;
9
15
  useCorrectedHSVInterpolation?: boolean;
@@ -20,6 +26,17 @@ export interface InterpolateHSV {
20
26
  v: number[];
21
27
  a: number[];
22
28
  }
29
+ /**
30
+ * Lets you map a value from a range of numbers to a range of colors using linear interpolation.
31
+ *
32
+ * @param value - A number from the `input` range that is going to be mapped to the color in the `output` range.
33
+ * @param inputRange - An array of numbers specifying the input range of the interpolation.
34
+ * @param outputRange - An array of output colors values (eg. "red", "#00FFCC", "rgba(255, 0, 0, 0.5)").
35
+ * @param colorSpace - The color space to use for interpolation. Defaults to 'RGB'.
36
+ * @param options - Additional options for interpolation - {@link InterpolationOptions}.
37
+ * @returns The color after interpolation from within the output range in rgba(r, g, b, a) format.
38
+ * @see https://docs.swmansion.com/react-native-reanimated/docs/utilities/interpolateColor
39
+ */
23
40
  export declare function interpolateColor(value: number, inputRange: readonly number[], outputRange: readonly string[], colorSpace?: 'RGB' | 'HSV', options?: InterpolationOptions): string;
24
41
  export declare function interpolateColor(value: number, inputRange: readonly number[], outputRange: readonly number[], colorSpace?: 'RGB' | 'HSV', options?: InterpolationOptions): number;
25
42
  export declare enum ColorSpace {
@@ -1,21 +1,49 @@
1
+ /**
2
+ * Extrapolation type.
3
+ *
4
+ * @param IDENTITY - Returns the provided value as is.
5
+ * @param CLAMP - Clamps the value to the edge of the output range.
6
+ * @param EXTEND - Predicts the values beyond the output range.
7
+ */
1
8
  export declare enum Extrapolation {
2
9
  IDENTITY = "identity",
3
10
  CLAMP = "clamp",
4
11
  EXTEND = "extend"
5
12
  }
13
+ /**
14
+ * Represents the possible values for extrapolation as a string.
15
+ */
6
16
  type ExtrapolationAsString = 'identity' | 'clamp' | 'extend';
17
+ /**
18
+ * Allows to specify extrapolation for left and right edge of the interpolation.
19
+ */
7
20
  export interface ExtrapolationConfig {
8
21
  extrapolateLeft?: Extrapolation | string;
9
22
  extrapolateRight?: Extrapolation | string;
10
23
  }
24
+ /**
25
+ * Configuration options for extrapolation.
26
+ */
11
27
  export type ExtrapolationType = ExtrapolationConfig | Extrapolation | ExtrapolationAsString | undefined;
12
- export declare function interpolate(x: number, input: readonly number[], output: readonly number[], type?: ExtrapolationType): number;
13
28
  /**
14
- * `clamp` lets you limit a value within a specified range.
29
+ * Lets you map a value from one range to another using linear interpolation.
30
+ *
31
+ * @param value - A number from the `input` range that is going to be mapped to the `output` range.
32
+ * @param inputRange - An array of numbers specifying the input range of the interpolation.
33
+ * @param outputRange - An array of numbers specifying the output range of the interpolation.
34
+ * @param extrapolate - determines what happens when the `value` goes beyond the `input` range. Defaults to `Extrapolation.EXTEND` - {@link ExtrapolationType}.
35
+ * @returns A mapped value within the output range.
36
+ * @see https://docs.swmansion.com/react-native-reanimated/docs/utilities/interpolate
37
+ */
38
+ export declare function interpolate(x: number, inputRange: readonly number[], outputRange: readonly number[], type?: ExtrapolationType): number;
39
+ /**
40
+ * Lets you limit a value within a specified range.
15
41
  *
16
42
  * @param value - A number that will be returned as long as the provided value is in range between `min` and `max`.
17
43
  * @param min - A number which will be returned when provided `value` is lower than `min`.
18
44
  * @param max - A number which will be returned when provided `value` is higher than `max`.
45
+ * @returns A number between min and max bounds.
46
+ * @see https://docs.swmansion.com/react-native-reanimated/docs/utilities/clamp/
19
47
  */
20
48
  export declare function clamp(value: number, min: number, max: number): number;
21
49
  export {};
@@ -8,16 +8,39 @@ export declare class BaseAnimationBuilder {
8
8
  callbackV?: (finished: boolean) => void;
9
9
  static createInstance: <T extends typeof BaseAnimationBuilder>(this: T) => InstanceType<T>;
10
10
  build: () => EntryExitAnimationFunction | LayoutAnimationFunction;
11
+ /**
12
+ * Lets you adjust the animation duration. Can be chained alongside other [layout animation modifiers](https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/glossary#layout-animation-modifier).
13
+ *
14
+ * @param durationMs - Length of the animation (in milliseconds).
15
+ */
11
16
  static duration<T extends typeof BaseAnimationBuilder>(this: T, durationMs: number): InstanceType<T>;
12
17
  duration(durationMs: number): this;
18
+ /**
19
+ * Lets you adjust the delay before the animation starts (in milliseconds). Can be chained alongside other [layout animation modifiers](https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/glossary#layout-animation-modifier).
20
+ *
21
+ * @param delayMs - Delay before the animation starts (in milliseconds).
22
+ */
13
23
  static delay<T extends typeof BaseAnimationBuilder>(this: T, delayMs: number): InstanceType<T>;
14
24
  delay(delayMs: number): this;
25
+ /**
26
+ * The callback that will fire after the animation ends. Can be chained alongside other [layout animation modifiers](https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/glossary#layout-animation-modifier).
27
+ *
28
+ * @param callback - Callback that will fire after the animation ends.
29
+ */
15
30
  static withCallback<T extends typeof BaseAnimationBuilder>(this: T, callback: (finished: boolean) => void): InstanceType<T>;
16
- withCallback(callback: (finsihed: boolean) => void): this;
17
- static reduceMotion<T extends typeof BaseAnimationBuilder>(this: T, reduceMotionV: ReduceMotion): InstanceType<T>;
31
+ withCallback(callback: (finished: boolean) => void): this;
32
+ /**
33
+ * Lets you adjust the behavior when the device's reduced motion accessibility setting is turned on. Can be chained alongside other [layout animation modifiers](https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/glossary#layout-animation-modifier).
34
+ *
35
+ * @param reduceMotion - Determines how the animation responds to the device's reduced motion accessibility setting. Default to `ReduceMotion.System` - {@link ReduceMotion}.
36
+ */
37
+ static reduceMotion<T extends typeof BaseAnimationBuilder>(this: T, reduceMotion: ReduceMotion): InstanceType<T>;
18
38
  reduceMotion(reduceMotionV: ReduceMotion): this;
19
39
  static getDuration(): number;
20
40
  getDuration(): number;
41
+ /**
42
+ * @deprecated Use `.delay()` with `Math.random()` instead
43
+ */
21
44
  static randomDelay<T extends typeof BaseAnimationBuilder>(this: T): InstanceType<T>;
22
45
  randomDelay(): this;
23
46
  getDelay(): number;
@@ -15,26 +15,81 @@ export declare class ComplexAnimationBuilder extends BaseAnimationBuilder {
15
15
  restSpeedThresholdV?: number;
16
16
  initialValues?: StyleProps;
17
17
  static createInstance: <T extends typeof BaseAnimationBuilder>(this: T) => InstanceType<T>;
18
+ /**
19
+ * Lets you change the easing curve of the animation. Can be chained alongside other [layout animation modifiers](https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/glossary#layout-animation-modifier).
20
+ *
21
+ * @param easingFunction - An easing function which defines the animation curve.
22
+ */
18
23
  static easing<T extends typeof ComplexAnimationBuilder>(this: T, easingFunction: EasingFunction): InstanceType<T>;
19
24
  easing(easingFunction: EasingFunction): this;
25
+ /**
26
+ * Lets you rotate the element. Can be chained alongside other [layout animation modifiers](https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/glossary#layout-animation-modifier).
27
+ *
28
+ * @param degree - The rotation degree.
29
+ */
20
30
  static rotate<T extends typeof ComplexAnimationBuilder>(this: T, degree: string): InstanceType<T>;
21
31
  rotate(degree: string): this;
32
+ /**
33
+ * Enables the spring-based animation configuration. Can be chained alongside other [layout animation modifiers](https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/glossary#layout-animation-modifier).
34
+ *
35
+ * @param duration - An optional duration of the spring animation (in milliseconds).
36
+ */
22
37
  static springify<T extends typeof ComplexAnimationBuilder>(this: T, duration?: number): ComplexAnimationBuilder;
23
38
  springify(duration?: number): this;
39
+ /**
40
+ * Lets you adjust the spring animation damping ratio. Can be chained alongside other [layout animation modifiers](https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/glossary#layout-animation-modifier).
41
+ *
42
+ * @param dampingRatio - How damped the spring is.
43
+ */
24
44
  static dampingRatio<T extends typeof ComplexAnimationBuilder>(this: T, dampingRatio: number): InstanceType<T>;
25
- dampingRatio(dampingRatio: number): this;
45
+ dampingRatio(value: number): this;
46
+ /**
47
+ * Lets you adjust the spring animation damping. Can be chained alongside other [layout animation modifiers](https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/glossary#layout-animation-modifier).
48
+ *
49
+ * @param value - Decides how quickly a spring stops moving. Higher damping means the spring will come to rest faster.
50
+ */
26
51
  static damping<T extends typeof ComplexAnimationBuilder>(this: T, damping: number): InstanceType<T>;
27
52
  damping(damping: number): this;
53
+ /**
54
+ * Lets you adjust the spring animation mass. Can be chained alongside other [layout animation modifiers](https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/glossary#layout-animation-modifier).
55
+ *
56
+ * @param mass - The weight of the spring. Reducing this value makes the animation faster.
57
+ */
28
58
  static mass<T extends typeof ComplexAnimationBuilder>(this: T, mass: number): InstanceType<T>;
29
59
  mass(mass: number): this;
60
+ /**
61
+ * Lets you adjust the stiffness of the spring animation. Can be chained alongside other [layout animation modifiers](https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/glossary#layout-animation-modifier).
62
+ *
63
+ * @param stiffness - How bouncy the spring is.
64
+ */
30
65
  static stiffness<T extends typeof ComplexAnimationBuilder>(this: T, stiffness: number): InstanceType<T>;
31
66
  stiffness(stiffness: number): this;
67
+ /**
68
+ * Lets you adjust overshoot clamping of the spring. Can be chained alongside other [layout animation modifiers](https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/glossary#layout-animation-modifier).
69
+ *
70
+ * @param overshootClamping - Whether a spring can bounce over the final position.
71
+ */
32
72
  static overshootClamping<T extends typeof ComplexAnimationBuilder>(this: T, overshootClamping: number): InstanceType<T>;
33
73
  overshootClamping(overshootClamping: number): this;
74
+ /**
75
+ * Lets you adjust the rest displacement threshold of the spring animation. Can be chained alongside other [layout animation modifiers](https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/glossary#layout-animation-modifier).
76
+ *
77
+ * @param restDisplacementThreshold - The displacement below which the spring will snap to the designated position without further oscillations.
78
+ */
34
79
  static restDisplacementThreshold<T extends typeof ComplexAnimationBuilder>(this: T, restDisplacementThreshold: number): InstanceType<T>;
35
80
  restDisplacementThreshold(restDisplacementThreshold: number): this;
81
+ /**
82
+ * Lets you adjust the rest speed threshold of the spring animation. Can be chained alongside other [layout animation modifiers](https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/glossary#layout-animation-modifier).
83
+ *
84
+ * @param restSpeedThreshold - The speed in pixels per second from which the spring will snap to the designated position without further oscillations.
85
+ */
36
86
  static restSpeedThreshold<T extends typeof ComplexAnimationBuilder>(this: T, restSpeedThreshold: number): InstanceType<T>;
37
87
  restSpeedThreshold(restSpeedThreshold: number): this;
88
+ /**
89
+ * Lets you override the initial config of the animation
90
+ *
91
+ * @param values - An object containing the styles to override.
92
+ */
38
93
  static withInitialValues<T extends typeof ComplexAnimationBuilder>(this: T, values: StyleProps): InstanceType<T>;
39
94
  withInitialValues(values: StyleProps): this;
40
95
  getAnimationAndConfig(): LayoutAnimationAndConfig;
@@ -74,6 +74,10 @@ export interface IExitAnimationBuilder {
74
74
  export type ProgressAnimationCallback = (viewTag: number, progress: number) => void;
75
75
  export type ProgressAnimation = (viewTag: number, values: SharedTransitionAnimationsValues, progress: number) => void;
76
76
  export type CustomProgressAnimation = (values: SharedTransitionAnimationsValues, progress: number) => StyleProps;
77
+ /**
78
+ * Used to configure the `.defaultTransitionType()` shared transition modifier.
79
+ * @experimental
80
+ */
77
81
  export declare enum SharedTransitionType {
78
82
  ANIMATION = "animation",
79
83
  PROGRESS_ANIMATION = "progressAnimation"