'use strict'; // This file works by accident - currently Builder Bob doesn't move `.d.ts` files to output types. // If it ever breaks, we should address it so we'd not pollute the user's global namespace. import type { callGuardDEV } from './callGuard'; import type { reportFatalRemoteError } from './debug/errors'; import type { CustomSerializableUnpacker } from './memory/customSerializableUnpacker'; import type { makeShareableCloneOnUIRecursive } from './memory/serializable'; import type { ShareableGuestUnpacker } from './memory/shareableGuestUnpacker'; import type { ShareableHostUnpacker } from './memory/shareableHostUnpacker'; import type { SynchronizableUnpacker } from './memory/synchronizableUnpacker'; import type { CustomSerializationRegistry } from './memory/types'; import type { Queue } from './runLoop/workletRuntime/taskQueue'; import type { ValueUnpacker } from './types'; import type { WorkletsModuleProxy } from './WorkletsModule/workletsModuleProxy'; declare global { /** The only runtime-available require method is `__r` defined by Metro. */ var __r: ((moduleId: number) => Record) & Record; var _toString: (value: unknown) => string; var __workletsModuleProxy: WorkletsModuleProxy; var _WORKLETS_BUNDLE_MODE_ENABLED: boolean | undefined; var _WORKLETS_VERSION_CPP: string | undefined; var _WORKLETS_VERSION_JS: string | undefined; var _createSerializable: ( value: T, nativeStateSource?: object ) => FlatSerializableRef; var _createSerializableString: (value: string) => FlatSerializableRef; var _createSerializableNumber: (value: number) => FlatSerializableRef; var _createSerializableBoolean: ( value: boolean ) => FlatSerializableRef; var _createSerializableBigInt: (value: bigint) => FlatSerializableRef; var _createSerializableUndefined: () => FlatSerializableRef; var _createSerializableNull: () => FlatSerializableRef; var _createSerializableObject: ( value: T, shouldRetainRemote: boolean, nativeStateSource?: object ) => FlatSerializableRef; var _createSerializableHostObject: ( value: T ) => FlatSerializableRef; var _createSerializableWorklet: ( value: object, shouldPersistRemote: boolean ) => FlatSerializableRef; var _createSerializableArray: ( value: unknown[] ) => FlatSerializableRef; var _createSerializableInitializer: ( value: object ) => FlatSerializableRef; var _createSerializableSynchronizable: ( value: object ) => FlatShareableRef; /** Only outside of Bundle Mode on Worklet Runtimes. */ var __serializer: typeof makeShareableCloneOnUIRecursive; var __callMicrotasks: () => void; var _scheduleHostFunctionOnJS: (fun: (...args: A) => R, args?: A) => void; var _scheduleRemoteFunctionOnJS: (fun: (...args: A) => R, args?: A) => void; /** Available only on RN Runtime */ var __reportFatalRemoteError: typeof reportFatalRemoteError | undefined; var __valueUnpacker: ValueUnpacker; var __synchronizableUnpacker: SynchronizableUnpacker; var __customSerializationRegistry: CustomSerializationRegistry; var __customSerializableUnpacker: CustomSerializableUnpacker; var __callGuardDEV: typeof callGuardDEV | undefined; /** @deprecated Don't flush animation frames imperatively. Don't use. */ var __flushAnimationFrame: (timestamp: number) => void; var __frameTimestamp: number | undefined; var _log: (value: unknown) => void; var _startProfiling: (meanHzFreq?: number) => void; var _stopProfiling: () => string; var _beginSection: (name: string) => void; var _endSection: () => void; var _getAnimationTimestamp: () => number; var _scheduleOnRuntime: ( runtime: WorkletRuntime, worklet: SerializableRef<() => void> ) => void; var _microtaskQueueFinalizers: (() => void)[]; var _scheduleTimeoutCallback: (delay: number, handlerId: number) => void; var __runTimeoutCallback: (handlerId: number) => void; var __flushMicrotasks: () => void; var _taskQueue: Queue; /** Only in Debug builds. */ var __hasNativeState: (value: object) => boolean; /** Only in Debug builds. */ var __isHostObject: (value: object) => boolean; var __shareableHostUnpacker: ShareableHostUnpacker; var __shareableGuestUnpacker: ShareableGuestUnpacker< unknown, unknown, unknown >; /** Only in Bundle Mode on Worklet Runtimes. */ var TurboModules: Map; interface NodeRequire { resolveWeak(id: string): number; getModules(): Map; } }