pdf-ysk-vue3 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,248 @@
1
+ import PDF from './pdf-vue3.vue';
2
+ export default PDF;
3
+ export type PDFDocumentProxy = {
4
+ _pdfInfo: any;
5
+ _transport: any;
6
+ /**
7
+ * @type {AnnotationStorage} Storage for annotation data in forms.
8
+ */
9
+ get annotationStorage(): any;
10
+ /**
11
+ * @type {Object} The filter factory instance.
12
+ */
13
+ get filterFactory(): Object;
14
+ /**
15
+ * @type {number} Total number of pages in the PDF file.
16
+ */
17
+ get numPages(): number;
18
+ /**
19
+ * @type {Array<string, string|null>} A (not guaranteed to be) unique ID to
20
+ * identify the PDF document.
21
+ * NOTE: The first element will always be defined for all PDF documents,
22
+ * whereas the second element is only defined for *modified* PDF documents.
23
+ */
24
+ get fingerprints(): string[];
25
+ /**
26
+ * @type {boolean} True if only XFA form.
27
+ */
28
+ get isPureXfa(): boolean;
29
+ /**
30
+ * NOTE: This is (mostly) intended to support printing of XFA forms.
31
+ *
32
+ * @type {Object | null} An object representing a HTML tree structure
33
+ * to render the XFA, or `null` when no XFA form exists.
34
+ */
35
+ get allXfaHtml(): Object | null;
36
+ /**
37
+ * @param {number} pageNumber - The page number to get. The first page is 1.
38
+ * @returns {Promise<PDFPageProxy>} A promise that is resolved with
39
+ * a {@link PDFPageProxy} object.
40
+ */
41
+ getPage(pageNumber: number): Promise<any>;
42
+ /**
43
+ * @param {RefProxy} ref - The page reference.
44
+ * @returns {Promise<number>} A promise that is resolved with the page index,
45
+ * starting from zero, that is associated with the reference.
46
+ */
47
+ getPageIndex(ref: any): Promise<number>;
48
+ /**
49
+ * @returns {Promise<Object<string, Array<any>>>} A promise that is resolved
50
+ * with a mapping from named destinations to references.
51
+ *
52
+ * This can be slow for large documents. Use `getDestination` instead.
53
+ */
54
+ getDestinations(): Promise<{
55
+ [x: string]: Array<any>;
56
+ }>;
57
+ /**
58
+ * @param {string} id - The named destination to get.
59
+ * @returns {Promise<Array<any> | null>} A promise that is resolved with all
60
+ * information of the given named destination, or `null` when the named
61
+ * destination is not present in the PDF file.
62
+ */
63
+ getDestination(id: string): Promise<Array<any> | null>;
64
+ /**
65
+ * @returns {Promise<Array<string> | null>} A promise that is resolved with
66
+ * an {Array} containing the page labels that correspond to the page
67
+ * indexes, or `null` when no page labels are present in the PDF file.
68
+ */
69
+ getPageLabels(): Promise<Array<string> | null>;
70
+ /**
71
+ * @returns {Promise<string>} A promise that is resolved with a {string}
72
+ * containing the page layout name.
73
+ */
74
+ getPageLayout(): Promise<string>;
75
+ /**
76
+ * @returns {Promise<string>} A promise that is resolved with a {string}
77
+ * containing the page mode name.
78
+ */
79
+ getPageMode(): Promise<string>;
80
+ /**
81
+ * @returns {Promise<Object | null>} A promise that is resolved with an
82
+ * {Object} containing the viewer preferences, or `null` when no viewer
83
+ * preferences are present in the PDF file.
84
+ */
85
+ getViewerPreferences(): Promise<Object | null>;
86
+ /**
87
+ * @returns {Promise<any | null>} A promise that is resolved with an {Array}
88
+ * containing the destination, or `null` when no open action is present
89
+ * in the PDF.
90
+ */
91
+ getOpenAction(): Promise<any | null>;
92
+ /**
93
+ * @returns {Promise<any>} A promise that is resolved with a lookup table
94
+ * for mapping named attachments to their content.
95
+ */
96
+ getAttachments(): Promise<any>;
97
+ /**
98
+ * @returns {Promise<Array<string> | null>} A promise that is resolved with
99
+ * an {Array} of all the JavaScript strings in the name tree, or `null`
100
+ * if no JavaScript exists.
101
+ */
102
+ getJavaScript(): Promise<Array<string> | null>;
103
+ /**
104
+ * @returns {Promise<Object | null>} A promise that is resolved with
105
+ * an {Object} with the JavaScript actions:
106
+ * - from the name tree (like getJavaScript);
107
+ * - from A or AA entries in the catalog dictionary.
108
+ * , or `null` if no JavaScript exists.
109
+ */
110
+ getJSActions(): Promise<Object | null>;
111
+ /**
112
+ * @typedef {Object} OutlineNode
113
+ * @property {string} title
114
+ * @property {boolean} bold
115
+ * @property {boolean} italic
116
+ * @property {Uint8ClampedArray} color - The color in RGB format to use for
117
+ * display purposes.
118
+ * @property {string | Array<any> | null} dest
119
+ * @property {string | null} url
120
+ * @property {string | undefined} unsafeUrl
121
+ * @property {boolean | undefined} newWindow
122
+ * @property {number | undefined} count
123
+ * @property {Array<OutlineNode>} items
124
+ */
125
+ /**
126
+ * @returns {Promise<Array<OutlineNode>>} A promise that is resolved with an
127
+ * {Array} that is a tree outline (if it has one) of the PDF file.
128
+ */
129
+ getOutline(): Promise<{
130
+ title: string;
131
+ bold: boolean;
132
+ italic: boolean;
133
+ /**
134
+ * - The color in RGB format to use for
135
+ * display purposes.
136
+ */
137
+ color: Uint8ClampedArray;
138
+ dest: string | Array<any> | null;
139
+ url: string | null;
140
+ unsafeUrl: string | undefined;
141
+ newWindow: boolean | undefined;
142
+ count: number | undefined;
143
+ items: any[];
144
+ }[]>;
145
+ /**
146
+ * @returns {Promise<OptionalContentConfig>} A promise that is resolved with
147
+ * an {@link OptionalContentConfig} that contains all the optional content
148
+ * groups (assuming that the document has any).
149
+ */
150
+ getOptionalContentConfig(): Promise<any>;
151
+ /**
152
+ * @returns {Promise<Array<number> | null>} A promise that is resolved with
153
+ * an {Array} that contains the permission flags for the PDF document, or
154
+ * `null` when no permissions are present in the PDF file.
155
+ */
156
+ getPermissions(): Promise<Array<number> | null>;
157
+ /**
158
+ * @returns {Promise<{ info: Object, metadata: Metadata }>} A promise that is
159
+ * resolved with an {Object} that has `info` and `metadata` properties.
160
+ * `info` is an {Object} filled with anything available in the information
161
+ * dictionary and similarly `metadata` is a {Metadata} object with
162
+ * information from the metadata section of the PDF.
163
+ */
164
+ getMetadata(): Promise<{
165
+ info: Object;
166
+ metadata: any;
167
+ }>;
168
+ /**
169
+ * @typedef {Object} MarkInfo
170
+ * Properties correspond to Table 321 of the PDF 32000-1:2008 spec.
171
+ * @property {boolean} Marked
172
+ * @property {boolean} UserProperties
173
+ * @property {boolean} Suspects
174
+ */
175
+ /**
176
+ * @returns {Promise<MarkInfo | null>} A promise that is resolved with
177
+ * a {MarkInfo} object that contains the MarkInfo flags for the PDF
178
+ * document, or `null` when no MarkInfo values are present in the PDF file.
179
+ */
180
+ getMarkInfo(): Promise<{
181
+ Marked: boolean;
182
+ UserProperties: boolean;
183
+ Suspects: boolean;
184
+ } | null>;
185
+ /**
186
+ * @returns {Promise<Uint8Array>} A promise that is resolved with a
187
+ * {Uint8Array} containing the raw data of the PDF document.
188
+ */
189
+ getData(): Promise<Uint8Array>;
190
+ /**
191
+ * @returns {Promise<Uint8Array>} A promise that is resolved with a
192
+ * {Uint8Array} containing the full data of the saved document.
193
+ */
194
+ saveDocument(): Promise<Uint8Array>;
195
+ /**
196
+ * @returns {Promise<{ length: number }>} A promise that is resolved when the
197
+ * document's data is loaded. It is resolved with an {Object} that contains
198
+ * the `length` property that indicates size of the PDF data in bytes.
199
+ */
200
+ getDownloadInfo(): Promise<{
201
+ length: number;
202
+ }>;
203
+ /**
204
+ * Cleans up resources allocated by the document on both the main and worker
205
+ * threads.
206
+ *
207
+ * NOTE: Do not, under any circumstances, call this method when rendering is
208
+ * currently ongoing since that may lead to rendering errors.
209
+ *
210
+ * @param {boolean} [keepLoadedFonts] - Let fonts remain attached to the DOM.
211
+ * NOTE: This will increase persistent memory usage, hence don't use this
212
+ * option unless absolutely necessary. The default value is `false`.
213
+ * @returns {Promise} A promise that is resolved when clean-up has finished.
214
+ */
215
+ cleanup(keepLoadedFonts?: boolean | undefined): Promise<any>;
216
+ /**
217
+ * Destroys the current document instance and terminates the worker.
218
+ */
219
+ destroy(): Promise<void>;
220
+ /**
221
+ * @type {DocumentInitParameters} A subset of the current
222
+ * {DocumentInitParameters}, which are needed in the viewer.
223
+ */
224
+ get loadingParams(): any;
225
+ /**
226
+ * @type {PDFDocumentLoadingTask} The loadingTask for the current document.
227
+ */
228
+ get loadingTask(): any;
229
+ /**
230
+ * @returns {Promise<Object<string, Array<Object>> | null>} A promise that is
231
+ * resolved with an {Object} containing /AcroForm field data for the JS
232
+ * sandbox, or `null` when no field data is present in the PDF file.
233
+ */
234
+ getFieldObjects(): Promise<{
235
+ [x: string]: Array<Object>;
236
+ } | null>;
237
+ /**
238
+ * @returns {Promise<boolean>} A promise that is resolved with `true`
239
+ * if some /AcroForm fields have JavaScript actions.
240
+ */
241
+ hasJSActions(): Promise<boolean>;
242
+ /**
243
+ * @returns {Promise<Array<string> | null>} A promise that is resolved with an
244
+ * {Array<string>} containing IDs of annotations that have a calculation
245
+ * action, or `null` when no such annotations are present in the PDF file.
246
+ */
247
+ getCalculationOrderIds(): Promise<Array<string> | null>;
248
+ };
@@ -0,0 +1,227 @@
1
+ import type { PDFDocumentProxy } from "./index";
2
+ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
3
+ src: {
4
+ type: import("vue").PropType<string | Uint8Array>;
5
+ required: true;
6
+ default: undefined;
7
+ };
8
+ httpHeaders: {
9
+ type: import("vue").PropType<Record<string, any>>;
10
+ default: undefined;
11
+ };
12
+ withCredentials: {
13
+ type: import("vue").PropType<boolean>;
14
+ default: undefined;
15
+ };
16
+ password: {
17
+ type: import("vue").PropType<string>;
18
+ default: undefined;
19
+ };
20
+ useSystemFonts: {
21
+ type: import("vue").PropType<boolean>;
22
+ default: undefined;
23
+ };
24
+ stopAtErrors: {
25
+ type: import("vue").PropType<boolean>;
26
+ default: undefined;
27
+ };
28
+ disableFontFace: {
29
+ type: import("vue").PropType<boolean>;
30
+ default: undefined;
31
+ };
32
+ disableRange: {
33
+ type: import("vue").PropType<boolean>;
34
+ default: undefined;
35
+ };
36
+ disableStream: {
37
+ type: import("vue").PropType<boolean>;
38
+ default: undefined;
39
+ };
40
+ disableAutoFetch: {
41
+ type: import("vue").PropType<boolean>;
42
+ default: undefined;
43
+ };
44
+ adInterval: {
45
+ type: import("vue").PropType<number>;
46
+ default: number;
47
+ };
48
+ adContent: {
49
+ type: import("vue").PropType<string>;
50
+ default: string;
51
+ };
52
+ showProgress: {
53
+ type: import("vue").PropType<boolean>;
54
+ default: boolean;
55
+ };
56
+ progressColor: {
57
+ type: import("vue").PropType<string>;
58
+ default: string;
59
+ };
60
+ showPageTooltip: {
61
+ type: import("vue").PropType<boolean>;
62
+ default: boolean;
63
+ };
64
+ showBackToTopBtn: {
65
+ type: import("vue").PropType<boolean>;
66
+ default: boolean;
67
+ };
68
+ scrollThreshold: {
69
+ type: import("vue").PropType<number>;
70
+ default: number;
71
+ };
72
+ pdfWidth: {
73
+ type: import("vue").PropType<string>;
74
+ default: string;
75
+ };
76
+ rowGap: {
77
+ type: import("vue").PropType<number>;
78
+ default: number;
79
+ };
80
+ page: {
81
+ type: import("vue").PropType<number>;
82
+ default: number;
83
+ };
84
+ cMapUrl: {
85
+ type: import("vue").PropType<string>;
86
+ default: string;
87
+ };
88
+ }, {
89
+ reload: () => void;
90
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
91
+ onProgress: (loadRatio: number) => void;
92
+ onComplete: () => void;
93
+ onScroll: (scrollOffset: number) => void;
94
+ onPageChange: (page: number) => void;
95
+ onPdfInit: (pdf: PDFDocumentProxy) => void;
96
+ }, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
97
+ src: {
98
+ type: import("vue").PropType<string | Uint8Array>;
99
+ required: true;
100
+ default: undefined;
101
+ };
102
+ httpHeaders: {
103
+ type: import("vue").PropType<Record<string, any>>;
104
+ default: undefined;
105
+ };
106
+ withCredentials: {
107
+ type: import("vue").PropType<boolean>;
108
+ default: undefined;
109
+ };
110
+ password: {
111
+ type: import("vue").PropType<string>;
112
+ default: undefined;
113
+ };
114
+ useSystemFonts: {
115
+ type: import("vue").PropType<boolean>;
116
+ default: undefined;
117
+ };
118
+ stopAtErrors: {
119
+ type: import("vue").PropType<boolean>;
120
+ default: undefined;
121
+ };
122
+ disableFontFace: {
123
+ type: import("vue").PropType<boolean>;
124
+ default: undefined;
125
+ };
126
+ disableRange: {
127
+ type: import("vue").PropType<boolean>;
128
+ default: undefined;
129
+ };
130
+ disableStream: {
131
+ type: import("vue").PropType<boolean>;
132
+ default: undefined;
133
+ };
134
+ disableAutoFetch: {
135
+ type: import("vue").PropType<boolean>;
136
+ default: undefined;
137
+ };
138
+ adInterval: {
139
+ type: import("vue").PropType<number>;
140
+ default: number;
141
+ };
142
+ adContent: {
143
+ type: import("vue").PropType<string>;
144
+ default: string;
145
+ };
146
+ showProgress: {
147
+ type: import("vue").PropType<boolean>;
148
+ default: boolean;
149
+ };
150
+ progressColor: {
151
+ type: import("vue").PropType<string>;
152
+ default: string;
153
+ };
154
+ showPageTooltip: {
155
+ type: import("vue").PropType<boolean>;
156
+ default: boolean;
157
+ };
158
+ showBackToTopBtn: {
159
+ type: import("vue").PropType<boolean>;
160
+ default: boolean;
161
+ };
162
+ scrollThreshold: {
163
+ type: import("vue").PropType<number>;
164
+ default: number;
165
+ };
166
+ pdfWidth: {
167
+ type: import("vue").PropType<string>;
168
+ default: string;
169
+ };
170
+ rowGap: {
171
+ type: import("vue").PropType<number>;
172
+ default: number;
173
+ };
174
+ page: {
175
+ type: import("vue").PropType<number>;
176
+ default: number;
177
+ };
178
+ cMapUrl: {
179
+ type: import("vue").PropType<string>;
180
+ default: string;
181
+ };
182
+ }>> & {
183
+ onOnProgress?: ((loadRatio: number) => any) | undefined;
184
+ onOnComplete?: (() => any) | undefined;
185
+ onOnScroll?: ((scrollOffset: number) => any) | undefined;
186
+ onOnPageChange?: ((page: number) => any) | undefined;
187
+ onOnPdfInit?: ((pdf: PDFDocumentProxy) => any) | undefined;
188
+ }, {
189
+ src: string | Uint8Array;
190
+ httpHeaders: Record<string, any>;
191
+ withCredentials: boolean;
192
+ password: string;
193
+ useSystemFonts: boolean;
194
+ stopAtErrors: boolean;
195
+ disableFontFace: boolean;
196
+ disableRange: boolean;
197
+ disableStream: boolean;
198
+ disableAutoFetch: boolean;
199
+ adInterval: number;
200
+ adContent: string;
201
+ showProgress: boolean;
202
+ progressColor: string;
203
+ showPageTooltip: boolean;
204
+ showBackToTopBtn: boolean;
205
+ scrollThreshold: number;
206
+ pdfWidth: string;
207
+ rowGap: number;
208
+ page: number;
209
+ cMapUrl: string;
210
+ }, {}>, {
211
+ progress?: ((props: {
212
+ loadRatio: number;
213
+ }) => any) | undefined;
214
+ pageTooltip?: ((props: {
215
+ currentPage: number;
216
+ totalPages: number;
217
+ }) => any) | undefined;
218
+ backToTopBtn?: ((props: {
219
+ scrollOffset: number;
220
+ }) => any) | undefined;
221
+ }>;
222
+ export default _default;
223
+ type __VLS_WithTemplateSlots<T, S> = T & {
224
+ new (): {
225
+ $slots: S;
226
+ };
227
+ };