import { InputHighlightData, ViewerOptions } from '@epam/pdf-highlighter-kit'; import { FC, ReactNode } from 'react'; import { PdfViewerApi } from '../../models/pdf-viewer.models'; /** * Props for the high-level document preview component. * * The component handles file loading, optional cache integration, toolbar controls, * highlight navigation, and thumbnail generation. */ export interface DocumentPreviewProps { /** URL passed to {@link loadFileCb} to fetch the PDF file. */ fileUrl: string; /** Display name used for PDF type detection. Falls back to {@link fileUrl}. */ fileName?: string; /** * Caller-provided file loader. * If the cache provider is mounted, this callback is used as the cache miss loader. */ loadFileCb: (url: string) => Promise; /** Highlight data rendered by the underlying PDF viewer. */ highlights: InputHighlightData[]; /** Custom label shown when file loading fails. */ errorLabel?: ReactNode; /** Label used before the highlights occurrence counter. */ occurrencesLabel?: ReactNode; /** Label shown when the file type is not a supported PDF. */ unsupportedLabel?: ReactNode; /** Show occurrence counter in the toolbar. Default: `true`. */ showOccurrences?: boolean; /** Navigate viewer to this page when provided. */ selectedPageNumber?: number; /** Additional class name for the inner {@link PDFViewer} container. */ pdfViewerClassName?: string; /** Additional class name for the outer wrapper container. */ containerClassName?: string; /** Callback invoked when total page count is known. */ onTotalPagesChange?: (totalPages: number) => void; /** Optional title shown in the toolbar center. */ title?: string; /** Page numbers for which thumbnails should be generated in batches. */ thumbnailPageNumbers?: number[]; /** Called incrementally after each thumbnail batch resolves. */ onThumbnailsLoaded?: (map: Map) => void; /** Called when the underlying viewer is ready and its imperative API is available. */ onViewerReady?: (api: PdfViewerApi) => void; /** Forces the loading overlay visible while parent-level work is in progress. */ showLoaderOverlay?: boolean; /** Restricts viewer loading to selected pages only. */ selectedPages?: number[]; /** * Highlight id to navigate to. When `showOccurrences` is true the internal * occurrence counter takes precedence; pass this when `showOccurrences` is * false to drive navigation externally (e.g. from a results table). */ selectedHighlightId?: string; /** * Override or extend low-level viewer initialization options passed to `PDFViewer`. * Values are merged on top of the defaults (`enableTextSelection: true`, * `enableVirtualScrolling: true`, `bboxOrigin: 'top-left'`). */ viewerOptions?: ViewerOptions; } /** * High-level PDF preview component with toolbar, highlight navigation, zoom controls, * loading and error overlays, and optional thumbnail generation. */ export declare const DocumentPreview: FC;