UNPKG

@evolu/web

Version:
17 lines 630 B
/** * Typed wrapper for Web Worker * * While Comlink DX is nice, there are still memory leaks and unresolved bugs. * Use plain Web Worker with a typed wrapper if maximum performance and * reliability are required. * * @module */ import { Worker } from "@evolu/common"; /** * Wraps a Web Worker to provide a typed interface for sending and receiving * messages. */ export declare const wrapWebWorker: <Input, Output>(createWebWorker: () => globalThis.Worker) => Worker<Input, Output>; export declare const wrapWebWorkerSelf: <Input, Output>(worker: Worker<Input, Output>) => void; //# sourceMappingURL=WebWorker.d.ts.map