ente/web/packages/next/worker/worker-bridge.ts
Manav Rathi 5339b1aa89
Merge
2024-04-08 20:39:53 +05:30

13 lines
467 B
TypeScript

import { wrap } from "comlink";
import type { WorkerBridge } from "./comlink-worker";
/**
* The web worker side handle to the {@link WorkerBridge} exposed by the main
* thread.
*
* This file is meant to be run inside a worker. Accessing the properties of
* this object will be transparently (but asynchrorously) relayed to the
* implementation of the {@link WorkerBridge} in `comlink-worker.ts`.
*/
export const workerBridge = wrap<WorkerBridge>(globalThis);