@vue-pdf-viewer/viewer 1.5.0-beta.3 → 1.5.0-beta.4
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.
- package/dist/index.js +3603 -3660
- package/dist/index.umd.cjs +8 -8
- package/dist/types/components/LayerCanvas.vue.d.ts +2 -2
- package/dist/types/components/ToolMenuOthers.vue.d.ts +7 -6
- package/dist/types/components/ToolPrint.vue.d.ts +7 -6
- package/dist/types/components/VPdfPage.vue.d.ts +2 -2
- package/dist/types/components/VPdfViewer.vue.d.ts +48 -11
- package/dist/types/composables/usePdfPagesSizes.d.ts +1 -1
- package/dist/types/composables/usePdfProperties.d.ts +1 -1
- package/dist/types/composables/usePrint.d.ts +12 -4
- package/dist/types/composables/usePrintProcess.d.ts +3 -3
- package/dist/types/composables/useRenderTask.d.ts +1 -1
- package/dist/types/composables/useVisibilities.d.ts +1 -1
- package/dist/types/const.d.ts +11 -29
- package/dist/types/index.d.ts +1 -1
- package/dist/types/utils/types.d.ts +18 -5
- package/package.json +1 -1
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import type { PDFPageProxy } from 'pdfjs-dist';
|
|
2
|
-
import {
|
|
2
|
+
import { CanvasLoadedCallback } from '@/utils/types';
|
|
3
3
|
interface OwnProps {
|
|
4
4
|
page: PDFPageProxy;
|
|
5
5
|
width: number;
|
|
6
6
|
height: number;
|
|
7
7
|
pageIndex: number;
|
|
8
8
|
intersecting: boolean;
|
|
9
|
-
afterCanvasLoaded?:
|
|
9
|
+
afterCanvasLoaded?: CanvasLoadedCallback;
|
|
10
10
|
}
|
|
11
11
|
declare const _default: import("vue").DefineComponent<__VLS_TypePropsToRuntimeProps<OwnProps>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
12
12
|
rendered: () => void;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { PreparePrintProgress } from '../utils/types';
|
|
1
2
|
declare const _default: {
|
|
2
3
|
new (...args: any[]): import("vue").CreateComponentPublicInstance<Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
|
|
3
4
|
rootContainer: HTMLDivElement;
|
|
@@ -5,7 +6,7 @@ declare const _default: {
|
|
|
5
6
|
isCancel: boolean;
|
|
6
7
|
afterCanvasLoaded?: Record<number, any> | undefined;
|
|
7
8
|
}>>> & {
|
|
8
|
-
onProgress?: ((
|
|
9
|
+
onProgress?: ((payload: PreparePrintProgress) => any) | undefined;
|
|
9
10
|
onLoading?: (() => any) | undefined;
|
|
10
11
|
onLoaded?: (() => any) | undefined;
|
|
11
12
|
onRotateClockwise?: (() => any) | undefined;
|
|
@@ -28,14 +29,14 @@ declare const _default: {
|
|
|
28
29
|
} & {
|
|
29
30
|
loaded: () => void;
|
|
30
31
|
} & {
|
|
31
|
-
progress: (
|
|
32
|
+
progress: (payload: PreparePrintProgress) => void;
|
|
32
33
|
}, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
|
|
33
34
|
rootContainer: HTMLDivElement;
|
|
34
35
|
textSelection: boolean;
|
|
35
36
|
isCancel: boolean;
|
|
36
37
|
afterCanvasLoaded?: Record<number, any> | undefined;
|
|
37
38
|
}>>> & {
|
|
38
|
-
onProgress?: ((
|
|
39
|
+
onProgress?: ((payload: PreparePrintProgress) => any) | undefined;
|
|
39
40
|
onLoading?: (() => any) | undefined;
|
|
40
41
|
onLoaded?: (() => any) | undefined;
|
|
41
42
|
onRotateClockwise?: (() => any) | undefined;
|
|
@@ -56,7 +57,7 @@ declare const _default: {
|
|
|
56
57
|
isCancel: boolean;
|
|
57
58
|
afterCanvasLoaded?: Record<number, any> | undefined;
|
|
58
59
|
}>>> & {
|
|
59
|
-
onProgress?: ((
|
|
60
|
+
onProgress?: ((payload: PreparePrintProgress) => any) | undefined;
|
|
60
61
|
onLoading?: (() => any) | undefined;
|
|
61
62
|
onLoaded?: (() => any) | undefined;
|
|
62
63
|
onRotateClockwise?: (() => any) | undefined;
|
|
@@ -74,7 +75,7 @@ declare const _default: {
|
|
|
74
75
|
isCancel: boolean;
|
|
75
76
|
afterCanvasLoaded?: Record<number, any> | undefined;
|
|
76
77
|
}>>> & {
|
|
77
|
-
onProgress?: ((
|
|
78
|
+
onProgress?: ((payload: PreparePrintProgress) => any) | undefined;
|
|
78
79
|
onLoading?: (() => any) | undefined;
|
|
79
80
|
onLoaded?: (() => any) | undefined;
|
|
80
81
|
onRotateClockwise?: (() => any) | undefined;
|
|
@@ -97,7 +98,7 @@ declare const _default: {
|
|
|
97
98
|
} & {
|
|
98
99
|
loaded: () => void;
|
|
99
100
|
} & {
|
|
100
|
-
progress: (
|
|
101
|
+
progress: (payload: PreparePrintProgress) => void;
|
|
101
102
|
}, string, {}, {}, string, {}> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & (new () => {
|
|
102
103
|
$slots: Record<string, {}> & Record<string, {}> & {
|
|
103
104
|
icon: (_: {}) => any;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
import type { PreparePrintProgress } from '../utils/types';
|
|
1
2
|
declare const _default: {
|
|
2
3
|
new (...args: any[]): import("vue").CreateComponentPublicInstance<Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
|
|
3
4
|
isCancel: boolean;
|
|
4
5
|
afterCanvasLoaded?: Record<number, any> | undefined;
|
|
5
6
|
}>>> & {
|
|
6
|
-
onProgress?: ((
|
|
7
|
+
onProgress?: ((payload: PreparePrintProgress) => any) | undefined;
|
|
7
8
|
onLoading?: (() => any) | undefined;
|
|
8
9
|
onLoaded?: (() => any) | undefined;
|
|
9
10
|
}, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
@@ -11,12 +12,12 @@ declare const _default: {
|
|
|
11
12
|
} & {
|
|
12
13
|
loaded: () => void;
|
|
13
14
|
} & {
|
|
14
|
-
progress: (
|
|
15
|
+
progress: (payload: PreparePrintProgress) => void;
|
|
15
16
|
}, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
|
|
16
17
|
isCancel: boolean;
|
|
17
18
|
afterCanvasLoaded?: Record<number, any> | undefined;
|
|
18
19
|
}>>> & {
|
|
19
|
-
onProgress?: ((
|
|
20
|
+
onProgress?: ((payload: PreparePrintProgress) => any) | undefined;
|
|
20
21
|
onLoading?: (() => any) | undefined;
|
|
21
22
|
onLoaded?: (() => any) | undefined;
|
|
22
23
|
}, {}, true, {}, {}, {
|
|
@@ -30,7 +31,7 @@ declare const _default: {
|
|
|
30
31
|
isCancel: boolean;
|
|
31
32
|
afterCanvasLoaded?: Record<number, any> | undefined;
|
|
32
33
|
}>>> & {
|
|
33
|
-
onProgress?: ((
|
|
34
|
+
onProgress?: ((payload: PreparePrintProgress) => any) | undefined;
|
|
34
35
|
onLoading?: (() => any) | undefined;
|
|
35
36
|
onLoaded?: (() => any) | undefined;
|
|
36
37
|
}, {}, {}, {}, {}, {}>;
|
|
@@ -41,7 +42,7 @@ declare const _default: {
|
|
|
41
42
|
isCancel: boolean;
|
|
42
43
|
afterCanvasLoaded?: Record<number, any> | undefined;
|
|
43
44
|
}>>> & {
|
|
44
|
-
onProgress?: ((
|
|
45
|
+
onProgress?: ((payload: PreparePrintProgress) => any) | undefined;
|
|
45
46
|
onLoading?: (() => any) | undefined;
|
|
46
47
|
onLoaded?: (() => any) | undefined;
|
|
47
48
|
}, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
@@ -49,7 +50,7 @@ declare const _default: {
|
|
|
49
50
|
} & {
|
|
50
51
|
loaded: () => void;
|
|
51
52
|
} & {
|
|
52
|
-
progress: (
|
|
53
|
+
progress: (payload: PreparePrintProgress) => void;
|
|
53
54
|
}, string, {}, {}, string, {}> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & (new () => {
|
|
54
55
|
$slots: {
|
|
55
56
|
default: (_: {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { CanvasLoadedCallback, AnnotationEventPayload, HighlightEventPayload, HighlightOptions, Match, TextLayerLoadedEventPayload, VisibilityInfo } from '../utils/types';
|
|
2
2
|
import type { PageViewport, PDFPageProxy } from 'pdfjs-dist/types/web/interfaces';
|
|
3
3
|
import type { PDFDocumentProxy } from 'pdfjs-dist';
|
|
4
4
|
interface BaseProps {
|
|
@@ -6,7 +6,7 @@ interface BaseProps {
|
|
|
6
6
|
page: PDFPageProxy;
|
|
7
7
|
viewport: PageViewport;
|
|
8
8
|
document: PDFDocumentProxy;
|
|
9
|
-
afterCanvasLoaded?:
|
|
9
|
+
afterCanvasLoaded?: CanvasLoadedCallback;
|
|
10
10
|
}
|
|
11
11
|
type TextProps = {
|
|
12
12
|
textLayer: true;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AnnotationEventPayload, TextLayerLoadedEventPayload, RotateEvent, ToolbarOptions, Localization } from '@/utils/types';
|
|
1
|
+
import type { AnnotationEventPayload, TextLayerLoadedEventPayload, RotateEvent, ToolbarOptions, Localization, PreparePrintProgress } from '@/utils/types';
|
|
2
2
|
import { ScrollMode, ViewMode, ZoomLevel } from '@/utils/enumerators';
|
|
3
3
|
import '../style.scss';
|
|
4
4
|
declare const _default: {
|
|
@@ -58,20 +58,29 @@ declare const _default: {
|
|
|
58
58
|
readonly default: undefined;
|
|
59
59
|
};
|
|
60
60
|
readonly afterCanvasLoaded: {
|
|
61
|
-
readonly type: import("vue").PropType<Record<number, import("@/utils/types").
|
|
61
|
+
readonly type: import("vue").PropType<Record<number, import("@/utils/types").CanvasLoadedCallback>>;
|
|
62
62
|
readonly default: undefined;
|
|
63
63
|
};
|
|
64
64
|
}>> & {
|
|
65
|
+
onProgress?: ((payload: PreparePrintProgress) => any) | undefined;
|
|
65
66
|
onAnnotation?: ((payload: AnnotationEventPayload) => any) | undefined;
|
|
66
67
|
onAnnotationLoaded?: ((payload: any[]) => any) | undefined;
|
|
67
68
|
onTextLoaded?: ((payload: TextLayerLoadedEventPayload) => any) | undefined;
|
|
69
|
+
onLoading?: (() => any) | undefined;
|
|
68
70
|
onLoaded?: (() => any) | undefined;
|
|
69
71
|
onRotate?: ((payload: RotateEvent) => any) | undefined;
|
|
70
72
|
onLoadProgress?: ((payload: number) => any) | undefined;
|
|
71
73
|
onXfaLoaded?: (() => any) | undefined;
|
|
72
74
|
}, {
|
|
73
|
-
searchControl: import("@/utils/types").SearchControl;
|
|
74
75
|
goToPage: (page: number) => void;
|
|
76
|
+
printControl: {
|
|
77
|
+
print: () => void;
|
|
78
|
+
cancel: () => void;
|
|
79
|
+
onProgress?: ((progress: PreparePrintProgress) => void) | undefined;
|
|
80
|
+
onError?: ((error: Error) => void) | undefined;
|
|
81
|
+
onComplete?: (() => void) | undefined;
|
|
82
|
+
};
|
|
83
|
+
searchControl: import("@/utils/types").SearchControl;
|
|
75
84
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
76
85
|
annotation: (payload: AnnotationEventPayload) => void;
|
|
77
86
|
} & {
|
|
@@ -86,6 +95,10 @@ declare const _default: {
|
|
|
86
95
|
xfaLoaded: () => void;
|
|
87
96
|
} & {
|
|
88
97
|
rotate: (payload: RotateEvent) => void;
|
|
98
|
+
} & {
|
|
99
|
+
loading: () => void;
|
|
100
|
+
} & {
|
|
101
|
+
progress: (payload: PreparePrintProgress) => void;
|
|
89
102
|
}, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & Readonly<import("vue").ExtractPropTypes<{
|
|
90
103
|
readonly src: {
|
|
91
104
|
readonly type: import("vue").PropType<string | import("@/utils/types").VPVSrc>;
|
|
@@ -142,13 +155,15 @@ declare const _default: {
|
|
|
142
155
|
readonly default: undefined;
|
|
143
156
|
};
|
|
144
157
|
readonly afterCanvasLoaded: {
|
|
145
|
-
readonly type: import("vue").PropType<Record<number, import("@/utils/types").
|
|
158
|
+
readonly type: import("vue").PropType<Record<number, import("@/utils/types").CanvasLoadedCallback>>;
|
|
146
159
|
readonly default: undefined;
|
|
147
160
|
};
|
|
148
161
|
}>> & {
|
|
162
|
+
onProgress?: ((payload: PreparePrintProgress) => any) | undefined;
|
|
149
163
|
onAnnotation?: ((payload: AnnotationEventPayload) => any) | undefined;
|
|
150
164
|
onAnnotationLoaded?: ((payload: any[]) => any) | undefined;
|
|
151
165
|
onTextLoaded?: ((payload: TextLayerLoadedEventPayload) => any) | undefined;
|
|
166
|
+
onLoading?: (() => any) | undefined;
|
|
152
167
|
onLoaded?: (() => any) | undefined;
|
|
153
168
|
onRotate?: ((payload: RotateEvent) => any) | undefined;
|
|
154
169
|
onLoadProgress?: ((payload: number) => any) | undefined;
|
|
@@ -166,7 +181,7 @@ declare const _default: {
|
|
|
166
181
|
readonly characterMap: import("@/utils/types").CharacterMap;
|
|
167
182
|
readonly toolbarOptions: false | Partial<ToolbarOptions>;
|
|
168
183
|
readonly localization: Record<string, Localization>;
|
|
169
|
-
readonly afterCanvasLoaded: Record<number, import("@/utils/types").
|
|
184
|
+
readonly afterCanvasLoaded: Record<number, import("@/utils/types").CanvasLoadedCallback>;
|
|
170
185
|
}, true, {}, {}, {
|
|
171
186
|
P: {};
|
|
172
187
|
B: {};
|
|
@@ -230,20 +245,29 @@ declare const _default: {
|
|
|
230
245
|
readonly default: undefined;
|
|
231
246
|
};
|
|
232
247
|
readonly afterCanvasLoaded: {
|
|
233
|
-
readonly type: import("vue").PropType<Record<number, import("@/utils/types").
|
|
248
|
+
readonly type: import("vue").PropType<Record<number, import("@/utils/types").CanvasLoadedCallback>>;
|
|
234
249
|
readonly default: undefined;
|
|
235
250
|
};
|
|
236
251
|
}>> & {
|
|
252
|
+
onProgress?: ((payload: PreparePrintProgress) => any) | undefined;
|
|
237
253
|
onAnnotation?: ((payload: AnnotationEventPayload) => any) | undefined;
|
|
238
254
|
onAnnotationLoaded?: ((payload: any[]) => any) | undefined;
|
|
239
255
|
onTextLoaded?: ((payload: TextLayerLoadedEventPayload) => any) | undefined;
|
|
256
|
+
onLoading?: (() => any) | undefined;
|
|
240
257
|
onLoaded?: (() => any) | undefined;
|
|
241
258
|
onRotate?: ((payload: RotateEvent) => any) | undefined;
|
|
242
259
|
onLoadProgress?: ((payload: number) => any) | undefined;
|
|
243
260
|
onXfaLoaded?: (() => any) | undefined;
|
|
244
261
|
}, {
|
|
245
|
-
searchControl: import("@/utils/types").SearchControl;
|
|
246
262
|
goToPage: (page: number) => void;
|
|
263
|
+
printControl: {
|
|
264
|
+
print: () => void;
|
|
265
|
+
cancel: () => void;
|
|
266
|
+
onProgress?: ((progress: PreparePrintProgress) => void) | undefined;
|
|
267
|
+
onError?: ((error: Error) => void) | undefined;
|
|
268
|
+
onComplete?: (() => void) | undefined;
|
|
269
|
+
};
|
|
270
|
+
searchControl: import("@/utils/types").SearchControl;
|
|
247
271
|
}, {}, {}, {}, {
|
|
248
272
|
readonly initialViewMode: ViewMode;
|
|
249
273
|
readonly initialScrollMode: ScrollMode;
|
|
@@ -257,7 +281,7 @@ declare const _default: {
|
|
|
257
281
|
readonly characterMap: import("@/utils/types").CharacterMap;
|
|
258
282
|
readonly toolbarOptions: false | Partial<ToolbarOptions>;
|
|
259
283
|
readonly localization: Record<string, Localization>;
|
|
260
|
-
readonly afterCanvasLoaded: Record<number, import("@/utils/types").
|
|
284
|
+
readonly afterCanvasLoaded: Record<number, import("@/utils/types").CanvasLoadedCallback>;
|
|
261
285
|
}>;
|
|
262
286
|
__isFragment?: undefined;
|
|
263
287
|
__isTeleport?: undefined;
|
|
@@ -318,20 +342,29 @@ declare const _default: {
|
|
|
318
342
|
readonly default: undefined;
|
|
319
343
|
};
|
|
320
344
|
readonly afterCanvasLoaded: {
|
|
321
|
-
readonly type: import("vue").PropType<Record<number, import("@/utils/types").
|
|
345
|
+
readonly type: import("vue").PropType<Record<number, import("@/utils/types").CanvasLoadedCallback>>;
|
|
322
346
|
readonly default: undefined;
|
|
323
347
|
};
|
|
324
348
|
}>> & {
|
|
349
|
+
onProgress?: ((payload: PreparePrintProgress) => any) | undefined;
|
|
325
350
|
onAnnotation?: ((payload: AnnotationEventPayload) => any) | undefined;
|
|
326
351
|
onAnnotationLoaded?: ((payload: any[]) => any) | undefined;
|
|
327
352
|
onTextLoaded?: ((payload: TextLayerLoadedEventPayload) => any) | undefined;
|
|
353
|
+
onLoading?: (() => any) | undefined;
|
|
328
354
|
onLoaded?: (() => any) | undefined;
|
|
329
355
|
onRotate?: ((payload: RotateEvent) => any) | undefined;
|
|
330
356
|
onLoadProgress?: ((payload: number) => any) | undefined;
|
|
331
357
|
onXfaLoaded?: (() => any) | undefined;
|
|
332
358
|
}, {
|
|
333
|
-
searchControl: import("@/utils/types").SearchControl;
|
|
334
359
|
goToPage: (page: number) => void;
|
|
360
|
+
printControl: {
|
|
361
|
+
print: () => void;
|
|
362
|
+
cancel: () => void;
|
|
363
|
+
onProgress?: ((progress: PreparePrintProgress) => void) | undefined;
|
|
364
|
+
onError?: ((error: Error) => void) | undefined;
|
|
365
|
+
onComplete?: (() => void) | undefined;
|
|
366
|
+
};
|
|
367
|
+
searchControl: import("@/utils/types").SearchControl;
|
|
335
368
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
336
369
|
annotation: (payload: AnnotationEventPayload) => void;
|
|
337
370
|
} & {
|
|
@@ -346,6 +379,10 @@ declare const _default: {
|
|
|
346
379
|
xfaLoaded: () => void;
|
|
347
380
|
} & {
|
|
348
381
|
rotate: (payload: RotateEvent) => void;
|
|
382
|
+
} & {
|
|
383
|
+
loading: () => void;
|
|
384
|
+
} & {
|
|
385
|
+
progress: (payload: PreparePrintProgress) => void;
|
|
349
386
|
}, string, {
|
|
350
387
|
readonly initialViewMode: ViewMode;
|
|
351
388
|
readonly initialScrollMode: ScrollMode;
|
|
@@ -359,7 +396,7 @@ declare const _default: {
|
|
|
359
396
|
readonly characterMap: import("@/utils/types").CharacterMap;
|
|
360
397
|
readonly toolbarOptions: false | Partial<ToolbarOptions>;
|
|
361
398
|
readonly localization: Record<string, Localization>;
|
|
362
|
-
readonly afterCanvasLoaded: Record<number, import("@/utils/types").
|
|
399
|
+
readonly afterCanvasLoaded: Record<number, import("@/utils/types").CanvasLoadedCallback>;
|
|
363
400
|
}, {}, string, {}> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & (new () => {
|
|
364
401
|
$slots: {
|
|
365
402
|
dropFileZone: (_: {
|
|
@@ -5,5 +5,5 @@ export declare function usePdfPageSizes(props: UnwrapRef<ViewerState>, initialSc
|
|
|
5
5
|
pdfPages: import("vue").ComputedRef<ViewerPdfPage[]>;
|
|
6
6
|
estimatedPdfPages: import("vue").ShallowRef<ViewerPdfPage[]>;
|
|
7
7
|
actualPdfPages: import("vue").ShallowRef<ViewerPdfPage[]>;
|
|
8
|
-
defaultScale: import("vue").Ref<number
|
|
8
|
+
defaultScale: import("vue").Ref<number>;
|
|
9
9
|
};
|
|
@@ -20,5 +20,5 @@ type CMapSource = {
|
|
|
20
20
|
cMapPacked: boolean;
|
|
21
21
|
cMapUrl: string;
|
|
22
22
|
};
|
|
23
|
-
export declare const usePdfProperties: (pdfDoc: ShallowRef<PDFDocumentProxy | undefined>, source: Ref<PDFSrc | CMapSource>, filename: Ref<string | undefined>) => Ref<PdfProperties | undefined
|
|
23
|
+
export declare const usePdfProperties: (pdfDoc: ShallowRef<PDFDocumentProxy | undefined>, source: Ref<PDFSrc | CMapSource>, filename: Ref<string | undefined>) => Ref<PdfProperties | undefined>;
|
|
24
24
|
export {};
|
|
@@ -1,8 +1,16 @@
|
|
|
1
|
-
import { type Ref } from 'vue';
|
|
1
|
+
import { type Ref, ShallowRef } from 'vue';
|
|
2
|
+
import type { PreparePrintProgress, ViewerPdfPage } from '@/utils/types';
|
|
2
3
|
export declare const usePrint: (isCancel: Ref<boolean>, emit: {
|
|
3
4
|
(event: 'loading'): void;
|
|
4
5
|
(event: 'loaded'): void;
|
|
5
|
-
(event: 'progress',
|
|
6
|
-
}, afterCanvasLoaded
|
|
7
|
-
|
|
6
|
+
(event: 'progress', payload: PreparePrintProgress): void;
|
|
7
|
+
}, afterCanvasLoaded?: Ref<Record<number, (element: HTMLCanvasElement) => void> | undefined> | undefined, pages?: ShallowRef<ViewerPdfPage[]>) => {
|
|
8
|
+
print: () => Promise<void>;
|
|
9
|
+
printControl: {
|
|
10
|
+
print: () => void;
|
|
11
|
+
cancel: () => void;
|
|
12
|
+
onProgress?: ((progress: PreparePrintProgress) => void) | undefined;
|
|
13
|
+
onError?: ((error: Error) => void) | undefined;
|
|
14
|
+
onComplete?: (() => void) | undefined;
|
|
15
|
+
};
|
|
8
16
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export declare const usePrintProcess: () => {
|
|
2
|
-
isCancel: import("vue").Ref<boolean
|
|
3
|
-
percent: import("vue").Ref<number
|
|
4
|
-
showPrintProcess: import("vue").Ref<boolean
|
|
2
|
+
isCancel: import("vue").Ref<boolean>;
|
|
3
|
+
percent: import("vue").Ref<number>;
|
|
4
|
+
showPrintProcess: import("vue").Ref<boolean>;
|
|
5
5
|
onCancel: () => void;
|
|
6
6
|
onLoading: () => void;
|
|
7
7
|
changePercent: (value: number) => void;
|
|
@@ -3,6 +3,6 @@ import { VirtualRange, VisibilityInfo } from '@/utils/types';
|
|
|
3
3
|
export declare function useVisibilities(totalPages: Ref<number>): {
|
|
4
4
|
resetVisibility: (preserveRange?: VirtualRange) => void;
|
|
5
5
|
updateVisibility: (info: VisibilityInfo) => void;
|
|
6
|
-
currentPage: Ref<number
|
|
6
|
+
currentPage: Ref<number>;
|
|
7
7
|
calculateCurrentPage: (range?: VirtualRange) => number;
|
|
8
8
|
};
|
package/dist/types/const.d.ts
CHANGED
|
@@ -30,28 +30,10 @@ export declare const FILE_INPUT: InjectionKey<Ref<ComponentPublicInstance<import
|
|
|
30
30
|
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{}>> & {
|
|
31
31
|
onChange?: ((file: string) => any) | undefined;
|
|
32
32
|
onFilenameChange?: ((file: string) => any) | undefined;
|
|
33
|
-
}, {}, {}>, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string, {}>, {}, {}> | undefined, ComponentPublicInstance<import("vue").DefineComponent<{}, {
|
|
34
|
-
triggerClick: () => void;
|
|
35
|
-
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
36
|
-
change: (file: string) => void;
|
|
37
|
-
} & {
|
|
38
|
-
filenameChange: (file: string) => void;
|
|
39
|
-
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{}>> & {
|
|
40
|
-
onChange?: ((file: string) => any) | undefined;
|
|
41
|
-
onFilenameChange?: ((file: string) => any) | undefined;
|
|
42
|
-
}, {}, {}>, {}, {}, {}, {}, {}, import("vue").DefineComponent<{}, {
|
|
43
|
-
triggerClick: () => void;
|
|
44
|
-
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
45
|
-
change: (file: string) => void;
|
|
46
|
-
} & {
|
|
47
|
-
filenameChange: (file: string) => void;
|
|
48
|
-
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{}>> & {
|
|
49
|
-
onChange?: ((file: string) => any) | undefined;
|
|
50
|
-
onFilenameChange?: ((file: string) => any) | undefined;
|
|
51
33
|
}, {}, {}>, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string, {}>, {}, {}> | undefined>>;
|
|
52
34
|
export declare const EMPTY_KEYWORD_REGEXP: NormalizedKeyword;
|
|
53
35
|
export declare const CURRENT_MATCH_CSS_CLASS = "vpv-highlight__text-current";
|
|
54
|
-
export declare const LATEST_MATCH_POSITION: InjectionKey<Ref<HighlightMatchPosition | undefined
|
|
36
|
+
export declare const LATEST_MATCH_POSITION: InjectionKey<Ref<HighlightMatchPosition | undefined>>;
|
|
55
37
|
export declare const GET_PAGE: InjectionKey<(doc: PDFDocumentProxy, pageIndex: number) => Promise<PDFPageProxy>>;
|
|
56
38
|
export declare const VIEWER_STATE: InjectionKey<{
|
|
57
39
|
pdfDocument: PDFDocumentProxy | undefined;
|
|
@@ -62,17 +44,17 @@ export declare const VIEWER_STATE: InjectionKey<{
|
|
|
62
44
|
scale: number;
|
|
63
45
|
rotation: number;
|
|
64
46
|
}>;
|
|
65
|
-
export declare const VIEWER_PAGES_PER_ROW: InjectionKey<Ref<number
|
|
66
|
-
export declare const TOOLBAR_OPTIONS: InjectionKey<Ref<ToolbarOptions | undefined
|
|
67
|
-
export declare const TOTAL_TOOL_OTHERS_MENU: InjectionKey<Ref<number
|
|
68
|
-
export declare const IS_DARK: InjectionKey<Ref<boolean
|
|
69
|
-
export declare const IS_MOBILE_VIEW: InjectionKey<Ref<boolean
|
|
47
|
+
export declare const VIEWER_PAGES_PER_ROW: InjectionKey<Ref<number>>;
|
|
48
|
+
export declare const TOOLBAR_OPTIONS: InjectionKey<Ref<ToolbarOptions | undefined>>;
|
|
49
|
+
export declare const TOTAL_TOOL_OTHERS_MENU: InjectionKey<Ref<number>>;
|
|
50
|
+
export declare const IS_DARK: InjectionKey<Ref<boolean>>;
|
|
51
|
+
export declare const IS_MOBILE_VIEW: InjectionKey<Ref<boolean>>;
|
|
70
52
|
export declare const CONTAINER: InjectionKey<ShallowRef<HTMLDivElement | undefined>>;
|
|
71
53
|
export declare const PAGES_CONTAINER: InjectionKey<ShallowRef<HTMLDivElement | undefined>>;
|
|
72
|
-
export declare const ACTUAL_PDF_PAGES: InjectionKey<
|
|
73
|
-
export declare const FOCUSED_PAGE_NUMBER: InjectionKey<Ref<number
|
|
74
|
-
export declare const ROTATION_DEGREE: InjectionKey<Ref<number
|
|
75
|
-
export declare const TOTAL_PAGE: InjectionKey<Ref<number
|
|
54
|
+
export declare const ACTUAL_PDF_PAGES: InjectionKey<ShallowRef<ViewerPdfPage[]>>;
|
|
55
|
+
export declare const FOCUSED_PAGE_NUMBER: InjectionKey<Ref<number>>;
|
|
56
|
+
export declare const ROTATION_DEGREE: InjectionKey<Ref<number>>;
|
|
57
|
+
export declare const TOTAL_PAGE: InjectionKey<Ref<number>>;
|
|
76
58
|
export declare const INITIAL_TEXT_LAYER: InjectionKey<boolean>;
|
|
77
59
|
export declare const DOWNLOAD_FILE: InjectionKey<() => Promise<void>>;
|
|
78
60
|
export declare const LICENSE: InjectionKey<ShallowRef<License | undefined>>;
|
|
@@ -81,5 +63,5 @@ export declare const SLOT_ICON_OPEN_FILE: InjectionKey<Slot<any> | undefined>;
|
|
|
81
63
|
export declare const SLOT_ICON_DOWNLOAD: InjectionKey<Slot<any> | undefined>;
|
|
82
64
|
export declare const SLOT_ICON_PRINT: InjectionKey<Slot<any> | undefined>;
|
|
83
65
|
export declare const SLOT_ICON_FULLSCREEN: InjectionKey<Slot<any> | undefined>;
|
|
84
|
-
export declare const LANG: InjectionKey<Ref<Localization
|
|
66
|
+
export declare const LANG: InjectionKey<Ref<Localization> | undefined>;
|
|
85
67
|
export declare const FUNC_GO_TO_PAGE: InjectionKey<(page: number) => void>;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -3,5 +3,5 @@ import { Locales } from './const';
|
|
|
3
3
|
export declare const VPdfViewerPlugin: Plugin;
|
|
4
4
|
export { Locales };
|
|
5
5
|
export * from './components';
|
|
6
|
-
export { type VPVInstance, type
|
|
6
|
+
export { type VPVInstance, type CanvasLoadedCallback, type Localization } from './utils/types';
|
|
7
7
|
export default VPdfViewerPlugin;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ComputedRef, MaybeRef, PropType, Ref, ShallowRef } from 'vue';
|
|
1
|
+
import { ComputedRef, MaybeRef, PropType, Reactive, Ref, ShallowRef } from 'vue';
|
|
2
2
|
import type { PageViewport } from 'pdfjs-dist';
|
|
3
3
|
import type { DocumentInitParameters, OnProgressParameters, PDFDataRangeTransport, TextContent, TypedArray, PDFPageProxy, PDFDocumentProxy } from 'pdfjs-dist/types/src/display/api';
|
|
4
4
|
import type { Metadata } from 'pdfjs-dist/types/src/display/metadata';
|
|
@@ -464,7 +464,7 @@ export interface HighlightMatchPosition {
|
|
|
464
464
|
matchIdx: number;
|
|
465
465
|
pageIdx: number;
|
|
466
466
|
}
|
|
467
|
-
export interface
|
|
467
|
+
export interface ViewportDimensions {
|
|
468
468
|
width: number;
|
|
469
469
|
height: number;
|
|
470
470
|
canvasWidth: number;
|
|
@@ -472,7 +472,7 @@ export interface AfterLoadedViewport {
|
|
|
472
472
|
widthRatio: number;
|
|
473
473
|
heightRatio: number;
|
|
474
474
|
}
|
|
475
|
-
export type
|
|
475
|
+
export type CanvasLoadedCallback = (element: HTMLCanvasElement, viewport: ViewportDimensions) => void;
|
|
476
476
|
export declare const VPVBaseProps: {
|
|
477
477
|
readonly src: {
|
|
478
478
|
readonly type: PropType<string | VPVSrc>;
|
|
@@ -529,7 +529,7 @@ export declare const VPVBaseProps: {
|
|
|
529
529
|
readonly default: undefined;
|
|
530
530
|
};
|
|
531
531
|
readonly afterCanvasLoaded: {
|
|
532
|
-
readonly type: PropType<Record<number,
|
|
532
|
+
readonly type: PropType<Record<number, CanvasLoadedCallback>>;
|
|
533
533
|
readonly default: undefined;
|
|
534
534
|
};
|
|
535
535
|
};
|
|
@@ -566,8 +566,21 @@ export interface SearchControl {
|
|
|
566
566
|
nextSearchMatch: () => void;
|
|
567
567
|
prevSearchMatch: () => void;
|
|
568
568
|
}
|
|
569
|
+
export interface PreparePrintProgress {
|
|
570
|
+
loadedPages: number;
|
|
571
|
+
totalPages: number;
|
|
572
|
+
percentage: number;
|
|
573
|
+
}
|
|
574
|
+
export interface PrintControl {
|
|
575
|
+
print(): Awaited<void>;
|
|
576
|
+
cancel(): void;
|
|
577
|
+
onProgress?: (progress: PreparePrintProgress) => void;
|
|
578
|
+
onError?: (error: Error) => void;
|
|
579
|
+
onComplete?: () => void;
|
|
580
|
+
}
|
|
569
581
|
export interface VPVInstance {
|
|
570
|
-
searchControl: SearchControl;
|
|
571
582
|
goToPage: (page: number) => void;
|
|
583
|
+
printControl: Reactive<PrintControl>;
|
|
584
|
+
searchControl: SearchControl;
|
|
572
585
|
}
|
|
573
586
|
export {};
|