/** * Define a module of code that will be executed with a web worker. This provides a simple * interface for moving chunks of logic off the main thread, and managing their dependencies * among one another. * * @param {object} options * @param {function} options.init * @param {array} [options.dependencies] * @param {function} [options.getTransferables] * @param {string} [options.name] * @param {string} [options.workerId] * @return {function(...[*]): {then}} */ export function defineWorkerModule(options: { init: Function; dependencies?: any[]; getTransferables?: Function; name?: string; workerId?: string; }): (...args: [any][]) => { then: any; }; /** * Terminate an active Worker by a workerId that was passed to defineWorkerModule. * This only terminates the Worker itself; the worker module will remain available * and if you call it again its Worker will be respawned. * @param {string} workerId */ export function terminateWorker(workerId: string): void; /** * Stringifies a function into a form that can be deserialized in the worker * @param fn */ export function stringifyFunction(fn: any): any;