@vue-pdf-viewer/viewer 3.3.0-beta.8 → 3.3.0-rc.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.
@@ -63,7 +63,7 @@ declare const _default: {
63
63
  intersected: (args: VisibilityInfo) => void;
64
64
  }, string, {}, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & (new () => {
65
65
  $slots: {
66
- 'page-overlay': (_: {
66
+ pageOverlay: (_: {
67
67
  pageIndex: number;
68
68
  scale: number;
69
69
  }) => any;
@@ -75,6 +75,10 @@ declare const _default: {
75
75
  readonly type: import("vue").PropType<import("@vue-pdf-viewer/shared").Plugin[]>;
76
76
  readonly default: undefined;
77
77
  };
78
+ readonly documentOptions: {
79
+ readonly type: import("vue").PropType<import("@/utils/types").PDFDocumentOptions>;
80
+ readonly default: undefined;
81
+ };
78
82
  }>> & Readonly<{
79
83
  onScroll?: ((scrollEvent: Event) => any) | undefined;
80
84
  onAnnotation?: ((data: AnnotationEventPayload) => any) | undefined;
@@ -106,7 +110,6 @@ declare const _default: {
106
110
  goToPage: (pageNumber: number) => void;
107
111
  totalPages: number;
108
112
  currentPage: number;
109
- getTextContent: (pageNumber: number) => Promise<import("pdfjs-dist/types/src/display/api").TextContent> | undefined;
110
113
  };
111
114
  searchControl: {
112
115
  searchMatches: {
@@ -186,6 +189,7 @@ declare const _default: {
186
189
  readonly afterCanvasLoaded: Record<number, import("@/utils/types").CanvasLoadedCallback>;
187
190
  readonly textHighlights: import("@/utils/types").TextHighlight[];
188
191
  readonly plugins: import("@vue-pdf-viewer/shared").Plugin[];
192
+ readonly documentOptions: import("@/utils/types").PDFDocumentOptions;
189
193
  readonly downloadFilename: string;
190
194
  }, true, {}, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, {}, any, import("vue").ComponentProvideOptions, {
191
195
  P: {};
@@ -266,6 +270,10 @@ declare const _default: {
266
270
  readonly type: import("vue").PropType<import("@vue-pdf-viewer/shared").Plugin[]>;
267
271
  readonly default: undefined;
268
272
  };
273
+ readonly documentOptions: {
274
+ readonly type: import("vue").PropType<import("@/utils/types").PDFDocumentOptions>;
275
+ readonly default: undefined;
276
+ };
269
277
  }>> & Readonly<{
270
278
  onScroll?: ((scrollEvent: Event) => any) | undefined;
271
279
  onAnnotation?: ((data: AnnotationEventPayload) => any) | undefined;
@@ -297,7 +305,6 @@ declare const _default: {
297
305
  goToPage: (pageNumber: number) => void;
298
306
  totalPages: number;
299
307
  currentPage: number;
300
- getTextContent: (pageNumber: number) => Promise<import("pdfjs-dist/types/src/display/api").TextContent> | undefined;
301
308
  };
302
309
  searchControl: {
303
310
  searchMatches: {
@@ -353,6 +360,7 @@ declare const _default: {
353
360
  readonly afterCanvasLoaded: Record<number, import("@/utils/types").CanvasLoadedCallback>;
354
361
  readonly textHighlights: import("@/utils/types").TextHighlight[];
355
362
  readonly plugins: import("@vue-pdf-viewer/shared").Plugin[];
363
+ readonly documentOptions: import("@/utils/types").PDFDocumentOptions;
356
364
  readonly downloadFilename: string;
357
365
  }>;
358
366
  __isFragment?: undefined;
@@ -430,6 +438,10 @@ declare const _default: {
430
438
  readonly type: import("vue").PropType<import("@vue-pdf-viewer/shared").Plugin[]>;
431
439
  readonly default: undefined;
432
440
  };
441
+ readonly documentOptions: {
442
+ readonly type: import("vue").PropType<import("@/utils/types").PDFDocumentOptions>;
443
+ readonly default: undefined;
444
+ };
433
445
  }>> & Readonly<{
434
446
  onScroll?: ((scrollEvent: Event) => any) | undefined;
435
447
  onAnnotation?: ((data: AnnotationEventPayload) => any) | undefined;
@@ -461,7 +473,6 @@ declare const _default: {
461
473
  goToPage: (pageNumber: number) => void;
462
474
  totalPages: number;
463
475
  currentPage: number;
464
- getTextContent: (pageNumber: number) => Promise<import("pdfjs-dist/types/src/display/api").TextContent> | undefined;
465
476
  };
466
477
  searchControl: {
467
478
  searchMatches: {
@@ -541,6 +552,7 @@ declare const _default: {
541
552
  readonly afterCanvasLoaded: Record<number, import("@/utils/types").CanvasLoadedCallback>;
542
553
  readonly textHighlights: import("@/utils/types").TextHighlight[];
543
554
  readonly plugins: import("@vue-pdf-viewer/shared").Plugin[];
555
+ readonly documentOptions: import("@/utils/types").PDFDocumentOptions;
544
556
  readonly downloadFilename: string;
545
557
  }, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & (new () => {
546
558
  $slots: {
@@ -617,7 +629,7 @@ declare const _default: {
617
629
  onToggle: () => void;
618
630
  }) => any;
619
631
  iconThumbnail: (_: {}) => any;
620
- 'page-overlay': (_: {
632
+ pageOverlay: (_: {
621
633
  pageIndex: number;
622
634
  scale: number;
623
635
  }) => any;
@@ -1,5 +1,5 @@
1
1
  import type { MaybeRef } from 'vue';
2
- import type { PDFDestination, PDFOptions, PDFSrc } from '../utils/types';
2
+ import type { PDFOptions, PDFSrc, PDFDocumentOptions } from '../utils/types';
3
3
  import { type PDFDocumentProxy, type PDFPageProxy } from 'pdfjs-dist/types/src/display/api';
4
4
  /**
5
5
  * @typedef {Object} UsePDFParameters
@@ -19,10 +19,8 @@ import { type PDFDocumentProxy, type PDFPageProxy } from 'pdfjs-dist/types/src/d
19
19
  * @param {UsePDFParameters} options
20
20
  * UsePDF object parameters
21
21
  */
22
- declare function usePdf(src: MaybeRef<PDFSrc>, options?: PDFOptions, workerUrl?: string): {
23
- pdf: import("vue").ShallowRef<import("pdfjs-dist/types/src/display/api").PDFDocumentLoadingTask | undefined, import("pdfjs-dist/types/src/display/api").PDFDocumentLoadingTask | undefined>;
24
- totalPages: import("vue").ShallowRef<number, number>;
22
+ declare function usePdf(src: MaybeRef<PDFSrc>, options?: PDFOptions, workerUrl?: string, documentOptions?: PDFDocumentOptions): {
23
+ pdfDocLoadingTask: import("vue").ShallowRef<import("pdfjs-dist/types/src/display/api").PDFDocumentLoadingTask | undefined, import("pdfjs-dist/types/src/display/api").PDFDocumentLoadingTask | undefined>;
25
24
  getPage: (doc: PDFDocumentProxy, pageIndex: number) => Promise<PDFPageProxy>;
26
- getPDFDestination: (destination: string | any[] | null) => Promise<PDFDestination | null>;
27
25
  };
28
26
  export default usePdf;
@@ -1,5 +1,6 @@
1
1
  export declare const useTextLayers: () => {
2
- addTextLayer: (textLayer: HTMLElement, pageIndex: number) => void;
3
- getTextLayers: () => import("vue").Reactive<Map<number, HTMLElement>>;
2
+ addTextLayer: (textLayerDiv: HTMLElement, endDiv: HTMLElement) => void;
3
+ removeTextLayer: (textLayerDiv: HTMLElement) => void;
4
+ getTextLayers: () => Map<HTMLElement, HTMLElement>;
4
5
  resetTextLayers: () => void;
5
6
  };
@@ -4,6 +4,5 @@ export declare const VPdfViewerPlugin: Plugin;
4
4
  export { Locales };
5
5
  export * from './components';
6
6
  export type { VPVInstance, CanvasLoadedCallback, PrintControl, ToolbarOptions, MatchHighlightResult } from './utils/types';
7
- export type { TextContent } from 'pdfjs-dist/types/src/display/api';
8
7
  export type { Localization } from '@vue-pdf-viewer/shared';
9
8
  export default VPdfViewerPlugin;
@@ -120,6 +120,32 @@ export type CharacterMap = {
120
120
  url: string;
121
121
  isCompressed?: boolean;
122
122
  };
123
+ /**
124
+ * Document loading options for configuring how the PDF is fetched and loaded.
125
+ */
126
+ export interface PDFDocumentOptions {
127
+ /**
128
+ * Specify maximum number of bytes fetched per range request.
129
+ * The default value is 65536 (64KB).
130
+ */
131
+ rangeChunkSize?: number;
132
+ /**
133
+ * Disable streaming of PDF file data.
134
+ * By default PDF.js attempts to load PDF files in chunks.
135
+ * The default value is `false`.
136
+ */
137
+ disableStream?: boolean;
138
+ /**
139
+ * Disable pre-fetching of PDF file data.
140
+ * When range requests are enabled PDF.js will automatically keep
141
+ * fetching more data even if it isn't needed to display the current page.
142
+ * The default value is `false`.
143
+ *
144
+ * NOTE: It is also necessary to disable streaming, see above, in order for
145
+ * disabling of pre-fetching to work correctly.
146
+ */
147
+ disableAutoFetch?: boolean;
148
+ }
123
149
  export type PDFSrc = string | URL | TypedArray | PDFDataRangeTransport | DocumentInitParameters | undefined | null;
124
150
  export interface PDFOptions {
125
151
  onProgress?: OnProgressCallback;
@@ -387,6 +413,11 @@ export interface VPdfViewerProps {
387
413
  * The plugins to be used in the VPV.
388
414
  */
389
415
  plugins?: Plugin[];
416
+ /**
417
+ * Document loading options for configuring how the PDF is fetched and loaded.
418
+ * Controls chunk size, streaming, and auto-fetch behavior.
419
+ */
420
+ documentOptions?: PDFDocumentOptions;
390
421
  }
391
422
  export interface HighlightMatchPosition {
392
423
  matchIdx: number;
@@ -494,6 +525,10 @@ export declare const VPVBaseProps: {
494
525
  readonly type: PropType<Plugin[]>;
495
526
  readonly default: undefined;
496
527
  };
528
+ readonly documentOptions: {
529
+ readonly type: PropType<PDFDocumentOptions>;
530
+ readonly default: undefined;
531
+ };
497
532
  };
498
533
  export interface MatchValue extends Match {
499
534
  page: number;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@vue-pdf-viewer/viewer",
3
3
  "private": false,
4
- "version": "3.3.0-beta.8",
4
+ "version": "3.3.0-rc.0",
5
5
  "type": "module",
6
6
  "main": "./dist/index.umd.cjs",
7
7
  "module": "./dist/index.js",