@depup/react-native-worklets 0.11.3-depup.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.
- package/.worklets/dummy.md +1 -0
- package/Common/cpp/worklets/AnimationFrameQueue/AnimationFrameBatchinator.cpp +64 -0
- package/Common/cpp/worklets/AnimationFrameQueue/AnimationFrameBatchinator.h +38 -0
- package/Common/cpp/worklets/Compat/Holders.h +25 -0
- package/Common/cpp/worklets/Compat/StableApi.cpp +145 -0
- package/Common/cpp/worklets/Compat/StableApi.h +128 -0
- package/Common/cpp/worklets/NativeModules/JSIWorkletsModuleProxy.cpp +729 -0
- package/Common/cpp/worklets/NativeModules/JSIWorkletsModuleProxy.h +126 -0
- package/Common/cpp/worklets/NativeModules/WorkletsModuleProxy.cpp +81 -0
- package/Common/cpp/worklets/NativeModules/WorkletsModuleProxy.h +76 -0
- package/Common/cpp/worklets/Registries/EventHandlerRegistry.cpp +95 -0
- package/Common/cpp/worklets/Registries/EventHandlerRegistry.h +44 -0
- package/Common/cpp/worklets/Registries/WorkletRuntimeRegistry.cpp +10 -0
- package/Common/cpp/worklets/Registries/WorkletRuntimeRegistry.h +43 -0
- package/Common/cpp/worklets/RunLoop/AsyncQueue.h +14 -0
- package/Common/cpp/worklets/RunLoop/AsyncQueueImpl.cpp +69 -0
- package/Common/cpp/worklets/RunLoop/AsyncQueueImpl.h +48 -0
- package/Common/cpp/worklets/RunLoop/EventLoop.cpp +103 -0
- package/Common/cpp/worklets/RunLoop/EventLoop.h +52 -0
- package/Common/cpp/worklets/SharedItems/MemoryManager.cpp +60 -0
- package/Common/cpp/worklets/SharedItems/MemoryManager.h +29 -0
- package/Common/cpp/worklets/SharedItems/Serializable.cpp +373 -0
- package/Common/cpp/worklets/SharedItems/Serializable.h +413 -0
- package/Common/cpp/worklets/SharedItems/SerializableFactory.cpp +172 -0
- package/Common/cpp/worklets/SharedItems/SerializableFactory.h +85 -0
- package/Common/cpp/worklets/SharedItems/SerializableRemoteFunction.cpp +71 -0
- package/Common/cpp/worklets/SharedItems/SerializableRemoteFunction.h +75 -0
- package/Common/cpp/worklets/SharedItems/Shareable.cpp +84 -0
- package/Common/cpp/worklets/SharedItems/Shareable.h +43 -0
- package/Common/cpp/worklets/SharedItems/Synchronizable.cpp +59 -0
- package/Common/cpp/worklets/SharedItems/Synchronizable.h +57 -0
- package/Common/cpp/worklets/SharedItems/SynchronizableAccess.cpp +78 -0
- package/Common/cpp/worklets/SharedItems/SynchronizableAccess.h +45 -0
- package/Common/cpp/worklets/SharedItems/UnpackerLoader.h +78 -0
- package/Common/cpp/worklets/Tools/FeatureFlags.cpp +18 -0
- package/Common/cpp/worklets/Tools/FeatureFlags.h +44 -0
- package/Common/cpp/worklets/Tools/JSISerializer.cpp +312 -0
- package/Common/cpp/worklets/Tools/JSISerializer.h +42 -0
- package/Common/cpp/worklets/Tools/JSLogger.cpp +92 -0
- package/Common/cpp/worklets/Tools/JSLogger.h +48 -0
- package/Common/cpp/worklets/Tools/JSScheduler.cpp +21 -0
- package/Common/cpp/worklets/Tools/JSScheduler.h +35 -0
- package/Common/cpp/worklets/Tools/PlatformLogger.h +16 -0
- package/Common/cpp/worklets/Tools/RNRuntimeStatus.h +27 -0
- package/Common/cpp/worklets/Tools/ScriptBuffer.h +56 -0
- package/Common/cpp/worklets/Tools/SingleInstanceChecker.h +75 -0
- package/Common/cpp/worklets/Tools/ThreadSafeQueue.h +49 -0
- package/Common/cpp/worklets/Tools/UIScheduler.cpp +19 -0
- package/Common/cpp/worklets/Tools/UIScheduler.h +22 -0
- package/Common/cpp/worklets/Tools/VersionUtils.cpp +61 -0
- package/Common/cpp/worklets/Tools/VersionUtils.h +24 -0
- package/Common/cpp/worklets/Tools/WorkletEventHandler.cpp +34 -0
- package/Common/cpp/worklets/Tools/WorkletEventHandler.h +44 -0
- package/Common/cpp/worklets/Tools/WorkletsJSIUtils.cpp +30 -0
- package/Common/cpp/worklets/Tools/WorkletsJSIUtils.h +222 -0
- package/Common/cpp/worklets/Tools/WorkletsSystraceSection.h +116 -0
- package/Common/cpp/worklets/Tools/WorkletsVersion.cpp +46 -0
- package/Common/cpp/worklets/Tools/WorkletsVersion.h +18 -0
- package/Common/cpp/worklets/WorkletRuntime/BundleModeConfig.h +17 -0
- package/Common/cpp/worklets/WorkletRuntime/HermesProfiling.cpp +45 -0
- package/Common/cpp/worklets/WorkletRuntime/HermesProfiling.h +12 -0
- package/Common/cpp/worklets/WorkletRuntime/RNRuntimeWorkletDecorator.cpp +68 -0
- package/Common/cpp/worklets/WorkletRuntime/RNRuntimeWorkletDecorator.h +24 -0
- package/Common/cpp/worklets/WorkletRuntime/RuntimeBindings.h +59 -0
- package/Common/cpp/worklets/WorkletRuntime/RuntimeData.h +38 -0
- package/Common/cpp/worklets/WorkletRuntime/RuntimeHolder.h +19 -0
- package/Common/cpp/worklets/WorkletRuntime/RuntimeManager.cpp +122 -0
- package/Common/cpp/worklets/WorkletRuntime/RuntimeManager.h +75 -0
- package/Common/cpp/worklets/WorkletRuntime/ScriptLoader.h +116 -0
- package/Common/cpp/worklets/WorkletRuntime/UIRuntimeDecorator.cpp +14 -0
- package/Common/cpp/worklets/WorkletRuntime/UIRuntimeDecorator.h +15 -0
- package/Common/cpp/worklets/WorkletRuntime/WorkletHermesRuntime.cpp +58 -0
- package/Common/cpp/worklets/WorkletRuntime/WorkletHermesRuntime.h +100 -0
- package/Common/cpp/worklets/WorkletRuntime/WorkletRuntime.cpp +327 -0
- package/Common/cpp/worklets/WorkletRuntime/WorkletRuntime.h +256 -0
- package/Common/cpp/worklets/WorkletRuntime/WorkletRuntimeCollector.h +36 -0
- package/Common/cpp/worklets/WorkletRuntime/WorkletRuntimeDecorator.cpp +320 -0
- package/Common/cpp/worklets/WorkletRuntime/WorkletRuntimeDecorator.h +36 -0
- package/LICENSE +20 -0
- package/README.md +43 -0
- package/RNWorklets.podspec +94 -0
- package/android/CMakeLists.txt +108 -0
- package/android/build.gradle.kts +369 -0
- package/android/fix-prefab.gradle.kts +56 -0
- package/android/generate-stub-pch.gradle.kts +84 -0
- package/android/gradle.properties +25 -0
- package/android/proguard-rules.pro +3 -0
- package/android/settings.gradle.kts +21 -0
- package/android/src/main/AndroidManifest.xml +2 -0
- package/android/src/main/cpp/WorkletsPCH.h +26 -0
- package/android/src/main/cpp/worklets/android/AndroidUIScheduler.cpp +66 -0
- package/android/src/main/cpp/worklets/android/AndroidUIScheduler.h +38 -0
- package/android/src/main/cpp/worklets/android/AnimationFrameCallback.h +30 -0
- package/android/src/main/cpp/worklets/android/JScriptBufferWrapper.cpp +66 -0
- package/android/src/main/cpp/worklets/android/JScriptBufferWrapper.h +48 -0
- package/android/src/main/cpp/worklets/android/JWorkletRuntimeWrapper.cpp +51 -0
- package/android/src/main/cpp/worklets/android/JWorkletRuntimeWrapper.h +43 -0
- package/android/src/main/cpp/worklets/android/PlatformLogger.cpp +31 -0
- package/android/src/main/cpp/worklets/android/WorkletsModule.cpp +203 -0
- package/android/src/main/cpp/worklets/android/WorkletsModule.h +75 -0
- package/android/src/main/cpp/worklets/android/WorkletsOnLoad.cpp +19 -0
- package/android/src/main/java/com/swmansion/worklets/AndroidUIScheduler.kt +56 -0
- package/android/src/main/java/com/swmansion/worklets/ScriptBufferWrapper.kt +103 -0
- package/android/src/main/java/com/swmansion/worklets/WorkletsPackage.kt +42 -0
- package/android/src/main/java/com/swmansion/worklets/runloop/AnimationFrameCallback.kt +14 -0
- package/android/src/main/java/com/swmansion/worklets/runloop/AnimationFrameQueue.kt +112 -0
- package/android/src/networking/com/swmansion/worklets/WorkletRuntimeWrapper.kt +27 -0
- package/android/src/networking/com/swmansion/worklets/WorkletsHeaderUtil.kt +30 -0
- package/android/src/networking/com/swmansion/worklets/WorkletsModule.kt +187 -0
- package/android/src/networking/com/swmansion/worklets/WorkletsNetworkEventUtil.kt +272 -0
- package/android/src/networking/com/swmansion/worklets/WorkletsNetworking.kt +1124 -0
- package/android/src/networking/com/swmansion/worklets/WorkletsOkHttpCallUtil.kt +40 -0
- package/android/src/networking/com/swmansion/worklets/WorkletsProgressListener.kt +13 -0
- package/android/src/networking/com/swmansion/worklets/WorkletsProgressRequestBody.kt +98 -0
- package/android/src/networking/com/swmansion/worklets/WorkletsProgressResponseBody.kt +60 -0
- package/android/src/networking/com/swmansion/worklets/WorkletsProgressiveStringDecoder.kt +87 -0
- package/android/src/networking/com/swmansion/worklets/WorkletsRequestBodyUtil.kt +181 -0
- package/android/src/no-networking/com/swmansion/worklets/WorkletsModule.kt +143 -0
- package/apple/worklets/apple/AnimationFrameQueue.h +15 -0
- package/apple/worklets/apple/AnimationFrameQueue.mm +145 -0
- package/apple/worklets/apple/AssertJavaScriptQueue.h +14 -0
- package/apple/worklets/apple/AssertTurboModuleManagerQueue.h +12 -0
- package/apple/worklets/apple/IOSUIScheduler.h +14 -0
- package/apple/worklets/apple/IOSUIScheduler.mm +29 -0
- package/apple/worklets/apple/Networking/WorkletsNetworking.h +25 -0
- package/apple/worklets/apple/Networking/WorkletsNetworking.mm +707 -0
- package/apple/worklets/apple/PlatformLogger.mm +31 -0
- package/apple/worklets/apple/SlowAnimations.h +8 -0
- package/apple/worklets/apple/SlowAnimations.mm +45 -0
- package/apple/worklets/apple/WorkletsDisplayLink.h +21 -0
- package/apple/worklets/apple/WorkletsModule.h +28 -0
- package/apple/worklets/apple/WorkletsModule.mm +177 -0
- package/bundleMode/index.d.ts +6 -0
- package/bundleMode/index.js +182 -0
- package/bundleMode/shims/reactNativeShim.js +21 -0
- package/bundleMode/shims/turboModuleRegistryShim.js +47 -0
- package/changes.json +58 -0
- package/compatibility.json +29 -0
- package/jest/pluginTestUtils.ts +16 -0
- package/jest/resolver.js +18 -0
- package/lib/module/WorkletsModule/NativeWorklets.js +4 -0
- package/lib/module/WorkletsModule/NativeWorklets.js.map +1 -0
- package/lib/module/WorkletsModule/NativeWorklets.native.js +199 -0
- package/lib/module/WorkletsModule/NativeWorklets.native.js.map +1 -0
- package/lib/module/WorkletsModule/workletsModuleProxy.js +4 -0
- package/lib/module/WorkletsModule/workletsModuleProxy.js.map +1 -0
- package/lib/module/bundleMode/metroOverrides.native.js +26 -0
- package/lib/module/bundleMode/metroOverrides.native.js.map +1 -0
- package/lib/module/bundleMode/network.native.js +44 -0
- package/lib/module/bundleMode/network.native.js.map +1 -0
- package/lib/module/debug/bundleMode.js +6 -0
- package/lib/module/debug/bundleMode.js.map +1 -0
- package/lib/module/debug/bundleMode.native.js +11 -0
- package/lib/module/debug/bundleMode.native.js.map +1 -0
- package/lib/module/debug/checkCppVersion.js +29 -0
- package/lib/module/debug/checkCppVersion.js.map +1 -0
- package/lib/module/debug/errors.native.js +67 -0
- package/lib/module/debug/errors.native.js.map +1 -0
- package/lib/module/debug/jsVersion.js +9 -0
- package/lib/module/debug/jsVersion.js.map +1 -0
- package/lib/module/debug/logger.js +15 -0
- package/lib/module/debug/logger.js.map +1 -0
- package/lib/module/debug/slowAnimations.js +7 -0
- package/lib/module/debug/slowAnimations.js.map +1 -0
- package/lib/module/debug/slowAnimations.native.js +17 -0
- package/lib/module/debug/slowAnimations.native.js.map +1 -0
- package/lib/module/deprecated.js +27 -0
- package/lib/module/deprecated.js.map +1 -0
- package/lib/module/featureFlags/featureFlags.js +12 -0
- package/lib/module/featureFlags/featureFlags.js.map +1 -0
- package/lib/module/featureFlags/featureFlags.native.js +51 -0
- package/lib/module/featureFlags/featureFlags.native.js.map +1 -0
- package/lib/module/featureFlags/staticFlags.json +6 -0
- package/lib/module/featureFlags/types.js +16 -0
- package/lib/module/featureFlags/types.js.map +1 -0
- package/lib/module/guardImplementation.native.js +17 -0
- package/lib/module/guardImplementation.native.js.map +1 -0
- package/lib/module/index.js +26 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/initializers/initializers.js +24 -0
- package/lib/module/initializers/initializers.js.map +1 -0
- package/lib/module/initializers/initializers.native.js +195 -0
- package/lib/module/initializers/initializers.native.js.map +1 -0
- package/lib/module/memory/bundleUnpacker.native.js +38 -0
- package/lib/module/memory/bundleUnpacker.native.js.map +1 -0
- package/lib/module/memory/customSerializableUnpacker.native.js +20 -0
- package/lib/module/memory/customSerializableUnpacker.native.js.map +1 -0
- package/lib/module/memory/isShareable.js +8 -0
- package/lib/module/memory/isShareable.js.map +1 -0
- package/lib/module/memory/isSynchronizable.js +8 -0
- package/lib/module/memory/isSynchronizable.js.map +1 -0
- package/lib/module/memory/remoteFunctionUnpacker.native.js +18 -0
- package/lib/module/memory/remoteFunctionUnpacker.native.js.map +1 -0
- package/lib/module/memory/serializable.js +18 -0
- package/lib/module/memory/serializable.js.map +1 -0
- package/lib/module/memory/serializable.native.js +619 -0
- package/lib/module/memory/serializable.native.js.map +1 -0
- package/lib/module/memory/serializableMappingCache.js +11 -0
- package/lib/module/memory/serializableMappingCache.js.map +1 -0
- package/lib/module/memory/serializableMappingCache.native.js +29 -0
- package/lib/module/memory/serializableMappingCache.native.js.map +1 -0
- package/lib/module/memory/shareable.js +18 -0
- package/lib/module/memory/shareable.js.map +1 -0
- package/lib/module/memory/shareable.native.js +42 -0
- package/lib/module/memory/shareable.native.js.map +1 -0
- package/lib/module/memory/shareableGuestUnpacker.native.js +105 -0
- package/lib/module/memory/shareableGuestUnpacker.native.js.map +1 -0
- package/lib/module/memory/shareableHostUnpacker.native.js +20 -0
- package/lib/module/memory/shareableHostUnpacker.native.js.map +1 -0
- package/lib/module/memory/synchronizable.js +6 -0
- package/lib/module/memory/synchronizable.js.map +1 -0
- package/lib/module/memory/synchronizable.native.js +9 -0
- package/lib/module/memory/synchronizable.native.js.map +1 -0
- package/lib/module/memory/synchronizableUnpacker.native.js +47 -0
- package/lib/module/memory/synchronizableUnpacker.native.js.map +1 -0
- package/lib/module/memory/types.js +12 -0
- package/lib/module/memory/types.js.map +1 -0
- package/lib/module/memory/valueUnpacker.native.js +52 -0
- package/lib/module/memory/valueUnpacker.native.js.map +1 -0
- package/lib/module/mock.js +85 -0
- package/lib/module/mock.js.map +1 -0
- package/lib/module/package.json +1 -0
- package/lib/module/platformChecker.js +4 -0
- package/lib/module/platformChecker.js.map +1 -0
- package/lib/module/platformChecker.native.js +4 -0
- package/lib/module/platformChecker.native.js.map +1 -0
- package/lib/module/privateGlobals.d.js +7 -0
- package/lib/module/privateGlobals.d.js.map +1 -0
- package/lib/module/runLoop/common/setImmediatePolyfill.js +15 -0
- package/lib/module/runLoop/common/setImmediatePolyfill.js.map +1 -0
- package/lib/module/runLoop/common/setIntervalPolyfill.js +26 -0
- package/lib/module/runLoop/common/setIntervalPolyfill.js.map +1 -0
- package/lib/module/runLoop/uiRuntime/mockedRequestAnimationFrame.js +10 -0
- package/lib/module/runLoop/uiRuntime/mockedRequestAnimationFrame.js.map +1 -0
- package/lib/module/runLoop/uiRuntime/requestAnimationFrame.js +71 -0
- package/lib/module/runLoop/uiRuntime/requestAnimationFrame.js.map +1 -0
- package/lib/module/runLoop/uiRuntime/setTimeoutPolyfill.js +32 -0
- package/lib/module/runLoop/uiRuntime/setTimeoutPolyfill.js.map +1 -0
- package/lib/module/runLoop/workletRuntime/index.js +19 -0
- package/lib/module/runLoop/workletRuntime/index.js.map +1 -0
- package/lib/module/runLoop/workletRuntime/queueMicrotask.js +11 -0
- package/lib/module/runLoop/workletRuntime/queueMicrotask.js.map +1 -0
- package/lib/module/runLoop/workletRuntime/requestAnimationFramePolyfill.js +48 -0
- package/lib/module/runLoop/workletRuntime/requestAnimationFramePolyfill.js.map +1 -0
- package/lib/module/runLoop/workletRuntime/setTimeout.js +28 -0
- package/lib/module/runLoop/workletRuntime/setTimeout.js.map +1 -0
- package/lib/module/runLoop/workletRuntime/taskQueue.js +37 -0
- package/lib/module/runLoop/workletRuntime/taskQueue.js.map +1 -0
- package/lib/module/runtimeKind.js +92 -0
- package/lib/module/runtimeKind.js.map +1 -0
- package/lib/module/runtimes.js +36 -0
- package/lib/module/runtimes.js.map +1 -0
- package/lib/module/runtimes.native.js +379 -0
- package/lib/module/runtimes.native.js.map +1 -0
- package/lib/module/specs/NativeWorkletsModule.js +5 -0
- package/lib/module/specs/NativeWorkletsModule.js.map +1 -0
- package/lib/module/specs/index.js +10 -0
- package/lib/module/specs/index.js.map +1 -0
- package/lib/module/threads.js +60 -0
- package/lib/module/threads.js.map +1 -0
- package/lib/module/threads.native.js +295 -0
- package/lib/module/threads.native.js.map +1 -0
- package/lib/module/types.js +5 -0
- package/lib/module/types.js.map +1 -0
- package/lib/module/workletFunction.js +36 -0
- package/lib/module/workletFunction.js.map +1 -0
- package/lib/typescript/WorkletsModule/NativeWorklets.d.ts +3 -0
- package/lib/typescript/WorkletsModule/NativeWorklets.d.ts.map +1 -0
- package/lib/typescript/WorkletsModule/NativeWorklets.native.d.ts +3 -0
- package/lib/typescript/WorkletsModule/NativeWorklets.native.d.ts.map +1 -0
- package/lib/typescript/WorkletsModule/workletsModuleProxy.d.ts +59 -0
- package/lib/typescript/WorkletsModule/workletsModuleProxy.d.ts.map +1 -0
- package/lib/typescript/bundleMode/metroOverrides.native.d.ts +9 -0
- package/lib/typescript/bundleMode/metroOverrides.native.d.ts.map +1 -0
- package/lib/typescript/bundleMode/network.native.d.ts +7 -0
- package/lib/typescript/bundleMode/network.native.d.ts.map +1 -0
- package/lib/typescript/debug/bundleMode.d.ts +2 -0
- package/lib/typescript/debug/bundleMode.d.ts.map +1 -0
- package/lib/typescript/debug/bundleMode.native.d.ts +2 -0
- package/lib/typescript/debug/bundleMode.native.d.ts.map +1 -0
- package/lib/typescript/debug/checkCppVersion.d.ts +3 -0
- package/lib/typescript/debug/checkCppVersion.d.ts.map +1 -0
- package/lib/typescript/debug/errors.native.d.ts +13 -0
- package/lib/typescript/debug/errors.native.d.ts.map +1 -0
- package/lib/typescript/debug/jsVersion.d.ts +7 -0
- package/lib/typescript/debug/jsVersion.d.ts.map +1 -0
- package/lib/typescript/debug/logger.d.ts +5 -0
- package/lib/typescript/debug/logger.d.ts.map +1 -0
- package/lib/typescript/debug/slowAnimations.d.ts +2 -0
- package/lib/typescript/debug/slowAnimations.d.ts.map +1 -0
- package/lib/typescript/debug/slowAnimations.native.d.ts +11 -0
- package/lib/typescript/debug/slowAnimations.native.d.ts.map +1 -0
- package/lib/typescript/deprecated.d.ts +19 -0
- package/lib/typescript/deprecated.d.ts.map +1 -0
- package/lib/typescript/featureFlags/featureFlags.d.ts +5 -0
- package/lib/typescript/featureFlags/featureFlags.d.ts.map +1 -0
- package/lib/typescript/featureFlags/featureFlags.native.d.ts +6 -0
- package/lib/typescript/featureFlags/featureFlags.native.d.ts.map +1 -0
- package/lib/typescript/featureFlags/types.d.ts +23 -0
- package/lib/typescript/featureFlags/types.d.ts.map +1 -0
- package/lib/typescript/guardImplementation.native.d.ts +3 -0
- package/lib/typescript/guardImplementation.native.d.ts.map +1 -0
- package/lib/typescript/index.d.ts +19 -0
- package/lib/typescript/index.d.ts.map +1 -0
- package/lib/typescript/initializers/initializers.d.ts +2 -0
- package/lib/typescript/initializers/initializers.d.ts.map +1 -0
- package/lib/typescript/initializers/initializers.native.d.ts +19 -0
- package/lib/typescript/initializers/initializers.native.d.ts.map +1 -0
- package/lib/typescript/memory/bundleUnpacker.native.d.ts +7 -0
- package/lib/typescript/memory/bundleUnpacker.native.d.ts.map +1 -0
- package/lib/typescript/memory/customSerializableUnpacker.native.d.ts +3 -0
- package/lib/typescript/memory/customSerializableUnpacker.native.d.ts.map +1 -0
- package/lib/typescript/memory/isShareable.d.ts +3 -0
- package/lib/typescript/memory/isShareable.d.ts.map +1 -0
- package/lib/typescript/memory/isSynchronizable.d.ts +3 -0
- package/lib/typescript/memory/isSynchronizable.d.ts.map +1 -0
- package/lib/typescript/memory/remoteFunctionUnpacker.native.d.ts +3 -0
- package/lib/typescript/memory/remoteFunctionUnpacker.native.d.ts.map +1 -0
- package/lib/typescript/memory/serializable.d.ts +7 -0
- package/lib/typescript/memory/serializable.d.ts.map +1 -0
- package/lib/typescript/memory/serializable.native.d.ts +37 -0
- package/lib/typescript/memory/serializable.native.d.ts.map +1 -0
- package/lib/typescript/memory/serializableMappingCache.d.ts +6 -0
- package/lib/typescript/memory/serializableMappingCache.d.ts.map +1 -0
- package/lib/typescript/memory/serializableMappingCache.native.d.ts +13 -0
- package/lib/typescript/memory/serializableMappingCache.native.d.ts.map +1 -0
- package/lib/typescript/memory/shareable.d.ts +15 -0
- package/lib/typescript/memory/shareable.d.ts.map +1 -0
- package/lib/typescript/memory/shareable.native.d.ts +15 -0
- package/lib/typescript/memory/shareable.native.d.ts.map +1 -0
- package/lib/typescript/memory/shareableGuestUnpacker.native.d.ts +4 -0
- package/lib/typescript/memory/shareableGuestUnpacker.native.d.ts.map +1 -0
- package/lib/typescript/memory/shareableHostUnpacker.native.d.ts +4 -0
- package/lib/typescript/memory/shareableHostUnpacker.native.d.ts.map +1 -0
- package/lib/typescript/memory/synchronizable.d.ts +3 -0
- package/lib/typescript/memory/synchronizable.d.ts.map +1 -0
- package/lib/typescript/memory/synchronizable.native.d.ts +3 -0
- package/lib/typescript/memory/synchronizable.native.d.ts.map +1 -0
- package/lib/typescript/memory/synchronizableUnpacker.native.d.ts +4 -0
- package/lib/typescript/memory/synchronizableUnpacker.native.d.ts.map +1 -0
- package/lib/typescript/memory/types.d.ts +136 -0
- package/lib/typescript/memory/types.d.ts.map +1 -0
- package/lib/typescript/memory/valueUnpacker.native.d.ts +7 -0
- package/lib/typescript/memory/valueUnpacker.native.d.ts.map +1 -0
- package/lib/typescript/mock.d.ts +2 -0
- package/lib/typescript/mock.d.ts.map +1 -0
- package/lib/typescript/package.json +1 -0
- package/lib/typescript/platformChecker.d.ts +2 -0
- package/lib/typescript/platformChecker.d.ts.map +1 -0
- package/lib/typescript/platformChecker.native.d.ts +2 -0
- package/lib/typescript/platformChecker.native.d.ts.map +1 -0
- package/lib/typescript/runLoop/common/setImmediatePolyfill.d.ts +2 -0
- package/lib/typescript/runLoop/common/setImmediatePolyfill.d.ts.map +1 -0
- package/lib/typescript/runLoop/common/setIntervalPolyfill.d.ts +2 -0
- package/lib/typescript/runLoop/common/setIntervalPolyfill.d.ts.map +1 -0
- package/lib/typescript/runLoop/uiRuntime/mockedRequestAnimationFrame.d.ts +6 -0
- package/lib/typescript/runLoop/uiRuntime/mockedRequestAnimationFrame.d.ts.map +1 -0
- package/lib/typescript/runLoop/uiRuntime/requestAnimationFrame.d.ts +2 -0
- package/lib/typescript/runLoop/uiRuntime/requestAnimationFrame.d.ts.map +1 -0
- package/lib/typescript/runLoop/uiRuntime/setTimeoutPolyfill.d.ts +2 -0
- package/lib/typescript/runLoop/uiRuntime/setTimeoutPolyfill.d.ts.map +1 -0
- package/lib/typescript/runLoop/workletRuntime/index.d.ts +2 -0
- package/lib/typescript/runLoop/workletRuntime/index.d.ts.map +1 -0
- package/lib/typescript/runLoop/workletRuntime/queueMicrotask.d.ts +2 -0
- package/lib/typescript/runLoop/workletRuntime/queueMicrotask.d.ts.map +1 -0
- package/lib/typescript/runLoop/workletRuntime/requestAnimationFramePolyfill.d.ts +2 -0
- package/lib/typescript/runLoop/workletRuntime/requestAnimationFramePolyfill.d.ts.map +1 -0
- package/lib/typescript/runLoop/workletRuntime/setTimeout.d.ts +2 -0
- package/lib/typescript/runLoop/workletRuntime/setTimeout.d.ts.map +1 -0
- package/lib/typescript/runLoop/workletRuntime/taskQueue.d.ts +10 -0
- package/lib/typescript/runLoop/workletRuntime/taskQueue.d.ts.map +1 -0
- package/lib/typescript/runtimeKind.d.ts +56 -0
- package/lib/typescript/runtimeKind.d.ts.map +1 -0
- package/lib/typescript/runtimes.d.ts +15 -0
- package/lib/typescript/runtimes.d.ts.map +1 -0
- package/lib/typescript/runtimes.native.d.ts +155 -0
- package/lib/typescript/runtimes.native.d.ts.map +1 -0
- package/lib/typescript/specs/NativeWorkletsModule.d.ts +9 -0
- package/lib/typescript/specs/NativeWorkletsModule.d.ts.map +1 -0
- package/lib/typescript/specs/index.d.ts +3 -0
- package/lib/typescript/specs/index.d.ts.map +1 -0
- package/lib/typescript/threads.d.ts +8 -0
- package/lib/typescript/threads.d.ts.map +1 -0
- package/lib/typescript/threads.native.d.ts +125 -0
- package/lib/typescript/threads.native.d.ts.map +1 -0
- package/lib/typescript/types.d.ts +136 -0
- package/lib/typescript/types.d.ts.map +1 -0
- package/lib/typescript/workletFunction.d.ts +26 -0
- package/lib/typescript/workletFunction.d.ts.map +1 -0
- package/package.json +220 -0
- package/plugin/index.d.ts +168 -0
- package/plugin/index.js +2188 -0
- package/scripts/validate-react-native-version.js +43 -0
- package/scripts/worklets_utils.rb +94 -0
- package/src/WorkletsModule/NativeWorklets.native.ts +461 -0
- package/src/WorkletsModule/NativeWorklets.ts +5 -0
- package/src/WorkletsModule/workletsModuleProxy.ts +247 -0
- package/src/bundleMode/metroOverrides.native.ts +33 -0
- package/src/bundleMode/network.native.ts +63 -0
- package/src/debug/bundleMode.native.ts +18 -0
- package/src/debug/bundleMode.ts +5 -0
- package/src/debug/checkCppVersion.ts +34 -0
- package/src/debug/errors.native.ts +74 -0
- package/src/debug/jsVersion.ts +8 -0
- package/src/debug/logger.ts +16 -0
- package/src/debug/slowAnimations.native.ts +15 -0
- package/src/debug/slowAnimations.ts +6 -0
- package/src/deprecated.ts +38 -0
- package/src/featureFlags/featureFlags.native.ts +70 -0
- package/src/featureFlags/featureFlags.ts +20 -0
- package/src/featureFlags/staticFlags.json +6 -0
- package/src/featureFlags/types.ts +32 -0
- package/src/guardImplementation.native.ts +26 -0
- package/src/index.ts +95 -0
- package/src/initializers/initializers.native.ts +218 -0
- package/src/initializers/initializers.ts +24 -0
- package/src/memory/bundleUnpacker.native.ts +59 -0
- package/src/memory/customSerializableUnpacker.native.ts +30 -0
- package/src/memory/isShareable.ts +16 -0
- package/src/memory/isSynchronizable.ts +14 -0
- package/src/memory/remoteFunctionUnpacker.native.ts +27 -0
- package/src/memory/serializable.native.ts +889 -0
- package/src/memory/serializable.ts +36 -0
- package/src/memory/serializableMappingCache.native.ts +37 -0
- package/src/memory/serializableMappingCache.ts +12 -0
- package/src/memory/shareable.native.ts +68 -0
- package/src/memory/shareable.ts +27 -0
- package/src/memory/shareableGuestUnpacker.native.ts +168 -0
- package/src/memory/shareableHostUnpacker.native.ts +31 -0
- package/src/memory/synchronizable.native.ts +17 -0
- package/src/memory/synchronizable.ts +9 -0
- package/src/memory/synchronizableUnpacker.native.ts +65 -0
- package/src/memory/types.ts +191 -0
- package/src/memory/valueUnpacker.native.ts +79 -0
- package/src/mock.ts +111 -0
- package/src/platformChecker.native.ts +3 -0
- package/src/platformChecker.ts +4 -0
- package/src/privateGlobals.d.ts +127 -0
- package/src/runLoop/common/setImmediatePolyfill.ts +20 -0
- package/src/runLoop/common/setIntervalPolyfill.ts +38 -0
- package/src/runLoop/uiRuntime/mockedRequestAnimationFrame.ts +11 -0
- package/src/runLoop/uiRuntime/requestAnimationFrame.ts +87 -0
- package/src/runLoop/uiRuntime/setTimeoutPolyfill.ts +40 -0
- package/src/runLoop/workletRuntime/index.ts +18 -0
- package/src/runLoop/workletRuntime/queueMicrotask.ts +13 -0
- package/src/runLoop/workletRuntime/requestAnimationFramePolyfill.ts +61 -0
- package/src/runLoop/workletRuntime/setTimeout.ts +37 -0
- package/src/runLoop/workletRuntime/taskQueue.ts +44 -0
- package/src/runtimeKind.ts +85 -0
- package/src/runtimes.native.ts +572 -0
- package/src/runtimes.ts +107 -0
- package/src/specs/NativeWorkletsModule.ts +11 -0
- package/src/specs/index.ts +13 -0
- package/src/threads.native.ts +408 -0
- package/src/threads.ts +110 -0
- package/src/types.ts +164 -0
- package/src/workletFunction.ts +41 -0
|
@@ -0,0 +1,295 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
import { isBundleModeEnabled } from './debug/bundleMode';
|
|
4
|
+
import { getStaticFeatureFlag } from './featureFlags/featureFlags';
|
|
5
|
+
import { addNoBundleModeGuardImplementation } from './guardImplementation';
|
|
6
|
+
import { createSerializable, makeShareableCloneOnUIRecursive } from './memory/serializable';
|
|
7
|
+
import { RuntimeKind } from "./runtimeKind.js";
|
|
8
|
+
import { isWorkletFunction } from "./workletFunction.js";
|
|
9
|
+
import { WorkletsModule } from './WorkletsModule/NativeWorklets';
|
|
10
|
+
const SHOULD_CAPTURE_SCHEDULE_STACK = __DEV__ && getStaticFeatureFlag('ENABLE_CROSS_RUNTIME_STACK_TRACES');
|
|
11
|
+
let runOnUIQueue = [];
|
|
12
|
+
export function setupMicrotasks() {
|
|
13
|
+
'worklet';
|
|
14
|
+
|
|
15
|
+
let microtasksQueue = [];
|
|
16
|
+
let isExecutingMicrotasksQueue = false;
|
|
17
|
+
globalThis.queueMicrotask = callback => {
|
|
18
|
+
microtasksQueue.push(callback);
|
|
19
|
+
};
|
|
20
|
+
// TODO: Remove it after support for Reanimated 4.3 is dropped.
|
|
21
|
+
globalThis._microtaskQueueFinalizers = [];
|
|
22
|
+
globalThis.__callMicrotasks = () => {
|
|
23
|
+
if (isExecutingMicrotasksQueue) {
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
try {
|
|
27
|
+
isExecutingMicrotasksQueue = true;
|
|
28
|
+
for (let index = 0; index < microtasksQueue.length; index += 1) {
|
|
29
|
+
// we use classic 'for' loop because the size of the currentTasks array may change while executing some of the callbacks due to queueMicrotask calls
|
|
30
|
+
microtasksQueue[index]();
|
|
31
|
+
}
|
|
32
|
+
microtasksQueue = [];
|
|
33
|
+
globalThis._microtaskQueueFinalizers.forEach(finalizer => finalizer());
|
|
34
|
+
} finally {
|
|
35
|
+
isExecutingMicrotasksQueue = false;
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Lets you schedule a function to be executed on the [UI
|
|
42
|
+
* Runtime](https://docs.swmansion.com/react-native-worklets/docs/fundamentals/runtimeKinds#ui-runtime).
|
|
43
|
+
*
|
|
44
|
+
* - The callback executes asynchronously and doesn't return a value.
|
|
45
|
+
* - Passed function and args are automatically
|
|
46
|
+
* [workletized](https://docs.swmansion.com/react-native-worklets/docs/fundamentals/glossary#to-workletize)
|
|
47
|
+
* and serialized.
|
|
48
|
+
* - This function cannot be called from the [UI
|
|
49
|
+
* Runtime](https://docs.swmansion.com/react-native-worklets/docs/fundamentals/runtimeKinds#ui-runtime)
|
|
50
|
+
* or a [Worker
|
|
51
|
+
* Runtime](https://docs.swmansion.com/react-native-worklets/docs/fundamentals/runtimeKinds#worker-runtime),
|
|
52
|
+
* unless you have the [Bundle Mode](/docs/bundleMode/) enabled.
|
|
53
|
+
*
|
|
54
|
+
* @param fun - A reference to a function you want to schedule on the [UI
|
|
55
|
+
* Runtime](https://docs.swmansion.com/react-native-worklets/docs/fundamentals/runtimeKinds#ui-runtime).
|
|
56
|
+
* @param args - Arguments to pass to the function.
|
|
57
|
+
* @see https://docs.swmansion.com/react-native-worklets/docs/threading/scheduleOnUI
|
|
58
|
+
*/
|
|
59
|
+
// @ts-expect-error This overload is correct since it's what user sees in their code
|
|
60
|
+
// before it's transformed by Worklets Babel plugin.
|
|
61
|
+
|
|
62
|
+
export function scheduleOnUI(worklet, ...args) {
|
|
63
|
+
if (__DEV__ && !isWorkletFunction(worklet) && !worklet.__bundleData) {
|
|
64
|
+
throw new Error('[Worklets] `scheduleOnUI` can only be used with worklets.');
|
|
65
|
+
}
|
|
66
|
+
if (__DEV__) {
|
|
67
|
+
// in DEV mode we call serializable conversion here because in case the object
|
|
68
|
+
// can't be converted, we will get a meaningful stack-trace as opposed to the
|
|
69
|
+
// situation when conversion is only done via microtask queue. This does not
|
|
70
|
+
// make the app particularily less efficient as converted objects are cached
|
|
71
|
+
// and for a given worklet the conversion only happens once.
|
|
72
|
+
createSerializable(worklet);
|
|
73
|
+
createSerializable(args);
|
|
74
|
+
}
|
|
75
|
+
enqueueUI(worklet, args);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Lets you asynchronously run
|
|
80
|
+
* [workletized](https://docs.swmansion.com/react-native-worklets/docs/fundamentals/glossary#to-workletize)
|
|
81
|
+
* functions on the [UI
|
|
82
|
+
* thread](https://docs.swmansion.com/react-native-worklets/docs/threading/runOnUI/).
|
|
83
|
+
*
|
|
84
|
+
* This method does not schedule the work immediately but instead waits for
|
|
85
|
+
* other worklets to be scheduled within the same JS loop. It uses
|
|
86
|
+
* queueMicrotask to schedule all the worklets at once making sure they will run
|
|
87
|
+
* within the same frame boundaries on the UI thread.
|
|
88
|
+
*
|
|
89
|
+
* @param fun - A reference to a function you want to execute on the [UI
|
|
90
|
+
* thread](https://docs.swmansion.com/react-native-worklets/docs/threading/runOnUI/)
|
|
91
|
+
* from the [JavaScript
|
|
92
|
+
* thread](https://docs.swmansion.com/react-native-worklets/docs/threading/runOnUI/).
|
|
93
|
+
* @returns A function that accepts arguments for the function passed as the
|
|
94
|
+
* first argument.
|
|
95
|
+
* @see https://docs.swmansion.com/react-native-worklets/docs/threading/runOnUI @deprecated Use `scheduleOnUI` instead.
|
|
96
|
+
*/
|
|
97
|
+
// @ts-expect-error This overload is correct since it's what user sees in their code
|
|
98
|
+
// before it's transformed by Worklets Babel plugin.
|
|
99
|
+
|
|
100
|
+
export function runOnUI(worklet) {
|
|
101
|
+
if (__DEV__ && !isWorkletFunction(worklet) && !worklet.__bundleData) {
|
|
102
|
+
throw new Error('[Worklets] `runOnUI` can only be used with worklets.');
|
|
103
|
+
}
|
|
104
|
+
return (...args) => {
|
|
105
|
+
scheduleOnUI(worklet, ...args);
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* Lets you run a function synchronously on the [UI
|
|
111
|
+
* Runtime](https://docs.swmansion.com/react-native-worklets/docs/fundamentals/runtimeKinds#ui-runtime)
|
|
112
|
+
* from the [RN
|
|
113
|
+
* Runtime](https://docs.swmansion.com/react-native-worklets/docs/fundamentals/runtimeKinds#rn-runtime).
|
|
114
|
+
* Passed function and args are automatically
|
|
115
|
+
* [workletized](https://docs.swmansion.com/react-native-worklets/docs/fundamentals/glossary#to-workletize)
|
|
116
|
+
* and serialized.
|
|
117
|
+
*
|
|
118
|
+
* - This function cannot be called from the [UI
|
|
119
|
+
* Runtime](https://docs.swmansion.com/react-native-worklets/docs/fundamentals/runtimeKinds#ui-runtime).
|
|
120
|
+
* - This function cannot be called from a [Worker
|
|
121
|
+
* Runtime](https://docs.swmansion.com/react-native-worklets/docs/fundamentals/runtimeKinds#worker-runtime).
|
|
122
|
+
*
|
|
123
|
+
* @param fun - A reference to a function you want to execute on the [UI
|
|
124
|
+
* Runtime](https://docs.swmansion.com/react-native-worklets/docs/fundamentals/runtimeKinds#ui-runtime).
|
|
125
|
+
* @param args - Arguments to pass to the function.
|
|
126
|
+
* @returns The return value of the function passed as the first argument.
|
|
127
|
+
* @see https://docs.swmansion.com/react-native-worklets/docs/threading/runOnUISync
|
|
128
|
+
*/
|
|
129
|
+
// @ts-expect-error This overload is correct since it's what user sees in their code
|
|
130
|
+
// before it's transformed by Worklets Babel plugin.
|
|
131
|
+
|
|
132
|
+
export function runOnUISync(worklet, ...args) {
|
|
133
|
+
return WorkletsModule.runOnUISync(createSerializable(() => {
|
|
134
|
+
'worklet';
|
|
135
|
+
|
|
136
|
+
const result = worklet(...args);
|
|
137
|
+
return makeShareableCloneOnUIRecursive(result);
|
|
138
|
+
}), SHOULD_CAPTURE_SCHEDULE_STACK ? new Error().stack ?? '' : undefined);
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
// @ts-expect-error This overload is correct since it's what user sees in their code
|
|
142
|
+
// before it's transformed by Worklets Babel plugin.
|
|
143
|
+
|
|
144
|
+
export function executeOnUIRuntimeSync(worklet) {
|
|
145
|
+
return (...args) => {
|
|
146
|
+
return runOnUISync(worklet, ...args);
|
|
147
|
+
};
|
|
148
|
+
}
|
|
149
|
+
function runWorkletOnJS(worklet, ...args) {
|
|
150
|
+
// remote function that calls a worklet synchronously on the JS runtime
|
|
151
|
+
worklet(...args);
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
* Lets you schedule a function to be executed on the RN runtime from any
|
|
156
|
+
* runtime. Check
|
|
157
|
+
* {@link https://docs.swmansion.com/react-native-worklets/docs/fundamentals/runtimeKinds}
|
|
158
|
+
* for more information about the different runtime kinds.
|
|
159
|
+
*
|
|
160
|
+
* Scheduling function from the RN Runtime (we are already on RN Runtime) simply
|
|
161
|
+
* uses `queueMicrotask`.
|
|
162
|
+
*
|
|
163
|
+
* When functions need to be scheduled from the UI Runtime, first function and
|
|
164
|
+
* args are serialized and then the system passes the scheduling responsibility
|
|
165
|
+
* to the JSScheduler. The JSScheduler then uses the RN CallInvoker to schedule
|
|
166
|
+
* the function asynchronously on the JavaScript thread by calling
|
|
167
|
+
* `jsCallInvoker_->invokeAsync()`.
|
|
168
|
+
*
|
|
169
|
+
* When called from a Worker Runtime, it uses the same JSScheduler mechanism.
|
|
170
|
+
*
|
|
171
|
+
* @param fun - A function you want to schedule on the RN runtime. A function
|
|
172
|
+
* can be a worklet, a remote function or a regular function.
|
|
173
|
+
* @param args - Arguments to pass to the function.
|
|
174
|
+
* @see https://docs.swmansion.com/react-native-worklets/docs/threading/scheduleOnRN
|
|
175
|
+
*/
|
|
176
|
+
export function scheduleOnRN(fun, ...args) {
|
|
177
|
+
'worklet';
|
|
178
|
+
|
|
179
|
+
if (globalThis.__RUNTIME_KIND === RuntimeKind.ReactNative) {
|
|
180
|
+
// if we are already on the JS thread, we just schedule the worklet on the JS queue
|
|
181
|
+
queueMicrotask(args.length ? () => fun(...args) : fun);
|
|
182
|
+
} else if (isWorkletFunction(fun)) {
|
|
183
|
+
// If `fun` is a worklet, we schedule a call of a remote function `runWorkletOnJS`
|
|
184
|
+
// and pass the worklet as a first argument followed by original arguments.
|
|
185
|
+
scheduleOnRN(runWorkletOnJS, fun, ...args);
|
|
186
|
+
} else {
|
|
187
|
+
globalThis.__workletsModuleProxy.scheduleOnRN(fun, args.length > 0 ? globalThis.__serializer(args) : undefined);
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
/**
|
|
192
|
+
* Lets you asynchronously run
|
|
193
|
+
* non-[workletized](https://docs.swmansion.com/react-native-worklets/docs/fundamentals/glossary#to-workletize)
|
|
194
|
+
* functions that couldn't otherwise run on the [UI
|
|
195
|
+
* thread](https://docs.swmansion.com/react-native-worklets/docs/fundamentals/glossary#ui-thread).
|
|
196
|
+
* This applies to most external libraries as they don't have their functions
|
|
197
|
+
* marked with "worklet"; directive.
|
|
198
|
+
*
|
|
199
|
+
* @param fun - A reference to a function you want to execute on the JavaScript
|
|
200
|
+
* thread from the UI thread.
|
|
201
|
+
* @returns A function that accepts arguments for the function passed as the
|
|
202
|
+
* first argument.
|
|
203
|
+
* @see https://docs.swmansion.com/react-native-worklets/docs/threading/runOnJS
|
|
204
|
+
*/
|
|
205
|
+
/** @deprecated Use `scheduleOnRN` instead. */
|
|
206
|
+
export function runOnJS(fun) {
|
|
207
|
+
'worklet';
|
|
208
|
+
|
|
209
|
+
return (...args) => {
|
|
210
|
+
scheduleOnRN(fun, ...args);
|
|
211
|
+
};
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
/**
|
|
215
|
+
* Lets you asynchronously run
|
|
216
|
+
* [workletized](https://docs.swmansion.com/react-native-worklets/docs/fundamentals/glossary#to-workletize)
|
|
217
|
+
* functions on the [UI
|
|
218
|
+
* Runtime](https://docs.swmansion.com/react-native-worklets/docs/fundamentals/runtimeKinds#ui-runtime).
|
|
219
|
+
*
|
|
220
|
+
* - This method does not schedule the work immediately but instead waits for
|
|
221
|
+
* other worklets to be scheduled within the same JS loop. It uses
|
|
222
|
+
* queueMicrotask to schedule all the worklets at once making sure they will
|
|
223
|
+
* run within the same frame boundaries on the UI thread.
|
|
224
|
+
*
|
|
225
|
+
* @param fun - A reference to a function you want to execute on the [UI
|
|
226
|
+
* Runtime](https://docs.swmansion.com/react-native-worklets/docs/fundamentals/runtimeKinds#ui-runtime).
|
|
227
|
+
* from the [JavaScript
|
|
228
|
+
* Runtime](https://docs.swmansion.com/react-native-worklets/docs/fundamentals/glossary#javascript-runtime).
|
|
229
|
+
* @returns A promise that resolves to the return value of the function passed
|
|
230
|
+
* as the first argument.
|
|
231
|
+
* @see https://docs.swmansion.com/react-native-worklets/docs/threading/runOnUIAsync
|
|
232
|
+
*/
|
|
233
|
+
export function runOnUIAsync(worklet, ...args) {
|
|
234
|
+
if (__DEV__) {
|
|
235
|
+
if (!isWorkletFunction(worklet)) {
|
|
236
|
+
throw new Error('[Worklets] `runOnUIAsync` can only be used with worklets.');
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
return new Promise((resolve, reject) => {
|
|
240
|
+
if (__DEV__) {
|
|
241
|
+
// in DEV mode we call serializable conversion here because in case the object
|
|
242
|
+
// can't be converted, we will get a meaningful stack-trace as opposed to the
|
|
243
|
+
// situation when conversion is only done via microtask queue. This does not
|
|
244
|
+
// make the app particularily less efficient as converted objects are cached
|
|
245
|
+
// and for a given worklet the conversion only happens once.
|
|
246
|
+
createSerializable(worklet);
|
|
247
|
+
createSerializable(args);
|
|
248
|
+
}
|
|
249
|
+
enqueueUI(worklet, args, resolve, reject);
|
|
250
|
+
});
|
|
251
|
+
}
|
|
252
|
+
function enqueueUI(worklet, args, resolve, reject) {
|
|
253
|
+
const scheduleStack = SHOULD_CAPTURE_SCHEDULE_STACK ? new Error().stack : undefined;
|
|
254
|
+
const job = [worklet, args, resolve, reject, scheduleStack];
|
|
255
|
+
runOnUIQueue.push(job);
|
|
256
|
+
if (runOnUIQueue.length === 1) {
|
|
257
|
+
flushUIQueue();
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
function flushUIQueue() {
|
|
261
|
+
queueMicrotask(() => {
|
|
262
|
+
const queue = runOnUIQueue;
|
|
263
|
+
runOnUIQueue = [];
|
|
264
|
+
const jobWorklets = queue.map(([workletFunction, workletArgs, resolve, reject]) => createSerializable(() => {
|
|
265
|
+
'worklet';
|
|
266
|
+
|
|
267
|
+
try {
|
|
268
|
+
const result = workletFunction(...workletArgs);
|
|
269
|
+
if (resolve) {
|
|
270
|
+
const serializedResult = globalThis.__serializer(result);
|
|
271
|
+
globalThis.__workletsModuleProxy.handlePromise(resolve, serializedResult);
|
|
272
|
+
}
|
|
273
|
+
} catch (error) {
|
|
274
|
+
if (reject) {
|
|
275
|
+
const serializedError = globalThis.__serializer(error);
|
|
276
|
+
globalThis.__workletsModuleProxy.handlePromise(reject, serializedError);
|
|
277
|
+
} else {
|
|
278
|
+
throw error;
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
}));
|
|
282
|
+
const scheduleStacks = SHOULD_CAPTURE_SCHEDULE_STACK ? queue.map(([,,,, scheduleStack]) => scheduleStack) : undefined;
|
|
283
|
+
WorkletsModule.scheduleOnUI(WorkletsModule.createSerializableArray(jobWorklets), scheduleStacks);
|
|
284
|
+
});
|
|
285
|
+
}
|
|
286
|
+
if (__DEV__ && !isBundleModeEnabled()) {
|
|
287
|
+
/**
|
|
288
|
+
* QoL guards to give a meaningful error message when the user tries to call
|
|
289
|
+
* these functions on Worklet Runtimes outside of the Bundle Mode.
|
|
290
|
+
*/
|
|
291
|
+
addNoBundleModeGuardImplementation(runOnUIAsync);
|
|
292
|
+
addNoBundleModeGuardImplementation(runOnUISync);
|
|
293
|
+
addNoBundleModeGuardImplementation(scheduleOnUI);
|
|
294
|
+
}
|
|
295
|
+
//# sourceMappingURL=threads.native.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["isBundleModeEnabled","getStaticFeatureFlag","addNoBundleModeGuardImplementation","createSerializable","makeShareableCloneOnUIRecursive","RuntimeKind","isWorkletFunction","WorkletsModule","SHOULD_CAPTURE_SCHEDULE_STACK","__DEV__","runOnUIQueue","setupMicrotasks","microtasksQueue","isExecutingMicrotasksQueue","globalThis","queueMicrotask","callback","push","_microtaskQueueFinalizers","__callMicrotasks","index","length","forEach","finalizer","scheduleOnUI","worklet","args","__bundleData","Error","enqueueUI","runOnUI","runOnUISync","result","stack","undefined","executeOnUIRuntimeSync","runWorkletOnJS","scheduleOnRN","fun","__RUNTIME_KIND","ReactNative","__workletsModuleProxy","__serializer","runOnJS","runOnUIAsync","Promise","resolve","reject","scheduleStack","job","flushUIQueue","queue","jobWorklets","map","workletFunction","workletArgs","serializedResult","handlePromise","error","serializedError","scheduleStacks","createSerializableArray"],"sourceRoot":"../../src","sources":["threads.native.ts"],"mappings":"AAAA,YAAY;;AAEZ,SAASA,mBAAmB,QAAQ,oBAAoB;AACxD,SAASC,oBAAoB,QAAQ,6BAA6B;AAClE,SAASC,kCAAkC,QAAQ,uBAAuB;AAC1E,SACEC,kBAAkB,EAClBC,+BAA+B,QAC1B,uBAAuB;AAE9B,SAASC,WAAW,QAAQ,kBAAe;AAE3C,SAASC,iBAAiB,QAAQ,sBAAmB;AACrD,SAASC,cAAc,QAAQ,iCAAiC;AAEhE,MAAMC,6BAA6B,GACjCC,OAAO,IAAIR,oBAAoB,CAAC,mCAAmC,CAAC;AAUtE,IAAIS,YAAqB,GAAG,EAAE;AAE9B,OAAO,SAASC,eAAeA,CAAA,EAAG;EAChC,SAAS;;EAET,IAAIC,eAAkC,GAAG,EAAE;EAC3C,IAAIC,0BAA0B,GAAG,KAAK;EACtCC,UAAU,CAACC,cAAc,GAAIC,QAAoB,IAAK;IACpDJ,eAAe,CAACK,IAAI,CAACD,QAAQ,CAAC;EAChC,CAAC;EACD;EACAF,UAAU,CAACI,yBAAyB,GAAG,EAAE;EAEzCJ,UAAU,CAACK,gBAAgB,GAAG,MAAM;IAClC,IAAIN,0BAA0B,EAAE;MAC9B;IACF;IACA,IAAI;MACFA,0BAA0B,GAAG,IAAI;MACjC,KAAK,IAAIO,KAAK,GAAG,CAAC,EAAEA,KAAK,GAAGR,eAAe,CAACS,MAAM,EAAED,KAAK,IAAI,CAAC,EAAE;QAC9D;QACAR,eAAe,CAACQ,KAAK,CAAC,CAAC,CAAC;MAC1B;MACAR,eAAe,GAAG,EAAE;MACpBE,UAAU,CAACI,yBAAyB,CAACI,OAAO,CAAEC,SAAS,IAAKA,SAAS,CAAC,CAAC,CAAC;IAC1E,CAAC,SAAS;MACRV,0BAA0B,GAAG,KAAK;IACpC;EACF,CAAC;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAMA,OAAO,SAASW,YAAYA,CAC1BC,OAA2C,EAC3C,GAAGC,IAAU,EACP;EACN,IACEjB,OAAO,IACP,CAACH,iBAAiB,CAACmB,OAAO,CAAC,IAC3B,CAAEA,OAAO,CAA8BE,YAAY,EACnD;IACA,MAAM,IAAIC,KAAK,CACb,2DACF,CAAC;EACH;EACA,IAAInB,OAAO,EAAE;IACX;IACA;IACA;IACA;IACA;IACAN,kBAAkB,CAACsB,OAAO,CAAC;IAC3BtB,kBAAkB,CAACuB,IAAI,CAAC;EAC1B;EAEAG,SAAS,CAACJ,OAAO,EAAEC,IAAI,CAAC;AAC1B;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAKA,OAAO,SAASI,OAAOA,CACrBL,OAA2C,EAClB;EACzB,IACEhB,OAAO,IACP,CAACH,iBAAiB,CAACmB,OAAO,CAAC,IAC3B,CAAEA,OAAO,CAA8BE,YAAY,EACnD;IACA,MAAM,IAAIC,KAAK,CAAC,sDAAsD,CAAC;EACzE;EACA,OAAO,CAAC,GAAGF,IAAU,KAAK;IACxBF,YAAY,CAACC,OAAO,EAAE,GAAGC,IAAI,CAAC;EAChC,CAAC;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAMA,OAAO,SAASK,WAAWA,CACzBN,OAA2C,EAC3C,GAAGC,IAAU,EACA;EACb,OAAOnB,cAAc,CAACwB,WAAW,CAC/B5B,kBAAkB,CAAC,MAAM;IACvB,SAAS;;IACT,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oot":"../../src","sources":["types.ts"],"mappings":"AAAA;AACA,YAAY;;AAAC","ignoreList":[]}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* This function allows you to determine if a given function is a worklet. It
|
|
5
|
+
* only works with Worklets Babel plugin enabled. Unless you are doing something
|
|
6
|
+
* with internals of Worklets you shouldn't need to use this function.
|
|
7
|
+
*
|
|
8
|
+
* ### Note
|
|
9
|
+
*
|
|
10
|
+
* Do not call it before the worklet is declared, as it will always return false
|
|
11
|
+
* then. E.g.:
|
|
12
|
+
*
|
|
13
|
+
* ```ts
|
|
14
|
+
* isWorkletFunction(myWorklet); // Will always return false.
|
|
15
|
+
*
|
|
16
|
+
* function myWorklet() {
|
|
17
|
+
* 'worklet';
|
|
18
|
+
* }
|
|
19
|
+
* ```
|
|
20
|
+
*
|
|
21
|
+
* ### Maintainer note
|
|
22
|
+
*
|
|
23
|
+
* This function is supposed to be used only in the React Runtime. It always
|
|
24
|
+
* returns `false` in Worklet Runtimes.
|
|
25
|
+
*/
|
|
26
|
+
export function isWorkletFunction(value) {
|
|
27
|
+
'worklet';
|
|
28
|
+
|
|
29
|
+
// Since host objects always return true for `in` operator, we have to use dot notation to check if the property exists.
|
|
30
|
+
// See https://github.com/facebook/hermes/blob/340726ef8cf666a7cce75bc60b02fa56b3e54560/lib/VM/JSObject.cpp#L1276.
|
|
31
|
+
return (
|
|
32
|
+
// `__workletHash` isn't extracted in Worklet Runtimes.
|
|
33
|
+
typeof value === 'function' && !!value.__workletHash
|
|
34
|
+
);
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=workletFunction.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["isWorkletFunction","value","__workletHash"],"sourceRoot":"../../src","sources":["workletFunction.ts"],"mappings":"AAAA,YAAY;;AAIZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASA,iBAAiBA,CAG/BC,KAAc,EAA+C;EAC7D,SAAS;;EACT;EACA;EAEA;IACE;IACA,OAAOA,KAAK,KAAK,UAAU,IAC3B,CAAC,CAAEA,KAAK,CAAwCC;EAAa;AAEjE","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NativeWorklets.d.ts","sourceRoot":"","sources":["../../../src/WorkletsModule/NativeWorklets.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAE7D,eAAO,MAAM,cAAc,EAAE,eAAuB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NativeWorklets.native.d.ts","sourceRoot":"","sources":["../../../src/WorkletsModule/NativeWorklets.native.ts"],"names":[],"mappings":"AAmBA,OAAO,KAAK,EACV,eAAe,EAEhB,MAAM,uBAAuB,CAAC;AAkY/B,eAAO,MAAM,cAAc,EAAE,eAAsC,CAAC"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import type { RemoteFunction, SerializableRef, SynchronizableRef } from '../memory/types';
|
|
2
|
+
import type { WorkletRuntime } from '../types';
|
|
3
|
+
/** Type of `__workletsModuleProxy` injected with JSI. */
|
|
4
|
+
export interface WorkletsModuleProxy {
|
|
5
|
+
loadUnpackersWithCode(valueUnpackerCode: string, valueUnpackerLocation: string, valueUnpackerSourceMap: string, synchronizableUnpackerCode: string, synchronizableUnpackerLocation: string, synchronizableUnpackerSourceMap: string, customSerializableUnpackerCode: string, customSerializableUnpackerLocation: string, customSerializableUnpackerSourceMap: string, shareableHostUnpackerCode: string, shareableHostUnpackerLocation: string, shareableHostUnpackerSourceMap: string, shareableGuestUnpackerCode: string, shareableGuestUnpackerLocation: string, shareableGuestUnpackerSourceMap: string, remoteFunctionUnpackerCode: string, remoteFunctionUnpackerLocation: string, remoteFunctionUnpackerSourceMap: string): void;
|
|
6
|
+
loadUnpackersWithBytecode(valueUnpackerBytecode: ArrayBuffer, synchronizableUnpackerBytecode: ArrayBuffer, customSerializableUnpackerBytecode: ArrayBuffer, shareableHostUnpackerBytecode: ArrayBuffer, shareableGuestUnpackerBytecode: ArrayBuffer, remoteFunctionUnpackerBytecode: ArrayBuffer): void;
|
|
7
|
+
createSerializableImport<TValue>(source: string, imported: string): SerializableRef<TValue>;
|
|
8
|
+
createSerializableString(str: string): SerializableRef<string>;
|
|
9
|
+
createSerializableNumber(num: number): SerializableRef<number>;
|
|
10
|
+
createSerializableBoolean(bool: boolean): SerializableRef<boolean>;
|
|
11
|
+
createSerializableBigInt(bigInt: bigint): SerializableRef<bigint>;
|
|
12
|
+
createSerializableUndefined(): SerializableRef<undefined>;
|
|
13
|
+
createSerializableNull(): SerializableRef<null>;
|
|
14
|
+
createSerializableTurboModuleLike<TProps extends object, TProto extends object>(props: TProps, proto: TProto): SerializableRef<TProps>;
|
|
15
|
+
createSerializableObject<T extends object>(obj: T, shouldRetainRemote: boolean, nativeStateSource?: object): SerializableRef<T>;
|
|
16
|
+
createSerializableHostObject<T extends object>(obj: T): SerializableRef<T>;
|
|
17
|
+
createSerializableArray(array: unknown[], shouldRetainRemote?: boolean): SerializableRef<unknown[]>;
|
|
18
|
+
createSerializableArrayBuffer(arrayBuffer: ArrayBuffer): SerializableRef<ArrayBuffer>;
|
|
19
|
+
createSerializableMap<TKey, TValue>(keys: TKey[], values: TValue[]): SerializableRef<Map<TKey, TValue>>;
|
|
20
|
+
createSerializableSet<TValues>(values: TValues[]): SerializableRef<Set<TValues>>;
|
|
21
|
+
createSerializableError(name: string, message: string, stack: string | undefined): SerializableRef<Error>;
|
|
22
|
+
createSerializableRegExp(pattern: string, flags: string): SerializableRef<RegExp>;
|
|
23
|
+
createSerializableArrayBufferView<TValue extends ArrayBufferView>(typeName: string, buffer: ArrayBuffer, byteOffset: number, length: number): SerializableRef<TValue>;
|
|
24
|
+
createSerializableInitializer(obj: object): SerializableRef<object>;
|
|
25
|
+
createSerializableNonWorkletFunction<TArgs extends unknown[], TReturn>(fun: (...args: TArgs) => TReturn, functionName: string | undefined): SerializableRef<(...args: TArgs) => TReturn>;
|
|
26
|
+
createSerializableWorklet(worklet: object, shouldPersistRemote: boolean): SerializableRef<object>;
|
|
27
|
+
createCustomSerializable(data: SerializableRef<unknown>, typeId: number): SerializableRef<unknown>;
|
|
28
|
+
registerCustomSerializable(determine: SerializableRef<object>, pack: SerializableRef<object>, unpack: SerializableRef<object>, typeId: number): void;
|
|
29
|
+
createShareable<TValue = unknown>(hostRuntimeId: number, initial: SerializableRef<TValue>, initSynchronously: boolean, decorateHost: SerializableRef, decorateGuest: SerializableRef): SerializableRef<TValue>;
|
|
30
|
+
scheduleOnRN<TArgs extends unknown[]>(fun: RemoteFunction | ((...args: TArgs) => unknown), args: SerializableRef<TArgs> | undefined): void;
|
|
31
|
+
scheduleOnUI<TValue>(serializableArrayOfWorklets: SerializableRef<TValue[]>, scheduleStacks: string[] | undefined): void;
|
|
32
|
+
runOnUISync<TValue, TReturn>(serializable: SerializableRef<TValue>, scheduleStack: string | undefined): TReturn;
|
|
33
|
+
createWorkletRuntime(name: string, initializer: SerializableRef<() => void>, useDefaultQueue: boolean, customQueue: object | undefined, enableEventLoop: boolean): WorkletRuntime;
|
|
34
|
+
scheduleOnRuntime<TValue>(workletRuntime: WorkletRuntime, worklet: SerializableRef<TValue>, scheduleStack?: string): void;
|
|
35
|
+
scheduleOnRuntimeWithId<TValue>(runtimeId: number, worklet: SerializableRef<TValue>, scheduleStack?: string): void;
|
|
36
|
+
runOnRuntimeSync<TValue, TReturn>(workletRuntime: WorkletRuntime, worklet: SerializableRef<TValue>, scheduleStack?: string): TReturn;
|
|
37
|
+
runOnRuntimeSyncWithId<TValue, TReturn>(runtimeId: number, worklet: SerializableRef<TValue>, scheduleStack?: string): TReturn;
|
|
38
|
+
handlePromise<TValue>(resolveOrReject: ((value: TValue | PromiseLike<TValue>) => void) | RemoteFunction, valueOrError: SerializableRef<TValue>): void;
|
|
39
|
+
reportFatalErrorOnJS(message: string, stack: string, name: string): void;
|
|
40
|
+
createSynchronizable<TValue>(value: TValue): SynchronizableRef<TValue>;
|
|
41
|
+
synchronizableGetDirty<TValue>(synchronizableRef: SynchronizableRef<TValue>): TValue;
|
|
42
|
+
synchronizableGetBlocking<TValue>(synchronizableRef: SynchronizableRef<TValue>): TValue;
|
|
43
|
+
synchronizableSetBlocking<TValue>(synchronizableRef: SynchronizableRef<TValue>, value: SerializableRef<TValue>): void;
|
|
44
|
+
synchronizableLock<TValue>(synchronizableRef: SynchronizableRef<TValue>): void;
|
|
45
|
+
synchronizableUnlock<TValue>(synchronizableRef: SynchronizableRef<TValue>): void;
|
|
46
|
+
getStaticFeatureFlag(name: string): boolean;
|
|
47
|
+
setDynamicFeatureFlag(name: string, value: boolean): void;
|
|
48
|
+
getUIRuntimeHolder(): object;
|
|
49
|
+
getUISchedulerHolder(): object;
|
|
50
|
+
/** @deprecated Don't use unless you have to. */
|
|
51
|
+
createSerializableLEGACY<TValue>(value: TValue, nativeStateSource: object | undefined): SerializableRef<TValue>;
|
|
52
|
+
}
|
|
53
|
+
type InternalMethods = 'loadUnpackersWithCode' | 'loadUnpackersWithBytecode' | 'createSerializableLEGACY';
|
|
54
|
+
type TurboModulePublic = {
|
|
55
|
+
toggleSlowAnimationsOnUIRuntime(): boolean;
|
|
56
|
+
};
|
|
57
|
+
export type IWorkletsModule = Omit<WorkletsModuleProxy, InternalMethods> & TurboModulePublic;
|
|
58
|
+
export {};
|
|
59
|
+
//# sourceMappingURL=workletsModuleProxy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workletsModuleProxy.d.ts","sourceRoot":"","sources":["../../../src/WorkletsModule/workletsModuleProxy.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,cAAc,EACd,eAAe,EACf,iBAAiB,EAClB,MAAM,iBAAiB,CA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AC5C,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG,IAAI,CAAC,mBAAmB,EAAE,eAAe,CAAC,GACtE,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Evaluating HMR updates on Worklet Runtimes leads to verbose warnings which
|
|
3
|
+
* don't affect runtime. This function silences those warnings by providing a
|
|
4
|
+
* dummy Refresh module to the global scope.
|
|
5
|
+
*
|
|
6
|
+
* Use only in dev builds.
|
|
7
|
+
*/
|
|
8
|
+
export declare function silenceHMRWarnings(): void;
|
|
9
|
+
//# sourceMappingURL=metroOverrides.native.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"metroOverrides.native.d.ts","sourceRoot":"","sources":["../../../src/bundleMode/metroOverrides.native.ts"],"names":[],"mappings":"AAIA;;;;;;GAMG;AACH,wBAAgB,kBAAkB,SAajC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Mocks necessary networking TurboModules on Worklet Runtimes to prevent
|
|
3
|
+
* crashes when code running on Worklet Runtimes tries to use networking APIs.
|
|
4
|
+
* The NetworkingModule itself is injected via C++.
|
|
5
|
+
*/
|
|
6
|
+
export declare function initializeNetworking(): void;
|
|
7
|
+
//# sourceMappingURL=network.native.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"network.native.d.ts","sourceRoot":"","sources":["../../../src/bundleMode/network.native.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,wBAAgB,oBAAoB,SA6BnC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bundleMode.d.ts","sourceRoot":"","sources":["../../../src/debug/bundleMode.ts"],"names":[],"mappings":"AAEA,wBAAgB,mBAAmB,IAAI,OAAO,CAE7C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bundleMode.native.d.ts","sourceRoot":"","sources":["../../../src/debug/bundleMode.native.ts"],"names":[],"mappings":"AAQA,wBAAgB,mBAAmB,IAAI,OAAO,CAS7C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"checkCppVersion.d.ts","sourceRoot":"","sources":["../../../src/debug/checkCppVersion.ts"],"names":[],"mappings":"AAKA,wBAAgB,eAAe,SAgB9B;AAED,wBAAgB,YAAY,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,WAU9D"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { WorkletStackDetails } from '../types';
|
|
2
|
+
export declare function registerWorkletStackDetails(hash: number, stackDetails: WorkletStackDetails): void;
|
|
3
|
+
/**
|
|
4
|
+
* Remote error is an error coming from a Worklet Runtime that we bubble up to
|
|
5
|
+
* the RN Runtime.
|
|
6
|
+
*/
|
|
7
|
+
export declare function reportFatalRemoteError({ message, stack, name }: Error, force: boolean): void;
|
|
8
|
+
/**
|
|
9
|
+
* Registers `reportFatalRemoteError` function in global scope to allow to
|
|
10
|
+
* invoke it from C++.
|
|
11
|
+
*/
|
|
12
|
+
export declare function registerReportFatalRemoteError(): void;
|
|
13
|
+
//# sourceMappingURL=errors.native.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.native.d.ts","sourceRoot":"","sources":["../../../src/debug/errors.native.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAIpD,wBAAgB,2BAA2B,CACzC,IAAI,EAAE,MAAM,EACZ,YAAY,EAAE,mBAAmB,QAGlC;AAoCD;;;GAGG;AACH,wBAAgB,sBAAsB,CACpC,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,KAAK,EAC/B,KAAK,EAAE,OAAO,GACb,IAAI,CAWN;AAED;;;GAGG;AACH,wBAAgB,8BAA8B,SAE7C"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* We hardcode the version of Worklets here in order to compare it with the
|
|
3
|
+
* version used to build the native part of the library in runtime. Remember to
|
|
4
|
+
* keep this in sync with the version declared in `package.json`
|
|
5
|
+
*/
|
|
6
|
+
export declare const jsVersion = "0.11.3";
|
|
7
|
+
//# sourceMappingURL=jsVersion.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jsVersion.d.ts","sourceRoot":"","sources":["../../../src/debug/jsVersion.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,eAAO,MAAM,SAAS,WAAW,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../../src/debug/logger.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,MAAM;kBACH,MAAM;mBAGL,MAAM;CAGtB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"slowAnimations.d.ts","sourceRoot":"","sources":["../../../src/debug/slowAnimations.ts"],"names":[],"mappings":"AAEA,wBAAgB,+BAA+B,YAG9C"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Toggles slow animations on the UI runtime. When enabled, animations will run
|
|
3
|
+
* at a reduced speed to aid debugging.
|
|
4
|
+
*
|
|
5
|
+
* Available only on Android. iOS offers built-in slow animations toggle.
|
|
6
|
+
*
|
|
7
|
+
* @returns Whether slow animations are now enabled.
|
|
8
|
+
* @throws When invoked on platform different than Android.
|
|
9
|
+
*/
|
|
10
|
+
export declare function toggleSlowAnimationsOnUIRuntime(): boolean;
|
|
11
|
+
//# sourceMappingURL=slowAnimations.native.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"slowAnimations.native.d.ts","sourceRoot":"","sources":["../../../src/debug/slowAnimations.native.ts"],"names":[],"mappings":"AAGA;;;;;;;;GAQG;AACH,wBAAgB,+BAA+B,IAAI,OAAO,CAEzD"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { isSerializableRef, makeShareable, makeShareableCloneOnUIRecursive } from './memory/serializable';
|
|
2
|
+
import type { SerializableRef } from './memory/types';
|
|
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(serializable: object, serializableRef?: SerializableRef | WeakRef<SerializableRef>): void;
|
|
15
|
+
get: (key: object) => symbol | SerializableRef | WeakRef<SerializableRef> | undefined;
|
|
16
|
+
};
|
|
17
|
+
/** @deprecated NOOP, don't use. */
|
|
18
|
+
export declare function callMicrotasks(): void;
|
|
19
|
+
//# 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,uBAAuB,CAAC;AAE/B,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;AAE9D,mCAAmC;AACnC,wBAAgB,cAAc,IAAI,IAAI,CAGrC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { DynamicFlagName, StaticFeatureFlagsSchema } from './types';
|
|
2
|
+
export declare function getStaticFeatureFlag(_name: keyof StaticFeatureFlagsSchema): boolean;
|
|
3
|
+
export declare function setDynamicFeatureFlag(_name: DynamicFlagName, _value: boolean): void;
|
|
4
|
+
export declare function getDynamicFeatureFlag(_name: DynamicFlagName): boolean;
|
|
5
|
+
//# sourceMappingURL=featureFlags.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"featureFlags.d.ts","sourceRoot":"","sources":["../../../src/featureFlags/featureFlags.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,wBAAwB,EAAE,MAAM,SAAS,CAAC;AAEzE,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,MAAM,wBAAwB,GACpC,OAAO,CAET;AAED,wBAAgB,qBAAqB,CACnC,KAAK,EAAE,eAAe,EACtB,MAAM,EAAE,OAAO,GACd,IAAI,CAEN;AAED,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,eAAe,GAAG,OAAO,CAErE"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { DynamicFlagName, DynamicFlagsType, StaticFeatureFlagsSchema } from './types';
|
|
2
|
+
export declare const DynamicFlags: DynamicFlagsType;
|
|
3
|
+
export declare function setDynamicFeatureFlag(name: DynamicFlagName, value: boolean): void;
|
|
4
|
+
export declare function getDynamicFeatureFlag(name: DynamicFlagName): boolean;
|
|
5
|
+
export declare function getStaticFeatureFlag(name: keyof StaticFeatureFlagsSchema): boolean;
|
|
6
|
+
//# sourceMappingURL=featureFlags.native.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"featureFlags.native.d.ts","sourceRoot":"","sources":["../../../src/featureFlags/featureFlags.native.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,eAAe,EACf,gBAAgB,EAChB,wBAAwB,EACzB,MAAM,SAAS,CAAC;AAEjB,eAAO,MAAM,YAAY,EAAE,gBAiC1B,CAAC;AAIF,wBAAgB,qBAAqB,CACnC,IAAI,EAAE,eAAe,EACrB,KAAK,EAAE,OAAO,GACb,IAAI,CAEN;AAGD,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,eAAe,GAAG,OAAO,CAEpE;AAID,wBAAgB,oBAAoB,CAClC,IAAI,EAAE,MAAM,wBAAwB,GACnC,OAAO,CAOT"}
|