@vue-pdf-viewer/viewer 3.0.0-alpha.0 → 3.0.0-alpha.3

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.
Files changed (206) hide show
  1. package/dist/{annotation-circle-tIpRci60.js → annotation-circle-COOiYsJg.js} +2 -2
  2. package/dist/{annotation-freetext-zmKZ4GuW.js → annotation-freetext-dvsFpAZu.js} +2 -2
  3. package/dist/{annotation-highlight-CBhenBLo.js → annotation-highlight-DfO5AU26.js} +2 -2
  4. package/dist/{annotation-ink-Cr5tjD8f.js → annotation-ink-Dq1T0COO.js} +2 -2
  5. package/dist/{annotation-line-CBubP1QZ.js → annotation-line-mbXXKVam.js} +2 -2
  6. package/dist/{annotation-link-DI9mj24Y.js → annotation-link-DHPTdWez.js} +2 -2
  7. package/dist/{annotation-signature-DQVfU7hJ.js → annotation-signature-4ci2KImE.js} +2 -2
  8. package/dist/{annotation-square-_rIuUCHT.js → annotation-square-SQ7oqcEq.js} +2 -2
  9. package/dist/{annotation-squiggly-DfLrUnSa.js → annotation-squiggly-B7fWFNAK.js} +2 -2
  10. package/dist/{annotation-stamp-B5gaCO0X.js → annotation-stamp-BkEskP5J.js} +2 -2
  11. package/dist/{annotation-strikeout-Cn_VHn_N.js → annotation-strikeout-C-bSOcHc.js} +2 -2
  12. package/dist/{annotation-text-pKHfDK_Q.js → annotation-text-BgsMjKeI.js} +2 -2
  13. package/dist/{annotation-underline-BDgmfJQk.js → annotation-underline-Be5qs13j.js} +2 -2
  14. package/dist/{arrow-up-DhoV0HvK.js → arrow-up-vWNs2knA.js} +2 -2
  15. package/dist/{check-BRo7Q5UG.js → check-BkaH7nrH.js} +2 -2
  16. package/dist/{chevron-down-BEs3P7KI.js → chevron-down-BSFTOkiu.js} +2 -2
  17. package/dist/{clear-DP391aEz.js → clear-CasZmBPr.js} +2 -2
  18. package/dist/{close-CnbAWKuA.js → close-BgsD04zx.js} +2 -2
  19. package/dist/{comment-panel-BkFw3FUB.js → comment-panel-B-sIKcBp.js} +2 -2
  20. package/dist/{download-C45QpUvK.js → download-DCHGUHXx.js} +2 -2
  21. package/dist/{drag-icon-CpENKa0y.js → drag-icon-D-z1P6O_.js} +2 -2
  22. package/dist/{drag-icon-dark-B0sqKXav.js → drag-icon-dark-DXDxQjnW.js} +2 -2
  23. package/dist/{ellipsis-vertical-X1VRRfZe.js → ellipsis-vertical-Cjbi7utY.js} +2 -2
  24. package/dist/{empty-comment-dark-DdPeDeR5.js → empty-comment-dark-CrZRt0Hl.js} +2 -2
  25. package/dist/{empty-comment-light-Dgc1r5xv.js → empty-comment-light-BVPUX2pA.js} +2 -2
  26. package/dist/{file-C2gjRcLU.js → file-BD05gONj.js} +2 -2
  27. package/dist/{first-page-32lvRrjG.js → first-page-DihCXIQm.js} +2 -2
  28. package/dist/{fullscreen-Cuegwls4.js → fullscreen-BmHQQPIs.js} +2 -2
  29. package/dist/{hand-BvbzlDGf.js → hand-B1v6mSWQ.js} +2 -2
  30. package/dist/index.js +9012 -8646
  31. package/dist/index.umd.cjs +18 -18
  32. package/dist/{info-2-wEcru0.js → info-DXpOTVKn.js} +2 -2
  33. package/dist/{last-page-DDJIJ2gp.js → last-page-DIN17z_8.js} +2 -2
  34. package/dist/{magnifier-shuB09Te.js → magnifier-Dep29X1B.js} +2 -2
  35. package/dist/{moon-Cf7pmsnw.js → moon-Dw-MII-V.js} +2 -2
  36. package/dist/{page-view-dual-f5-I0-4D.js → page-view-dual-DCLg-YkG.js} +2 -2
  37. package/dist/{page-view-single-DTduusoS.js → page-view-single-CWOhdavX.js} +2 -2
  38. package/dist/{pointer-CdvbhXLR.js → pointer-jfdFDx4z.js} +2 -2
  39. package/dist/{printer-ERNx1Q88.js → printer-B8qbXO9F.js} +2 -2
  40. package/dist/{rotate-counter-clockwise-CEN3P8nT.js → rotate-counter-clockwise-DFl9ijSR.js} +2 -2
  41. package/dist/{scrolling-horizontal-CdariRpO.js → scrolling-horizontal-JO2P2O-8.js} +2 -2
  42. package/dist/{scrolling-page-wFZlGv_K.js → scrolling-page-y5Rrmrnm.js} +2 -2
  43. package/dist/{scrolling-vertical-B1Doxmyt.js → scrolling-vertical-D9MCCss9.js} +2 -2
  44. package/dist/{scrolling-wrapped-BBipRQ-N.js → scrolling-wrapped-CYbEHLH6.js} +2 -2
  45. package/dist/{sun-C0fX-A5U.js → sun-BhyBd5LA.js} +2 -2
  46. package/dist/{thumbnail-HzftUNEp.js → thumbnail-BMmN_jSl.js} +2 -2
  47. package/dist/{trash-BTydaFkw.js → trash-Deie-RCt.js} +2 -2
  48. package/dist/{zoom-in-CPqqALGr.js → zoom-in-qogh-J7e.js} +2 -2
  49. package/dist/{zoom-out-BpilF8O_.js → zoom-out-BFzERV6_.js} +2 -2
  50. package/package.json +16 -11
  51. package/dist/types/assets/pdf-annotations/index.d.ts +0 -2
  52. package/dist/types/components/AppButton.vue.d.ts +0 -18
  53. package/dist/types/components/AppFormControl.vue.d.ts +0 -30
  54. package/dist/types/components/AppIcon.vue.d.ts +0 -15
  55. package/dist/types/components/AppInput.vue.d.ts +0 -12
  56. package/dist/types/components/AppLoader.vue.d.ts +0 -19
  57. package/dist/types/components/AppPopover.vue.d.ts +0 -93
  58. package/dist/types/components/AppTooltip.vue.d.ts +0 -34
  59. package/dist/types/components/DragFileMask.vue.d.ts +0 -55
  60. package/dist/types/components/HighlightColorButton.vue.d.ts +0 -15
  61. package/dist/types/components/HighlightColorPicker.vue.d.ts +0 -2
  62. package/dist/types/components/LayerAnnotation.vue.d.ts +0 -47
  63. package/dist/types/components/LayerAnnotationEditor.vue.d.ts +0 -26
  64. package/dist/types/components/LayerAnnotationEditorHighlight.vue.d.ts +0 -37
  65. package/dist/types/components/LayerAnnotationEditorHighlightItem.vue.d.ts +0 -26
  66. package/dist/types/components/LayerAnnotationEditorImage.vue.d.ts +0 -28
  67. package/dist/types/components/LayerAnnotationStampResizer.vue.d.ts +0 -28
  68. package/dist/types/components/LayerCanvas.vue.d.ts +0 -25
  69. package/dist/types/components/LayerText.vue.d.ts +0 -30
  70. package/dist/types/components/LayerTextHighlight.vue.d.ts +0 -20
  71. package/dist/types/components/LayerTextSearchHighlight.vue.d.ts +0 -19
  72. package/dist/types/components/LayerXFA.vue.d.ts +0 -23
  73. package/dist/types/components/ModalPassword.vue.d.ts +0 -19
  74. package/dist/types/components/ModalPdfProperties.vue.d.ts +0 -18
  75. package/dist/types/components/ModalPrintLoadingProgress.vue.d.ts +0 -20
  76. package/dist/types/components/Signatures.vue.d.ts +0 -2
  77. package/dist/types/components/SwitchAppearance.vue.d.ts +0 -23
  78. package/dist/types/components/ToolCommentPanel.vue.d.ts +0 -31
  79. package/dist/types/components/ToolDownload.vue.d.ts +0 -21
  80. package/dist/types/components/ToolFullscreen.vue.d.ts +0 -22
  81. package/dist/types/components/ToolMenuOthers.vue.d.ts +0 -88
  82. package/dist/types/components/ToolMenuOthersMobile.vue.d.ts +0 -21
  83. package/dist/types/components/ToolOpenFile.vue.d.ts +0 -21
  84. package/dist/types/components/ToolOpenFileInput.vue.d.ts +0 -11
  85. package/dist/types/components/ToolPagination.vue.d.ts +0 -68
  86. package/dist/types/components/ToolPrint.vue.d.ts +0 -35
  87. package/dist/types/components/ToolSearch.vue.d.ts +0 -73
  88. package/dist/types/components/ToolThumbnail.vue.d.ts +0 -43
  89. package/dist/types/components/ToolZoom.vue.d.ts +0 -55
  90. package/dist/types/components/ToolZoomPercentageMenu.vue.d.ts +0 -25
  91. package/dist/types/components/VPdfComments.vue.d.ts +0 -28
  92. package/dist/types/components/VPdfCommentsDate.vue.d.ts +0 -15
  93. package/dist/types/components/VPdfCommentsHeader.vue.d.ts +0 -16
  94. package/dist/types/components/VPdfCommentsIcon.vue.d.ts +0 -16
  95. package/dist/types/components/VPdfCommentsReplies.vue.d.ts +0 -16
  96. package/dist/types/components/VPdfCommentsSidebar.vue.d.ts +0 -15
  97. package/dist/types/components/VPdfCommentsText.vue.d.ts +0 -2
  98. package/dist/types/components/VPdfPage.vue.d.ts +0 -44
  99. package/dist/types/components/VPdfSplitter.vue.d.ts +0 -2
  100. package/dist/types/components/VPdfThumbnail.vue.d.ts +0 -26
  101. package/dist/types/components/VPdfThumbnails.vue.d.ts +0 -22
  102. package/dist/types/components/VPdfViewer.vue.d.ts +0 -602
  103. package/dist/types/components/index.d.ts +0 -4
  104. package/dist/types/components/ui/button/Button.vue.d.ts +0 -52
  105. package/dist/types/components/ui/button/index.d.ts +0 -7
  106. package/dist/types/components/ui/checkbox/Checkbox.vue.d.ts +0 -35
  107. package/dist/types/components/ui/checkbox/index.d.ts +0 -1
  108. package/dist/types/components/ui/collapsible/Collapsible.vue.d.ts +0 -30
  109. package/dist/types/components/ui/collapsible/CollapsibleContent.vue.d.ts +0 -28
  110. package/dist/types/components/ui/collapsible/CollapsibleTrigger.vue.d.ts +0 -28
  111. package/dist/types/components/ui/collapsible/index.d.ts +0 -3
  112. package/dist/types/components/ui/dialog/Dialog.vue.d.ts +0 -28
  113. package/dist/types/components/ui/dialog/DialogClose.vue.d.ts +0 -28
  114. package/dist/types/components/ui/dialog/DialogContent.vue.d.ts +0 -35
  115. package/dist/types/components/ui/dialog/DialogDescription.vue.d.ts +0 -35
  116. package/dist/types/components/ui/dialog/DialogFooter.vue.d.ts +0 -34
  117. package/dist/types/components/ui/dialog/DialogHeader.vue.d.ts +0 -34
  118. package/dist/types/components/ui/dialog/DialogTitle.vue.d.ts +0 -35
  119. package/dist/types/components/ui/dialog/DialogTrigger.vue.d.ts +0 -28
  120. package/dist/types/components/ui/dialog/index.d.ts +0 -8
  121. package/dist/types/components/ui/dropdown-menu/DropdownMenu.vue.d.ts +0 -28
  122. package/dist/types/components/ui/dropdown-menu/DropdownMenuCheckboxItem.vue.d.ts +0 -35
  123. package/dist/types/components/ui/dropdown-menu/DropdownMenuContent.vue.d.ts +0 -52
  124. package/dist/types/components/ui/dropdown-menu/DropdownMenuGroup.vue.d.ts +0 -28
  125. package/dist/types/components/ui/dropdown-menu/DropdownMenuItem.vue.d.ts +0 -41
  126. package/dist/types/components/ui/dropdown-menu/DropdownMenuLabel.vue.d.ts +0 -38
  127. package/dist/types/components/ui/dropdown-menu/DropdownMenuRadioGroup.vue.d.ts +0 -28
  128. package/dist/types/components/ui/dropdown-menu/DropdownMenuRadioItem.vue.d.ts +0 -38
  129. package/dist/types/components/ui/dropdown-menu/DropdownMenuSeparator.vue.d.ts +0 -17
  130. package/dist/types/components/ui/dropdown-menu/DropdownMenuShortcut.vue.d.ts +0 -34
  131. package/dist/types/components/ui/dropdown-menu/DropdownMenuSub.vue.d.ts +0 -28
  132. package/dist/types/components/ui/dropdown-menu/DropdownMenuSubContent.vue.d.ts +0 -35
  133. package/dist/types/components/ui/dropdown-menu/DropdownMenuSubTrigger.vue.d.ts +0 -35
  134. package/dist/types/components/ui/dropdown-menu/DropdownMenuTrigger.vue.d.ts +0 -28
  135. package/dist/types/components/ui/dropdown-menu/index.d.ts +0 -15
  136. package/dist/types/components/ui/input/Input.vue.d.ts +0 -16
  137. package/dist/types/components/ui/input/index.d.ts +0 -7
  138. package/dist/types/components/ui/popover/Popover.vue.d.ts +0 -28
  139. package/dist/types/components/ui/popover/PopoverContent.vue.d.ts +0 -64
  140. package/dist/types/components/ui/popover/PopoverTrigger.vue.d.ts +0 -28
  141. package/dist/types/components/ui/popover/index.d.ts +0 -3
  142. package/dist/types/components/ui/progress/Progress.vue.d.ts +0 -28
  143. package/dist/types/components/ui/progress/index.d.ts +0 -1
  144. package/dist/types/components/ui/toast/Toast.vue.d.ts +0 -28
  145. package/dist/types/components/ui/toast/ToastAction.vue.d.ts +0 -35
  146. package/dist/types/components/ui/toast/ToastClose.vue.d.ts +0 -17
  147. package/dist/types/components/ui/toast/ToastDescription.vue.d.ts +0 -35
  148. package/dist/types/components/ui/toast/ToastProvider.vue.d.ts +0 -28
  149. package/dist/types/components/ui/toast/ToastTitle.vue.d.ts +0 -35
  150. package/dist/types/components/ui/toast/ToastViewport.vue.d.ts +0 -17
  151. package/dist/types/components/ui/toast/Toaster.vue.d.ts +0 -2
  152. package/dist/types/components/ui/toast/index.d.ts +0 -21
  153. package/dist/types/components/ui/toast/use-toast.d.ts +0 -272
  154. package/dist/types/components/ui/tooltip/Tooltip.vue.d.ts +0 -28
  155. package/dist/types/components/ui/tooltip/TooltipContent.vue.d.ts +0 -52
  156. package/dist/types/components/ui/tooltip/TooltipProvider.vue.d.ts +0 -28
  157. package/dist/types/components/ui/tooltip/TooltipTrigger.vue.d.ts +0 -28
  158. package/dist/types/components/ui/tooltip/index.d.ts +0 -4
  159. package/dist/types/components/utils/annotations.d.ts +0 -5
  160. package/dist/types/components/utils/destination.d.ts +0 -7
  161. package/dist/types/components/utils/helpers.d.ts +0 -2
  162. package/dist/types/components/utils/link_service.d.ts +0 -71
  163. package/dist/types/components/utils/sanitizeExternalURL.d.ts +0 -1
  164. package/dist/types/composables/useAnnotationDrag.d.ts +0 -72
  165. package/dist/types/composables/useAnnotationHighlight.d.ts +0 -389
  166. package/dist/types/composables/useAnnotationStamp.d.ts +0 -493
  167. package/dist/types/composables/useAnnotationStorage.d.ts +0 -72
  168. package/dist/types/composables/useDownload.d.ts +0 -13
  169. package/dist/types/composables/useHighlight.d.ts +0 -11
  170. package/dist/types/composables/useLicense.d.ts +0 -22
  171. package/dist/types/composables/usePdf.d.ts +0 -28
  172. package/dist/types/composables/usePdfComments.d.ts +0 -5
  173. package/dist/types/composables/usePdfPagesSizes.d.ts +0 -8
  174. package/dist/types/composables/usePdfProperties.d.ts +0 -10
  175. package/dist/types/composables/usePinch.d.ts +0 -3
  176. package/dist/types/composables/usePlugins.d.ts +0 -252
  177. package/dist/types/composables/usePrintControl.d.ts +0 -22
  178. package/dist/types/composables/usePrintProcess.d.ts +0 -8
  179. package/dist/types/composables/useRenderQueue.d.ts +0 -13
  180. package/dist/types/composables/useRequestAnimationFrame.d.ts +0 -1
  181. package/dist/types/composables/useRotation.d.ts +0 -7
  182. package/dist/types/composables/useScale.d.ts +0 -21
  183. package/dist/types/composables/useSearch.d.ts +0 -5
  184. package/dist/types/composables/useTextLayers.d.ts +0 -5
  185. package/dist/types/composables/useVirtualPages.d.ts +0 -32
  186. package/dist/types/composables/useVisibilities.d.ts +0 -9
  187. package/dist/types/const.d.ts +0 -130
  188. package/dist/types/index.d.ts +0 -8
  189. package/dist/types/utils/annotation-command.d.ts +0 -18
  190. package/dist/types/utils/annotation-display.d.ts +0 -24
  191. package/dist/types/utils/annotation-highlight.d.ts +0 -69
  192. package/dist/types/utils/annotation-image.d.ts +0 -111
  193. package/dist/types/utils/annotation-pdf.d.ts +0 -35
  194. package/dist/types/utils/appConsole.d.ts +0 -24
  195. package/dist/types/utils/characters.d.ts +0 -16
  196. package/dist/types/utils/color.d.ts +0 -4
  197. package/dist/types/utils/convertPDFDate.d.ts +0 -1
  198. package/dist/types/utils/enumerators.d.ts +0 -80
  199. package/dist/types/utils/highlight.d.ts +0 -8
  200. package/dist/types/utils/promiseWithResolvers.d.ts +0 -7
  201. package/dist/types/utils/searchHighlight.d.ts +0 -10
  202. package/dist/types/utils/smoothScroll.d.ts +0 -2
  203. package/dist/types/utils/types.d.ts +0 -715
  204. package/dist/types/utils/uiViewer.d.ts +0 -4
  205. package/dist/types/utils/validators.d.ts +0 -26
  206. package/dist/types/utils.d.ts +0 -20
@@ -1,715 +0,0 @@
1
- import { ComputedRef, MaybeRef, PropType, Reactive, Ref, ShallowRef } from 'vue';
2
- import type { PageViewport } from 'pdfjs-dist';
3
- import type { DocumentInitParameters, OnProgressParameters, PDFDataRangeTransport, TextContent, TypedArray, PDFPageProxy, PDFDocumentProxy } from 'pdfjs-dist/types/src/display/api';
4
- import type { Metadata } from 'pdfjs-dist/types/src/display/metadata';
5
- import { ZoomLevel, ViewMode, ScrollMode, VPVAnnotationType, LicenseType, AnnotationType, LicenseProduct } from './enumerators';
6
- import { Localization, Plugin } from '@vue-pdf-viewer/shared';
7
- export interface VirtualRange {
8
- start: number;
9
- end: number;
10
- }
11
- export interface ElementRect {
12
- left: number;
13
- top: number;
14
- width: number;
15
- height: number;
16
- }
17
- export interface Match {
18
- start: {
19
- idx: number;
20
- offset: number;
21
- };
22
- end: {
23
- idx: number;
24
- offset: number;
25
- };
26
- str: string;
27
- oIndex: number;
28
- pageIndex: number;
29
- rect: ElementRect;
30
- }
31
- export type LoadedEventPayload = number;
32
- export type FocusedPageEventPayload = number;
33
- export interface PageShowRatioChangePayload {
34
- page: number;
35
- ratio: number;
36
- }
37
- export interface OutlineRef {
38
- gen: number;
39
- num: number;
40
- }
41
- export type OutlineDestination = [
42
- OutlineRef | number,
43
- OutlineDestinationName,
44
- ...any[]
45
- ];
46
- export interface OutlineDestinationName {
47
- name: string;
48
- }
49
- interface AnnotationPoint {
50
- x: number;
51
- y: number;
52
- }
53
- interface Attachment {
54
- content: Uint8Array;
55
- filename: string;
56
- }
57
- type OutlineDestinationType = string | OutlineDestination;
58
- export interface Annotation {
59
- annotationType: number;
60
- color?: Uint8ClampedArray;
61
- dest: OutlineDestinationType;
62
- hasAppearance: boolean;
63
- id: string;
64
- rect: number[];
65
- subtype: string;
66
- borderStyle: {
67
- dashArray: number[];
68
- horizontalCornerRadius: number;
69
- style: number;
70
- verticalCornerRadius: number;
71
- width: number;
72
- };
73
- hasPopup?: boolean;
74
- contents?: string;
75
- contentsObj?: {
76
- dir: string;
77
- str: string;
78
- };
79
- modificationDate?: string;
80
- quadPoints?: Array<any>;
81
- title?: string;
82
- titleObj?: {
83
- dir: string;
84
- str: string;
85
- };
86
- parentId?: string;
87
- parentType?: string;
88
- file?: Attachment;
89
- inkLists?: AnnotationPoint[][];
90
- lineCoordinates: number[];
91
- action?: string;
92
- unsafeUrl?: string;
93
- url?: string;
94
- newWindow?: boolean;
95
- vertices?: AnnotationPoint[];
96
- name?: string;
97
- fieldType: string;
98
- pushButton: boolean;
99
- deleted?: boolean;
100
- noView?: boolean;
101
- noPrint?: boolean;
102
- }
103
- export type AnnotationIconType = keyof typeof AnnotationType | 'Signature';
104
- export interface AnnotationEventPayload {
105
- type: VPVAnnotationType;
106
- data: any;
107
- }
108
- export interface RotateEvent {
109
- direction: 'clockwise' | 'counterclockwise';
110
- rotate: number;
111
- }
112
- export interface CharacterIndex {
113
- char: string;
114
- charIdxInSpan: number;
115
- spanIdx: number;
116
- }
117
- export interface MatchRangeIndex {
118
- keyword: RegExp;
119
- startIndex: number;
120
- endIndex: number;
121
- }
122
- export interface FlagKeyword {
123
- keyword: string;
124
- matchCase?: boolean;
125
- wholeWords?: boolean;
126
- }
127
- export type SingleKeyword = string | RegExp | FlagKeyword;
128
- export interface NormalizedKeyword {
129
- keyword: string;
130
- regExp: RegExp;
131
- wholeWords: boolean;
132
- color?: string;
133
- }
134
- export interface HighlightArea {
135
- keywordStr: string;
136
- left: number;
137
- top: number;
138
- height: number;
139
- width: number;
140
- pageHeight: number;
141
- pageWidth: number;
142
- highlightColor?: string;
143
- }
144
- export interface HighlightEventPayload {
145
- matches: Match[];
146
- page: number;
147
- textContent: TextContent;
148
- textDivs: HTMLElement[];
149
- }
150
- export interface TextLayerLoadedEventPayload {
151
- textDivs: HTMLElement[];
152
- textContent: TextContent | undefined;
153
- textLayerRef?: HTMLElement;
154
- }
155
- export interface HighlightOptions {
156
- matchCase?: boolean;
157
- wholeWords?: boolean;
158
- }
159
- export interface TextLayerHighlightProps {
160
- keyword: string;
161
- options?: HighlightOptions;
162
- }
163
- export interface Base<T, S> {
164
- type: T;
165
- spec: S;
166
- }
167
- export type XYZ = Base<'XYZ', [left: number, top: number, zoom: number]>;
168
- export type Fit = Base<'Fit', []>;
169
- export type FitH = Base<'FitH', [top: number]>;
170
- export type FitV = Base<'FitV', [left: number]>;
171
- export type FitR = Base<'FitR', [left: number, bottom: number, right: number, top: number]>;
172
- export type FitB = Base<'FitB', []>;
173
- export type FitBH = Base<'FitBH', [top: number]>;
174
- export type FitBV = Base<'FitBV', [left: number]>;
175
- export type PDFLocation = XYZ | Fit | FitH | FitV | FitR | FitB | FitBH | FitBV;
176
- export interface PDFDestination {
177
- pageIndex: number;
178
- location: PDFLocation;
179
- }
180
- export type OnProgressCallback = (progressData: OnProgressParameters) => void;
181
- export type UpdatePasswordFn = (newPassword: string) => void;
182
- export type OnPasswordCallback = (updatePassword: UpdatePasswordFn, reason: any) => void;
183
- export type OnErrorCallback = (error: any) => void;
184
- export type CharacterMap = {
185
- url: string;
186
- isCompressed?: boolean;
187
- };
188
- export type PDFSrc = string | URL | TypedArray | PDFDataRangeTransport | DocumentInitParameters | undefined | null;
189
- export interface PDFOptions {
190
- onProgress?: OnProgressCallback;
191
- onPassword?: OnPasswordCallback;
192
- onError?: OnErrorCallback;
193
- password?: string;
194
- }
195
- export interface PDFInfoMetadata {
196
- info: Object;
197
- metadata: Metadata;
198
- }
199
- export interface PDFInfo {
200
- metadata: PDFInfoMetadata;
201
- attachments: Record<string, unknown>;
202
- javascript: string[] | null;
203
- outline: any;
204
- }
205
- export interface AppPdfPage {
206
- page: PDFPageProxy;
207
- viewport: PageViewport;
208
- height: number;
209
- scale: number;
210
- }
211
- export type PageViewportRawDimensions = {
212
- pageWidth: number;
213
- pageHeight: number;
214
- pageX: number;
215
- pageY: number;
216
- };
217
- export interface Rect {
218
- height: number;
219
- width: number;
220
- }
221
- export interface PdfPageSize {
222
- rotation: number;
223
- pageRect: Rect;
224
- }
225
- export interface VPVThumbnail {
226
- page: PDFPageProxy;
227
- }
228
- export interface Offset {
229
- left: number;
230
- top: number;
231
- }
232
- export interface ViewerPdfPage {
233
- page: PDFPageProxy;
234
- viewport: PageViewport;
235
- height: number;
236
- width: number;
237
- }
238
- export interface ItemMeasurement {
239
- index: number;
240
- start: Offset;
241
- size: Rect;
242
- end: Offset;
243
- visibility: number;
244
- }
245
- export interface VirtualItem extends ItemMeasurement {
246
- pdfPage: ViewerPdfPage;
247
- }
248
- export type DestinationOffsetFromViewport = (viewportWidth: number, viewportHeight: number) => number;
249
- export interface Destination {
250
- pageIndex: number;
251
- bottomOffset: number | DestinationOffsetFromViewport;
252
- leftOffset: number | DestinationOffsetFromViewport;
253
- label?: string;
254
- scaleTo?: number | ZoomLevel;
255
- }
256
- export interface PageDimensionsWithSummation {
257
- pageNumber: number;
258
- dimension: {
259
- width: number;
260
- height: number;
261
- };
262
- summation: {
263
- totalWidth: number;
264
- totalHeight: number;
265
- };
266
- }
267
- export interface ViewerState {
268
- pdfDocument: ShallowRef<PDFDocumentProxy | undefined>;
269
- pagesContainerRef: ShallowRef<HTMLElement | undefined>;
270
- pageIndex: Ref<number>;
271
- viewMode: Ref<ViewMode>;
272
- scrollMode: Ref<ScrollMode>;
273
- scale: Ref<number>;
274
- rotation: Ref<number>;
275
- isEditing: Ref<boolean>;
276
- updateViewerState: (state: Partial<ViewerState>) => void;
277
- }
278
- export interface VisibilityInfo {
279
- pageIndex: number;
280
- ratio: number;
281
- }
282
- export interface ToolbarOptions {
283
- /**
284
- * Determines whether the toolbar includes a search functionality.
285
- * If set to `true`, users can search for specific text within the PDF document.
286
- */
287
- searchable: boolean;
288
- /**
289
- * Indicates whether navigation controls (such as next page and previous page buttons) are available in the toolbar.
290
- * When set to `true`, users can navigate through the pages of the PDF document.
291
- */
292
- navigatable: boolean;
293
- /**
294
- * Specifies whether zoom controls (zoom in, zoom out buttons, and zoom dropdown menu) are part of the toolbar.
295
- * If `zoomable` is `true`, users can adjust the zoom level for better readability.
296
- */
297
- zoomable: boolean;
298
- /**
299
- * Determines whether users can switch between different themes (e.g., light mode and dark mode) using the toolbar.
300
- * If enabled, users can customize the appearance of the PDF viewer.
301
- */
302
- themeSwitchable: boolean;
303
- /**
304
- * Indicates whether a full-screen button is available in the toolbar.
305
- * When set to `true`, users can expand the PDF viewer to fill the entire screen.
306
- */
307
- fullscreen: boolean;
308
- /**
309
- * Specifies whether a download button is included in the toolbar.
310
- * If enabled, users can download the PDF document directly.
311
- */
312
- downloadable: boolean;
313
- /**
314
- * Determines whether a print button is part of the toolbar.
315
- * When set to `true`, users can print the PDF document.
316
- */
317
- printable: boolean;
318
- /**
319
- * Indicates whether the functionality to open a file from the local computer,
320
- * including both the open file icon and drag-and-drop, is enabled or disabled.
321
- */
322
- newFileOpenable: boolean;
323
- /**
324
- * Determines whether a sidebar is part of the viewer.
325
- */
326
- sidebarEnable: boolean;
327
- /**
328
- * Determines whether a thumbnail button is part of the toolbar.
329
- */
330
- thumbnailViewable: boolean;
331
- /**
332
- * Determines whether rotation group menu is a part of the others dropdown menu.
333
- */
334
- rotatable: boolean;
335
- /**
336
- * Determines whether document properties menu is a part of the others dropdown menu.
337
- */
338
- docPropertiesEnabled: boolean;
339
- /**
340
- * Determines whether text selection & hand tool menu are a part of the others dropdown menu.
341
- */
342
- pointerSwitchable: boolean;
343
- /**
344
- * Determines whether top page & last page menu are a part of the others dropdown menu.
345
- */
346
- jumpNavigatable: boolean;
347
- /**
348
- * Indicates whether the viewer's scrolling modes (vertical, horizontal, wrapped) can be toggled via the more options dropdown menu.
349
- */
350
- scrollingSwitchable: boolean;
351
- /**
352
- * Indicates whether the viewer's page view modes (single, dual) can be toggled via the more options dropdown menu.
353
- */
354
- pageViewSwitchable: boolean;
355
- /**
356
- * Indicates whether the comment panel is enabled.
357
- */
358
- commentPanelEnabled: boolean;
359
- }
360
- export interface License {
361
- isValidating: boolean;
362
- isValidated: boolean;
363
- isValidKey: boolean;
364
- licenseKey: string | null;
365
- type: LicenseType;
366
- product: LicenseProduct;
367
- }
368
- export interface AppLicense extends Omit<License, 'licenseKey'> {
369
- invalidatedMessage?: string;
370
- }
371
- export type VPVSrc = Omit<PDFSrc, 'DocumentInitParameters' | 'PDFDataRangeTransport'>;
372
- export interface TextHighlight {
373
- /**
374
- * The keyword or regular expression to match text for highlighting.
375
- */
376
- keyword: string | RegExp;
377
- /**
378
- * The color used to highlight the matched text.
379
- */
380
- highlightColor: string;
381
- /**
382
- * Optional match options for fine-tuning the search behavior.
383
- */
384
- options?: HighlightOptions;
385
- }
386
- export interface VPdfViewerProps {
387
- src: MaybeRef<VPVSrc>;
388
- /**
389
- * The path of your prefer pdfjs worker
390
- * If unspecified, the viewer will use the worker from pdfjs-dist@3.11.174
391
- */
392
- workerUrl?: string;
393
- /**
394
- * The number of page that will be displayed initially
395
- */
396
- initialPage?: number;
397
- /**
398
- * The initial zoom level default
399
- * If unspecified, the initial zoom level is determined by the page dimensions and the width of the container
400
- */
401
- initialScale?: number | ZoomLevel;
402
- /**
403
- * The initial scroll mode
404
- */
405
- initialScrollMode?: ScrollMode;
406
- /**
407
- * The initial viewer mode
408
- */
409
- initialViewMode?: ViewMode;
410
- /**
411
- * The initial rotation must be divisible by 90
412
- */
413
- initialRotation?: number;
414
- /**
415
- * The initial thumbnails visible default
416
- * If unspecified, the thumbnails visible will be `false`
417
- */
418
- initialThumbnailsVisible?: boolean;
419
- /**
420
- * The initial search value
421
- */
422
- initialSearch?: string;
423
- /**
424
- * A layer on a PDF to allow text selection
425
- */
426
- textLayer?: boolean;
427
- /**
428
- * Specifies the character map (CMap) to be used for text rendering.
429
- * A CMap associates character codes with corresponding glyphs in CID fonts.
430
- * Use this property when displaying PDFs with complex character sets (e.g., East Asian languages).
431
- */
432
- characterMap?: CharacterMap;
433
- /**
434
- * Determine whether the toolbar is visible in the VPV.
435
- * Remark: The toolbar consists of top bar and left sidebar.
436
- */
437
- toolbarOptions?: Partial<ToolbarOptions> | false;
438
- /**
439
- * localization json data
440
- */
441
- localization?: Record<string, Localization>;
442
- /**
443
- * A callback function that will be executed after each canvas is loaded.
444
- * The key is the page number, and the value is the callback function.
445
- */
446
- afterCanvasLoaded?: Record<number, CanvasLoadedCallback>;
447
- /**
448
- * The initial text highlights
449
- */
450
- textHighlights?: Array<TextHighlight>;
451
- /**
452
- * The plugins to be used in the VPV.
453
- */
454
- plugins?: Plugin[];
455
- }
456
- export interface HighlightMatchPosition {
457
- matchIdx: number;
458
- pageIdx: number;
459
- }
460
- export interface HighlightMatchPosition {
461
- matchIdx: number;
462
- pageIdx: number;
463
- }
464
- export interface ViewportDimensions {
465
- width: number;
466
- height: number;
467
- canvasWidth: number;
468
- canvasHeight: number;
469
- widthRatio: number;
470
- heightRatio: number;
471
- }
472
- export type CanvasLoadedCallback = (element: HTMLCanvasElement, viewport: ViewportDimensions) => void;
473
- export interface PdfProperties {
474
- filename: string;
475
- fileSize: string;
476
- title: string;
477
- author: string;
478
- subject: string;
479
- keywords: string;
480
- creator: string;
481
- createdOn: string;
482
- modifierOn: string;
483
- pdfProducer: string;
484
- pdfVersion: string;
485
- pageCount?: number;
486
- }
487
- export declare const VPVBaseProps: {
488
- readonly src: {
489
- readonly type: PropType<string | VPVSrc>;
490
- readonly required: true;
491
- };
492
- readonly workerUrl: {
493
- readonly type: PropType<string>;
494
- readonly default: undefined;
495
- };
496
- readonly initialPage: {
497
- readonly type: PropType<number>;
498
- readonly default: () => number;
499
- };
500
- readonly initialScale: {
501
- readonly type: PropType<number | ZoomLevel>;
502
- readonly default: () => ZoomLevel;
503
- };
504
- readonly initialScrollMode: {
505
- readonly type: PropType<ScrollMode>;
506
- readonly default: () => ScrollMode;
507
- readonly validator: (initialScrollMode: ScrollMode, args: unknown) => boolean;
508
- };
509
- readonly initialViewMode: {
510
- readonly type: PropType<ViewMode>;
511
- readonly default: () => ViewMode;
512
- readonly validator: (initialViewMode: ViewMode, args: unknown) => boolean;
513
- };
514
- readonly initialRotation: {
515
- readonly type: PropType<number>;
516
- readonly default: () => number;
517
- };
518
- readonly initialThumbnailsVisible: {
519
- readonly type: PropType<boolean>;
520
- readonly default: undefined;
521
- };
522
- readonly textLayer: {
523
- readonly type: PropType<boolean>;
524
- readonly default: () => boolean;
525
- };
526
- readonly characterMap: {
527
- readonly type: PropType<CharacterMap>;
528
- readonly default: undefined;
529
- };
530
- readonly toolbarOptions: {
531
- readonly type: PropType<false | Partial<ToolbarOptions>>;
532
- readonly default: () => ToolbarOptions;
533
- };
534
- readonly localization: {
535
- readonly type: PropType<Record<string, Localization>>;
536
- readonly default: () => Record<string, Localization>;
537
- };
538
- readonly initialSearch: {
539
- readonly type: StringConstructor;
540
- readonly default: undefined;
541
- };
542
- readonly afterCanvasLoaded: {
543
- readonly type: PropType<Record<number, CanvasLoadedCallback>>;
544
- readonly default: undefined;
545
- };
546
- /**
547
- * Experiment property
548
- */
549
- readonly textHighlights: {
550
- readonly type: PropType<TextHighlight[]>;
551
- readonly default: undefined;
552
- readonly validator: (value: Array<TextHighlight>) => boolean;
553
- };
554
- readonly downloadFilename: {
555
- readonly type: StringConstructor;
556
- readonly default: undefined;
557
- };
558
- readonly plugins: {
559
- readonly type: PropType<Plugin[]>;
560
- readonly default: undefined;
561
- };
562
- };
563
- export interface MatchValue extends Match {
564
- page: number;
565
- pageMatchIdx: number;
566
- }
567
- export interface MatchHighlight extends MatchValue {
568
- keyword: string | RegExp;
569
- color: string;
570
- }
571
- export interface MatchHighlightResult {
572
- /**
573
- * The index of the page that contains the match
574
- */
575
- pageIndex: number;
576
- /**
577
- * The index of the match in the page
578
- */
579
- pageMatchIdx: number;
580
- }
581
- export interface SearchControlValue {
582
- textContentPages: Ref<Record<string, TextContent>>;
583
- searchValue: Ref<string | undefined>;
584
- matches: Ref<MatchValue[]>;
585
- matchCount: ComputedRef<number>;
586
- currentSearchMatchIndex: Ref<number | undefined>;
587
- currentSearchMatch: ComputedRef<MatchValue | undefined>;
588
- searching: Ref<boolean>;
589
- openSearch: Ref<boolean>;
590
- onOpenSearch: () => void;
591
- onCloseSearch: () => void;
592
- handleSelectNext: () => void;
593
- handleSelectPrev: () => void;
594
- search: (value: string) => Promise<MatchHighlightResult[]>;
595
- goToMatch: (index: number) => void;
596
- }
597
- export interface SearchControl {
598
- searchMatches?: {
599
- totalMatches: number;
600
- matches: {
601
- index: number;
602
- page: number;
603
- }[];
604
- };
605
- searching: Ref<boolean>;
606
- search: (value: string) => void;
607
- goToMatch: (index: number) => void;
608
- nextSearchMatch: () => void;
609
- prevSearchMatch: () => void;
610
- }
611
- export interface PreparePrintProgress {
612
- loadedPages: number;
613
- totalPages: number;
614
- percentage: number;
615
- }
616
- export interface PrintControl {
617
- print(options?: {
618
- visibleDefaultProgress: boolean;
619
- }): Awaited<void>;
620
- cancel(): void;
621
- onProgress?: (progress: PreparePrintProgress) => void;
622
- onError?: (error: Error) => void;
623
- onComplete?: () => void;
624
- }
625
- export interface RotateControl {
626
- rotateClockwise: () => void;
627
- rotateCounterclockwise: () => void;
628
- currentRotation: number;
629
- }
630
- export interface PageControl {
631
- goToPage: (page: number) => void;
632
- currentPage: number;
633
- totalPages: number;
634
- }
635
- export interface DownloadPdfProgress {
636
- bytesDownloaded: number;
637
- percentage: number;
638
- }
639
- export interface DownloadControl {
640
- download(): Awaited<void>;
641
- onError?: (error: Error) => void;
642
- onComplete?: () => void;
643
- }
644
- export interface ZoomControl {
645
- scale: Ref<number>;
646
- zoom(scale: number | ZoomLevel): void;
647
- }
648
- export interface UseScaleCallback {
649
- status: 'success' | 'error';
650
- scale: number;
651
- mode?: ZoomLevel;
652
- error?: string;
653
- }
654
- export interface VPVInstance {
655
- printControl: Reactive<PrintControl> | undefined;
656
- searchControl: SearchControl | undefined;
657
- pageControl: Reactive<PageControl> | undefined;
658
- rotateControl: Reactive<RotateControl> | undefined;
659
- downloadControl: Reactive<DownloadControl> | undefined;
660
- zoomControl: Reactive<ZoomControl> | undefined;
661
- }
662
- export interface NavigationAnnotation {
663
- action: 'FirstPage' | 'LastPage' | 'NextPage' | 'PrevPage';
664
- }
665
- type CommentContents = {
666
- str: string;
667
- dir: string;
668
- };
669
- export interface Comment {
670
- page: number;
671
- id: string;
672
- text: string;
673
- rect: [number, number, number, number];
674
- creationDate: string | Date;
675
- modificationDate: string | Date;
676
- color: Uint8ClampedArray | null;
677
- annotationType: AnnotationType;
678
- annotationIconType: AnnotationIconType;
679
- inReplyTo?: string;
680
- contentsObj?: CommentContents;
681
- titleObj?: CommentContents;
682
- }
683
- export interface CommentWithReplies {
684
- original: Comment;
685
- replies: Comment[];
686
- }
687
- export interface PdfCommentPage {
688
- page: number;
689
- comments: CommentWithReplies[];
690
- }
691
- export interface UsePdfCommentsReturn {
692
- comments: Ref<Map<number, Comment[]>>;
693
- repliedCommentPages: Ref<PdfCommentPage[]>;
694
- }
695
- export type RectBox = {
696
- x: number;
697
- y: number;
698
- width: number;
699
- height: number;
700
- };
701
- export interface AnnotationHighlight extends Annotation {
702
- hexColor: string;
703
- drawLayerId: number;
704
- outlineId: number;
705
- pageIndex?: number;
706
- }
707
- export interface AnnotationStamp extends Annotation {
708
- hasOwnCanvas: boolean;
709
- originalAnnotation?: any;
710
- pageIndex?: number;
711
- elementRect?: ElementRect;
712
- bitmapId?: string;
713
- bitmap?: ImageData;
714
- }
715
- export {};
@@ -1,4 +0,0 @@
1
- import type { PageViewport } from 'pdfjs-dist';
2
- import type { Offset } from './types';
3
- export declare const calculateOffset: (children: HTMLElement, parent: HTMLElement) => Offset;
4
- export declare const transformLayer: (element: HTMLElement, viewport: PageViewport) => void;