/** Where the engine's assets live, as passed to a worker factory. */ export interface PdfWorkerUrls { /** Absolute URL of `pdfium_worker.js`, a classic worker script. */ workerUrl: string; /** * Absolute URL of `pdfium.wasm`. The worker script reads it from the global * `pdfiumWasmUrl`, which the bootstrap must define before running the script. * */ wasmUrl: string; } /** * The part of the Web Worker API this engine uses. A browser `Worker` satisfies * it as is; on hosts without one (Node) the engine wraps their equivalent. * */ export interface PdfWorkerLike { /** * Sends a protocol message to the worker. * * @param message - The structured-cloneable message. * @param transfer - Transferable objects whose ownership moves to the worker. */ postMessage(message: unknown, transfer: Transferable[]): void; terminate(): void; onmessage: ((event: { data: unknown; }) => void) | null; onerror: ((event: { message?: string; }) => void) | null; } /** * Where the engine's own `assets/` directory is, relative to this module — the * two are shipped side by side in the package, so on a host that can read the * package's files there is nothing for the caller to configure. * * A browser cannot: the assets have to be served, and a bundler will have * rewritten `import.meta.url` to point at the bundle by then, so callers there * say where they put them. * @internal * */ export declare function defaultWasmModulesUrl(): string; /** * What relative URLs resolve against when the caller does not say: the document * base URL in a browser, the current directory on a server runtime. * @internal * */ export declare function defaultBaseUrl(): string; /** * Runs `pdfium_worker.js` on whatever this host offers: a Web Worker in a * browser, a module worker on Bun/Deno (no `importScripts` there), or a * `node:worker_threads` worker on Node. * @internal * */ export declare function createDefaultWorker(urls: PdfWorkerUrls): PdfWorkerLike | Promise; //# sourceMappingURL=worker-host.d.ts.map