@vue-pdf-viewer/viewer
Version:
The PDF Viewer component for Vue 3 and Nuxt
48 lines (47 loc) • 2.26 kB
TypeScript
import type { PageViewport, PDFPageProxy } from 'pdfjs-dist/types/web/interfaces';
import type { PDFDocumentProxy } from 'pdfjs-dist';
import type { CanvasLoadedCallback, AnnotationEventPayload, HighlightEventPayload, HighlightOptions, MatchValue, TextLayerLoadedEventPayload, VisibilityInfo, TextHighlight } from '../utils/types';
interface BaseProps {
pageIndex: number;
page: PDFPageProxy;
viewport: PageViewport;
document: PDFDocumentProxy;
afterCanvasLoaded?: CanvasLoadedCallback;
annoImageResourcesPath?: string;
}
type TextProps = {
initialTextLayer: boolean;
textLayer: boolean;
searchKeyword?: string;
highlightTexts?: TextHighlight[];
currentHighlight?: MatchValue;
highlightOptions?: HighlightOptions;
};
type OwnProps = BaseProps & TextProps;
declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<OwnProps>>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
highlight: (payload: HighlightEventPayload) => void;
} & {
textLoaded: (payload: TextLayerLoadedEventPayload) => void;
} & {
annotated: (payload: AnnotationEventPayload) => void;
} & {
annotationLoaded: (payload?: any[] | undefined) => void;
} & {
intersected: (args: VisibilityInfo) => void;
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<OwnProps>>> & Readonly<{
onAnnotationLoaded?: ((payload?: any[] | undefined) => any) | undefined;
onHighlight?: ((payload: HighlightEventPayload) => any) | undefined;
onTextLoaded?: ((payload: TextLayerLoadedEventPayload) => any) | undefined;
onAnnotated?: ((payload: AnnotationEventPayload) => any) | undefined;
onIntersected?: ((args: VisibilityInfo) => any) | undefined;
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
export default _default;
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
type __VLS_TypePropsToRuntimeProps<T> = {
[K in keyof T]-?: {} extends Pick<T, K> ? {
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
} : {
type: import('vue').PropType<T[K]>;
required: true;
};
};