import { Value, type TNode, SplitValue } from '@tempots/dom'; import type { PDFDocumentProxy } from 'pdfjs-dist/types/src/display/api'; export type PDFDocument = PDFDocumentProxy; interface LoadCompleteOptions { pdfDoc: PDFDocument; } export interface PdfPageViewerOptions { /** PDF source: URL string, Uint8Array, or ArrayBuffer */ source: SplitValue; /** * Page number to display (1-based) * @default 1 */ page?: Value; /** * How the PDF should fit in the available space: * - 'none': Use explicit scale value (see scale option) * - 'width': Fit to container width while maintaining aspect ratio * - 'height': Fit to container height while maintaining aspect ratio * - 'contain': Fit entire page in container (like CSS object-fit: contain) * - 'cover': Fill container, may crop (like CSS object-fit: cover) * @default 'width' */ fit?: Value<'none' | 'width' | 'height' | 'contain' | 'cover'>; /** * Explicit scale factor when fit='none' * Ignored when fit is not 'none' * @default 1 */ scale?: Value; /** * Rotation angle in degrees (0, 90, 180, 270) * @default 0 */ rotation?: Value<0 | 90 | 180 | 270>; /** * Rendering quality/pixel density multiplier * Higher values produce sharper images but use more memory * @default 2 */ quality?: Value; /** * Enable text selection layer overlay * Default: true */ renderTextLayer?: Value; /** * Enable annotation layer (forms, links, etc.) * Default: false */ renderAnnotationLayer?: Value; /** * Callback when page changes */ onPageChange?: (page: number) => void; /** * Callback when PDF loads successfully */ onLoadComplete?: (info: LoadCompleteOptions) => void; } /** * PdfPageViewer component that displays a single PDF page as a canvas element. * Lazy loads pdf.js library only when mounted. * Returns a canvas element directly - you can pass additional attributes as rest parameters. * Automatically adapts to container size when scale is 'fit' or 'fill'. * * @example * PdfPageViewer({ source: pdfUrl, page: 1 }, attr.class('my-canvas')) */ export declare function PdfPageViewer({ source, page, fit, scale, rotation, quality, renderTextLayer, renderAnnotationLayer, onPageChange, onLoadComplete, }: PdfPageViewerOptions, ...children: TNode[]): import("@tempots/core").Renderable; export {};