web-worker-helper
Version:
Utilities for running tasks on worker threads
7 lines (6 loc) • 353 B
TypeScript
import type { WorkerContext, Process, ProcessInBatches } from '../types';
export type ProcessOnMainThread = (data: any, options?: Record<string, any>, context?: WorkerContext) => any;
/**
* Set up a WebWorkerGlobalScope to talk with the main thread
*/
export declare function createWorker(process: Process, processInBatches?: ProcessInBatches): void;