import type { GetOriginalSizeResult, Handle, RenderResult, RPCRequest, SerializableRenderParams } from "./protocol.js"; type DistributiveOmit = T extends unknown ? Omit : never; export type RPCRequestBody = DistributiveOmit; export declare class WorkerChannel { private nextId; private readonly pending; private readonly worker; private readonly objectUrl; constructor(worker: Worker, objectUrl: string | null); call(req: RPCRequestBody, transfer?: Transferable[]): Promise; terminate(): void; } export type PDFiumWorkerRenderParams = SerializableRenderParams; export type PDFiumWorkerRenderResult = RenderResult; export declare class PDFiumWorkerPage { readonly number: number; private readonly handle; private readonly channel; constructor(channel: WorkerChannel, handle: Handle, pageIndex: number); getText(): Promise; getOriginalSize(): Promise; render(options?: PDFiumWorkerRenderParams): Promise; } export declare class PDFiumWorkerDocument { private readonly handle; private readonly channel; constructor(channel: WorkerChannel, handle: Handle); getPageCount(): Promise; getPage(pageIndex: number): Promise; pages(): AsyncGenerator; destroy(): Promise; } export declare class PDFiumWorkerClientBase { protected readonly channel: WorkerChannel; constructor(channel: WorkerChannel); loadDocument(bytes: Uint8Array, password?: string): Promise; destroy(): Promise; } export type PDFiumWorkerSpawnInternalOptions = { workerSource: string; init: { wasmUrl?: string; wasmBinary?: ArrayBuffer; }; }; export declare function spawnWorkerChannel(opts: PDFiumWorkerSpawnInternalOptions): Promise; export {};