react-native-reanimated
Advanced tools
Comparing version 3.17.0-nightly-20241216-f35185521 to 3.17.0-nightly-20241217-c6d681516
@@ -5,5 +5,2 @@ project(Reanimated) | ||
set(CMAKE_EXPORT_COMPILE_COMMANDS ON) | ||
set(CMAKE_EXPORT_COMPILE_COMMANDS | ||
ON | ||
CACHE INTERNAL "") | ||
@@ -21,10 +18,9 @@ set(CMAKE_CXX_STANDARD 20) | ||
CMAKE_CXX_FLAGS | ||
" -DREACT_NATIVE_MINOR_VERSION=${REACT_NATIVE_MINOR_VERSION} -DREANIMATED_VERSION=${REANIMATED_VERSION} -DHERMES_ENABLE_DEBUGGER=${HERMES_ENABLE_DEBUGGER}" | ||
) | ||
" -DREACT_NATIVE_MINOR_VERSION=${REACT_NATIVE_MINOR_VERSION}\ | ||
-DREANIMATED_VERSION=${REANIMATED_VERSION}\ | ||
-DHERMES_ENABLE_DEBUGGER=${HERMES_ENABLE_DEBUGGER}") | ||
string( | ||
APPEND | ||
CMAKE_CXX_FLAGS | ||
" -fexceptions -fno-omit-frame-pointer -frtti -fstack-protector-all -std=c++${CMAKE_CXX_STANDARD} -Wall -Werror" | ||
) | ||
string(APPEND CMAKE_CXX_FLAGS | ||
" -fexceptions -fno-omit-frame-pointer -frtti -fstack-protector-all\ | ||
-std=c++${CMAKE_CXX_STANDARD} -Wall -Werror") | ||
@@ -56,3 +52,3 @@ if(${IS_NEW_ARCHITECTURE_ENABLED}) | ||
# configuration. | ||
set(ignoreMe "${JS_RUNTIME_DIR}") | ||
set(IGNORE_ME "${JS_RUNTIME_DIR}") | ||
@@ -59,0 +55,0 @@ set(BUILD_DIR "${CMAKE_SOURCE_DIR}/build") |
@@ -78,7 +78,4 @@ cmake_minimum_required(VERSION 3.8) | ||
target_include_directories(worklets PRIVATE "${JS_RUNTIME_DIR}/src") | ||
file( | ||
GLOB | ||
V8_SO_DIR | ||
"${JS_RUNTIME_DIR}/android/build/intermediates/library_jni/**/jni/${ANDROID_ABI}" | ||
) | ||
file(GLOB V8_SO_DIR "${JS_RUNTIME_DIR}/android/build/intermediates/\ | ||
library_jni/**/jni/${ANDROID_ABI}") | ||
find_library( | ||
@@ -85,0 +82,0 @@ V8EXECUTOR_LIB v8executor |
@@ -5,3 +5,2 @@ 'use strict'; | ||
import { SensorType } from "../../commonTypes.js"; | ||
import { mockedRequestAnimationFrame } from "../../mockedRequestAnimationFrame.js"; | ||
import { logger } from "../../logger/index.js"; | ||
@@ -13,7 +12,2 @@ import { ReanimatedError } from "../../errors.js"; | ||
} | ||
// In Node.js environments (like when static rendering with Expo Router) | ||
// requestAnimationFrame is unavailable, so we use our mock. | ||
// It also has to be mocked for Jest purposes (see `initializeUIRuntime`). | ||
const requestAnimationFrameImpl = isJest() || !globalThis.requestAnimationFrame ? mockedRequestAnimationFrame : globalThis.requestAnimationFrame; | ||
class JSReanimated { | ||
@@ -28,12 +22,2 @@ /** | ||
platform = undefined; | ||
scheduleOnUI(worklet) { | ||
// @ts-ignore web implementation has still not been updated after the rewrite, this will be addressed once the web implementation updates are ready | ||
requestAnimationFrameImpl(worklet); | ||
} | ||
createWorkletRuntime(_name, _initializer) { | ||
throw new ReanimatedError('createWorkletRuntime is not available in JSReanimated.'); | ||
} | ||
scheduleOnRuntime() { | ||
throw new ReanimatedError('scheduleOnRuntime is not available in JSReanimated.'); | ||
} | ||
registerEventHandler(_eventHandler, _eventName, _emitterReactTag) { | ||
@@ -224,5 +208,2 @@ throw new ReanimatedError('registerEventHandler is not available in JSReanimated.'); | ||
} | ||
executeOnUIRuntimeSync(_shareable) { | ||
throw new ReanimatedError('`executeOnUIRuntimeSync` is not available in JSReanimated.'); | ||
} | ||
} | ||
@@ -229,0 +210,0 @@ |
@@ -45,14 +45,2 @@ 'use strict'; | ||
} | ||
scheduleOnUI(shareable) { | ||
return this.#reanimatedModuleProxy.scheduleOnUI(shareable); | ||
} | ||
executeOnUIRuntimeSync(shareable) { | ||
return this.#reanimatedModuleProxy.executeOnUIRuntimeSync(shareable); | ||
} | ||
createWorkletRuntime(name, initializer) { | ||
return this.#reanimatedModuleProxy.createWorkletRuntime(name, initializer); | ||
} | ||
scheduleOnRuntime(workletRuntime, shareableWorklet) { | ||
return this.#reanimatedModuleProxy.scheduleOnRuntime(workletRuntime, shareableWorklet); | ||
} | ||
registerSensor(sensorType, interval, iosReferenceFrame, handler) { | ||
@@ -59,0 +47,0 @@ return this.#reanimatedModuleProxy.registerSensor(sensorType, interval, iosReferenceFrame, handler); |
@@ -7,5 +7,5 @@ 'use strict'; | ||
import { registerLoggerConfig } from "./logger/index.js"; | ||
import { ReanimatedModule } from './ReanimatedModule'; | ||
import { shouldBeUseWeb } from "./PlatformChecker.js"; | ||
import { makeShareableCloneOnUIRecursive, makeShareableCloneRecursive } from "./shareables.js"; | ||
import { WorkletsModule } from "./worklets/index.js"; | ||
const SHOULD_BE_USE_WEB = shouldBeUseWeb(); | ||
@@ -31,3 +31,3 @@ | ||
const config = __reanimatedLoggerConfig; | ||
return ReanimatedModule.createWorkletRuntime(name, makeShareableCloneRecursive(() => { | ||
return WorkletsModule.createWorkletRuntime(name, makeShareableCloneRecursive(() => { | ||
'worklet'; | ||
@@ -59,3 +59,3 @@ | ||
} | ||
return (...args) => ReanimatedModule.scheduleOnRuntime(workletRuntime, makeShareableCloneRecursive(() => { | ||
return (...args) => WorkletsModule.scheduleOnRuntime(workletRuntime, makeShareableCloneRecursive(() => { | ||
'worklet'; | ||
@@ -62,0 +62,0 @@ |
@@ -7,3 +7,3 @@ 'use strict'; | ||
import { ReanimatedError } from "./errors.js"; | ||
import { ReanimatedModule } from './ReanimatedModule'; | ||
import { WorkletsModule } from "./worklets/index.js"; | ||
const IS_JEST = isJest(); | ||
@@ -90,3 +90,3 @@ const SHOULD_BE_USE_WEB = shouldBeUseWeb(); | ||
// uses that we currently have but may not be ok for future tests that we write. | ||
ReanimatedModule.scheduleOnUI(makeShareableCloneRecursive(() => { | ||
WorkletsModule.scheduleOnUI(makeShareableCloneRecursive(() => { | ||
'worklet'; | ||
@@ -112,3 +112,3 @@ | ||
_runOnUIQueue = []; | ||
ReanimatedModule.scheduleOnUI(makeShareableCloneRecursive(() => { | ||
WorkletsModule.scheduleOnUI(makeShareableCloneRecursive(() => { | ||
'worklet'; | ||
@@ -131,3 +131,3 @@ | ||
return (...args) => { | ||
return ReanimatedModule.executeOnUIRuntimeSync(makeShareableCloneRecursive(() => { | ||
return WorkletsModule.executeOnUIRuntimeSync(makeShareableCloneRecursive(() => { | ||
'worklet'; | ||
@@ -154,3 +154,3 @@ | ||
return (...args) => { | ||
ReanimatedModule.scheduleOnUI(makeShareableCloneRecursive(() => { | ||
WorkletsModule.scheduleOnUI(makeShareableCloneRecursive(() => { | ||
'worklet'; | ||
@@ -157,0 +157,0 @@ |
'use strict'; | ||
import { ReanimatedError } from "../../errors.js"; | ||
import { mockedRequestAnimationFrame } from "../../mockedRequestAnimationFrame.js"; | ||
import { isJest } from "../../PlatformChecker.js"; | ||
export function createJSWorkletsModule() { | ||
return new JSWorklets(); | ||
} | ||
// In Node.js environments (like when static rendering with Expo Router) | ||
// requestAnimationFrame is unavailable, so we use our mock. | ||
// It also has to be mocked for Jest purposes (see `initializeUIRuntime`). | ||
const requestAnimationFrameImpl = isJest() || !globalThis.requestAnimationFrame ? mockedRequestAnimationFrame : globalThis.requestAnimationFrame; | ||
class JSWorklets { | ||
@@ -11,3 +18,17 @@ makeShareableClone() { | ||
} | ||
scheduleOnUI(worklet) { | ||
// @ts-ignore web implementation has still not been updated after the rewrite, | ||
// this will be addressed once the web implementation updates are ready | ||
requestAnimationFrameImpl(worklet); | ||
} | ||
executeOnUIRuntimeSync(_shareable) { | ||
throw new ReanimatedError('`executeOnUIRuntimeSync` is not available in JSReanimated.'); | ||
} | ||
createWorkletRuntime(_name, _initializer) { | ||
throw new ReanimatedError('createWorkletRuntime is not available in JSReanimated.'); | ||
} | ||
scheduleOnRuntime() { | ||
throw new ReanimatedError('scheduleOnRuntime is not available in JSReanimated.'); | ||
} | ||
} | ||
//# sourceMappingURL=JSWorklets.js.map |
@@ -25,3 +25,15 @@ 'use strict'; | ||
} | ||
scheduleOnUI(shareable) { | ||
return this.#workletsModuleProxy.scheduleOnUI(shareable); | ||
} | ||
executeOnUIRuntimeSync(shareable) { | ||
return this.#workletsModuleProxy.executeOnUIRuntimeSync(shareable); | ||
} | ||
createWorkletRuntime(name, initializer) { | ||
return this.#workletsModuleProxy.createWorkletRuntime(name, initializer); | ||
} | ||
scheduleOnRuntime(workletRuntime, shareableWorklet) { | ||
return this.#workletsModuleProxy.scheduleOnRuntime(workletRuntime, shareableWorklet); | ||
} | ||
} | ||
//# sourceMappingURL=NativeWorklets.js.map |
@@ -5,5 +5,8 @@ /// <reference types="react" /> | ||
import type { ReanimatedModuleProxy } from './ReanimatedModule'; | ||
type DisallowKeysOf<TInterface> = { | ||
[TKey in keyof TInterface]?: never; | ||
}; | ||
export interface IWorkletsModule extends WorkletsModuleProxy { | ||
} | ||
export interface IReanimatedModule extends Omit<ReanimatedModuleProxy, 'getViewProp'> { | ||
export interface IReanimatedModule extends Omit<ReanimatedModuleProxy, 'getViewProp'>, DisallowKeysOf<IWorkletsModule> { | ||
getViewProp<TValue>(viewTag: number, propName: string, component: React.Component | undefined, callback?: (result: TValue) => void): Promise<TValue>; | ||
@@ -10,0 +13,0 @@ } |
import type { ShareableRef, ShadowNodeWrapper, Value3D, ValueRotation, LayoutAnimationBatchItem, WorkletFunction } from '../commonTypes'; | ||
import type { WorkletRuntime } from '../runtimes'; | ||
/** Type of `__reanimatedModuleProxy` injected with JSI. */ | ||
export interface ReanimatedModuleProxy { | ||
scheduleOnUI<T>(shareable: ShareableRef<T>): void; | ||
executeOnUIRuntimeSync<T, R>(shareable: ShareableRef<T>): R; | ||
createWorkletRuntime(name: string, initializer: ShareableRef<() => void>): WorkletRuntime; | ||
scheduleOnRuntime<T>(workletRuntime: WorkletRuntime, worklet: ShareableRef<T>): void; | ||
registerEventHandler<T>(eventHandler: ShareableRef<T>, eventName: string, emitterReactTag: number): number; | ||
@@ -10,0 +5,0 @@ unregisterEventHandler(id: number): void; |
import type { ShareableRef } from '../../commonTypes'; | ||
import type { WorkletRuntime } from '../../runtimes'; | ||
/** Type of `__workletsModuleProxy` injected with JSI. */ | ||
export interface WorkletsModuleProxy { | ||
makeShareableClone<TValue>(value: TValue, shouldPersistRemote: boolean, nativeStateSource?: object): ShareableRef<TValue>; | ||
scheduleOnUI<TValue>(shareable: ShareableRef<TValue>): void; | ||
executeOnUIRuntimeSync<TValue, TReturn>(shareable: ShareableRef<TValue>): TReturn; | ||
createWorkletRuntime(name: string, initializer: ShareableRef<() => void>): WorkletRuntime; | ||
scheduleOnRuntime<TValue>(workletRuntime: WorkletRuntime, worklet: ShareableRef<TValue>): void; | ||
} | ||
//# sourceMappingURL=workletsModuleProxy.d.ts.map |
{ | ||
"name": "react-native-reanimated", | ||
"version": "3.17.0-nightly-20241216-f35185521", | ||
"version": "3.17.0-nightly-20241217-c6d681516", | ||
"description": "More powerful alternative to Animated library for React Native.", | ||
@@ -5,0 +5,0 @@ "scripts": { |
@@ -16,3 +16,2 @@ <img src="https://user-images.githubusercontent.com/16062886/117443145-ff868480-af37-11eb-8680-648bccf0d0ce.png" alt="React Native Reanimated by Software Mansion" width="100%"> | ||
[![Reanimated compatibility check](https://github.com/software-mansion/react-native-reanimated/actions/workflows/reanimated-compatibility-check-nightly.yml/badge.svg)](https://github.com/software-mansion/react-native-reanimated/actions/workflows/reanimated-compatibility-check-nightly.yml) | ||
[![Monorepo app Reanimated build check](https://github.com/software-mansion/react-native-reanimated/actions/workflows/monorepo-app-reanimated-build-check-nightly.yml/badge.svg)](https://github.com/software-mansion/react-native-reanimated/actions/workflows/monorepo-app-reanimated-build-check-nightly.yml) | ||
[![Static framework Reanimated build check](https://github.com/software-mansion/react-native-reanimated/actions/workflows/static-framework-reanimated-build-check-nightly.yml/badge.svg)](https://github.com/software-mansion/react-native-reanimated/actions/workflows/static-framework-reanimated-build-check-nightly.yml) | ||
@@ -19,0 +18,0 @@ [![React Native nightly Reanimated build check](https://github.com/software-mansion/react-native-reanimated/actions/workflows/react-native-nightly-reanimated-build-check-nightly.yml/badge.svg)](https://github.com/software-mansion/react-native-reanimated/actions/workflows/react-native-nightly-reanimated-build-check-nightly.yml) |
@@ -11,6 +11,10 @@ 'use strict'; | ||
type DisallowKeysOf<TInterface> = { | ||
[TKey in keyof TInterface]?: never; | ||
}; | ||
export interface IWorkletsModule extends WorkletsModuleProxy {} | ||
export interface IReanimatedModule | ||
extends Omit<ReanimatedModuleProxy, 'getViewProp'> { | ||
extends Omit<ReanimatedModuleProxy, 'getViewProp'>, | ||
DisallowKeysOf<IWorkletsModule> { | ||
getViewProp<TValue>( | ||
@@ -17,0 +21,0 @@ viewTag: number, |
@@ -7,2 +7,2 @@ 'use strict'; | ||
*/ | ||
export const jsVersion = '3.17.0-nightly-20241216-f35185521'; | ||
export const jsVersion = '3.17.0-nightly-20241217-c6d681516'; |
@@ -18,4 +18,2 @@ 'use strict'; | ||
import type { WebSensor } from './WebSensor'; | ||
import { mockedRequestAnimationFrame } from '../../mockedRequestAnimationFrame'; | ||
import type { WorkletRuntime } from '../../runtimes'; | ||
import { logger } from '../../logger'; | ||
@@ -29,10 +27,2 @@ import { ReanimatedError } from '../../errors'; | ||
// In Node.js environments (like when static rendering with Expo Router) | ||
// requestAnimationFrame is unavailable, so we use our mock. | ||
// It also has to be mocked for Jest purposes (see `initializeUIRuntime`). | ||
const requestAnimationFrameImpl = | ||
isJest() || !globalThis.requestAnimationFrame | ||
? mockedRequestAnimationFrame | ||
: globalThis.requestAnimationFrame; | ||
class JSReanimated implements IReanimatedModule { | ||
@@ -48,22 +38,2 @@ /** | ||
scheduleOnUI<T>(worklet: ShareableRef<T>) { | ||
// @ts-ignore web implementation has still not been updated after the rewrite, this will be addressed once the web implementation updates are ready | ||
requestAnimationFrameImpl(worklet); | ||
} | ||
createWorkletRuntime( | ||
_name: string, | ||
_initializer: ShareableRef<() => void> | ||
): WorkletRuntime { | ||
throw new ReanimatedError( | ||
'createWorkletRuntime is not available in JSReanimated.' | ||
); | ||
} | ||
scheduleOnRuntime() { | ||
throw new ReanimatedError( | ||
'scheduleOnRuntime is not available in JSReanimated.' | ||
); | ||
} | ||
registerEventHandler<T>( | ||
@@ -299,8 +269,2 @@ _eventHandler: ShareableRef<T>, | ||
} | ||
executeOnUIRuntimeSync<T, R>(_shareable: ShareableRef<T>): R { | ||
throw new ReanimatedError( | ||
'`executeOnUIRuntimeSync` is not available in JSReanimated.' | ||
); | ||
} | ||
} | ||
@@ -307,0 +271,0 @@ |
@@ -13,3 +13,2 @@ 'use strict'; | ||
import { jsVersion } from '../platform-specific/jsVersion'; | ||
import type { WorkletRuntime } from '../runtimes'; | ||
import { isFabric } from '../PlatformChecker'; | ||
@@ -69,24 +68,2 @@ import type React from 'react'; | ||
scheduleOnUI<T>(shareable: ShareableRef<T>) { | ||
return this.#reanimatedModuleProxy.scheduleOnUI(shareable); | ||
} | ||
executeOnUIRuntimeSync<T, R>(shareable: ShareableRef<T>): R { | ||
return this.#reanimatedModuleProxy.executeOnUIRuntimeSync(shareable); | ||
} | ||
createWorkletRuntime(name: string, initializer: ShareableRef<() => void>) { | ||
return this.#reanimatedModuleProxy.createWorkletRuntime(name, initializer); | ||
} | ||
scheduleOnRuntime<T>( | ||
workletRuntime: WorkletRuntime, | ||
shareableWorklet: ShareableRef<T> | ||
) { | ||
return this.#reanimatedModuleProxy.scheduleOnRuntime( | ||
workletRuntime, | ||
shareableWorklet | ||
); | ||
} | ||
registerSensor( | ||
@@ -93,0 +70,0 @@ sensorType: number, |
@@ -11,20 +11,5 @@ 'use strict'; | ||
} from '../commonTypes'; | ||
import type { WorkletRuntime } from '../runtimes'; | ||
/** Type of `__reanimatedModuleProxy` injected with JSI. */ | ||
export interface ReanimatedModuleProxy { | ||
scheduleOnUI<T>(shareable: ShareableRef<T>): void; | ||
executeOnUIRuntimeSync<T, R>(shareable: ShareableRef<T>): R; | ||
createWorkletRuntime( | ||
name: string, | ||
initializer: ShareableRef<() => void> | ||
): WorkletRuntime; | ||
scheduleOnRuntime<T>( | ||
workletRuntime: WorkletRuntime, | ||
worklet: ShareableRef<T> | ||
): void; | ||
registerEventHandler<T>( | ||
@@ -31,0 +16,0 @@ eventHandler: ShareableRef<T>, |
@@ -7,3 +7,2 @@ 'use strict'; | ||
import { registerLoggerConfig } from './logger'; | ||
import { ReanimatedModule } from './ReanimatedModule'; | ||
import { shouldBeUseWeb } from './PlatformChecker'; | ||
@@ -14,2 +13,3 @@ import { | ||
} from './shareables'; | ||
import { WorkletsModule } from './worklets'; | ||
@@ -48,3 +48,3 @@ const SHOULD_BE_USE_WEB = shouldBeUseWeb(); | ||
const config = __reanimatedLoggerConfig; | ||
return ReanimatedModule.createWorkletRuntime( | ||
return WorkletsModule.createWorkletRuntime( | ||
name, | ||
@@ -92,3 +92,3 @@ makeShareableCloneRecursive(() => { | ||
return (...args) => | ||
ReanimatedModule.scheduleOnRuntime( | ||
WorkletsModule.scheduleOnRuntime( | ||
workletRuntime, | ||
@@ -95,0 +95,0 @@ makeShareableCloneRecursive(() => { |
@@ -10,3 +10,3 @@ 'use strict'; | ||
import { ReanimatedError } from './errors'; | ||
import { ReanimatedModule } from './ReanimatedModule'; | ||
import { WorkletsModule } from './worklets'; | ||
@@ -105,3 +105,3 @@ const IS_JEST = isJest(); | ||
// uses that we currently have but may not be ok for future tests that we write. | ||
ReanimatedModule.scheduleOnUI( | ||
WorkletsModule.scheduleOnUI( | ||
makeShareableCloneRecursive(() => { | ||
@@ -128,3 +128,3 @@ 'worklet'; | ||
_runOnUIQueue = []; | ||
ReanimatedModule.scheduleOnUI( | ||
WorkletsModule.scheduleOnUI( | ||
makeShareableCloneRecursive(() => { | ||
@@ -153,3 +153,3 @@ 'worklet'; | ||
return (...args) => { | ||
return ReanimatedModule.executeOnUIRuntimeSync( | ||
return WorkletsModule.executeOnUIRuntimeSync( | ||
makeShareableCloneRecursive(() => { | ||
@@ -184,3 +184,3 @@ 'worklet'; | ||
return (...args) => { | ||
ReanimatedModule.scheduleOnUI( | ||
WorkletsModule.scheduleOnUI( | ||
makeShareableCloneRecursive(() => { | ||
@@ -187,0 +187,0 @@ 'worklet'; |
@@ -5,2 +5,5 @@ 'use strict'; | ||
import { ReanimatedError } from '../../errors'; | ||
import { mockedRequestAnimationFrame } from '../../mockedRequestAnimationFrame'; | ||
import { isJest } from '../../PlatformChecker'; | ||
import type { WorkletRuntime } from '../../runtimes'; | ||
@@ -11,4 +14,12 @@ export function createJSWorkletsModule(): IWorkletsModule { | ||
// In Node.js environments (like when static rendering with Expo Router) | ||
// requestAnimationFrame is unavailable, so we use our mock. | ||
// It also has to be mocked for Jest purposes (see `initializeUIRuntime`). | ||
const requestAnimationFrameImpl = | ||
isJest() || !globalThis.requestAnimationFrame | ||
? mockedRequestAnimationFrame | ||
: globalThis.requestAnimationFrame; | ||
class JSWorklets implements IWorkletsModule { | ||
makeShareableClone<T>(): ShareableRef<T> { | ||
makeShareableClone<TValue>(): ShareableRef<TValue> { | ||
throw new ReanimatedError( | ||
@@ -18,2 +29,29 @@ 'makeShareableClone should never be called in JSWorklets.' | ||
} | ||
scheduleOnUI<TValue>(worklet: ShareableRef<TValue>) { | ||
// @ts-ignore web implementation has still not been updated after the rewrite, | ||
// this will be addressed once the web implementation updates are ready | ||
requestAnimationFrameImpl(worklet); | ||
} | ||
executeOnUIRuntimeSync<T, R>(_shareable: ShareableRef<T>): R { | ||
throw new ReanimatedError( | ||
'`executeOnUIRuntimeSync` is not available in JSReanimated.' | ||
); | ||
} | ||
createWorkletRuntime( | ||
_name: string, | ||
_initializer: ShareableRef<() => void> | ||
): WorkletRuntime { | ||
throw new ReanimatedError( | ||
'createWorkletRuntime is not available in JSReanimated.' | ||
); | ||
} | ||
scheduleOnRuntime() { | ||
throw new ReanimatedError( | ||
'scheduleOnRuntime is not available in JSReanimated.' | ||
); | ||
} | ||
} |
@@ -5,4 +5,5 @@ 'use strict'; | ||
import { ReanimatedError } from '../../errors'; | ||
import type { IWorkletsModule } from '../../commonTypes'; | ||
import type { IWorkletsModule, ShareableRef } from '../../commonTypes'; | ||
import type { WorkletsModuleProxy } from './workletsModuleProxy'; | ||
import type { WorkletRuntime } from '../../runtimes'; | ||
@@ -30,4 +31,4 @@ export function createNativeWorkletsModule(): IWorkletsModule { | ||
makeShareableClone<T>( | ||
value: T, | ||
makeShareableClone<TValue>( | ||
value: TValue, | ||
shouldPersistRemote: boolean, | ||
@@ -42,2 +43,26 @@ nativeStateSource?: object | ||
} | ||
scheduleOnUI<TValue>(shareable: ShareableRef<TValue>) { | ||
return this.#workletsModuleProxy.scheduleOnUI(shareable); | ||
} | ||
executeOnUIRuntimeSync<TValue, TReturn>( | ||
shareable: ShareableRef<TValue> | ||
): TReturn { | ||
return this.#workletsModuleProxy.executeOnUIRuntimeSync(shareable); | ||
} | ||
createWorkletRuntime(name: string, initializer: ShareableRef<() => void>) { | ||
return this.#workletsModuleProxy.createWorkletRuntime(name, initializer); | ||
} | ||
scheduleOnRuntime<T>( | ||
workletRuntime: WorkletRuntime, | ||
shareableWorklet: ShareableRef<T> | ||
) { | ||
return this.#workletsModuleProxy.scheduleOnRuntime( | ||
workletRuntime, | ||
shareableWorklet | ||
); | ||
} | ||
} |
'use strict'; | ||
import type { ShareableRef } from '../../commonTypes'; | ||
import type { WorkletRuntime } from '../../runtimes'; | ||
@@ -12,2 +13,18 @@ /** Type of `__workletsModuleProxy` injected with JSI. */ | ||
): ShareableRef<TValue>; | ||
scheduleOnUI<TValue>(shareable: ShareableRef<TValue>): void; | ||
executeOnUIRuntimeSync<TValue, TReturn>( | ||
shareable: ShareableRef<TValue> | ||
): TReturn; | ||
createWorkletRuntime( | ||
name: string, | ||
initializer: ShareableRef<() => void> | ||
): WorkletRuntime; | ||
scheduleOnRuntime<TValue>( | ||
workletRuntime: WorkletRuntime, | ||
worklet: ShareableRef<TValue> | ||
): void; | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
3384917
50543
60