Favivon - Correção

This commit is contained in:
2026-05-30 19:59:39 -03:00
parent 76ddaa815d
commit d7dfd221f0
32859 changed files with 5459654 additions and 404 deletions
+26
View File
@@ -0,0 +1,26 @@
import { type PromiseWorkerType, type WorkerInterfaceImplementation } from './worker-types';
export * from './worker-types';
/**
* Wraps a Regular worker into a `PromiseWorker`
*
* @param worker
* @returns
*/
export declare const getPromiseWorker: (worker: Worker) => PromiseWorkerType;
/**
* Returns an interface where methods of the worker can be called by the host site
*
* @example
* // this assumes a vite-like bundler understands the `?worker` import
* import GainMapWorker from '@monogrid/gainmap-js/worker?worker'
* import { getPromiseWorker, getWorkerInterface } from '@monogrid/gainmap-js/worker-interface'
*
* // turn our Worker into a PromiseWorker
* const promiseWorker = getPromiseWorker(new GainMapWorker())
* // get the interface
* const workerInterface = getWorkerInterface(promiseWorker)
*
* @param worker
* @returns
*/
export declare const getWorkerInterface: (worker: PromiseWorkerType) => WorkerInterfaceImplementation;