UNPKG

@vue-pdf-viewer/viewer

Version:

The PDF Viewer component for Vue 3 and Nuxt

584 lines (583 loc) 23.4 kB
import type { AnnotationEventPayload, TextLayerLoadedEventPayload, RotateEvent, ToolbarOptions, Localization, PdfProperties } from '@/utils/types'; import { ScrollMode, ViewMode, ZoomLevel } from '@/utils/enumerators'; import '../style.scss'; declare const _default: { new (...args: any[]): import("vue").CreateComponentPublicInstanceWithMixins<Readonly<import("vue").ExtractPropTypes<{ readonly src: { readonly type: import("vue").PropType<string | import("@/utils/types").VPVSrc>; readonly required: true; }; readonly workerUrl: { readonly type: import("vue").PropType<string>; readonly default: undefined; }; readonly initialPage: { readonly type: import("vue").PropType<number>; readonly default: () => number; }; readonly initialScale: { readonly type: import("vue").PropType<number | ZoomLevel>; readonly default: () => ZoomLevel; }; readonly initialScrollMode: { readonly type: import("vue").PropType<ScrollMode>; readonly default: () => ScrollMode; readonly validator: (initialScrollMode: ScrollMode, args: unknown) => boolean; }; readonly initialViewMode: { readonly type: import("vue").PropType<ViewMode>; readonly default: () => ViewMode; readonly validator: (initialViewMode: ViewMode, args: unknown) => boolean; }; readonly initialRotation: { readonly type: import("vue").PropType<number>; readonly default: () => number; }; readonly initialThumbnailsVisible: { readonly type: import("vue").PropType<boolean>; readonly default: undefined; }; readonly textLayer: { readonly type: import("vue").PropType<boolean>; readonly default: () => boolean; }; readonly characterMap: { readonly type: import("vue").PropType<import("@/utils/types").CharacterMap>; readonly default: undefined; }; readonly toolbarOptions: { readonly type: import("vue").PropType<false | Partial<ToolbarOptions>>; readonly default: () => ToolbarOptions; }; readonly localization: { readonly type: import("vue").PropType<Record<string, Localization>>; readonly default: () => Record<string, Localization>; }; readonly initialSearch: { readonly type: StringConstructor; readonly default: undefined; }; readonly afterCanvasLoaded: { readonly type: import("vue").PropType<Record<number, import("@/utils/types").CanvasLoadedCallback>>; readonly default: undefined; }; readonly textHighlights: { readonly type: import("vue").PropType<import("@/utils/types").TextHighlight[]>; readonly default: undefined; readonly validator: (value: import("@/utils/types").TextHighlight[]) => boolean; }; readonly downloadFilename: { readonly type: StringConstructor; readonly default: undefined; }; }>> & Readonly<{ onAnnotation?: ((data: AnnotationEventPayload) => any) | undefined; onAnnotationLoaded?: ((annotations: any[]) => any) | undefined; onRotate?: ((rotateEvent: RotateEvent) => any) | undefined; onTextLoaded?: ((data: TextLayerLoadedEventPayload) => any) | undefined; onXfaLoaded?: (() => any) | undefined; onLoaded?: ((properties?: PdfProperties | undefined) => any) | undefined; onLoadError?: ((error: any) => any) | undefined; onLoading?: (() => any) | undefined; onLoadProgress?: ((progress: number) => any) | undefined; onAfterGoToPage?: ((progress: number) => any) | undefined; onPageChanged?: ((progress: number) => any) | undefined; }>, { highlightControl: { highlight: (args: import("@/utils/types").TextHighlight[]) => Promise<Record<string, import("@/utils/types").MatchHighlightResult[]>>; clear: () => void; }; printControl: { print: (options?: { visibleDefaultProgress: boolean; } | undefined) => void; cancel: () => void; onProgress?: ((progress: import("@/utils/types").PreparePrintProgress) => void) | undefined; onError?: ((error: Error) => void) | undefined; onComplete?: (() => void) | undefined; }; pageControl: { goToPage: (pageNumber: number) => void; totalPages: number; currentPage: number; }; searchControl: { searchMatches: { totalMatches: number; matches: { index: number; page: number; }[]; } | { totalMatches: number; matches: { index: number; page: number; }[]; }; searching: boolean; goToMatch: (index: number) => void; search: (value: string) => Promise<import("@/utils/types").MatchHighlightResult[]>; nextSearchMatch: () => void; prevSearchMatch: () => void; }; rotateControl: { rotateClockwise: () => void; rotateCounterclockwise: () => void; currentRotation: number; }; downloadControl: { download: () => void; onError?: ((error: Error) => void) | undefined; onComplete?: (() => void) | undefined; }; zoomControl: { scale: number; zoom: (scale: number | ZoomLevel) => void; }; }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, { annotation: (data: AnnotationEventPayload) => void; } & { loaded: (properties?: PdfProperties | undefined) => void; } & { loadError: (error: any) => void; } & { loading: () => void; } & { loadProgress: (progress: number) => void; } & { textLoaded: (data: TextLayerLoadedEventPayload) => void; } & { annotationLoaded: (annotations: any[]) => void; } & { xfaLoaded: () => void; } & { rotate: (rotateEvent: RotateEvent) => void; } & { afterGoToPage: (progress: number) => void; } & { pageChanged: (progress: number) => void; }, import("vue").PublicProps, { readonly initialViewMode: ViewMode; readonly initialScrollMode: ScrollMode; readonly workerUrl: string; readonly initialPage: number; readonly initialScale: number | ZoomLevel; readonly initialRotation: number; readonly initialThumbnailsVisible: boolean; readonly initialSearch: string; readonly textLayer: boolean; readonly characterMap: import("@/utils/types").CharacterMap; readonly toolbarOptions: false | Partial<ToolbarOptions>; readonly localization: Record<string, Localization>; readonly afterCanvasLoaded: Record<number, import("@/utils/types").CanvasLoadedCallback>; readonly textHighlights: import("@/utils/types").TextHighlight[]; readonly downloadFilename: string; }, true, {}, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, {}, any, import("vue").ComponentProvideOptions, { P: {}; B: {}; D: {}; C: {}; M: {}; Defaults: {}; }, Readonly<import("vue").ExtractPropTypes<{ readonly src: { readonly type: import("vue").PropType<string | import("@/utils/types").VPVSrc>; readonly required: true; }; readonly workerUrl: { readonly type: import("vue").PropType<string>; readonly default: undefined; }; readonly initialPage: { readonly type: import("vue").PropType<number>; readonly default: () => number; }; readonly initialScale: { readonly type: import("vue").PropType<number | ZoomLevel>; readonly default: () => ZoomLevel; }; readonly initialScrollMode: { readonly type: import("vue").PropType<ScrollMode>; readonly default: () => ScrollMode; readonly validator: (initialScrollMode: ScrollMode, args: unknown) => boolean; }; readonly initialViewMode: { readonly type: import("vue").PropType<ViewMode>; readonly default: () => ViewMode; readonly validator: (initialViewMode: ViewMode, args: unknown) => boolean; }; readonly initialRotation: { readonly type: import("vue").PropType<number>; readonly default: () => number; }; readonly initialThumbnailsVisible: { readonly type: import("vue").PropType<boolean>; readonly default: undefined; }; readonly textLayer: { readonly type: import("vue").PropType<boolean>; readonly default: () => boolean; }; readonly characterMap: { readonly type: import("vue").PropType<import("@/utils/types").CharacterMap>; readonly default: undefined; }; readonly toolbarOptions: { readonly type: import("vue").PropType<false | Partial<ToolbarOptions>>; readonly default: () => ToolbarOptions; }; readonly localization: { readonly type: import("vue").PropType<Record<string, Localization>>; readonly default: () => Record<string, Localization>; }; readonly initialSearch: { readonly type: StringConstructor; readonly default: undefined; }; readonly afterCanvasLoaded: { readonly type: import("vue").PropType<Record<number, import("@/utils/types").CanvasLoadedCallback>>; readonly default: undefined; }; readonly textHighlights: { readonly type: import("vue").PropType<import("@/utils/types").TextHighlight[]>; readonly default: undefined; readonly validator: (value: import("@/utils/types").TextHighlight[]) => boolean; }; readonly downloadFilename: { readonly type: StringConstructor; readonly default: undefined; }; }>> & Readonly<{ onAnnotation?: ((data: AnnotationEventPayload) => any) | undefined; onAnnotationLoaded?: ((annotations: any[]) => any) | undefined; onRotate?: ((rotateEvent: RotateEvent) => any) | undefined; onTextLoaded?: ((data: TextLayerLoadedEventPayload) => any) | undefined; onXfaLoaded?: (() => any) | undefined; onLoaded?: ((properties?: PdfProperties | undefined) => any) | undefined; onLoadError?: ((error: any) => any) | undefined; onLoading?: (() => any) | undefined; onLoadProgress?: ((progress: number) => any) | undefined; onAfterGoToPage?: ((progress: number) => any) | undefined; onPageChanged?: ((progress: number) => any) | undefined; }>, { highlightControl: { highlight: (args: import("@/utils/types").TextHighlight[]) => Promise<Record<string, import("@/utils/types").MatchHighlightResult[]>>; clear: () => void; }; printControl: { print: (options?: { visibleDefaultProgress: boolean; } | undefined) => void; cancel: () => void; onProgress?: ((progress: import("@/utils/types").PreparePrintProgress) => void) | undefined; onError?: ((error: Error) => void) | undefined; onComplete?: (() => void) | undefined; }; pageControl: { goToPage: (pageNumber: number) => void; totalPages: number; currentPage: number; }; searchControl: { searchMatches: { totalMatches: number; matches: { index: number; page: number; }[]; } | { totalMatches: number; matches: { index: number; page: number; }[]; }; searching: boolean; goToMatch: (index: number) => void; search: (value: string) => Promise<import("@/utils/types").MatchHighlightResult[]>; nextSearchMatch: () => void; prevSearchMatch: () => void; }; rotateControl: { rotateClockwise: () => void; rotateCounterclockwise: () => void; currentRotation: number; }; downloadControl: { download: () => void; onError?: ((error: Error) => void) | undefined; onComplete?: (() => void) | undefined; }; zoomControl: { scale: number; zoom: (scale: number | ZoomLevel) => void; }; }, {}, {}, {}, { readonly initialViewMode: ViewMode; readonly initialScrollMode: ScrollMode; readonly workerUrl: string; readonly initialPage: number; readonly initialScale: number | ZoomLevel; readonly initialRotation: number; readonly initialThumbnailsVisible: boolean; readonly initialSearch: string; readonly textLayer: boolean; readonly characterMap: import("@/utils/types").CharacterMap; readonly toolbarOptions: false | Partial<ToolbarOptions>; readonly localization: Record<string, Localization>; readonly afterCanvasLoaded: Record<number, import("@/utils/types").CanvasLoadedCallback>; readonly textHighlights: import("@/utils/types").TextHighlight[]; readonly downloadFilename: string; }>; __isFragment?: undefined; __isTeleport?: undefined; __isSuspense?: undefined; } & import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<{ readonly src: { readonly type: import("vue").PropType<string | import("@/utils/types").VPVSrc>; readonly required: true; }; readonly workerUrl: { readonly type: import("vue").PropType<string>; readonly default: undefined; }; readonly initialPage: { readonly type: import("vue").PropType<number>; readonly default: () => number; }; readonly initialScale: { readonly type: import("vue").PropType<number | ZoomLevel>; readonly default: () => ZoomLevel; }; readonly initialScrollMode: { readonly type: import("vue").PropType<ScrollMode>; readonly default: () => ScrollMode; readonly validator: (initialScrollMode: ScrollMode, args: unknown) => boolean; }; readonly initialViewMode: { readonly type: import("vue").PropType<ViewMode>; readonly default: () => ViewMode; readonly validator: (initialViewMode: ViewMode, args: unknown) => boolean; }; readonly initialRotation: { readonly type: import("vue").PropType<number>; readonly default: () => number; }; readonly initialThumbnailsVisible: { readonly type: import("vue").PropType<boolean>; readonly default: undefined; }; readonly textLayer: { readonly type: import("vue").PropType<boolean>; readonly default: () => boolean; }; readonly characterMap: { readonly type: import("vue").PropType<import("@/utils/types").CharacterMap>; readonly default: undefined; }; readonly toolbarOptions: { readonly type: import("vue").PropType<false | Partial<ToolbarOptions>>; readonly default: () => ToolbarOptions; }; readonly localization: { readonly type: import("vue").PropType<Record<string, Localization>>; readonly default: () => Record<string, Localization>; }; readonly initialSearch: { readonly type: StringConstructor; readonly default: undefined; }; readonly afterCanvasLoaded: { readonly type: import("vue").PropType<Record<number, import("@/utils/types").CanvasLoadedCallback>>; readonly default: undefined; }; readonly textHighlights: { readonly type: import("vue").PropType<import("@/utils/types").TextHighlight[]>; readonly default: undefined; readonly validator: (value: import("@/utils/types").TextHighlight[]) => boolean; }; readonly downloadFilename: { readonly type: StringConstructor; readonly default: undefined; }; }>> & Readonly<{ onAnnotation?: ((data: AnnotationEventPayload) => any) | undefined; onAnnotationLoaded?: ((annotations: any[]) => any) | undefined; onRotate?: ((rotateEvent: RotateEvent) => any) | undefined; onTextLoaded?: ((data: TextLayerLoadedEventPayload) => any) | undefined; onXfaLoaded?: (() => any) | undefined; onLoaded?: ((properties?: PdfProperties | undefined) => any) | undefined; onLoadError?: ((error: any) => any) | undefined; onLoading?: (() => any) | undefined; onLoadProgress?: ((progress: number) => any) | undefined; onAfterGoToPage?: ((progress: number) => any) | undefined; onPageChanged?: ((progress: number) => any) | undefined; }>, { highlightControl: { highlight: (args: import("@/utils/types").TextHighlight[]) => Promise<Record<string, import("@/utils/types").MatchHighlightResult[]>>; clear: () => void; }; printControl: { print: (options?: { visibleDefaultProgress: boolean; } | undefined) => void; cancel: () => void; onProgress?: ((progress: import("@/utils/types").PreparePrintProgress) => void) | undefined; onError?: ((error: Error) => void) | undefined; onComplete?: (() => void) | undefined; }; pageControl: { goToPage: (pageNumber: number) => void; totalPages: number; currentPage: number; }; searchControl: { searchMatches: { totalMatches: number; matches: { index: number; page: number; }[]; } | { totalMatches: number; matches: { index: number; page: number; }[]; }; searching: boolean; goToMatch: (index: number) => void; search: (value: string) => Promise<import("@/utils/types").MatchHighlightResult[]>; nextSearchMatch: () => void; prevSearchMatch: () => void; }; rotateControl: { rotateClockwise: () => void; rotateCounterclockwise: () => void; currentRotation: number; }; downloadControl: { download: () => void; onError?: ((error: Error) => void) | undefined; onComplete?: (() => void) | undefined; }; zoomControl: { scale: number; zoom: (scale: number | ZoomLevel) => void; }; }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, { annotation: (data: AnnotationEventPayload) => void; } & { loaded: (properties?: PdfProperties | undefined) => void; } & { loadError: (error: any) => void; } & { loading: () => void; } & { loadProgress: (progress: number) => void; } & { textLoaded: (data: TextLayerLoadedEventPayload) => void; } & { annotationLoaded: (annotations: any[]) => void; } & { xfaLoaded: () => void; } & { rotate: (rotateEvent: RotateEvent) => void; } & { afterGoToPage: (progress: number) => void; } & { pageChanged: (progress: number) => void; }, string, { readonly initialViewMode: ViewMode; readonly initialScrollMode: ScrollMode; readonly workerUrl: string; readonly initialPage: number; readonly initialScale: number | ZoomLevel; readonly initialRotation: number; readonly initialThumbnailsVisible: boolean; readonly initialSearch: string; readonly textLayer: boolean; readonly characterMap: import("@/utils/types").CharacterMap; readonly toolbarOptions: false | Partial<ToolbarOptions>; readonly localization: Record<string, Localization>; readonly afterCanvasLoaded: Record<number, import("@/utils/types").CanvasLoadedCallback>; readonly textHighlights: import("@/utils/types").TextHighlight[]; readonly downloadFilename: string; }, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & (new () => { $slots: { dropFileZone: (_: { isDark: boolean; }) => any; loader: (_: { progress: number; loaded: boolean; }) => any; loaderImage: (_: {}) => any; loaderProgress: (_: { progress: number; }) => any; thumbnailTool: (_: { onToggle: () => void; }) => any; iconThumbnail: (_: {}) => any; iconSearch: (_: {}) => any; pageNavigationTool: (_: { total: number; current: number; onNext: () => void; onPrev: () => void; onChangePage: (pageNumber: number) => void; }) => any; iconPrevPage: (_: {}) => any; iconNextPage: (_: {}) => any; zoomTool: (_: { currentScale: number; zoom: (nextScale: number | ZoomLevel) => void; }) => any; iconZoomOut: (_: {}) => any; iconZoomIn: (_: {}) => any; commentPanelTool: (_: { onClick: () => void; }) => any; iconCommentPanel: (_: {}) => any; themeTool: (_: { isDark: boolean; onClick: () => void; }) => any; iconThemeDark: (_: {}) => any; iconThemeLight: (_: {}) => any; openFileTool: (_: { onClick: () => void; }) => any; iconOpenFile: (_: {}) => any; downloadTool: (_: { onClick: () => void; }) => any; iconDownload: (_: {}) => any; printTool: (_: { onClick: ((showProgress?: boolean | undefined) => Promise<void>) & Promise<void>; }) => any; iconPrint: (_: {}) => any; fullScreenTool: (_: { onClick: () => Promise<void>; isSupported: boolean; }) => any; iconFullScreen: (_: {}) => any; iconMoreOptions: (_: {}) => any; iconFirstPage: (_: {}) => any; iconLastPage: (_: {}) => any; iconRotateClockwise: (_: {}) => any; iconRotateCounterClockwise: (_: {}) => any; iconTextSelection: (_: {}) => any; iconHandMode: (_: {}) => any; iconScrollingPage: (_: {}) => any; iconScrollingVertical: (_: {}) => any; iconScrollingHorizontal: (_: {}) => any; iconScrollingWrapped: (_: {}) => any; iconPageViewSingle: (_: {}) => any; iconPageViewDual: (_: {}) => any; iconDocProperties: (_: {}) => any; }; }); export default _default;