import type { ProofWorkerJobType, ProofWorkerPayloads, ProofWorkerResults } from "./workerTypes.js"; /** * Options for creating a ZkpWorkerClient. */ export interface ZkpWorkerClientOptions { /** Custom worker factory for testing */ createWorker?: () => Worker; } /** * Client for running ZKP proof jobs in a Web Worker. * Manages worker lifecycle, job queue, and error handling. */ export declare class ZkpWorkerClient { private worker; private failed; private nextJobId; private readonly pendingJobs; private readonly createWorkerFn; constructor(options?: ZkpWorkerClientOptions); /** * Returns true if this client can run jobs (Worker API available and not failed). */ canUse(): boolean; /** * Runs a ZKP proof job in the worker. * * **Important:** Always await or catch the returned promise. * Calling `disable()` or `reset()` will reject pending jobs, * which can cause unhandled rejections if not properly awaited. * * @throws Error if worker is not available or has failed. */ runJob(type: T, payload: ProofWorkerPayloads[T]): Promise; /** * Disables the worker and rejects all pending jobs. */ disable(error?: unknown): void; /** * Resets the client to its initial state. Useful for testing. */ reset(): void; private ensureWorker; private handleMessage; private handleError; } //# sourceMappingURL=workerClient.d.ts.map