vue-pdf-embed
Version:
PDF embed component for Vue
135 lines (133 loc) • 3.93 kB
TypeScript
import { PDFLinkService } from 'pdfjs-dist/web/pdf_viewer.mjs';
import type { PasswordRequestParams, Source } from './types';
declare function __VLS_template(): {
"before-page"?(_: {
page: number;
}): any;
"after-page"?(_: {
page: number;
}): any;
};
declare const __VLS_component: import("vue").DefineComponent<{
/**
* Whether to enable an annotation layer.
*/
annotationLayer?: boolean;
/**
* Desired page height.
*/
height?: number;
/**
* Root element identifier (inherited by page containers with page number
* postfixes).
*/
id?: string;
/**
* Path for annotation icons, including trailing slash.
*/
imageResourcesPath?: string;
/**
* Document navigation service.
*/
linkService?: PDFLinkService;
/**
* Page number(s) to display.
*/
page?: number | number[];
/**
* Desired page rotation angle.
*/
rotation?: number;
/**
* Desired ratio of canvas size to document size.
*/
scale?: number;
/**
* Source of the document to display.
*/
source: Source;
/**
* Whether to enable a text layer.
*/
textLayer?: boolean;
/**
* Desired page width.
*/
width?: number;
}, {
doc: import("vue").ShallowRef<import("pdfjs-dist/types/src/display/api").PDFDocumentProxy | null>;
download: (filename: string) => Promise<void>;
print: (dpi?: number, filename?: string, allPages?: boolean) => Promise<void>;
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
progress: (value: import("pdfjs-dist/types/src/display/api").OnProgressParameters) => any;
"internal-link-clicked": (value: number) => any;
loaded: (value: import("pdfjs-dist/types/src/display/api").PDFDocumentProxy) => any;
"loading-failed": (value: Error) => any;
"password-requested": (value: PasswordRequestParams) => any;
rendered: () => any;
"rendering-failed": (value: Error) => any;
}, string, import("vue").PublicProps, Readonly<{
/**
* Whether to enable an annotation layer.
*/
annotationLayer?: boolean;
/**
* Desired page height.
*/
height?: number;
/**
* Root element identifier (inherited by page containers with page number
* postfixes).
*/
id?: string;
/**
* Path for annotation icons, including trailing slash.
*/
imageResourcesPath?: string;
/**
* Document navigation service.
*/
linkService?: PDFLinkService;
/**
* Page number(s) to display.
*/
page?: number | number[];
/**
* Desired page rotation angle.
*/
rotation?: number;
/**
* Desired ratio of canvas size to document size.
*/
scale?: number;
/**
* Source of the document to display.
*/
source: Source;
/**
* Whether to enable a text layer.
*/
textLayer?: boolean;
/**
* Desired page width.
*/
width?: number;
} & {
onProgress?: ((value: import("pdfjs-dist/types/src/display/api").OnProgressParameters) => any) | undefined;
"onInternal-link-clicked"?: ((value: number) => any) | undefined;
onLoaded?: ((value: import("pdfjs-dist/types/src/display/api").PDFDocumentProxy) => any) | undefined;
"onLoading-failed"?: ((value: Error) => any) | undefined;
"onPassword-requested"?: ((value: PasswordRequestParams) => any) | undefined;
onRendered?: (() => any) | undefined;
"onRendering-failed"?: ((value: Error) => any) | undefined;
}>, {
rotation: number;
scale: number;
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}>;
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, ReturnType<typeof __VLS_template>>;
export default _default;
type __VLS_WithTemplateSlots<T, S> = T & {
new (): {
$slots: S;
};
};