import type { WorkerMessageType, WorkerMessagePayload } from "../../types.js"; /** * Type safe wrapper for worker code */ export default class WorkerBody { /** Check that we are actually in a worker thread */ static inWorkerThread(): Promise; static set onmessage(onMessage: (type: WorkerMessageType, payload: WorkerMessagePayload) => any); static addEventListener(onMessage: (type: WorkerMessageType, payload: WorkerMessagePayload) => any): Promise; static removeEventListener(onMessage: (type: WorkerMessageType, payload: WorkerMessagePayload) => any): Promise; /** * Send a message from a worker to creating thread (main thread) * @param type * @param payload */ static postMessage(type: WorkerMessageType, payload: WorkerMessagePayload): Promise; } //# sourceMappingURL=worker-body.d.ts.map