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

13 lines
459 B
TypeScript
Raw Normal View History

2024-04-08 07:10:03 +00:00
import { wrap } from "comlink";
import type { WorkerBridge } from "./comlinkWorker";
/**
* 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 `comlinkWorker.ts`.
*/
export const workerBridge = wrap<WorkerBridge>(self);