export type PDFDocumentProxy = any; import { PdfPage } from './PdfPage.js'; /** * Wraps a PDF.js document. Pages are built lazily on first access and can be * released individually (via releasePage) or all at once (via releaseAll). * * Releasing a page calls pdf.js's PDFPageProxy.cleanup() to drop worker-side * state, then evicts the wrapper. The same page can be re-requested afterwards * and will be rebuilt on demand. */ export declare class PdfDocument { private proxy; private scale?; private pageCache; private destroyed; constructor(proxy: PDFDocumentProxy, scale?: number | undefined); /** * Kept for backwards compatibility. Previously eagerly loaded every page's * operator list at initialize time, which cost ~3-4 MB RSS per page. Now a * no-op besides progress reporting — pages are built lazily by getPage(). */ process(onProgress?: (event: { loaded: number; total: number; }) => void): Promise; getPage(pageNumber: number): Promise; /** * Release pdf.js worker-side state for a page and evict the wrapper from * the cache. Safe to call repeatedly; rebuild happens on next getPage(n). */ releasePage(pageNumber: number): Promise; /** * Release every cached page. Subsequent getPage() calls rebuild as needed. * Also asks pdf.js to drop its document-level caches (fonts, color spaces, * image dictionaries) which accumulate across pages and aren't reached by * per-page cleanup alone. */ releaseAll(): Promise; /** * Drop pdf.js's document-level caches without destroying the document. * Safe to call between page batches in a long-running loop. */ cleanupCaches(): Promise; /** * Terminate the underlying PDF.js document. After destroy(), the instance * is unusable. Call this in a dispose() path. */ destroy(): Promise; getRawPage(pageNumber: number): Promise; getOutline(): any; getData(): any; get fingerprint(): any; get numPages(): any; get isDestroyed(): boolean; get rawProxy(): any; get pages(): PdfPage[]; } //# sourceMappingURL=PdfDocument.d.ts.map