UNPKG

@vue-pdf-viewer/viewer

Version:

The PDF Viewer component for Vue 3 and Nuxt

27 lines (26 loc) 1.46 kB
import { ScrollMode, ViewMode } from './enumerators'; import { PDFSrc, VPdfViewerProps } from './types'; /** * Validates the scroll mode based on the view mode settings. * Some scroll modes are only compatible with certain view modes. * * @param args - Object containing initialViewMode and initialScrollMode * @param warn - Whether to show console warnings for invalid combinations (default: true) * @returns The validated scroll mode, defaulting to ScrollMode.Vertical if invalid */ export declare function getValidScrollMode(args: Pick<VPdfViewerProps, 'initialViewMode' | 'initialScrollMode'>, warn?: boolean): ScrollMode; /** * Validates the view mode based on the scroll mode settings. * Some view modes are only compatible with certain scroll modes. * * @param args - Object containing initialViewMode and initialScrollMode * @param warn - Whether to show console warnings for invalid combinations (default: true) * @returns The validated view mode, defaulting to ViewMode.SinglePage if invalid */ export declare function getValidViewMode(args: Pick<VPdfViewerProps, 'initialViewMode' | 'initialScrollMode'>, warn?: boolean): ViewMode; /** * Validates a PDF source (URL, Blob URL, or Vite-resolved file path). * @param source - The PDF source to validate. * @returns {Promise<boolean>} - Resolves to `true` if the source is valid, `false` otherwise. */ export declare function validatePDFSourceAsync(source?: PDFSrc): Promise<boolean>;