UNPKG

web-worker-helper

Version:

Utilities for running tasks on worker threads

19 lines (18 loc) 705 B
import type { WorkerObject, WorkerOptions, WorkerContext } from '../types'; type ProcessOnWorkerOptions = WorkerOptions & { jobName?: string; [key: string]: any; }; /** * Determines if we can parse with worker * @param loader * @param data * @param options */ export declare function canProcessOnWorker(worker: WorkerObject, options?: WorkerOptions): boolean; /** * This function expects that the worker thread sends certain messages, * Creating such a worker can be automated if the worker is wrapper by a call to createWorker */ export declare function processOnWorker(worker: WorkerObject, data: any, options?: ProcessOnWorkerOptions, context?: WorkerContext): Promise<any>; export {};