@amazon-devices/react-native-worklets 1.0.0-rn-83

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 (348) hide show
  1. package/Common/cpp/worklets/AnimationFrameQueue/AnimationFrameBatchinator.cpp +71 -0
  2. package/Common/cpp/worklets/AnimationFrameQueue/AnimationFrameBatchinator.h +38 -0
  3. package/Common/cpp/worklets/NativeModules/JSIWorkletsModuleProxy.cpp +712 -0
  4. package/Common/cpp/worklets/NativeModules/JSIWorkletsModuleProxy.h +88 -0
  5. package/Common/cpp/worklets/NativeModules/WorkletsModuleProxy.cpp +89 -0
  6. package/Common/cpp/worklets/NativeModules/WorkletsModuleProxy.h +80 -0
  7. package/Common/cpp/worklets/Public/AsyncQueue.h +14 -0
  8. package/Common/cpp/worklets/Registries/EventHandlerRegistry.cpp +94 -0
  9. package/Common/cpp/worklets/Registries/EventHandlerRegistry.h +51 -0
  10. package/Common/cpp/worklets/Registries/WorkletRuntimeRegistry.cpp +8 -0
  11. package/Common/cpp/worklets/Registries/WorkletRuntimeRegistry.h +40 -0
  12. package/Common/cpp/worklets/Resources/SynchronizableUnpacker.cpp +49 -0
  13. package/Common/cpp/worklets/Resources/Unpackers.h +6 -0
  14. package/Common/cpp/worklets/Resources/ValueUnpacker.cpp +53 -0
  15. package/Common/cpp/worklets/RunLoop/AsyncQueueImpl.cpp +62 -0
  16. package/Common/cpp/worklets/RunLoop/AsyncQueueImpl.h +46 -0
  17. package/Common/cpp/worklets/RunLoop/EventLoop.cpp +112 -0
  18. package/Common/cpp/worklets/RunLoop/EventLoop.h +52 -0
  19. package/Common/cpp/worklets/SharedItems/Serializable.cpp +545 -0
  20. package/Common/cpp/worklets/SharedItems/Serializable.h +473 -0
  21. package/Common/cpp/worklets/SharedItems/Synchronizable.cpp +67 -0
  22. package/Common/cpp/worklets/SharedItems/Synchronizable.h +59 -0
  23. package/Common/cpp/worklets/SharedItems/SynchronizableAccess.cpp +81 -0
  24. package/Common/cpp/worklets/SharedItems/SynchronizableAccess.h +45 -0
  25. package/Common/cpp/worklets/Tools/Defs.h +10 -0
  26. package/Common/cpp/worklets/Tools/FeatureFlags.cpp +15 -0
  27. package/Common/cpp/worklets/Tools/FeatureFlags.h +44 -0
  28. package/Common/cpp/worklets/Tools/JSISerializer.cpp +342 -0
  29. package/Common/cpp/worklets/Tools/JSISerializer.h +51 -0
  30. package/Common/cpp/worklets/Tools/JSLogger.cpp +68 -0
  31. package/Common/cpp/worklets/Tools/JSLogger.h +37 -0
  32. package/Common/cpp/worklets/Tools/JSScheduler.cpp +24 -0
  33. package/Common/cpp/worklets/Tools/JSScheduler.h +39 -0
  34. package/Common/cpp/worklets/Tools/PlatformLogger.h +16 -0
  35. package/Common/cpp/worklets/Tools/SingleInstanceChecker.h +82 -0
  36. package/Common/cpp/worklets/Tools/ThreadSafeQueue.h +49 -0
  37. package/Common/cpp/worklets/Tools/UIScheduler.cpp +19 -0
  38. package/Common/cpp/worklets/Tools/UIScheduler.h +26 -0
  39. package/Common/cpp/worklets/Tools/VersionUtils.cpp +75 -0
  40. package/Common/cpp/worklets/Tools/VersionUtils.h +28 -0
  41. package/Common/cpp/worklets/Tools/WorkletEventHandler.cpp +29 -0
  42. package/Common/cpp/worklets/Tools/WorkletEventHandler.h +41 -0
  43. package/Common/cpp/worklets/Tools/WorkletsJSIUtils.cpp +46 -0
  44. package/Common/cpp/worklets/Tools/WorkletsJSIUtils.h +208 -0
  45. package/Common/cpp/worklets/Tools/WorkletsSystraceSection.h +161 -0
  46. package/Common/cpp/worklets/Tools/WorkletsVersion.cpp +54 -0
  47. package/Common/cpp/worklets/Tools/WorkletsVersion.h +20 -0
  48. package/Common/cpp/worklets/WorkletRuntime/RNRuntimeWorkletDecorator.cpp +38 -0
  49. package/Common/cpp/worklets/WorkletRuntime/RNRuntimeWorkletDecorator.h +21 -0
  50. package/Common/cpp/worklets/WorkletRuntime/RuntimeData.cpp +3 -0
  51. package/Common/cpp/worklets/WorkletRuntime/RuntimeData.h +12 -0
  52. package/Common/cpp/worklets/WorkletRuntime/RuntimeInitialization.md +191 -0
  53. package/Common/cpp/worklets/WorkletRuntime/RuntimeKind.h +16 -0
  54. package/Common/cpp/worklets/WorkletRuntime/RuntimeManager.cpp +105 -0
  55. package/Common/cpp/worklets/WorkletRuntime/RuntimeManager.h +63 -0
  56. package/Common/cpp/worklets/WorkletRuntime/UIRuntimeDecorator.cpp +23 -0
  57. package/Common/cpp/worklets/WorkletRuntime/UIRuntimeDecorator.h +16 -0
  58. package/Common/cpp/worklets/WorkletRuntime/WorkletHermesRuntime.cpp +119 -0
  59. package/Common/cpp/worklets/WorkletRuntime/WorkletHermesRuntime.h +134 -0
  60. package/Common/cpp/worklets/WorkletRuntime/WorkletRuntime.cpp +244 -0
  61. package/Common/cpp/worklets/WorkletRuntime/WorkletRuntime.h +102 -0
  62. package/Common/cpp/worklets/WorkletRuntime/WorkletRuntimeCollector.h +36 -0
  63. package/Common/cpp/worklets/WorkletRuntime/WorkletRuntimeDecorator.cpp +308 -0
  64. package/Common/cpp/worklets/WorkletRuntime/WorkletRuntimeDecorator.h +26 -0
  65. package/LICENSE +7 -0
  66. package/README.md +31 -0
  67. package/RNWorklets.podspec +94 -0
  68. package/SystemBundles/cc12deac6e91c435b76698c8445aed85612f2f88e733218d14f88a35d06fb0f4.bundle +10512 -0
  69. package/SystemBundles/cc12deac6e91c435b76698c8445aed85612f2f88e733218d14f88a35d06fb0f4.map +3771 -0
  70. package/SystemModules/amzn__react-native-worklets-1.modules.txt +39 -0
  71. package/SystemModules/amzn__react-native-worklets-1.private.modules.txt +61 -0
  72. package/SystemModules/keplerscript-system-bundle-config.json +7 -0
  73. package/android/CMakeLists.txt +124 -0
  74. package/android/build.gradle +350 -0
  75. package/android/gradle.properties +5 -0
  76. package/android/proguard-rules.pro +3 -0
  77. package/android/spotless.gradle +9 -0
  78. package/android/src/experimentalBundling/com/swmansion/worklets/WorkletsModule.java +149 -0
  79. package/android/src/legacyBundling/com/swmansion/worklets/WorkletsModule.java +122 -0
  80. package/android/src/main/AndroidManifest.xml +2 -0
  81. package/android/src/main/cpp/worklets/android/AndroidUIScheduler.cpp +63 -0
  82. package/android/src/main/cpp/worklets/android/AndroidUIScheduler.h +43 -0
  83. package/android/src/main/cpp/worklets/android/AnimationFrameCallback.h +34 -0
  84. package/android/src/main/cpp/worklets/android/PlatformLogger.cpp +29 -0
  85. package/android/src/main/cpp/worklets/android/WorkletsModule.cpp +115 -0
  86. package/android/src/main/cpp/worklets/android/WorkletsModule.h +78 -0
  87. package/android/src/main/cpp/worklets/android/WorkletsOnLoad.cpp +13 -0
  88. package/android/src/main/java/com/swmansion/worklets/AndroidUIScheduler.java +60 -0
  89. package/android/src/main/java/com/swmansion/worklets/JSCallInvokerResolver.java +27 -0
  90. package/android/src/main/java/com/swmansion/worklets/WorkletsMessageQueueThread.java +16 -0
  91. package/android/src/main/java/com/swmansion/worklets/WorkletsMessageQueueThreadBase.java +73 -0
  92. package/android/src/main/java/com/swmansion/worklets/WorkletsPackage.java +48 -0
  93. package/android/src/main/java/com/swmansion/worklets/runloop/AnimationFrameCallback.java +19 -0
  94. package/android/src/main/java/com/swmansion/worklets/runloop/AnimationFrameQueue.java +113 -0
  95. package/apple/worklets/apple/AnimationFrameQueue.h +15 -0
  96. package/apple/worklets/apple/AnimationFrameQueue.mm +135 -0
  97. package/apple/worklets/apple/AssertJavaScriptQueue.h +14 -0
  98. package/apple/worklets/apple/AssertTurboModuleManagerQueue.h +16 -0
  99. package/apple/worklets/apple/IOSUIScheduler.h +15 -0
  100. package/apple/worklets/apple/IOSUIScheduler.mm +29 -0
  101. package/apple/worklets/apple/PlatformLogger.mm +31 -0
  102. package/apple/worklets/apple/SlowAnimations.h +8 -0
  103. package/apple/worklets/apple/SlowAnimations.mm +45 -0
  104. package/apple/worklets/apple/WorkletsDisplayLink.h +21 -0
  105. package/apple/worklets/apple/WorkletsMessageThread.h +16 -0
  106. package/apple/worklets/apple/WorkletsMessageThread.mm +31 -0
  107. package/apple/worklets/apple/WorkletsModule.h +28 -0
  108. package/apple/worklets/apple/WorkletsModule.mm +121 -0
  109. package/bundleMode/index.d.ts +3 -0
  110. package/bundleMode/index.js +59 -0
  111. package/compatibility.json +11 -0
  112. package/kepler-compatibility.json +5 -0
  113. package/kepler-transformed-package-info.json +3 -0
  114. package/lib/module/PlatformChecker/PlatformChecker.js +8 -0
  115. package/lib/module/PlatformChecker/PlatformChecker.js.map +1 -0
  116. package/lib/module/PlatformChecker/index.js +18 -0
  117. package/lib/module/PlatformChecker/index.js.map +1 -0
  118. package/lib/module/WorkletsError.js +29 -0
  119. package/lib/module/WorkletsError.js.map +1 -0
  120. package/lib/module/WorkletsModule/JSWorklets.js +111 -0
  121. package/lib/module/WorkletsModule/JSWorklets.js.map +1 -0
  122. package/lib/module/WorkletsModule/NativeWorklets.js +126 -0
  123. package/lib/module/WorkletsModule/NativeWorklets.js.map +1 -0
  124. package/lib/module/WorkletsModule/index.js +4 -0
  125. package/lib/module/WorkletsModule/index.js.map +1 -0
  126. package/lib/module/WorkletsModule/workletsModuleInstance.js +7 -0
  127. package/lib/module/WorkletsModule/workletsModuleInstance.js.map +1 -0
  128. package/lib/module/WorkletsModule/workletsModuleInstance.web.js +5 -0
  129. package/lib/module/WorkletsModule/workletsModuleInstance.web.js.map +1 -0
  130. package/lib/module/WorkletsModule/workletsModuleProxy.js +4 -0
  131. package/lib/module/WorkletsModule/workletsModuleProxy.js.map +1 -0
  132. package/lib/module/bundleUnpacker.js +47 -0
  133. package/lib/module/bundleUnpacker.js.map +1 -0
  134. package/lib/module/callGuard.js +30 -0
  135. package/lib/module/callGuard.js.map +1 -0
  136. package/lib/module/deprecated.js +20 -0
  137. package/lib/module/deprecated.js.map +1 -0
  138. package/lib/module/errors.js +69 -0
  139. package/lib/module/errors.js.map +1 -0
  140. package/lib/module/featureFlags/index.js +48 -0
  141. package/lib/module/featureFlags/index.js.map +1 -0
  142. package/lib/module/featureFlags/staticFlags.json +4 -0
  143. package/lib/module/index.js +26 -0
  144. package/lib/module/index.js.map +1 -0
  145. package/lib/module/initializers.js +221 -0
  146. package/lib/module/initializers.js.map +1 -0
  147. package/lib/module/isSynchronizable.js +6 -0
  148. package/lib/module/isSynchronizable.js.map +1 -0
  149. package/lib/module/logger.js +15 -0
  150. package/lib/module/logger.js.map +1 -0
  151. package/lib/module/privateGlobals.d.js +7 -0
  152. package/lib/module/privateGlobals.d.js.map +1 -0
  153. package/lib/module/publicGlobals.js +6 -0
  154. package/lib/module/publicGlobals.js.map +1 -0
  155. package/lib/module/runLoop/common/setImmediatePolyfill.js +15 -0
  156. package/lib/module/runLoop/common/setImmediatePolyfill.js.map +1 -0
  157. package/lib/module/runLoop/common/setIntervalPolyfill.js +26 -0
  158. package/lib/module/runLoop/common/setIntervalPolyfill.js.map +1 -0
  159. package/lib/module/runLoop/uiRuntime/mockedRequestAnimationFrame.js +10 -0
  160. package/lib/module/runLoop/uiRuntime/mockedRequestAnimationFrame.js.map +1 -0
  161. package/lib/module/runLoop/uiRuntime/requestAnimationFrame.js +52 -0
  162. package/lib/module/runLoop/uiRuntime/requestAnimationFrame.js.map +1 -0
  163. package/lib/module/runLoop/uiRuntime/setTimeoutPolyfill.js +32 -0
  164. package/lib/module/runLoop/uiRuntime/setTimeoutPolyfill.js.map +1 -0
  165. package/lib/module/runLoop/workletRuntime/index.js +19 -0
  166. package/lib/module/runLoop/workletRuntime/index.js.map +1 -0
  167. package/lib/module/runLoop/workletRuntime/queueMicrotask.js +11 -0
  168. package/lib/module/runLoop/workletRuntime/queueMicrotask.js.map +1 -0
  169. package/lib/module/runLoop/workletRuntime/requestAnimationFramePolyfill.js +48 -0
  170. package/lib/module/runLoop/workletRuntime/requestAnimationFramePolyfill.js.map +1 -0
  171. package/lib/module/runLoop/workletRuntime/setTimeout.js +28 -0
  172. package/lib/module/runLoop/workletRuntime/setTimeout.js.map +1 -0
  173. package/lib/module/runLoop/workletRuntime/taskQueue.js +37 -0
  174. package/lib/module/runLoop/workletRuntime/taskQueue.js.map +1 -0
  175. package/lib/module/runtimeKind.js +39 -0
  176. package/lib/module/runtimeKind.js.map +1 -0
  177. package/lib/module/runtimes.js +100 -0
  178. package/lib/module/runtimes.js.map +1 -0
  179. package/lib/module/serializable.js +568 -0
  180. package/lib/module/serializable.js.map +1 -0
  181. package/lib/module/serializableMappingCache.js +37 -0
  182. package/lib/module/serializableMappingCache.js.map +1 -0
  183. package/lib/module/specs/NativeWorkletsModule.js +5 -0
  184. package/lib/module/specs/NativeWorkletsModule.js.map +1 -0
  185. package/lib/module/specs/NativeWorkletsModule.kepler.js +7 -0
  186. package/lib/module/specs/NativeWorkletsModule.kepler.js.map +1 -0
  187. package/lib/module/specs/index.js +10 -0
  188. package/lib/module/specs/index.js.map +1 -0
  189. package/lib/module/synchronizable.js +9 -0
  190. package/lib/module/synchronizable.js.map +1 -0
  191. package/lib/module/synchronizableUnpacker.js +42 -0
  192. package/lib/module/synchronizableUnpacker.js.map +1 -0
  193. package/lib/module/threads.js +347 -0
  194. package/lib/module/threads.js.map +1 -0
  195. package/lib/module/utils/checkCppVersion.js +30 -0
  196. package/lib/module/utils/checkCppVersion.js.map +1 -0
  197. package/lib/module/utils/jsVersion.js +9 -0
  198. package/lib/module/utils/jsVersion.js.map +1 -0
  199. package/lib/module/valueUnpacker.js +60 -0
  200. package/lib/module/valueUnpacker.js.map +1 -0
  201. package/lib/module/workletFunction.js +37 -0
  202. package/lib/module/workletFunction.js.map +1 -0
  203. package/lib/module/workletRuntimeEntry.js +32 -0
  204. package/lib/module/workletRuntimeEntry.js.map +1 -0
  205. package/lib/module/workletTypes.js +12 -0
  206. package/lib/module/workletTypes.js.map +1 -0
  207. package/lib/typescript/PlatformChecker/PlatformChecker.d.ts +5 -0
  208. package/lib/typescript/PlatformChecker/PlatformChecker.d.ts.map +1 -0
  209. package/lib/typescript/PlatformChecker/index.d.ts +10 -0
  210. package/lib/typescript/PlatformChecker/index.d.ts.map +1 -0
  211. package/lib/typescript/WorkletsError.d.ts +15 -0
  212. package/lib/typescript/WorkletsError.d.ts.map +1 -0
  213. package/lib/typescript/WorkletsModule/JSWorklets.d.ts +3 -0
  214. package/lib/typescript/WorkletsModule/JSWorklets.d.ts.map +1 -0
  215. package/lib/typescript/WorkletsModule/NativeWorklets.d.ts +3 -0
  216. package/lib/typescript/WorkletsModule/NativeWorklets.d.ts.map +1 -0
  217. package/lib/typescript/WorkletsModule/index.d.ts +3 -0
  218. package/lib/typescript/WorkletsModule/index.d.ts.map +1 -0
  219. package/lib/typescript/WorkletsModule/workletsModuleInstance.d.ts +2 -0
  220. package/lib/typescript/WorkletsModule/workletsModuleInstance.d.ts.map +1 -0
  221. package/lib/typescript/WorkletsModule/workletsModuleInstance.web.d.ts +2 -0
  222. package/lib/typescript/WorkletsModule/workletsModuleInstance.web.d.ts.map +1 -0
  223. package/lib/typescript/WorkletsModule/workletsModuleProxy.d.ts +37 -0
  224. package/lib/typescript/WorkletsModule/workletsModuleProxy.d.ts.map +1 -0
  225. package/lib/typescript/bundleUnpacker.d.ts +7 -0
  226. package/lib/typescript/bundleUnpacker.d.ts.map +1 -0
  227. package/lib/typescript/callGuard.d.ts +4 -0
  228. package/lib/typescript/callGuard.d.ts.map +1 -0
  229. package/lib/typescript/deprecated.d.ts +20 -0
  230. package/lib/typescript/deprecated.d.ts.map +1 -0
  231. package/lib/typescript/errors.d.ts +16 -0
  232. package/lib/typescript/errors.d.ts.map +1 -0
  233. package/lib/typescript/featureFlags/index.d.ts +23 -0
  234. package/lib/typescript/featureFlags/index.d.ts.map +1 -0
  235. package/lib/typescript/index.d.ts +17 -0
  236. package/lib/typescript/index.d.ts.map +1 -0
  237. package/lib/typescript/initializers.d.ts +17 -0
  238. package/lib/typescript/initializers.d.ts.map +1 -0
  239. package/lib/typescript/isSynchronizable.d.ts +3 -0
  240. package/lib/typescript/isSynchronizable.d.ts.map +1 -0
  241. package/lib/typescript/logger.d.ts +5 -0
  242. package/lib/typescript/logger.d.ts.map +1 -0
  243. package/lib/typescript/publicGlobals.d.ts +31 -0
  244. package/lib/typescript/publicGlobals.d.ts.map +1 -0
  245. package/lib/typescript/runLoop/common/setImmediatePolyfill.d.ts +2 -0
  246. package/lib/typescript/runLoop/common/setImmediatePolyfill.d.ts.map +1 -0
  247. package/lib/typescript/runLoop/common/setIntervalPolyfill.d.ts +2 -0
  248. package/lib/typescript/runLoop/common/setIntervalPolyfill.d.ts.map +1 -0
  249. package/lib/typescript/runLoop/uiRuntime/mockedRequestAnimationFrame.d.ts +6 -0
  250. package/lib/typescript/runLoop/uiRuntime/mockedRequestAnimationFrame.d.ts.map +1 -0
  251. package/lib/typescript/runLoop/uiRuntime/requestAnimationFrame.d.ts +2 -0
  252. package/lib/typescript/runLoop/uiRuntime/requestAnimationFrame.d.ts.map +1 -0
  253. package/lib/typescript/runLoop/uiRuntime/setTimeoutPolyfill.d.ts +2 -0
  254. package/lib/typescript/runLoop/uiRuntime/setTimeoutPolyfill.d.ts.map +1 -0
  255. package/lib/typescript/runLoop/workletRuntime/index.d.ts +2 -0
  256. package/lib/typescript/runLoop/workletRuntime/index.d.ts.map +1 -0
  257. package/lib/typescript/runLoop/workletRuntime/queueMicrotask.d.ts +2 -0
  258. package/lib/typescript/runLoop/workletRuntime/queueMicrotask.d.ts.map +1 -0
  259. package/lib/typescript/runLoop/workletRuntime/requestAnimationFramePolyfill.d.ts +2 -0
  260. package/lib/typescript/runLoop/workletRuntime/requestAnimationFramePolyfill.d.ts.map +1 -0
  261. package/lib/typescript/runLoop/workletRuntime/setTimeout.d.ts +2 -0
  262. package/lib/typescript/runLoop/workletRuntime/setTimeout.d.ts.map +1 -0
  263. package/lib/typescript/runLoop/workletRuntime/taskQueue.d.ts +10 -0
  264. package/lib/typescript/runLoop/workletRuntime/taskQueue.d.ts.map +1 -0
  265. package/lib/typescript/runtimeKind.d.ts +25 -0
  266. package/lib/typescript/runtimeKind.d.ts.map +1 -0
  267. package/lib/typescript/runtimes.d.ts +77 -0
  268. package/lib/typescript/runtimes.d.ts.map +1 -0
  269. package/lib/typescript/serializable.d.ts +20 -0
  270. package/lib/typescript/serializable.d.ts.map +1 -0
  271. package/lib/typescript/serializableMappingCache.d.ts +16 -0
  272. package/lib/typescript/serializableMappingCache.d.ts.map +1 -0
  273. package/lib/typescript/specs/NativeWorkletsModule.d.ts +7 -0
  274. package/lib/typescript/specs/NativeWorkletsModule.d.ts.map +1 -0
  275. package/lib/typescript/specs/NativeWorkletsModule.kepler.d.ts +7 -0
  276. package/lib/typescript/specs/NativeWorkletsModule.kepler.d.ts.map +1 -0
  277. package/lib/typescript/specs/index.d.ts +3 -0
  278. package/lib/typescript/specs/index.d.ts.map +1 -0
  279. package/lib/typescript/synchronizable.d.ts +15 -0
  280. package/lib/typescript/synchronizable.d.ts.map +1 -0
  281. package/lib/typescript/synchronizableUnpacker.d.ts +4 -0
  282. package/lib/typescript/synchronizableUnpacker.d.ts.map +1 -0
  283. package/lib/typescript/threads.d.ts +138 -0
  284. package/lib/typescript/threads.d.ts.map +1 -0
  285. package/lib/typescript/utils/checkCppVersion.d.ts +3 -0
  286. package/lib/typescript/utils/checkCppVersion.d.ts.map +1 -0
  287. package/lib/typescript/utils/jsVersion.d.ts +7 -0
  288. package/lib/typescript/utils/jsVersion.d.ts.map +1 -0
  289. package/lib/typescript/valueUnpacker.d.ts +6 -0
  290. package/lib/typescript/valueUnpacker.d.ts.map +1 -0
  291. package/lib/typescript/workletFunction.d.ts +27 -0
  292. package/lib/typescript/workletFunction.d.ts.map +1 -0
  293. package/lib/typescript/workletRuntimeEntry.d.ts +14 -0
  294. package/lib/typescript/workletRuntimeEntry.d.ts.map +1 -0
  295. package/lib/typescript/workletTypes.d.ts +61 -0
  296. package/lib/typescript/workletTypes.d.ts.map +1 -0
  297. package/package.json +153 -0
  298. package/plugin/index.js +1761 -0
  299. package/react-native.config.js +21 -0
  300. package/scripts/validate-react-native-version.js +43 -0
  301. package/scripts/worklets_utils.rb +94 -0
  302. package/src/PlatformChecker/PlatformChecker.ts +7 -0
  303. package/src/PlatformChecker/index.ts +30 -0
  304. package/src/WorkletsError.ts +36 -0
  305. package/src/WorkletsModule/JSWorklets.ts +200 -0
  306. package/src/WorkletsModule/NativeWorklets.ts +256 -0
  307. package/src/WorkletsModule/index.ts +7 -0
  308. package/src/WorkletsModule/workletsModuleInstance.ts +9 -0
  309. package/src/WorkletsModule/workletsModuleInstance.web.ts +5 -0
  310. package/src/WorkletsModule/workletsModuleProxy.ts +126 -0
  311. package/src/bundleUnpacker.ts +75 -0
  312. package/src/callGuard.ts +33 -0
  313. package/src/deprecated.ts +32 -0
  314. package/src/errors.ts +80 -0
  315. package/src/featureFlags/index.ts +72 -0
  316. package/src/featureFlags/staticFlags.json +4 -0
  317. package/src/index.ts +53 -0
  318. package/src/initializers.ts +262 -0
  319. package/src/isSynchronizable.ts +13 -0
  320. package/src/logger.ts +16 -0
  321. package/src/privateGlobals.d.ts +79 -0
  322. package/src/publicGlobals.ts +39 -0
  323. package/src/runLoop/common/setImmediatePolyfill.ts +20 -0
  324. package/src/runLoop/common/setIntervalPolyfill.ts +38 -0
  325. package/src/runLoop/uiRuntime/mockedRequestAnimationFrame.ts +11 -0
  326. package/src/runLoop/uiRuntime/requestAnimationFrame.ts +66 -0
  327. package/src/runLoop/uiRuntime/setTimeoutPolyfill.ts +40 -0
  328. package/src/runLoop/workletRuntime/index.ts +18 -0
  329. package/src/runLoop/workletRuntime/queueMicrotask.ts +13 -0
  330. package/src/runLoop/workletRuntime/requestAnimationFramePolyfill.ts +61 -0
  331. package/src/runLoop/workletRuntime/setTimeout.ts +37 -0
  332. package/src/runLoop/workletRuntime/taskQueue.ts +44 -0
  333. package/src/runtimeKind.ts +37 -0
  334. package/src/runtimes.ts +193 -0
  335. package/src/serializable.ts +801 -0
  336. package/src/serializableMappingCache.ts +42 -0
  337. package/src/specs/NativeWorkletsModule.kepler.ts +11 -0
  338. package/src/specs/NativeWorkletsModule.ts +9 -0
  339. package/src/specs/index.ts +13 -0
  340. package/src/synchronizable.ts +32 -0
  341. package/src/synchronizableUnpacker.ts +67 -0
  342. package/src/threads.ts +452 -0
  343. package/src/utils/checkCppVersion.ts +34 -0
  344. package/src/utils/jsVersion.ts +7 -0
  345. package/src/valueUnpacker.ts +90 -0
  346. package/src/workletFunction.ts +42 -0
  347. package/src/workletRuntimeEntry.ts +35 -0
  348. package/src/workletTypes.ts +81 -0
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sourceRoot":"../../src","sources":["workletTypes.ts"],"mappings":"AAAA,YAAY;;AAEZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","ignoreList":[]}
@@ -0,0 +1,5 @@
1
+ export declare const IS_JEST: boolean;
2
+ export declare const IS_WEB: boolean;
3
+ export declare const IS_WINDOWS: boolean;
4
+ export declare const SHOULD_BE_USE_WEB: boolean;
5
+ //# sourceMappingURL=PlatformChecker.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PlatformChecker.d.ts","sourceRoot":"","sources":["../../../src/PlatformChecker/PlatformChecker.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,OAAO,EAAE,OAAsC,CAAC;AAC7D,eAAO,MAAM,MAAM,EAAE,OAA+B,CAAC;AACrD,eAAO,MAAM,UAAU,EAAE,OAAmC,CAAC;AAC7D,eAAO,MAAM,iBAAiB,EAAE,OAAyC,CAAC"}
@@ -0,0 +1,10 @@
1
+ declare let IS_JEST: boolean;
2
+ declare let IS_WEB: boolean;
3
+ declare let IS_WINDOWS: boolean;
4
+ declare let SHOULD_BE_USE_WEB: boolean;
5
+ export { IS_JEST,
6
+ /** @knipIgnore */
7
+ IS_WEB,
8
+ /** @knipIgnore */
9
+ IS_WINDOWS, SHOULD_BE_USE_WEB, };
10
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/PlatformChecker/index.ts"],"names":[],"mappings":"AAUA,QAAA,IAAI,OAAO,SAAQ,CAAC;AACpB,QAAA,IAAI,MAAM,SAAQ,CAAC;AACnB,QAAA,IAAI,UAAU,SAAQ,CAAC;AACvB,QAAA,IAAI,iBAAiB,SAAQ,CAAC;AAS9B,OAAO,EACL,OAAO;AACP,kBAAkB;AAClB,MAAM;AACN,kBAAkB;AAClB,UAAU,EACV,iBAAiB,GAClB,CAAC"}
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Registers WorkletsError in the global scope. Register only for Worklet
3
+ * runtimes.
4
+ */
5
+ export declare function registerWorkletsError(): void;
6
+ export declare const WorkletsError: IWorkletsErrorConstructor;
7
+ export type WorkletsError = Error & {
8
+ name: 'Worklets';
9
+ };
10
+ export interface IWorkletsErrorConstructor extends Error {
11
+ new (message?: string): WorkletsError;
12
+ (message?: string): WorkletsError;
13
+ readonly prototype: WorkletsError;
14
+ }
15
+ //# sourceMappingURL=WorkletsError.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WorkletsError.d.ts","sourceRoot":"","sources":["../../src/WorkletsError.ts"],"names":[],"mappings":"AAcA;;;GAGG;AACH,wBAAgB,qBAAqB,SAMpC;AAED,eAAO,MAAM,aAAa,EACI,yBAAyB,CAAC;AAExD,MAAM,MAAM,aAAa,GAAG,KAAK,GAAG;IAAE,IAAI,EAAE,UAAU,CAAA;CAAE,CAAC;AAEzD,MAAM,WAAW,yBAA0B,SAAQ,KAAK;IACtD,KAAK,OAAO,CAAC,EAAE,MAAM,GAAG,aAAa,CAAC;IACtC,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,aAAa,CAAC;IAClC,QAAQ,CAAC,SAAS,EAAE,aAAa,CAAC;CACnC"}
@@ -0,0 +1,3 @@
1
+ import type { IWorkletsModule } from './workletsModuleProxy';
2
+ export declare function createJSWorkletsModule(): IWorkletsModule;
3
+ //# sourceMappingURL=JSWorklets.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"JSWorklets.d.ts","sourceRoot":"","sources":["../../../src/WorkletsModule/JSWorklets.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAE7D,wBAAgB,sBAAsB,IAAI,eAAe,CAExD"}
@@ -0,0 +1,3 @@
1
+ import type { IWorkletsModule } from './workletsModuleProxy';
2
+ export declare function createNativeWorkletsModule(): IWorkletsModule;
3
+ //# sourceMappingURL=NativeWorklets.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NativeWorklets.d.ts","sourceRoot":"","sources":["../../../src/WorkletsModule/NativeWorklets.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EACV,eAAe,EAEhB,MAAM,uBAAuB,CAAC;AAE/B,wBAAgB,0BAA0B,IAAI,eAAe,CAE5D"}
@@ -0,0 +1,3 @@
1
+ export { WorkletsModule } from './workletsModuleInstance';
2
+ export type { IWorkletsModule, WorkletsModuleProxy, } from './workletsModuleProxy';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/WorkletsModule/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,YAAY,EACV,eAAe,EACf,mBAAmB,GACpB,MAAM,uBAAuB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare const WorkletsModule: import("./workletsModuleProxy").WorkletsModuleProxy;
2
+ //# sourceMappingURL=workletsModuleInstance.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workletsModuleInstance.d.ts","sourceRoot":"","sources":["../../../src/WorkletsModule/workletsModuleInstance.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,cAAc,qDAEK,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare const WorkletsModule: import("./workletsModuleProxy").WorkletsModuleProxy;
2
+ //# sourceMappingURL=workletsModuleInstance.web.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workletsModuleInstance.web.d.ts","sourceRoot":"","sources":["../../../src/WorkletsModule/workletsModuleInstance.web.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,cAAc,qDAA2B,CAAC"}
@@ -0,0 +1,37 @@
1
+ import type { SynchronizableRef } from '../synchronizable';
2
+ import type { SerializableRef, WorkletRuntime } from '../workletTypes';
3
+ /** Type of `__workletsModuleProxy` injected with JSI. */
4
+ export interface WorkletsModuleProxy {
5
+ createSerializable<TValue>(value: TValue, shouldPersistRemote: boolean, nativeStateSource?: object): SerializableRef<TValue>;
6
+ createSerializableImport<TValue>(source: string, imported: string): SerializableRef<TValue>;
7
+ createSerializableString(str: string): SerializableRef<string>;
8
+ createSerializableNumber(num: number): SerializableRef<number>;
9
+ createSerializableBoolean(bool: boolean): SerializableRef<boolean>;
10
+ createSerializableBigInt(bigInt: bigint): SerializableRef<bigint>;
11
+ createSerializableUndefined(): SerializableRef<undefined>;
12
+ createSerializableNull(): SerializableRef<null>;
13
+ createSerializableTurboModuleLike<TProps extends object, TProto extends object>(props: TProps, proto: TProto): SerializableRef<TProps>;
14
+ createSerializableObject<T extends object>(obj: T, shouldRetainRemote: boolean, nativeStateSource?: object): SerializableRef<T>;
15
+ createSerializableHostObject<T extends object>(obj: T): SerializableRef<T>;
16
+ createSerializableArray(array: unknown[], shouldRetainRemote: boolean): SerializableRef<unknown[]>;
17
+ createSerializableMap<TKey, TValue>(keys: TKey[], values: TValue[]): SerializableRef<Map<TKey, TValue>>;
18
+ createSerializableSet<TValues>(values: TValues[]): SerializableRef<Set<TValues>>;
19
+ createSerializableInitializer(obj: object): SerializableRef<object>;
20
+ createSerializableFunction<TArgs extends unknown[], TReturn>(func: (...args: TArgs) => TReturn): SerializableRef<TReturn>;
21
+ createSerializableWorklet(worklet: object, shouldPersistRemote: boolean): SerializableRef<object>;
22
+ scheduleOnUI<TValue>(serializable: SerializableRef<TValue>): void;
23
+ executeOnUIRuntimeSync<TValue, TReturn>(serializable: SerializableRef<TValue>): TReturn;
24
+ createWorkletRuntime(name: string, initializer: SerializableRef<() => void>, useDefaultQueue: boolean, customQueue: object | undefined, enableEventLoop: boolean): WorkletRuntime;
25
+ scheduleOnRuntime<TValue>(workletRuntime: WorkletRuntime, worklet: SerializableRef<TValue>): void;
26
+ reportFatalErrorOnJS(message: string, stack: string, name: string, jsEngine: string): void;
27
+ createSynchronizable<TValue>(value: TValue): SynchronizableRef<TValue>;
28
+ synchronizableGetDirty<TValue>(synchronizableRef: SynchronizableRef<TValue>): TValue;
29
+ synchronizableGetBlocking<TValue>(synchronizableRef: SynchronizableRef<TValue>): TValue;
30
+ synchronizableSetBlocking<TValue>(synchronizableRef: SynchronizableRef<TValue>, value: SerializableRef<TValue>): void;
31
+ synchronizableLock<TValue>(synchronizableRef: SynchronizableRef<TValue>): void;
32
+ synchronizableUnlock<TValue>(synchronizableRef: SynchronizableRef<TValue>): void;
33
+ getStaticFeatureFlag(name: string): boolean;
34
+ setDynamicFeatureFlag(name: string, value: boolean): void;
35
+ }
36
+ export type IWorkletsModule = WorkletsModuleProxy;
37
+ //# sourceMappingURL=workletsModuleProxy.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workletsModuleProxy.d.ts","sourceRoot":"","sources":["../../../src/WorkletsModule/workletsModuleProxy.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,7 @@
1
+ import type { WorkletFunction } from './workletTypes';
2
+ export declare function bundleValueUnpacker(objectToUnpack: ObjectToUnpack, category?: string, remoteFunctionName?: string): unknown;
3
+ interface ObjectToUnpack extends WorkletFunction {
4
+ _recur: unknown;
5
+ }
6
+ export {};
7
+ //# sourceMappingURL=bundleUnpacker.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bundleUnpacker.d.ts","sourceRoot":"","sources":["../../src/bundleUnpacker.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAkB,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAItE,wBAAgB,mBAAmB,CACjC,cAAc,EAAE,cAAc,EAC9B,QAAQ,CAAC,EAAE,MAAM,EACjB,kBAAkB,CAAC,EAAE,MAAM,GAC1B,OAAO,CA4BT;AAiCD,UAAU,cAAe,SAAQ,eAAe;IAC9C,MAAM,EAAE,OAAO,CAAC;CACjB"}
@@ -0,0 +1,4 @@
1
+ /** Used only with debug builds. */
2
+ export declare function callGuardDEV<Args extends unknown[], ReturnValue>(fn: (...args: Args) => ReturnValue, ...args: Args): ReturnValue | void;
3
+ export declare function setupCallGuard(): void;
4
+ //# sourceMappingURL=callGuard.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"callGuard.d.ts","sourceRoot":"","sources":["../../src/callGuard.ts"],"names":[],"mappings":"AAIA,mCAAmC;AACnC,wBAAgB,YAAY,CAAC,IAAI,SAAS,OAAO,EAAE,EAAE,WAAW,EAC9D,EAAE,EAAE,CAAC,GAAG,IAAI,EAAE,IAAI,KAAK,WAAW,EAClC,GAAG,IAAI,EAAE,IAAI,GACZ,WAAW,GAAG,IAAI,CAiBpB;AAED,wBAAgB,cAAc,SAK7B"}
@@ -0,0 +1,20 @@
1
+ import { isSerializableRef, makeShareable, makeShareableCloneOnUIRecursive } from './serializable';
2
+ import type { SerializableRef } from './workletTypes';
3
+ /** @deprecated Use {@link SerializableRef} instead. */
4
+ export type ShareableRef<T> = SerializableRef<T>;
5
+ export { makeShareable, makeShareableCloneOnUIRecursive };
6
+ /** @deprecated It will be removed in the next major version. */
7
+ export type MakeShareableClone = <T>(value: T, shouldPersistRemote?: boolean, depth?: number) => ShareableRef<T>;
8
+ /** @deprecated Use {@link createSerializable} instead. */
9
+ export declare const makeShareableCloneRecursive: MakeShareableClone;
10
+ /** @deprecated Use {@link isSerializableRef} instead. */
11
+ export declare const isShareableRef: typeof isSerializableRef;
12
+ /** @deprecated Use {@link serializableMappingCache} instead. */
13
+ export declare const shareableMappingCache: {
14
+ set(): void;
15
+ get(): null;
16
+ } | {
17
+ set(serializable: object, serializableRef?: SerializableRef): void;
18
+ get: (key: object) => symbol | SerializableRef | undefined;
19
+ };
20
+ //# sourceMappingURL=deprecated.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deprecated.d.ts","sourceRoot":"","sources":["../../src/deprecated.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,iBAAiB,EACjB,aAAa,EACb,+BAA+B,EAChC,MAAM,gBAAgB,CAAC;AAExB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAEtD,uDAAuD;AACvD,MAAM,MAAM,YAAY,CAAC,CAAC,IAAI,eAAe,CAAC,CAAC,CAAC,CAAC;AAEjD,OAAO,EAAE,aAAa,EAAE,+BAA+B,EAAE,CAAC;AAE1D,gEAAgE;AAChE,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,EACjC,KAAK,EAAE,CAAC,EACR,mBAAmB,CAAC,EAAE,OAAO,EAC7B,KAAK,CAAC,EAAE,MAAM,KACX,YAAY,CAAC,CAAC,CAAC,CAAC;AAErB,0DAA0D;AAC1D,eAAO,MAAM,2BAA2B,EAAE,kBACtB,CAAC;AAErB,yDAAyD;AACzD,eAAO,MAAM,cAAc,0BAAoB,CAAC;AAEhD,gEAAgE;AAChE,eAAO,MAAM,qBAAqB;;;;;;CAA2B,CAAC"}
@@ -0,0 +1,16 @@
1
+ import type { WorkletStackDetails } from './workletTypes';
2
+ export declare function registerWorkletStackDetails(hash: number, stackDetails: WorkletStackDetails): void;
3
+ export interface RNError extends Error {
4
+ jsEngine: string;
5
+ }
6
+ /**
7
+ * Remote error is an error coming from a Worklet Runtime that we bubble up to
8
+ * the RN Runtime.
9
+ */
10
+ export declare function reportFatalRemoteError({ message, stack, name, jsEngine }: RNError, force: boolean): void;
11
+ /**
12
+ * Registers `reportFatalRemoteError` function in global scope to allow to
13
+ * invoke it from C++.
14
+ */
15
+ export declare function registerReportFatalRemoteError(): void;
16
+ //# sourceMappingURL=errors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/errors.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAI1D,wBAAgB,2BAA2B,CACzC,IAAI,EAAE,MAAM,EACZ,YAAY,EAAE,mBAAmB,QAGlC;AAoCD,MAAM,WAAW,OAAQ,SAAQ,KAAK;IACpC,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,CACpC,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,OAAO,EAC3C,KAAK,EAAE,OAAO,GACb,IAAI,CAYN;AAED;;;GAGG;AACH,wBAAgB,8BAA8B,SAE7C"}
@@ -0,0 +1,23 @@
1
+ type DynamicFlagsType = {
2
+ EXAMPLE_DYNAMIC_FLAG: boolean;
3
+ init(): void;
4
+ setFlag(name: DynamicFlagName, value: boolean): void;
5
+ };
6
+ type DynamicFlagName = keyof Omit<Omit<DynamicFlagsType, 'setFlag'>, 'init'>;
7
+ export declare const DynamicFlags: DynamicFlagsType;
8
+ export declare function setDynamicFeatureFlag(name: DynamicFlagName, value: boolean): void;
9
+ /**
10
+ * This constant is needed for typechecking and preserving static typechecks in
11
+ * generated .d.ts files. Without it, the static flags resolve to an object
12
+ * without specific keys.
13
+ */
14
+ declare const DefaultStaticFeatureFlags: {
15
+ readonly RUNTIME_TEST_FLAG: false;
16
+ readonly IOS_DYNAMIC_FRAMERATE_ENABLED: false;
17
+ };
18
+ type StaticFeatureFlagsSchema = {
19
+ -readonly [K in keyof typeof DefaultStaticFeatureFlags]: boolean;
20
+ };
21
+ export declare function getStaticFeatureFlag(name: keyof StaticFeatureFlagsSchema): boolean;
22
+ export {};
23
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/featureFlags/index.ts"],"names":[],"mappings":"AAKA,KAAK,gBAAgB,GAAG;IACtB,oBAAoB,EAAE,OAAO,CAAC;IAC9B,IAAI,IAAI,IAAI,CAAC;IACb,OAAO,CAAC,IAAI,EAAE,eAAe,EAAE,KAAK,EAAE,OAAO,GAAG,IAAI,CAAC;CACtD,CAAC;AACF,KAAK,eAAe,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,gBAAgB,EAAE,SAAS,CAAC,EAAE,MAAM,CAAC,CAAC;AAE7E,eAAO,MAAM,YAAY,EAAE,gBAuB1B,CAAC;AAGF,wBAAgB,qBAAqB,CACnC,IAAI,EAAE,eAAe,EACrB,KAAK,EAAE,OAAO,GACb,IAAI,CAEN;AAED;;;;GAIG;AAEH,QAAA,MAAM,yBAAyB;;;CAGmB,CAAC;AAEnD,KAAK,wBAAwB,GAAG;IAC9B,CAAC,UAAU,CAAC,IAAI,MAAM,OAAO,yBAAyB,GAAG,OAAO;CACjE,CAAC;AAIF,wBAAgB,oBAAoB,CAClC,IAAI,EAAE,MAAM,wBAAwB,GACnC,OAAO,CAOT"}
@@ -0,0 +1,17 @@
1
+ import './publicGlobals';
2
+ export type { MakeShareableClone, ShareableRef } from './deprecated';
3
+ export { isShareableRef, makeShareable, makeShareableCloneOnUIRecursive, makeShareableCloneRecursive, shareableMappingCache, } from './deprecated';
4
+ export { getStaticFeatureFlag, setDynamicFeatureFlag } from './featureFlags';
5
+ export { isSynchronizable } from './isSynchronizable';
6
+ export { getRuntimeKind, RuntimeKind } from './runtimeKind';
7
+ export { createWorkletRuntime, runOnRuntime } from './runtimes';
8
+ export { createSerializable, isSerializableRef } from './serializable';
9
+ export { serializableMappingCache } from './serializableMappingCache';
10
+ export type { Synchronizable } from './synchronizable';
11
+ export { createSynchronizable } from './synchronizable';
12
+ export { callMicrotasks, executeOnUIRuntimeSync, runOnJS, runOnUI, runOnUIAsync, runOnUISync, scheduleOnRN, scheduleOnUI, unstable_eventLoopTask, } from './threads';
13
+ export { isWorkletFunction } from './workletFunction';
14
+ export type { IWorkletsModule, WorkletsModuleProxy } from './WorkletsModule';
15
+ export { WorkletsModule } from './WorkletsModule';
16
+ export type { SerializableRef, WorkletFunction, WorkletRuntime, WorkletStackDetails, } from './workletTypes';
17
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,iBAAiB,CAAC;AAOzB,YAAY,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AACrE,OAAO,EACL,cAAc,EACd,aAAa,EACb,+BAA+B,EAC/B,2BAA2B,EAC3B,qBAAqB,GACtB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AAC7E,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5D,OAAO,EAAE,oBAAoB,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAChE,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACvE,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AACtE,YAAY,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,EACL,cAAc,EACd,sBAAsB,EACtB,OAAO,EACP,OAAO,EACP,YAAY,EACZ,WAAW,EACX,YAAY,EACZ,YAAY,EAEZ,sBAAsB,GACvB,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACtD,YAAY,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAC7E,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,YAAY,EACV,eAAe,EACf,eAAe,EACf,cAAc,EACd,mBAAmB,GACpB,MAAM,gBAAgB,CAAC"}
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Currently there seems to be a bug in the JSI layer which causes a crash when
3
+ * we try to copy some of the console methods, i.e. `clear` or `dirxml`.
4
+ *
5
+ * The crash happens only in React Native 0.75. It's not reproducible in neither
6
+ * 0.76 nor 0.74. It also happens only in the configuration of a debug app and
7
+ * production bundle.
8
+ *
9
+ * I haven't yet discovered what exactly causes the crash. It's tied to the
10
+ * console methods sometimes being `HostFunction`s. Therefore, as a workaround
11
+ * we don't copy the methods as they are in the original console object, we copy
12
+ * JavaScript wrappers instead.
13
+ */
14
+ export declare function getMemorySafeCapturableConsole(): typeof console;
15
+ export declare function setupConsole(boundCapturableConsole: typeof console): void;
16
+ export declare function init(): void;
17
+ //# sourceMappingURL=initializers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"initializers.d.ts","sourceRoot":"","sources":["../../src/initializers.ts"],"names":[],"mappings":"AAqBA;;;;;;;;;;;;GAYG;AACH,wBAAgB,8BAA8B,IAAI,OAAO,OAAO,CA8B/D;AAED,wBAAgB,YAAY,CAAC,sBAAsB,EAAE,OAAO,OAAO,QAWlE;AAID,wBAAgB,IAAI,SA0BnB"}
@@ -0,0 +1,3 @@
1
+ import type { Synchronizable } from './synchronizable';
2
+ export declare function isSynchronizable<TValue>(value: unknown): value is Synchronizable<TValue>;
3
+ //# sourceMappingURL=isSynchronizable.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"isSynchronizable.d.ts","sourceRoot":"","sources":["../../src/isSynchronizable.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAEvD,wBAAgB,gBAAgB,CAAC,MAAM,EACrC,KAAK,EAAE,OAAO,GACb,KAAK,IAAI,cAAc,CAAC,MAAM,CAAC,CAOjC"}
@@ -0,0 +1,5 @@
1
+ export declare const logger: {
2
+ warn(message: string): void;
3
+ error(message: string): void;
4
+ };
5
+ //# sourceMappingURL=logger.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src/logger.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,MAAM;kBACH,MAAM;mBAGL,MAAM;CAGtB,CAAC"}
@@ -0,0 +1,31 @@
1
+ import type { RuntimeKind } from './runtimeKind';
2
+ export {};
3
+ declare global {
4
+ /**
5
+ * @deprecated Use {@link __RUNTIME_KIND} instead.
6
+ *
7
+ * This global variable is a diagnostic/development tool.
8
+ *
9
+ * It's `true` on Worklet Runtimes and `false` on React Native Runtime.
10
+ */
11
+ var _WORKLET: boolean | undefined;
12
+ /**
13
+ * This ArrayBuffer contains the memory address of `jsi::Runtime` which is the
14
+ * Reanimated UI runtime.
15
+ */
16
+ var _WORKLET_RUNTIME: ArrayBuffer;
17
+ /** @deprecated Don't use. */
18
+ var _IS_FABRIC: boolean | undefined;
19
+ /**
20
+ * This global variable is used to determine the kind of the current runtime.
21
+ * You can use it directly to differentiate between runtimes. However, the
22
+ * recommended way for differentiating is to use the {@link getRuntimeKind}
23
+ * function.
24
+ *
25
+ * - Value _1_: React Native Runtime
26
+ * - Value _2_: UI Worklet Runtime
27
+ * - Value _3_: Worker Worklet Runtime
28
+ */
29
+ var __RUNTIME_KIND: RuntimeKind | 1 | 2 | 3;
30
+ }
31
+ //# sourceMappingURL=publicGlobals.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"publicGlobals.d.ts","sourceRoot":"","sources":["../../src/publicGlobals.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAIjD,OAAO,EAAE,CAAC;AAEV,OAAO,CAAC,MAAM,CAAC;IACb;;;;;;OAMG;IACH,IAAI,QAAQ,EAAE,OAAO,GAAG,SAAS,CAAC;IAElC;;;OAGG;IACH,IAAI,gBAAgB,EAAE,WAAW,CAAC;IAElC,6BAA6B;IAC7B,IAAI,UAAU,EAAE,OAAO,GAAG,SAAS,CAAC;IAEpC;;;;;;;;;OASG;IACH,IAAI,cAAc,EAAE,WAAW,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;CAC7C"}
@@ -0,0 +1,2 @@
1
+ export declare function setupSetImmediate(): void;
2
+ //# sourceMappingURL=setImmediatePolyfill.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"setImmediatePolyfill.d.ts","sourceRoot":"","sources":["../../../../src/runLoop/common/setImmediatePolyfill.ts"],"names":[],"mappings":"AAEA,wBAAgB,iBAAiB,SAiBhC"}
@@ -0,0 +1,2 @@
1
+ export declare function setupSetInterval(): void;
2
+ //# sourceMappingURL=setIntervalPolyfill.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"setIntervalPolyfill.d.ts","sourceRoot":"","sources":["../../../../src/runLoop/common/setIntervalPolyfill.ts"],"names":[],"mappings":"AAEA,wBAAgB,gBAAgB,SAmC/B"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * This is Jest implementation of `requestAnimationFrame` that is required by
3
+ * React Native for test purposes.
4
+ */
5
+ export declare function mockedRequestAnimationFrame(callback: (timestamp: number) => void): ReturnType<typeof setTimeout>;
6
+ //# sourceMappingURL=mockedRequestAnimationFrame.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mockedRequestAnimationFrame.d.ts","sourceRoot":"","sources":["../../../../src/runLoop/uiRuntime/mockedRequestAnimationFrame.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,wBAAgB,2BAA2B,CACzC,QAAQ,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,GACpC,UAAU,CAAC,OAAO,UAAU,CAAC,CAE/B"}
@@ -0,0 +1,2 @@
1
+ export declare function setupRequestAnimationFrame(): void;
2
+ //# sourceMappingURL=requestAnimationFrame.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"requestAnimationFrame.d.ts","sourceRoot":"","sources":["../../../../src/runLoop/uiRuntime/requestAnimationFrame.ts"],"names":[],"mappings":"AAIA,wBAAgB,0BAA0B,SA6DzC"}
@@ -0,0 +1,2 @@
1
+ export declare function setupSetTimeout(): void;
2
+ //# sourceMappingURL=setTimeoutPolyfill.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"setTimeoutPolyfill.d.ts","sourceRoot":"","sources":["../../../../src/runLoop/uiRuntime/setTimeoutPolyfill.ts"],"names":[],"mappings":"AAEA,wBAAgB,eAAe,SAqC9B"}
@@ -0,0 +1,2 @@
1
+ export declare function setupRunLoop(animationQueuePollingRate: number): void;
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/runLoop/workletRuntime/index.ts"],"names":[],"mappings":"AASA,wBAAgB,YAAY,CAAC,yBAAyB,EAAE,MAAM,QAQ7D"}
@@ -0,0 +1,2 @@
1
+ export declare function setupQueueMicrotask(): void;
2
+ //# sourceMappingURL=queueMicrotask.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"queueMicrotask.d.ts","sourceRoot":"","sources":["../../../../src/runLoop/workletRuntime/queueMicrotask.ts"],"names":[],"mappings":"AAIA,wBAAgB,mBAAmB,SAQlC"}
@@ -0,0 +1,2 @@
1
+ export declare function setupRequestAnimationFrame(animationQueuePollingRate: number): void;
2
+ //# sourceMappingURL=requestAnimationFramePolyfill.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"requestAnimationFramePolyfill.d.ts","sourceRoot":"","sources":["../../../../src/runLoop/workletRuntime/requestAnimationFramePolyfill.ts"],"names":[],"mappings":"AAEA,wBAAgB,0BAA0B,CAAC,yBAAyB,EAAE,MAAM,QA0D3E"}
@@ -0,0 +1,2 @@
1
+ export declare function setupSetTimeout(): void;
2
+ //# sourceMappingURL=setTimeout.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"setTimeout.d.ts","sourceRoot":"","sources":["../../../../src/runLoop/workletRuntime/setTimeout.ts"],"names":[],"mappings":"AAIA,wBAAgB,eAAe,SAgC9B"}
@@ -0,0 +1,10 @@
1
+ type Callback = () => void;
2
+ export type Queue = {
3
+ microtasks: Array<Callback>;
4
+ timeoutCallbacks: Map<number, Callback>;
5
+ };
6
+ export declare function setupTaskQueue(): void;
7
+ export declare function pushMicrotask(callback: Callback): void;
8
+ export declare function pushTask(callback: Callback, handlerId: number, delay: number): void;
9
+ export {};
10
+ //# sourceMappingURL=taskQueue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"taskQueue.d.ts","sourceRoot":"","sources":["../../../../src/runLoop/workletRuntime/taskQueue.ts"],"names":[],"mappings":"AAEA,KAAK,QAAQ,GAAG,MAAM,IAAI,CAAC;AAE3B,MAAM,MAAM,KAAK,GAAG;IAClB,UAAU,EAAE,KAAK,CAAC,QAAQ,CAAC,CAAC;IAC5B,gBAAgB,EAAE,GAAG,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;CACzC,CAAC;AAEF,wBAAgB,cAAc,SAqB7B;AAED,wBAAgB,aAAa,CAAC,QAAQ,EAAE,QAAQ,QAI/C;AAED,wBAAgB,QAAQ,CAAC,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,QAK5E"}
@@ -0,0 +1,25 @@
1
+ export declare enum RuntimeKind {
2
+ /**
3
+ * The React Native runtime, which is the main runtime for React Native where
4
+ * React exists and where components are rendered.
5
+ */
6
+ ReactNative = 1,
7
+ /**
8
+ * The UI runtime, which is a special runtime that executes on the UI thread,
9
+ * mostly used for animations and gestures.
10
+ */
11
+ UI = 2,
12
+ /** Additional runtime created on-demand by the user. */
13
+ Worker = 3
14
+ }
15
+ /**
16
+ * Programmatic way to check the current runtime kind. It's useful when you need
17
+ * specific implementations for different runtimes created by Worklets.
18
+ *
19
+ * For more optimized calls you can check the value of
20
+ * `globalThis.__RUNTIME_KIND` directly.
21
+ *
22
+ * @returns The kind of the current runtime.
23
+ */
24
+ export declare function getRuntimeKind(): RuntimeKind;
25
+ //# sourceMappingURL=runtimeKind.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtimeKind.d.ts","sourceRoot":"","sources":["../../src/runtimeKind.ts"],"names":[],"mappings":"AAEA,oBAAY,WAAW;IACrB;;;OAGG;IACH,WAAW,IAAI;IACf;;;OAGG;IACH,EAAE,IAAI;IACN,wDAAwD;IACxD,MAAM,IAAI;CACX;AAED;;;;;;;;GAQG;AACH,wBAAgB,cAAc,IAAI,WAAW,CAG5C"}
@@ -0,0 +1,77 @@
1
+ import type { WorkletFunction, WorkletRuntime } from './workletTypes';
2
+ /**
3
+ * Lets you create a new JS runtime which can be used to run worklets possibly
4
+ * on different threads than JS or UI thread.
5
+ *
6
+ * @param config - Runtime configuration object - {@link WorkletRuntimeConfig}.
7
+ * @returns WorkletRuntime which is a
8
+ * `jsi::HostObject<worklets::WorkletRuntime>` - {@link WorkletRuntime}
9
+ * @see https://docs.swmansion.com/react-native-worklets/docs/threading/createWorkletRuntime/
10
+ */
11
+ export declare function createWorkletRuntime(config?: WorkletRuntimeConfig): WorkletRuntime;
12
+ /**
13
+ * @deprecated Please use the new config object signature instead:
14
+ * `createWorkletRuntime({ name, initializer })`
15
+ *
16
+ * Lets you create a new JS runtime which can be used to run worklets possibly
17
+ * on different threads than JS or UI thread.
18
+ * @param name - A name used to identify the runtime which will appear in
19
+ * devices list in Chrome DevTools.
20
+ * @param initializer - An optional worklet that will be run synchronously on
21
+ * the same thread immediately after the runtime is created.
22
+ * @returns WorkletRuntime which is a
23
+ * `jsi::HostObject<worklets::WorkletRuntime>` - {@link WorkletRuntime}
24
+ * @see https://docs.swmansion.com/react-native-worklets/docs/threading/createWorkletRuntime/
25
+ */
26
+ export declare function createWorkletRuntime(name?: string, initializer?: () => void): WorkletRuntime;
27
+ export declare function runOnRuntime<Args extends unknown[], ReturnValue>(workletRuntime: WorkletRuntime, worklet: (...args: Args) => ReturnValue): WorkletFunction<Args, ReturnValue>;
28
+ /** Configuration object for creating a worklet runtime. */
29
+ export type WorkletRuntimeConfig = {
30
+ /** The name of the worklet runtime. */
31
+ name?: string;
32
+ /**
33
+ * A worklet that will be run immediately after the runtime is created and
34
+ * before any other worklets.
35
+ */
36
+ initializer?: () => void;
37
+ /**
38
+ * Time interval in milliseconds between polling of frame callbacks scheduled
39
+ * by requestAnimationFrame. If not specified, it defaults to 16 ms.
40
+ */
41
+ animationQueuePollingRate?: number;
42
+ /**
43
+ * Determines whether to enable the default Event Loop or not. The Event Loop
44
+ * provides implementations for `setTimeout`, `setImmediate`, `setInterval`,
45
+ * `requestAnimationFrame`, `queueMicrotask`, `clearTimeout`, `clearInterval`,
46
+ * `clearImmediate`, and `cancelAnimationFrame` methods. If not specified, it
47
+ * defaults to `true`.
48
+ */
49
+ enableEventLoop?: true;
50
+ } & ({
51
+ /**
52
+ * If true, the runtime will use the default queue implementation for
53
+ * scheduling worklets. Defaults to true.
54
+ */
55
+ useDefaultQueue?: true;
56
+ /**
57
+ * An optional custom queue to be used for scheduling worklets.
58
+ *
59
+ * The queue has to implement the C++ `AsyncQueue` interface from
60
+ * `<worklets/Public/AsyncQueue.h>`.
61
+ */
62
+ customQueue?: never;
63
+ } | {
64
+ /**
65
+ * If true, the runtime will use the default queue implementation for
66
+ * scheduling worklets. Defaults to true.
67
+ */
68
+ useDefaultQueue: false;
69
+ /**
70
+ * An optional custom queue to be used for scheduling worklets.
71
+ *
72
+ * The queue has to implement the C++ `AsyncQueue` interface from
73
+ * `<worklets/Public/AsyncQueue.h>`.
74
+ */
75
+ customQueue?: object;
76
+ });
77
+ //# sourceMappingURL=runtimes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtimes.d.ts","sourceRoot":"","sources":["../../src/runtimes.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAEtE;;;;;;;;GAQG;AAEH,wBAAgB,oBAAoB,CAClC,MAAM,CAAC,EAAE,oBAAoB,GAC5B,cAAc,CAAC;AAElB;;;;;;;;;;;;;GAaG;AACH,wBAAgB,oBAAoB,CAClC,IAAI,CAAC,EAAE,MAAM,EACb,WAAW,CAAC,EAAE,MAAM,IAAI,GACvB,cAAc,CAAC;AAsDlB,wBAAgB,YAAY,CAAC,IAAI,SAAS,OAAO,EAAE,EAAE,WAAW,EAC9D,cAAc,EAAE,cAAc,EAC9B,OAAO,EAAE,CAAC,GAAG,IAAI,EAAE,IAAI,KAAK,WAAW,GACtC,eAAe,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC;AAiCtC,2DAA2D;AAC3D,MAAM,MAAM,oBAAoB,GAAG;IACjC,uCAAuC;IACvC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,IAAI,CAAC;IACzB;;;OAGG;IACH,yBAAyB,CAAC,EAAE,MAAM,CAAC;IACnC;;;;;;OAMG;IACH,eAAe,CAAC,EAAE,IAAI,CAAC;CACxB,GAAG,CACA;IACE;;;OAGG;IACH,eAAe,CAAC,EAAE,IAAI,CAAC;IACvB;;;;;OAKG;IACH,WAAW,CAAC,EAAE,KAAK,CAAC;CACrB,GACD;IACE;;;OAGG;IACH,eAAe,EAAE,KAAK,CAAC;IACvB;;;;;OAKG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CACJ,CAAC"}
@@ -0,0 +1,20 @@
1
+ import type { FlatSerializableRef, SerializableRef } from './workletTypes';
2
+ export declare function isSerializableRef(value: unknown): value is SerializableRef;
3
+ interface CreateSerializable {
4
+ <T>(value: T): SerializableRef<T>;
5
+ <T>(value: T, shouldPersistRemote: boolean, depth: number): SerializableRef<T>;
6
+ }
7
+ export declare const createSerializable: CreateSerializable;
8
+ declare function makeShareableCloneOnUIRecursiveLEGACY<T>(value: T): FlatSerializableRef<T>;
9
+ /** @deprecated This function is no longer supported. */
10
+ export declare const makeShareableCloneOnUIRecursive: typeof makeShareableCloneOnUIRecursiveLEGACY;
11
+ declare function makeShareableNative<T extends object>(value: T): T;
12
+ /**
13
+ * This function creates a value on UI with persistent state - changes to it on
14
+ * the UI thread will be seen by all worklets. Use it when you want to create a
15
+ * value that is read and written only on the UI thread.
16
+ */
17
+ /** @deprecated This function is no longer supported. */
18
+ export declare const makeShareable: typeof makeShareableNative;
19
+ export {};
20
+ //# sourceMappingURL=serializable.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"serializable.d.ts","sourceRoot":"","sources":["../../src/serializable.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EACV,mBAAmB,EACnB,eAAe,EAGhB,MAAM,gBAAgB,CAAC;AAkBxB,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,eAAe,CAI1E;AA0MD,UAAU,kBAAkB;IAC1B,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,eAAe,CAAC,CAAC,CAAC,CAAC;IAClC,CAAC,CAAC,EACA,KAAK,EAAE,CAAC,EACR,mBAAmB,EAAE,OAAO,EAC5B,KAAK,EAAE,MAAM,GACZ,eAAe,CAAC,CAAC,CAAC,CAAC;CACvB;AAED,eAAO,MAAM,kBAAkB,EAAE,kBAEL,CAAC;AAob7B,iBAAS,qCAAqC,CAAC,CAAC,EAC9C,KAAK,EAAE,CAAC,GACP,mBAAmB,CAAC,CAAC,CAAC,CAyExB;AAED,wDAAwD;AACxD,eAAO,MAAM,+BAA+B,EAIvC,OAAO,qCAAqC,CAAC;AAMlD,iBAAS,mBAAmB,CAAC,CAAC,SAAS,MAAM,EAAE,KAAK,EAAE,CAAC,GAAG,CAAC,CAY1D;AAED;;;;GAIG;AACH,wDAAwD;AACxD,eAAO,MAAM,aAAa,4BAEH,CAAC"}
@@ -0,0 +1,16 @@
1
+ import type { SerializableRef } from './workletTypes';
2
+ /**
3
+ * This symbol is used to represent a mapping from the value to itself.
4
+ *
5
+ * It's used to prevent converting a serializable that's already converted - for
6
+ * example a Shared Value that's in worklet's closure.
7
+ */
8
+ export declare const serializableMappingFlag: unique symbol;
9
+ export declare const serializableMappingCache: {
10
+ set(): void;
11
+ get(): null;
12
+ } | {
13
+ set(serializable: object, serializableRef?: SerializableRef): void;
14
+ get: (key: object) => symbol | SerializableRef | undefined;
15
+ };
16
+ //# sourceMappingURL=serializableMappingCache.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"serializableMappingCache.d.ts","sourceRoot":"","sources":["../../src/serializableMappingCache.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAEtD;;;;;GAKG;AACH,eAAO,MAAM,uBAAuB,eAA8B,CAAC;AAiBnE,eAAO,MAAM,wBAAwB;;;;sBAUb,MAAM,oBAAoB,eAAe,GAAG,IAAI;;CAInE,CAAC"}
@@ -0,0 +1,7 @@
1
+ import type { TurboModule } from 'react-native';
2
+ export interface Spec extends TurboModule {
3
+ installTurboModule: () => boolean;
4
+ }
5
+ declare const _default: Spec | null;
6
+ export default _default;
7
+ //# sourceMappingURL=NativeWorkletsModule.d.ts.map