import type { DocumentLoader } from '../types.js'; /** * The slice of `unpdf` this loader uses — declared structurally, so a stub, a * pinned fork, or a future version satisfies it without this package taking a * hard type dependency on an optional peer. */ export interface UnpdfBackend { getDocumentProxy(data: Uint8Array): Promise; extractText(doc: unknown, options?: { mergePages?: boolean; }): Promise<{ totalPages: number; text: string | string[]; }>; } export interface PdfLoaderOptions { /** * An ALREADY-IMPORTED `unpdf`. Supply this and the lazy load never happens — * which is what makes the loader work in a BUNDLED app, where a bare * specifier reaches the runtime unresolved: * * ```ts * import * as unpdf from 'unpdf'; * pdfLoader({ backend: unpdf }); * ``` * * The same mechanism the embedders and the store adapters use: the library * states the surface it needs, the host owns the construction. */ readonly backend?: UnpdfBackend; } /** Raised when a PDF is met and `unpdf` is not installed. */ export declare class MissingPdfSupportError extends Error { readonly code: "ERR_MISSING_PDF_SUPPORT"; /** The file that could not be read. */ readonly uri: string; constructor(uri: string); } export declare function pdfLoader(options?: PdfLoaderOptions): DocumentLoader; //# sourceMappingURL=pdf.d.ts.map