/** * Minimal STRUCTURAL types for the pdf.js objects this library touches. * * Deliberately local instead of importing pdfjs-dist's own types: the core has * always kept pdfjs-dist out of its published type surface (see the local * PDFDocumentProxy in core/PdfDocument.ts), and these interfaces only declare * the members our seams actually use, so a pdfjs-dist upgrade that keeps these * members type-checks unchanged. */ /** The subset of pdf.js PageViewport the library reads. */ export interface PdfJsViewport { width: number; height: number; [key: string]: unknown; } /** One text run from pdf.js getTextContent(). */ export interface PdfJsTextItem { str?: string; dir?: string; transform: number[]; width?: number; height?: number; fontName?: string; hasEOL?: boolean; } /** The subset of pdf.js PDFPageProxy the library calls. */ export interface PdfJsPage { getViewport(options: { scale: number; }): PdfJsViewport; getTextContent(options?: Record): Promise<{ items: PdfJsTextItem[]; styles?: Record; }>; getAnnotations(options?: Record): Promise>>; getOperatorList(): Promise<{ fnArray: number[]; argsArray: any[][]; }>; render(options: Record): { promise: Promise; }; objs: { get(objectId: string, callback?: (obj: unknown) => void): unknown; has(objectId: string): boolean; }; commonObjs: { get(objectId: string, callback?: (obj: unknown) => void): unknown; has(objectId: string): boolean; }; cleanup?(): void; _pageIndex?: number; [key: string]: unknown; } //# sourceMappingURL=pdfjs.types.d.ts.map