react-native-reanimated 2.5.0 → 2.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (123) hide show
  1. package/RNReanimated.podspec +15 -6
  2. package/android/.gradle/7.2/dependencies-accessors/dependencies-accessors.lock +0 -0
  3. package/android/.gradle/7.2/executionHistory/executionHistory.bin +0 -0
  4. package/android/.gradle/7.2/executionHistory/executionHistory.lock +0 -0
  5. package/android/.gradle/7.2/fileHashes/fileHashes.bin +0 -0
  6. package/android/.gradle/7.2/fileHashes/fileHashes.lock +0 -0
  7. package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
  8. package/android/.gradle/buildOutputCleanup/cache.properties +1 -1
  9. package/android/.gradle/buildOutputCleanup/outputFiles.bin +0 -0
  10. package/android/.gradle/checksums/checksums.lock +0 -0
  11. package/android/.gradle/checksums/md5-checksums.bin +0 -0
  12. package/android/.gradle/checksums/sha1-checksums.bin +0 -0
  13. package/android/build.gradle +13 -23
  14. package/ios/REANodesManager.m +1 -1
  15. package/ios/sensor/ReanimatedSensor.h +4 -0
  16. package/ios/sensor/ReanimatedSensor.m +48 -0
  17. package/ios/sensor/ReanimatedSensorContainer.h +0 -1
  18. package/ios/sensor/ReanimatedSensorContainer.m +0 -1
  19. package/lib/reanimated2/interpolateColor.js +11 -11
  20. package/lib/reanimated2/js-reanimated/index.js +3 -3
  21. package/lib/types/lib/ConfigHelper.d.ts +12 -0
  22. package/lib/types/lib/ReanimatedEventEmitter.d.ts +3 -0
  23. package/lib/types/lib/ReanimatedModule.d.ts +2 -0
  24. package/lib/types/lib/ReanimatedModule.macos.d.ts +2 -0
  25. package/lib/types/lib/ReanimatedModule.native.d.ts +2 -0
  26. package/lib/types/lib/ReanimatedModule.windows.d.ts +2 -0
  27. package/lib/types/lib/ReanimatedModuleCompat.d.ts +14 -0
  28. package/lib/types/lib/createAnimatedComponent.d.ts +33 -0
  29. package/lib/types/lib/reanimated2/Bezier.d.ts +6 -0
  30. package/lib/types/lib/reanimated2/Colors.d.ts +31 -0
  31. package/lib/types/lib/reanimated2/Easing.d.ts +172 -0
  32. package/lib/types/lib/reanimated2/NativeMethods.d.ts +14 -0
  33. package/lib/types/lib/reanimated2/NativeReanimated/NativeReanimated.d.ts +20 -0
  34. package/lib/types/lib/reanimated2/NativeReanimated/index.d.ts +3 -0
  35. package/lib/types/lib/reanimated2/PlatformChecker.d.ts +5 -0
  36. package/lib/types/lib/reanimated2/PropAdapters.d.ts +4 -0
  37. package/lib/types/lib/reanimated2/UpdateProps.d.ts +9 -0
  38. package/lib/types/lib/reanimated2/ViewDescriptorsSet.d.ts +20 -0
  39. package/lib/types/lib/reanimated2/WorkletEventHandler.d.ts +13 -0
  40. package/lib/types/lib/reanimated2/__mocks__/MutableValue.d.ts +5 -0
  41. package/lib/types/lib/reanimated2/__mocks__/NativeReanimated.d.ts +13 -0
  42. package/lib/types/lib/reanimated2/__mocks__/NativeReanimated.native.d.ts +13 -0
  43. package/lib/types/lib/reanimated2/animation/commonTypes.d.ts +27 -0
  44. package/lib/types/lib/reanimated2/animation/decay.d.ts +19 -0
  45. package/lib/types/lib/reanimated2/animation/delay.d.ts +7 -0
  46. package/lib/types/lib/reanimated2/animation/index.d.ts +9 -0
  47. package/lib/types/lib/reanimated2/animation/repeat.d.ts +12 -0
  48. package/lib/types/lib/reanimated2/animation/sequence.d.ts +7 -0
  49. package/lib/types/lib/reanimated2/animation/spring.d.ts +22 -0
  50. package/lib/types/lib/reanimated2/animation/styleAnimation.d.ts +7 -0
  51. package/lib/types/lib/reanimated2/animation/timing.d.ts +21 -0
  52. package/lib/types/lib/reanimated2/animation/util.d.ts +9 -0
  53. package/lib/types/lib/reanimated2/commonTypes.d.ts +80 -0
  54. package/lib/types/lib/reanimated2/component/FlatList.d.ts +9 -0
  55. package/lib/types/lib/reanimated2/component/WrappedComponents.d.ts +8 -0
  56. package/lib/types/lib/reanimated2/component/index.d.ts +9 -0
  57. package/lib/types/lib/reanimated2/core.d.ts +24 -0
  58. package/lib/types/lib/reanimated2/hook/Hooks.d.ts +5 -0
  59. package/lib/types/lib/reanimated2/hook/commonTypes.d.ts +14 -0
  60. package/lib/types/lib/reanimated2/hook/index.d.ts +10 -0
  61. package/lib/types/lib/reanimated2/hook/useAnimatedGestureHandler.d.ts +35 -0
  62. package/lib/types/lib/reanimated2/hook/useAnimatedReaction.d.ts +12 -0
  63. package/lib/types/lib/reanimated2/hook/useAnimatedRef.d.ts +3 -0
  64. package/lib/types/lib/reanimated2/hook/useAnimatedScrollHandler.d.ts +21 -0
  65. package/lib/types/lib/reanimated2/hook/useAnimatedSensor.d.ts +20 -0
  66. package/lib/types/lib/reanimated2/hook/useAnimatedStyle.d.ts +11 -0
  67. package/lib/types/lib/reanimated2/hook/useDerivedValue.d.ts +4 -0
  68. package/lib/types/lib/reanimated2/hook/useSharedValue.d.ts +2 -0
  69. package/lib/types/lib/reanimated2/hook/utils.d.ts +28 -0
  70. package/lib/types/lib/reanimated2/index.d.ts +12 -0
  71. package/lib/types/lib/reanimated2/interpolateColor.d.ts +26 -0
  72. package/lib/types/lib/reanimated2/interpolation.d.ts +14 -0
  73. package/lib/types/lib/reanimated2/jestUtils.d.ts +12 -0
  74. package/lib/types/lib/reanimated2/js-reanimated/JSReanimated.d.ts +30 -0
  75. package/lib/types/lib/reanimated2/js-reanimated/Mapper.d.ts +14 -0
  76. package/lib/types/lib/reanimated2/js-reanimated/MapperRegistry.d.ts +14 -0
  77. package/lib/types/lib/reanimated2/js-reanimated/MutableValue.d.ts +14 -0
  78. package/lib/types/lib/reanimated2/js-reanimated/commonTypes.d.ts +44 -0
  79. package/lib/types/lib/reanimated2/js-reanimated/index.d.ts +15 -0
  80. package/lib/types/lib/reanimated2/layoutReanimation/LayoutAnimationRepository.d.ts +1 -0
  81. package/lib/types/lib/reanimated2/layoutReanimation/animationBuilder/BaseAnimationBuilder.d.ts +22 -0
  82. package/lib/types/lib/reanimated2/layoutReanimation/animationBuilder/ComplexAnimationBuilder.d.ts +38 -0
  83. package/lib/types/lib/reanimated2/layoutReanimation/animationBuilder/Keyframe.d.ts +25 -0
  84. package/lib/types/lib/reanimated2/layoutReanimation/animationBuilder/commonTypes.d.ts +77 -0
  85. package/lib/types/lib/reanimated2/layoutReanimation/animationBuilder/index.d.ts +4 -0
  86. package/lib/types/lib/reanimated2/layoutReanimation/defaultAnimations/Bounce.d.ts +62 -0
  87. package/lib/types/lib/reanimated2/layoutReanimation/defaultAnimations/Default.d.ts +4 -0
  88. package/lib/types/lib/reanimated2/layoutReanimation/defaultAnimations/Fade.d.ts +42 -0
  89. package/lib/types/lib/reanimated2/layoutReanimation/defaultAnimations/Flip.d.ts +50 -0
  90. package/lib/types/lib/reanimated2/layoutReanimation/defaultAnimations/Lightspeed.d.ts +18 -0
  91. package/lib/types/lib/reanimated2/layoutReanimation/defaultAnimations/Pinwheel.d.ts +10 -0
  92. package/lib/types/lib/reanimated2/layoutReanimation/defaultAnimations/Roll.d.ts +18 -0
  93. package/lib/types/lib/reanimated2/layoutReanimation/defaultAnimations/Rotate.d.ts +34 -0
  94. package/lib/types/lib/reanimated2/layoutReanimation/defaultAnimations/Slide.d.ts +34 -0
  95. package/lib/types/lib/reanimated2/layoutReanimation/defaultAnimations/Stretch.d.ts +18 -0
  96. package/lib/types/lib/reanimated2/layoutReanimation/defaultAnimations/Zoom.d.ts +66 -0
  97. package/lib/types/lib/reanimated2/layoutReanimation/defaultAnimations/index.d.ts +10 -0
  98. package/lib/types/lib/reanimated2/layoutReanimation/defaultTransitions/CurvedTransition.d.ts +19 -0
  99. package/lib/types/lib/reanimated2/layoutReanimation/defaultTransitions/EntryExitTransition.d.ts +13 -0
  100. package/lib/types/lib/reanimated2/layoutReanimation/defaultTransitions/FadingTransition.d.ts +6 -0
  101. package/lib/types/lib/reanimated2/layoutReanimation/defaultTransitions/JumpingTransition.d.ts +6 -0
  102. package/lib/types/lib/reanimated2/layoutReanimation/defaultTransitions/LinearTransition.d.ts +7 -0
  103. package/lib/types/lib/reanimated2/layoutReanimation/defaultTransitions/SequencedTransition.d.ts +9 -0
  104. package/lib/types/lib/reanimated2/layoutReanimation/defaultTransitions/index.d.ts +6 -0
  105. package/lib/types/lib/reanimated2/layoutReanimation/index.d.ts +4 -0
  106. package/lib/types/lib/reanimated2/mock.d.ts +55 -0
  107. package/lib/types/lib/reanimated2/platform-specific/RNRenderer.d.ts +1 -0
  108. package/lib/types/lib/reanimated2/platform-specific/RNRenderer.web.d.ts +0 -0
  109. package/lib/types/lib/reanimated2/utils.d.ts +7 -0
  110. package/lib/types/lib/setAndForwardRef.d.ts +40 -0
  111. package/lib/types/react-native-reanimated-tests.d.ts +1 -0
  112. package/package.json +4 -4
  113. package/plugin.js +1 -0
  114. package/react-native-reanimated.d.ts +26 -29
  115. package/src/createAnimatedComponent.tsx +1 -1
  116. package/src/reanimated2/component/FlatList.tsx +1 -1
  117. package/src/reanimated2/interpolateColor.ts +11 -11
  118. package/src/reanimated2/jestUtils.ts +11 -0
  119. package/src/reanimated2/js-reanimated/index.ts +3 -3
  120. package/android/expo/linking.gradle +0 -46
  121. package/android/expo/src/main/java/com/swmansion/reanimated/EXReanimatedAdapter.java +0 -12
  122. package/android/expo/src/main/java/expo/modules/adapters/reanimated/EXReanimatedPackage.java +0 -26
  123. package/expo-module.config.json +0 -3
@@ -3,27 +3,34 @@ require "json"
3
3
  package = JSON.parse(File.read(File.join(__dir__, "package.json")))
4
4
 
5
5
  reactVersion = '0.0.0'
6
+ reactTargetTvOS = false
6
7
 
7
8
  begin
8
9
  # standard app
9
10
  # /appName/node_modules/react-native-reanimated/RNReanimated.podspec
10
11
  # /appName/node_modules/react-native/package.json
11
- reactVersion = JSON.parse(File.read(File.join(__dir__, "..", "..", "node_modules", "react-native", "package.json")))["version"]
12
+ reactJson = JSON.parse(File.read(File.join(__dir__, "..", "..", "node_modules", "react-native", "package.json")))
13
+ reactVersion = reactJson["version"]
14
+ reactTargetTvOS = reactJson["name"] == "react-native-tvos"
12
15
  rescue
13
16
  begin
14
17
  # monorepo
15
18
  # /monorepo/packages/appName/node_modules/react-native-reanimated/RNReanimated.podspec
16
19
  # /monorepo/node_modules/react-native/package.json
17
- reactVersion = JSON.parse(File.read(File.join(__dir__, "..", "..", "..", "..", "node_modules", "react-native", "package.json")))["version"]
20
+ reactJson = JSON.parse(File.read(File.join(__dir__, "..", "..", "..", "..", "node_modules", "react-native", "package.json")))
21
+ reactVersion = reactJson["version"]
22
+ reactTargetTvOS = reactJson["name"] == "react-native-tvos"
18
23
  rescue
19
24
  begin
20
25
  # Example app in reanimated repo
21
26
  # /react-native-reanimated/RNReanimated.podspec
22
27
  # /react-native-reanimated/node_modules/react-native/package.json
23
- reactVersion = JSON.parse(File.read(File.join(__dir__, "node_modules", "react-native", "package.json")))["version"]
28
+ reactJson = JSON.parse(File.read(File.join(__dir__, "node_modules", "react-native", "package.json")))
29
+ reactVersion = reactJson["version"]
30
+ reactTargetTvOS = ENV["ReanimatedTVOSExample"] == "1"
24
31
  rescue
25
32
  # should never happen
26
- reactVersion = '0.66.0'
33
+ reactVersion = '0.68.0'
27
34
  puts "[RNReanimated] Unable to recognized your `react-native` version! Default `react-native` version: " + reactVersion
28
35
  end
29
36
  end
@@ -78,7 +85,7 @@ Pod::Spec.new do |s|
78
85
 
79
86
  s.requires_arc = true
80
87
 
81
- s.dependency "React"
88
+ s.dependency "React-Core"
82
89
  s.dependency 'FBLazyVector'
83
90
  s.dependency 'FBReactNativeSpec'
84
91
  s.dependency 'RCTRequired'
@@ -86,7 +93,9 @@ Pod::Spec.new do |s|
86
93
  s.dependency 'React-Core'
87
94
  s.dependency 'React-CoreModules'
88
95
  s.dependency 'React-Core/DevSupport'
89
- s.dependency 'React-RCTActionSheet'
96
+ if !reactTargetTvOS
97
+ s.dependency 'React-RCTActionSheet'
98
+ end
90
99
  s.dependency 'React-RCTNetwork'
91
100
  s.dependency 'React-RCTAnimation'
92
101
  s.dependency 'React-RCTLinking'
@@ -1,2 +1,2 @@
1
- #Mon Mar 21 07:47:31 UTC 2022
1
+ #Mon Apr 04 19:58:22 UTC 2022
2
2
  gradle.version=7.2
@@ -74,15 +74,6 @@ def resolveBuildType() {
74
74
  return true
75
75
  }
76
76
 
77
- def resolveExpoLinkingGradle() {
78
- def gradleScript = file("./expo/linking.gradle")
79
- if (gradleScript.exists()) {
80
- return "./expo/linking.gradle"
81
- } else {
82
- return "../android-npm/expo/linking.gradle"
83
- }
84
- }
85
-
86
77
  def isDeveloperMode() {
87
78
  // developer mode, to run Example app
88
79
  return file("$projectDir/../node_modules/react-native/package.json").exists()
@@ -291,9 +282,6 @@ if (!BUILD_FROM_SOURCE) {
291
282
  // end if already loaded aar
292
283
  if (!BUILD_FROM_SOURCE) return
293
284
 
294
- // apply expo config
295
- apply from: resolveExpoLinkingGradle()
296
-
297
285
  def localProps = new Properties()
298
286
  def localPropertiesFile = file("local.properties")
299
287
  if (localPropertiesFile.exists()) {
@@ -701,17 +689,19 @@ task downloadNdkBuildDependencies {
701
689
  task prepareThirdPartyNdkHeaders(dependsOn:[downloadNdkBuildDependencies, prepareBoost, prepareDoubleConversion, prepareFolly, prepareGlog]) {
702
690
  }
703
691
 
704
- tasks.whenTaskAdded { task ->
705
- if (
706
- task.name.contains("externalNativeBuild")
707
- || task.name.contains("buildCMake")
708
- ) {
709
- task.dependsOn(prepareThirdPartyNdkHeaders)
710
- extractAARHeaders.dependsOn(prepareThirdPartyNdkHeaders)
711
- extractSOFiles.dependsOn(prepareThirdPartyNdkHeaders)
712
- task.dependsOn(extractAARHeaders)
713
- task.dependsOn(extractSOFiles)
714
- }
692
+ def nativeBuildDependsOn(dependsOnTask) {
693
+ def buildTasks = tasks.findAll({ task ->
694
+ !task.name.contains("Clean") && (task.name.contains("externalNative") || task.name.contains("CMake")) })
695
+ buildTasks.forEach { task -> task.dependsOn(dependsOnTask) }
696
+ }
697
+
698
+ afterEvaluate {
699
+ extractAARHeaders.dependsOn(prepareThirdPartyNdkHeaders)
700
+ extractSOFiles.dependsOn(prepareThirdPartyNdkHeaders)
701
+
702
+ nativeBuildDependsOn(prepareThirdPartyNdkHeaders)
703
+ nativeBuildDependsOn(extractAARHeaders)
704
+ nativeBuildDependsOn(extractSOFiles)
715
705
  }
716
706
 
717
707
  if (CLIENT_SIDE_BUILD) {
@@ -143,7 +143,7 @@
143
143
  - (void)invalidate
144
144
  {
145
145
  _eventHandler = nil;
146
- [self stopUpdatingOnAnimationFrame];
146
+ [_displayLink invalidate];
147
147
  }
148
148
 
149
149
  - (void)operationsBatchDidComplete
@@ -1,11 +1,15 @@
1
+ #if __has_include(<CoreMotion/CoreMotion.h>)
1
2
  #import <CoreMotion/CoreMotion.h>
3
+ #endif
2
4
  #import "ReanimatedSensorType.h"
3
5
 
4
6
  @interface ReanimatedSensor : NSObject {
5
7
  ReanimatedSensorType _sensorType;
6
8
  double _interval;
7
9
  double _lastTimestamp;
10
+ #if !TARGET_OS_TV
8
11
  CMMotionManager *_motionManager;
12
+ #endif
9
13
  void (^_setter)(double[]);
10
14
  }
11
15
 
@@ -1,5 +1,6 @@
1
1
  #import "ReanimatedSensor.h"
2
2
 
3
+ #if __has_include(<CoreMotion/CoreMotion.h>)
3
4
  @implementation ReanimatedSensor
4
5
 
5
6
  - (instancetype)init:(ReanimatedSensorType)sensorType interval:(int)interval setter:(void (^)(double[]))setter
@@ -167,3 +168,50 @@
167
168
  }
168
169
 
169
170
  @end
171
+
172
+ #else
173
+
174
+ @implementation ReanimatedSensor
175
+
176
+ - (instancetype)init:(ReanimatedSensorType)sensorType interval:(int)interval setter:(void (^)(double[]))setter
177
+ {
178
+ self = [super init];
179
+ return self;
180
+ }
181
+
182
+ - (bool)initialize
183
+ {
184
+ return false;
185
+ }
186
+
187
+ - (bool)initializeGyroscope
188
+ {
189
+ return false;
190
+ }
191
+
192
+ - (bool)initializeAccelerometer
193
+ {
194
+ return false;
195
+ }
196
+
197
+ - (bool)initializeGravity
198
+ {
199
+ return false;
200
+ }
201
+
202
+ - (bool)initializeMagnetometer
203
+ {
204
+ return false;
205
+ }
206
+
207
+ - (bool)initializeOrientation
208
+ {
209
+ return false;
210
+ }
211
+
212
+ - (void)cancel
213
+ {
214
+ }
215
+
216
+ @end
217
+ #endif
@@ -1,4 +1,3 @@
1
- #import <CoreMotion/CoreMotion.h>
2
1
  #import "ReanimatedSensorType.h"
3
2
 
4
3
  @interface ReanimatedSensorContainer : NSObject {
@@ -1,5 +1,4 @@
1
1
  #import "ReanimatedSensorContainer.h"
2
- #import <CoreMotion/CoreMotion.h>
3
2
  #import <Foundation/Foundation.h>
4
3
  #import "ReanimatedSensor.h"
5
4
 
@@ -27,13 +27,13 @@ const getInterpolateRGB = (colors) => {
27
27
  const a = [];
28
28
  for (let i = 0; i < colors.length; ++i) {
29
29
  const color = colors[i];
30
- const proocessedColor = processColor(color);
30
+ const processedColor = processColor(color);
31
31
  // explicit check in case if processedColor is 0
32
- if (proocessedColor !== null && proocessedColor !== undefined) {
33
- r.push(red(proocessedColor));
34
- g.push(green(proocessedColor));
35
- b.push(blue(proocessedColor));
36
- a.push(opacity(proocessedColor));
32
+ if (processedColor !== null && processedColor !== undefined) {
33
+ r.push(red(processedColor));
34
+ g.push(green(processedColor));
35
+ b.push(blue(processedColor));
36
+ a.push(opacity(processedColor));
37
37
  }
38
38
  }
39
39
  return { r, g, b, a };
@@ -45,11 +45,11 @@ const getInterpolateHSV = (colors) => {
45
45
  const v = [];
46
46
  for (let i = 0; i < colors.length; ++i) {
47
47
  const color = colors[i];
48
- const proocessedColor = RGBtoHSV(processColor(color));
49
- if (proocessedColor) {
50
- h.push(proocessedColor.h);
51
- s.push(proocessedColor.s);
52
- v.push(proocessedColor.v);
48
+ const processedColor = RGBtoHSV(processColor(color));
49
+ if (processedColor) {
50
+ h.push(processedColor.h);
51
+ s.push(processedColor.s);
52
+ v.push(processedColor.v);
53
53
  }
54
54
  }
55
55
  return { h, s, v };
@@ -7,7 +7,7 @@ if (shouldBeUseWeb()) {
7
7
  // noop
8
8
  };
9
9
  global._measure = () => {
10
- console.warn("[Reanimated] You can't use 'measue' method with Chrome Debugger or with web version");
10
+ console.warn("[Reanimated] You can't use `measure` with Chrome Debugger or with web version");
11
11
  return {
12
12
  x: 0,
13
13
  y: 0,
@@ -18,10 +18,10 @@ if (shouldBeUseWeb()) {
18
18
  };
19
19
  };
20
20
  global._scrollTo = () => {
21
- console.warn("[Reanimated] You can't use 'scrollTo' method with Chrome Debugger or with web version");
21
+ console.warn("[Reanimated] You can't use `scrollTo` with Chrome Debugger or with web version");
22
22
  };
23
23
  global._setGestureState = () => {
24
- console.warn("[Reanimated] You can't use 'setGestureState' method with Chrome Debugger or with web version");
24
+ console.warn("[Reanimated] You can't use `setGestureState` with Chrome Debugger or with web version");
25
25
  };
26
26
  }
27
27
  export const _updatePropsJS = (updates, viewRef) => {
@@ -0,0 +1,12 @@
1
+ export declare function addWhitelistedNativeProps(props: Record<string, boolean>): void;
2
+ export declare function addWhitelistedUIProps(props: Record<string, boolean>): void;
3
+ interface ViewConfig {
4
+ uiViewClassName: string;
5
+ validAttributes: Record<string, unknown>;
6
+ }
7
+ /**
8
+ * updates UI props whitelist for given view host instance
9
+ * this will work just once for every view name
10
+ */
11
+ export declare function adaptViewConfig(viewConfig: ViewConfig): void;
12
+ export {};
@@ -0,0 +1,3 @@
1
+ import { NativeEventEmitter } from 'react-native';
2
+ declare const _default: NativeEventEmitter;
3
+ export default _default;
@@ -0,0 +1,2 @@
1
+ import ReanimatedModuleCompat from './ReanimatedModuleCompat';
2
+ export default ReanimatedModuleCompat;
@@ -0,0 +1,2 @@
1
+ import ReanimatedModuleCompat from './ReanimatedModuleCompat';
2
+ export default ReanimatedModuleCompat;
@@ -0,0 +1,2 @@
1
+ declare let exportedModule: any;
2
+ export default exportedModule;
@@ -0,0 +1,2 @@
1
+ import ReanimatedModuleCompat from './ReanimatedModuleCompat';
2
+ export default ReanimatedModuleCompat;
@@ -0,0 +1,14 @@
1
+ declare const _default: {
2
+ disconnectNodeFromView(): Promise<void>;
3
+ attachEvent(_viewTag: number, _eventName: string, _nodeID: number): Promise<void>;
4
+ detachEvent(_viewTag: number, _eventName: string, _nodeID: number): Promise<void>;
5
+ createNode(_nodeID: number, _config: Record<string, unknown>): Promise<void>;
6
+ dropNode(_nodeID: number): Promise<void>;
7
+ configureProps(_nativeProps: string[], _uiProps: string[]): Promise<void>;
8
+ disconnectNodes(): Promise<void>;
9
+ addListener(): Promise<void>;
10
+ removeListeners(): Promise<void>;
11
+ removeAllListeners(): Promise<void>;
12
+ animateNextTransition(): Promise<void>;
13
+ };
14
+ export default _default;
@@ -0,0 +1,33 @@
1
+ import { Component, ComponentType, Ref } from 'react';
2
+ import './reanimated2/layoutReanimation/LayoutAnimationRepository';
3
+ import { BaseAnimationBuilder, EntryExitAnimationFunction, ILayoutAnimationBuilder } from './reanimated2/layoutReanimation';
4
+ import { SharedValue, StyleProps } from './reanimated2/commonTypes';
5
+ import { ViewDescriptorsSet, ViewRefSet } from './reanimated2/ViewDescriptorsSet';
6
+ declare type NestedArray<T> = T | NestedArray<T>[];
7
+ interface AnimatedProps extends Record<string, unknown> {
8
+ viewDescriptors?: ViewDescriptorsSet;
9
+ viewsRef?: ViewRefSet<unknown>;
10
+ initial?: SharedValue<StyleProps>;
11
+ }
12
+ export declare type AnimatedComponentProps<P extends Record<string, unknown>> = P & {
13
+ forwardedRef?: Ref<Component>;
14
+ style?: NestedArray<StyleProps>;
15
+ animatedProps?: Partial<AnimatedComponentProps<AnimatedProps>>;
16
+ animatedStyle?: StyleProps;
17
+ layout?: BaseAnimationBuilder | ILayoutAnimationBuilder | typeof BaseAnimationBuilder;
18
+ entering?: BaseAnimationBuilder | typeof BaseAnimationBuilder | EntryExitAnimationFunction | Keyframe;
19
+ exiting?: BaseAnimationBuilder | typeof BaseAnimationBuilder | EntryExitAnimationFunction | Keyframe;
20
+ };
21
+ declare type Options<P> = {
22
+ setNativeProps: (ref: ComponentRef, props: P) => void;
23
+ };
24
+ interface ComponentRef extends Component {
25
+ setNativeProps?: (props: Record<string, unknown>) => void;
26
+ getScrollableNode?: () => ComponentRef;
27
+ }
28
+ export interface InitialComponentProps extends Record<string, unknown> {
29
+ ref?: Ref<Component>;
30
+ collapsable?: boolean;
31
+ }
32
+ export default function createAnimatedComponent(Component: ComponentType<InitialComponentProps>, options?: Options<InitialComponentProps>): ComponentType<AnimatedComponentProps<InitialComponentProps>>;
33
+ export {};
@@ -0,0 +1,6 @@
1
+ /**
2
+ * https://github.com/gre/bezier-easing
3
+ * BezierEasing - use bezier curve for transition easing function
4
+ * by Gaëtan Renaudeau 2014 - 2015 – MIT License
5
+ */
6
+ export declare function Bezier(mX1: number, mY1: number, mX2: number, mY2: number): (x: number) => number;
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Copied from:
3
+ * react-native/Libraries/StyleSheet/normalizeColor.js
4
+ * react-native/Libraries/StyleSheet/processColor.js
5
+ * https://github.com/wcandillon/react-native-redash/blob/master/src/Colors.ts
6
+ */
7
+ interface RGB {
8
+ r: number;
9
+ g: number;
10
+ b: number;
11
+ }
12
+ interface HSV {
13
+ h: number;
14
+ s: number;
15
+ v: number;
16
+ }
17
+ export declare const opacity: (c: number) => number;
18
+ export declare const red: (c: number) => number;
19
+ export declare const green: (c: number) => number;
20
+ export declare const blue: (c: number) => number;
21
+ export declare const rgbaColor: (r: number, g: number, b: number, alpha?: number) => number | string;
22
+ export declare function RGBtoHSV(rgb: RGB): HSV;
23
+ export declare function RGBtoHSV(r: number, g: number, b: number): HSV;
24
+ export declare const hsvToColor: (h: number, s: number, v: number) => number | string;
25
+ export declare function processColorInitially(color: unknown): number | null | undefined;
26
+ export declare function isColor(value: unknown): boolean;
27
+ export declare function processColor(color: unknown): number | null | undefined;
28
+ export declare type ParsedColorArray = [number, number, number, number];
29
+ export declare function convertToHSVA(color: unknown): ParsedColorArray;
30
+ export declare function toRGBA(HSVA: ParsedColorArray): string;
31
+ export {};
@@ -0,0 +1,172 @@
1
+ /**
2
+ * The `Easing` module implements common easing functions. This module is used
3
+ * by [Animate.timing()](docs/animate.html#timing) to convey physically
4
+ * believable motion in animations.
5
+ *
6
+ * You can find a visualization of some common easing functions at
7
+ * http://easings.net/
8
+ *
9
+ * ### Predefined animations
10
+ *
11
+ * The `Easing` module provides several predefined animations through the
12
+ * following methods:
13
+ *
14
+ * - [`back`](docs/easing.html#back) provides a simple animation where the
15
+ * object goes slightly back before moving forward
16
+ * - [`bounce`](docs/easing.html#bounce) provides a bouncing animation
17
+ * - [`ease`](docs/easing.html#ease) provides a simple inertial animation
18
+ * - [`elastic`](docs/easing.html#elastic) provides a simple spring interaction
19
+ *
20
+ * ### Standard functions
21
+ *
22
+ * Three standard easing functions are provided:
23
+ *
24
+ * - [`linear`](docs/easing.html#linear)
25
+ * - [`quad`](docs/easing.html#quad)
26
+ * - [`cubic`](docs/easing.html#cubic)
27
+ *
28
+ * The [`poly`](docs/easing.html#poly) function can be used to implement
29
+ * quartic, quintic, and other higher power functions.
30
+ *
31
+ * ### Additional functions
32
+ *
33
+ * Additional mathematical functions are provided by the following methods:
34
+ *
35
+ * - [`bezier`](docs/easing.html#bezier) provides a cubic bezier curve
36
+ * - [`circle`](docs/easing.html#circle) provides a circular function
37
+ * - [`sin`](docs/easing.html#sin) provides a sinusoidal function
38
+ * - [`exp`](docs/easing.html#exp) provides an exponential function
39
+ *
40
+ * The following helpers are used to modify other easing functions.
41
+ *
42
+ * - [`in`](docs/easing.html#in) runs an easing function forwards
43
+ * - [`inOut`](docs/easing.html#inout) makes any easing function symmetrical
44
+ * - [`out`](docs/easing.html#out) runs an easing function backwards
45
+ */
46
+ export declare type EasingFn = (t: number) => number;
47
+ export declare type EasingFactoryFn = {
48
+ factory: () => EasingFn;
49
+ };
50
+ /**
51
+ * A linear function, `f(t) = t`. Position correlates to elapsed time one to
52
+ * one.
53
+ *
54
+ * http://cubic-bezier.com/#0,0,1,1
55
+ */
56
+ declare function linear(t: number): number;
57
+ /**
58
+ * A simple inertial interaction, similar to an object slowly accelerating to
59
+ * speed.
60
+ *
61
+ * http://cubic-bezier.com/#.42,0,1,1
62
+ */
63
+ declare function ease(t: number): number;
64
+ /**
65
+ * A quadratic function, `f(t) = t * t`. Position equals the square of elapsed
66
+ * time.
67
+ *
68
+ * http://easings.net/#easeInQuad
69
+ */
70
+ declare function quad(t: number): number;
71
+ /**
72
+ * A cubic function, `f(t) = t * t * t`. Position equals the cube of elapsed
73
+ * time.
74
+ *
75
+ * http://easings.net/#easeInCubic
76
+ */
77
+ declare function cubic(t: number): number;
78
+ /**
79
+ * A power function. Position is equal to the Nth power of elapsed time.
80
+ *
81
+ * n = 4: http://easings.net/#easeInQuart
82
+ * n = 5: http://easings.net/#easeInQuint
83
+ */
84
+ declare function poly(n: number): EasingFn;
85
+ /**
86
+ * A sinusoidal function.
87
+ *
88
+ * http://easings.net/#easeInSine
89
+ */
90
+ declare function sin(t: number): number;
91
+ /**
92
+ * A circular function.
93
+ *
94
+ * http://easings.net/#easeInCirc
95
+ */
96
+ declare function circle(t: number): number;
97
+ /**
98
+ * An exponential function.
99
+ *
100
+ * http://easings.net/#easeInExpo
101
+ */
102
+ declare function exp(t: number): number;
103
+ /**
104
+ * A simple elastic interaction, similar to a spring oscillating back and
105
+ * forth.
106
+ *
107
+ * Default bounciness is 1, which overshoots a little bit once. 0 bounciness
108
+ * doesn't overshoot at all, and bounciness of N > 1 will overshoot about N
109
+ * times.
110
+ *
111
+ * http://easings.net/#easeInElastic
112
+ */
113
+ declare function elastic(bounciness?: number): EasingFn;
114
+ /**
115
+ * Use with `Animated.parallel()` to create a simple effect where the object
116
+ * animates back slightly as the animation starts.
117
+ *
118
+ * Wolfram Plot:
119
+ *
120
+ * - http://tiny.cc/back_default (s = 1.70158, default)
121
+ */
122
+ declare function back(s?: number): (t: number) => number;
123
+ /**
124
+ * Provides a simple bouncing effect.
125
+ *
126
+ * http://easings.net/#easeInBounce
127
+ */
128
+ declare function bounce(t: number): number;
129
+ /**
130
+ * Provides a cubic bezier curve, equivalent to CSS Transitions'
131
+ * `transition-timing-function`.
132
+ *
133
+ * A useful tool to visualize cubic bezier curves can be found at
134
+ * http://cubic-bezier.com/
135
+ */
136
+ declare function bezier(x1: number, y1: number, x2: number, y2: number): {
137
+ factory: () => (x: number) => number;
138
+ };
139
+ declare function bezierFn(x1: number, y1: number, x2: number, y2: number): (x: number) => number;
140
+ /**
141
+ * Runs an easing function forwards.
142
+ */
143
+ declare function in_(easing: EasingFn): EasingFn;
144
+ /**
145
+ * Runs an easing function backwards.
146
+ */
147
+ declare function out(easing: EasingFn): EasingFn;
148
+ /**
149
+ * Makes any easing function symmetrical. The easing function will run
150
+ * forwards for half of the duration, then backwards for the rest of the
151
+ * duration.
152
+ */
153
+ declare function inOut(easing: EasingFn): EasingFn;
154
+ export declare const Easing: {
155
+ linear: typeof linear;
156
+ ease: typeof ease;
157
+ quad: typeof quad;
158
+ cubic: typeof cubic;
159
+ poly: typeof poly;
160
+ sin: typeof sin;
161
+ circle: typeof circle;
162
+ exp: typeof exp;
163
+ elastic: typeof elastic;
164
+ back: typeof back;
165
+ bounce: typeof bounce;
166
+ bezier: typeof bezier;
167
+ bezierFn: typeof bezierFn;
168
+ in: typeof in_;
169
+ out: typeof out;
170
+ inOut: typeof inOut;
171
+ };
172
+ export {};
@@ -0,0 +1,14 @@
1
+ import { Component } from 'react';
2
+ import { RefObjectFunction } from './commonTypes';
3
+ export declare function getTag(view: null | number | React.Component<any, any> | React.ComponentClass<any>): null | number;
4
+ export interface MeasuredDimensions {
5
+ x: number;
6
+ y: number;
7
+ width: number;
8
+ height: number;
9
+ pageX: number;
10
+ pageY: number;
11
+ }
12
+ export declare function measure(animatedRef: RefObjectFunction<Component>): MeasuredDimensions;
13
+ export declare function scrollTo(animatedRef: RefObjectFunction<Component>, x: number, y: number, animated: boolean): void;
14
+ export declare function setGestureState(handlerTag: number, newState: number): void;
@@ -0,0 +1,20 @@
1
+ import { SharedValue, SensorValue3D, SensorValueRotation } from '../commonTypes';
2
+ import { Descriptor } from '../hook/commonTypes';
3
+ export declare class NativeReanimated {
4
+ native: boolean;
5
+ private InnerNativeModule;
6
+ constructor(native?: boolean);
7
+ installCoreFunctions(valueSetter: <T>(value: T) => void): void;
8
+ makeShareable<T>(value: T): T;
9
+ makeMutable<T>(value: T): SharedValue<T>;
10
+ makeRemote<T>(object?: {}): T;
11
+ registerSensor(sensorType: number, interval: number, sensorData: SensorValue3D | SensorValueRotation): any;
12
+ unregisterSensor(sensorId: number): any;
13
+ startMapper(mapper: () => void, inputs: any[] | undefined, outputs: any[] | undefined, updater: () => void, viewDescriptors: Descriptor[] | SharedValue<Descriptor[]>): number;
14
+ stopMapper(mapperId: number): void;
15
+ registerEventHandler<T>(eventHash: string, eventHandler: (event: T) => void): string;
16
+ unregisterEventHandler(id: string): void;
17
+ getViewProp<T>(viewTag: string, propName: string, callback?: (result: T) => void): Promise<T>;
18
+ enableLayoutAnimations(flag: boolean): void;
19
+ configureProps(uiProps: string[], nativeProps: string[]): void;
20
+ }
@@ -0,0 +1,3 @@
1
+ import { NativeReanimated } from './NativeReanimated';
2
+ declare const _default: NativeReanimated;
3
+ export default _default;
@@ -0,0 +1,5 @@
1
+ export declare function isJest(): boolean;
2
+ export declare function isChromeDebugger(): boolean;
3
+ export declare function isWeb(): boolean;
4
+ export declare function shouldBeUseWeb(): boolean;
5
+ export declare function nativeShouldBeMock(): boolean;
@@ -0,0 +1,4 @@
1
+ import { AdapterWorkletFunction } from './commonTypes';
2
+ export declare function createAnimatedPropAdapter(adapter: AdapterWorkletFunction, nativeProps?: string[]): AdapterWorkletFunction;
3
+ export declare const SVGAdapter: AdapterWorkletFunction;
4
+ export declare const TextInputAdapter: AdapterWorkletFunction;