@xylabs/threads
Version:
Web workers & worker threads as simple as a function call
10 lines • 702 B
TypeScript
import type { AbstractedWorkerAPI, WorkerFunction, WorkerModule } from '../types/worker.ts';
import type { WorkerGlobalScope } from './WorkerGlobalScope.ts';
/**
* Create an `expose()` function bound to a specific worker API implementation and global scope.
* @param implementation - The abstracted worker API for communicating with the master thread.
* @param self - The worker's global scope for subscribing to error events.
* @returns The `expose()` function that workers call to register their API.
*/
export declare function createExpose(implementation: AbstractedWorkerAPI, self: WorkerGlobalScope): (exposed: WorkerFunction | WorkerModule<any>) => void;
//# sourceMappingURL=expose.d.ts.map