UNPKG

623 BTypeScriptView Raw
1import { WorkerFunction, WorkerModule } from "../types/worker";
2export { registerSerializer } from "../common";
3export { Transfer } from "../transferable";
4/** Returns `true` if this code is currently running in a worker. */
5export declare const isWorkerRuntime: () => boolean;
6/**
7 * Expose a function or a module (an object whose values are functions)
8 * to the main thread. Must be called exactly once in every worker thread
9 * to signal its API to the main thread.
10 *
11 * @param exposed Function or object whose values are functions
12 */
13export declare function expose(exposed: WorkerFunction | WorkerModule<any>): void;