ente/web/packages/next/worker/worker-bridge.ts

13 lines
467 B
TypeScript
Raw Normal View History

2024-04-08 07:10:03 +00:00
import { wrap } from "comlink";
2024-04-08 15:08:59 +00:00
import type { WorkerBridge } from "./comlink-worker";
2024-04-08 07:10:03 +00:00
/**
* 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
2024-04-08 15:08:59 +00:00
* implementation of the {@link WorkerBridge} in `comlink-worker.ts`.
2024-04-08 07:10:03 +00:00
*/
2024-04-08 07:20:11 +00:00
export const workerBridge = wrap<WorkerBridge>(globalThis);