Brunobkr commited on
Commit
9e51689
·
verified ·
1 Parent(s): 1800093

Upload folder using huggingface_hub (part 46)

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. .gitattributes +4 -0
  2. tools/ui/node_modules/pdfjs-dist/standard_fonts/FoxitFixedItalic.pfb +0 -0
  3. tools/ui/node_modules/pdfjs-dist/standard_fonts/FoxitSerif.pfb +0 -0
  4. tools/ui/node_modules/pdfjs-dist/standard_fonts/FoxitSerifBold.pfb +0 -0
  5. tools/ui/node_modules/pdfjs-dist/standard_fonts/FoxitSerifBoldItalic.pfb +0 -0
  6. tools/ui/node_modules/pdfjs-dist/standard_fonts/FoxitSerifItalic.pfb +0 -0
  7. tools/ui/node_modules/pdfjs-dist/standard_fonts/FoxitSymbol.pfb +0 -0
  8. tools/ui/node_modules/pdfjs-dist/standard_fonts/LICENSE_FOXIT +27 -0
  9. tools/ui/node_modules/pdfjs-dist/standard_fonts/LICENSE_LIBERATION +102 -0
  10. tools/ui/node_modules/pdfjs-dist/standard_fonts/LiberationSans-Bold.ttf +3 -0
  11. tools/ui/node_modules/pdfjs-dist/standard_fonts/LiberationSans-BoldItalic.ttf +3 -0
  12. tools/ui/node_modules/pdfjs-dist/standard_fonts/LiberationSans-Italic.ttf +3 -0
  13. tools/ui/node_modules/pdfjs-dist/standard_fonts/LiberationSans-Regular.ttf +3 -0
  14. tools/ui/node_modules/pdfjs-dist/types/src/display/annotation_layer.d.ts +244 -0
  15. tools/ui/node_modules/pdfjs-dist/types/src/display/annotation_storage.d.ts +92 -0
  16. tools/ui/node_modules/pdfjs-dist/types/src/display/api.d.ts +1567 -0
  17. tools/ui/node_modules/pdfjs-dist/types/src/display/api_utils.d.ts +13 -0
  18. tools/ui/node_modules/pdfjs-dist/types/src/display/canvas.d.ts +205 -0
  19. tools/ui/node_modules/pdfjs-dist/types/src/display/canvas_factory.d.ts +27 -0
  20. tools/ui/node_modules/pdfjs-dist/types/src/display/cmap_reader_factory.d.ts +25 -0
  21. tools/ui/node_modules/pdfjs-dist/types/src/display/content_disposition.d.ts +7 -0
  22. tools/ui/node_modules/pdfjs-dist/types/src/display/display_utils.d.ts +258 -0
  23. tools/ui/node_modules/pdfjs-dist/types/src/display/draw_layer.d.ts +26 -0
  24. tools/ui/node_modules/pdfjs-dist/types/src/display/editor/alt_text.d.ts +34 -0
  25. tools/ui/node_modules/pdfjs-dist/types/src/display/editor/annotation_editor_layer.d.ts +230 -0
  26. tools/ui/node_modules/pdfjs-dist/types/src/display/editor/color_picker.d.ts +39 -0
  27. tools/ui/node_modules/pdfjs-dist/types/src/display/editor/comment.d.ts +32 -0
  28. tools/ui/node_modules/pdfjs-dist/types/src/display/editor/draw.d.ts +121 -0
  29. tools/ui/node_modules/pdfjs-dist/types/src/display/editor/drawers/contour.d.ts +3 -0
  30. tools/ui/node_modules/pdfjs-dist/types/src/display/editor/drawers/freedraw.d.ts +31 -0
  31. tools/ui/node_modules/pdfjs-dist/types/src/display/editor/drawers/highlight.d.ts +36 -0
  32. tools/ui/node_modules/pdfjs-dist/types/src/display/editor/drawers/inkdraw.d.ts +129 -0
  33. tools/ui/node_modules/pdfjs-dist/types/src/display/editor/drawers/outline.d.ts +19 -0
  34. tools/ui/node_modules/pdfjs-dist/types/src/display/editor/drawers/signaturedraw.d.ts +79 -0
  35. tools/ui/node_modules/pdfjs-dist/types/src/display/editor/editor.d.ts +517 -0
  36. tools/ui/node_modules/pdfjs-dist/types/src/display/editor/freetext.d.ts +61 -0
  37. tools/ui/node_modules/pdfjs-dist/types/src/display/editor/highlight.d.ts +74 -0
  38. tools/ui/node_modules/pdfjs-dist/types/src/display/editor/ink.d.ts +41 -0
  39. tools/ui/node_modules/pdfjs-dist/types/src/display/editor/signature.d.ts +82 -0
  40. tools/ui/node_modules/pdfjs-dist/types/src/display/editor/stamp.d.ts +49 -0
  41. tools/ui/node_modules/pdfjs-dist/types/src/display/editor/toolbar.d.ts +24 -0
  42. tools/ui/node_modules/pdfjs-dist/types/src/display/editor/tools.d.ts +429 -0
  43. tools/ui/node_modules/pdfjs-dist/types/src/display/fetch_stream.d.ts +60 -0
  44. tools/ui/node_modules/pdfjs-dist/types/src/display/filter_factory.d.ts +29 -0
  45. tools/ui/node_modules/pdfjs-dist/types/src/display/font_loader.d.ts +39 -0
  46. tools/ui/node_modules/pdfjs-dist/types/src/display/metadata.d.ts +10 -0
  47. tools/ui/node_modules/pdfjs-dist/types/src/display/network.d.ts +86 -0
  48. tools/ui/node_modules/pdfjs-dist/types/src/display/network_utils.d.ts +15 -0
  49. tools/ui/node_modules/pdfjs-dist/types/src/display/node_stream.d.ts +54 -0
  50. tools/ui/node_modules/pdfjs-dist/types/src/display/node_utils.d.ts +32 -0
.gitattributes CHANGED
@@ -107,3 +107,7 @@ tools/ui/node_modules/lightningcss-linux-x64-gnu/lightningcss.linux-x64-gnu.node
107
  tools/ui/node_modules/lightningcss-linux-x64-musl/lightningcss.linux-x64-musl.node filter=lfs diff=lfs merge=lfs -text
108
  tools/ui/node_modules/mermaid/dist/mermaid.js.map filter=lfs diff=lfs merge=lfs -text
109
  tools/ui/node_modules/mermaid/dist/mermaid.min.js.map filter=lfs diff=lfs merge=lfs -text
 
 
 
 
 
107
  tools/ui/node_modules/lightningcss-linux-x64-musl/lightningcss.linux-x64-musl.node filter=lfs diff=lfs merge=lfs -text
108
  tools/ui/node_modules/mermaid/dist/mermaid.js.map filter=lfs diff=lfs merge=lfs -text
109
  tools/ui/node_modules/mermaid/dist/mermaid.min.js.map filter=lfs diff=lfs merge=lfs -text
110
+ tools/ui/node_modules/pdfjs-dist/standard_fonts/LiberationSans-Bold.ttf filter=lfs diff=lfs merge=lfs -text
111
+ tools/ui/node_modules/pdfjs-dist/standard_fonts/LiberationSans-BoldItalic.ttf filter=lfs diff=lfs merge=lfs -text
112
+ tools/ui/node_modules/pdfjs-dist/standard_fonts/LiberationSans-Italic.ttf filter=lfs diff=lfs merge=lfs -text
113
+ tools/ui/node_modules/pdfjs-dist/standard_fonts/LiberationSans-Regular.ttf filter=lfs diff=lfs merge=lfs -text
tools/ui/node_modules/pdfjs-dist/standard_fonts/FoxitFixedItalic.pfb ADDED
Binary file (18.7 kB). View file
 
tools/ui/node_modules/pdfjs-dist/standard_fonts/FoxitSerif.pfb ADDED
Binary file (19.5 kB). View file
 
tools/ui/node_modules/pdfjs-dist/standard_fonts/FoxitSerifBold.pfb ADDED
Binary file (19.4 kB). View file
 
tools/ui/node_modules/pdfjs-dist/standard_fonts/FoxitSerifBoldItalic.pfb ADDED
Binary file (20.7 kB). View file
 
tools/ui/node_modules/pdfjs-dist/standard_fonts/FoxitSerifItalic.pfb ADDED
Binary file (21.2 kB). View file
 
tools/ui/node_modules/pdfjs-dist/standard_fonts/FoxitSymbol.pfb ADDED
Binary file (16.7 kB). View file
 
tools/ui/node_modules/pdfjs-dist/standard_fonts/LICENSE_FOXIT ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // Copyright 2014 PDFium Authors. All rights reserved.
2
+ //
3
+ // Redistribution and use in source and binary forms, with or without
4
+ // modification, are permitted provided that the following conditions are
5
+ // met:
6
+ //
7
+ // * Redistributions of source code must retain the above copyright
8
+ // notice, this list of conditions and the following disclaimer.
9
+ // * Redistributions in binary form must reproduce the above
10
+ // copyright notice, this list of conditions and the following disclaimer
11
+ // in the documentation and/or other materials provided with the
12
+ // distribution.
13
+ // * Neither the name of Google Inc. nor the names of its
14
+ // contributors may be used to endorse or promote products derived from
15
+ // this software without specific prior written permission.
16
+ //
17
+ // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
18
+ // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
19
+ // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
20
+ // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
21
+ // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
22
+ // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
23
+ // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24
+ // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25
+ // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26
+ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27
+ // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
tools/ui/node_modules/pdfjs-dist/standard_fonts/LICENSE_LIBERATION ADDED
@@ -0,0 +1,102 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Digitized data copyright (c) 2010 Google Corporation
2
+ with Reserved Font Arimo, Tinos and Cousine.
3
+ Copyright (c) 2012 Red Hat, Inc.
4
+ with Reserved Font Name Liberation.
5
+
6
+ This Font Software is licensed under the SIL Open Font License,
7
+ Version 1.1.
8
+
9
+ This license is copied below, and is also available with a FAQ at:
10
+ http://scripts.sil.org/OFL
11
+
12
+ SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
13
+
14
+ PREAMBLE The goals of the Open Font License (OFL) are to stimulate
15
+ worldwide development of collaborative font projects, to support the font
16
+ creation efforts of academic and linguistic communities, and to provide
17
+ a free and open framework in which fonts may be shared and improved in
18
+ partnership with others.
19
+
20
+ The OFL allows the licensed fonts to be used, studied, modified and
21
+ redistributed freely as long as they are not sold by themselves.
22
+ The fonts, including any derivative works, can be bundled, embedded,
23
+ redistributed and/or sold with any software provided that any reserved
24
+ names are not used by derivative works. The fonts and derivatives,
25
+ however, cannot be released under any other type of license. The
26
+ requirement for fonts to remain under this license does not apply to
27
+ any document created using the fonts or their derivatives.
28
+
29
+
30
+
31
+ DEFINITIONS
32
+ "Font Software" refers to the set of files released by the Copyright
33
+ Holder(s) under this license and clearly marked as such.
34
+ This may include source files, build scripts and documentation.
35
+
36
+ "Reserved Font Name" refers to any names specified as such after the
37
+ copyright statement(s).
38
+
39
+ "Original Version" refers to the collection of Font Software components
40
+ as distributed by the Copyright Holder(s).
41
+
42
+ "Modified Version" refers to any derivative made by adding to, deleting,
43
+ or substituting ? in part or in whole ?
44
+ any of the components of the Original Version, by changing formats or
45
+ by porting the Font Software to a new environment.
46
+
47
+ "Author" refers to any designer, engineer, programmer, technical writer
48
+ or other person who contributed to the Font Software.
49
+
50
+
51
+ PERMISSION & CONDITIONS
52
+
53
+ Permission is hereby granted, free of charge, to any person obtaining a
54
+ copy of the Font Software, to use, study, copy, merge, embed, modify,
55
+ redistribute, and sell modified and unmodified copies of the Font
56
+ Software, subject to the following conditions:
57
+
58
+ 1) Neither the Font Software nor any of its individual components,in
59
+ Original or Modified Versions, may be sold by itself.
60
+
61
+ 2) Original or Modified Versions of the Font Software may be bundled,
62
+ redistributed and/or sold with any software, provided that each copy
63
+ contains the above copyright notice and this license. These can be
64
+ included either as stand-alone text files, human-readable headers or
65
+ in the appropriate machine-readable metadata fields within text or
66
+ binary files as long as those fields can be easily viewed by the user.
67
+
68
+ 3) No Modified Version of the Font Software may use the Reserved Font
69
+ Name(s) unless explicit written permission is granted by the
70
+ corresponding Copyright Holder. This restriction only applies to the
71
+ primary font name as presented to the users.
72
+
73
+ 4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
74
+ Software shall not be used to promote, endorse or advertise any
75
+ Modified Version, except to acknowledge the contribution(s) of the
76
+ Copyright Holder(s) and the Author(s) or with their explicit written
77
+ permission.
78
+
79
+ 5) The Font Software, modified or unmodified, in part or in whole, must
80
+ be distributed entirely under this license, and must not be distributed
81
+ under any other license. The requirement for fonts to remain under
82
+ this license does not apply to any document created using the Font
83
+ Software.
84
+
85
+
86
+
87
+ TERMINATION
88
+ This license becomes null and void if any of the above conditions are not met.
89
+
90
+
91
+
92
+ DISCLAIMER
93
+ THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
94
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
95
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
96
+ OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
97
+ COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
98
+ INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
99
+ DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
100
+ FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER
101
+ DEALINGS IN THE FONT SOFTWARE.
102
+
tools/ui/node_modules/pdfjs-dist/standard_fonts/LiberationSans-Bold.ttf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:361c61b82d575c5c35fd9157fda8b0194bcfcd0d88ea8521a4fb5dd53d33dddc
3
+ size 137052
tools/ui/node_modules/pdfjs-dist/standard_fonts/LiberationSans-BoldItalic.ttf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a224075ac17495ad0a3af3bc0a419ac0704a8b3fd1095456201fb9b095fc281d
3
+ size 135124
tools/ui/node_modules/pdfjs-dist/standard_fonts/LiberationSans-Italic.ttf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:832b4406dbef23628800d3aaad21048534ac84d7e3ad955be83b8172ed8ef512
3
+ size 162036
tools/ui/node_modules/pdfjs-dist/standard_fonts/LiberationSans-Regular.ttf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f8ace1f892b2bd9dc1792ba7f097fa7588f84fed48321480e04de5390828221f
3
+ size 139512
tools/ui/node_modules/pdfjs-dist/types/src/display/annotation_layer.d.ts ADDED
@@ -0,0 +1,244 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ export type PDFPageProxy = import("./api").PDFPageProxy;
2
+ export type PageViewport = import("./display_utils").PageViewport;
3
+ export type TextAccessibilityManager = import("../../web/text_accessibility.js").TextAccessibilityManager;
4
+ export type IDownloadManager = import("../../web/interfaces").IDownloadManager;
5
+ export type IPDFLinkService = import("../../web/interfaces").IPDFLinkService;
6
+ export type AnnotationEditorUIManager = any;
7
+ export type StructTreeLayerBuilder = import("../../web/struct_tree_layer_builder.js").StructTreeLayerBuilder;
8
+ export type AnnotationElementParameters = {
9
+ data: Object;
10
+ layer: HTMLDivElement;
11
+ linkService: IPDFLinkService;
12
+ downloadManager?: import("../../web/interfaces").IDownloadManager | undefined;
13
+ annotationStorage?: AnnotationStorage | undefined;
14
+ /**
15
+ * - Path for image resources, mainly
16
+ * for annotation icons. Include trailing slash.
17
+ */
18
+ imageResourcesPath?: string | undefined;
19
+ renderForms: boolean;
20
+ svgFactory: Object;
21
+ enableScripting?: boolean | undefined;
22
+ hasJSActions?: boolean | undefined;
23
+ fieldObjects?: Object | undefined;
24
+ };
25
+ export type AnnotationLayerParameters = {
26
+ viewport: PageViewport;
27
+ div: HTMLDivElement;
28
+ annotations: any[];
29
+ page: PDFPageProxy;
30
+ linkService: IPDFLinkService;
31
+ downloadManager?: import("../../web/interfaces").IDownloadManager | undefined;
32
+ annotationStorage?: AnnotationStorage | undefined;
33
+ /**
34
+ * - Path for image resources, mainly
35
+ * for annotation icons. Include trailing slash.
36
+ */
37
+ imageResourcesPath?: string | undefined;
38
+ renderForms: boolean;
39
+ /**
40
+ * - Enable embedded script execution.
41
+ */
42
+ enableScripting?: boolean | undefined;
43
+ /**
44
+ * - Some fields have JS actions.
45
+ * The default value is `false`.
46
+ */
47
+ hasJSActions?: boolean | undefined;
48
+ fieldObjects?: {
49
+ [x: string]: Object[];
50
+ } | null | undefined;
51
+ annotationCanvasMap?: Map<string, HTMLCanvasElement> | undefined;
52
+ accessibilityManager?: import("../../web/text_accessibility.js").TextAccessibilityManager | undefined;
53
+ annotationEditorUIManager?: AnnotationEditorUIManager;
54
+ structTreeLayer?: import("../../web/struct_tree_layer_builder.js").StructTreeLayerBuilder | undefined;
55
+ };
56
+ /**
57
+ * @typedef {Object} AnnotationLayerParameters
58
+ * @property {PageViewport} viewport
59
+ * @property {HTMLDivElement} div
60
+ * @property {Array} annotations
61
+ * @property {PDFPageProxy} page
62
+ * @property {IPDFLinkService} linkService
63
+ * @property {IDownloadManager} [downloadManager]
64
+ * @property {AnnotationStorage} [annotationStorage]
65
+ * @property {string} [imageResourcesPath] - Path for image resources, mainly
66
+ * for annotation icons. Include trailing slash.
67
+ * @property {boolean} renderForms
68
+ * @property {boolean} [enableScripting] - Enable embedded script execution.
69
+ * @property {boolean} [hasJSActions] - Some fields have JS actions.
70
+ * The default value is `false`.
71
+ * @property {Object<string, Array<Object>> | null} [fieldObjects]
72
+ * @property {Map<string, HTMLCanvasElement>} [annotationCanvasMap]
73
+ * @property {TextAccessibilityManager} [accessibilityManager]
74
+ * @property {AnnotationEditorUIManager} [annotationEditorUIManager]
75
+ * @property {StructTreeLayerBuilder} [structTreeLayer]
76
+ */
77
+ /**
78
+ * Manage the layer containing all the annotations.
79
+ */
80
+ export class AnnotationLayer {
81
+ /**
82
+ * @private
83
+ */
84
+ private static get _defaultBorderStyle();
85
+ constructor({ div, accessibilityManager, annotationCanvasMap, annotationEditorUIManager, page, viewport, structTreeLayer, }: {
86
+ div: any;
87
+ accessibilityManager: any;
88
+ annotationCanvasMap: any;
89
+ annotationEditorUIManager: any;
90
+ page: any;
91
+ viewport: any;
92
+ structTreeLayer: any;
93
+ });
94
+ div: any;
95
+ page: any;
96
+ viewport: any;
97
+ zIndex: number;
98
+ _annotationEditorUIManager: any;
99
+ popupShow: any[] | undefined;
100
+ hasEditableAnnotations(): boolean;
101
+ /**
102
+ * Render a new annotation layer with all annotation elements.
103
+ *
104
+ * @param {AnnotationLayerParameters} params
105
+ * @memberof AnnotationLayer
106
+ */
107
+ render(params: AnnotationLayerParameters): Promise<void>;
108
+ /**
109
+ * Add link annotations to the annotation layer.
110
+ *
111
+ * @param {Array<Object>} annotations
112
+ * @param {IPDFLinkService} linkService
113
+ * @memberof AnnotationLayer
114
+ */
115
+ addLinkAnnotations(annotations: Array<Object>, linkService: IPDFLinkService): Promise<void>;
116
+ /**
117
+ * Update the annotation elements on existing annotation layer.
118
+ *
119
+ * @param {AnnotationLayerParameters} viewport
120
+ * @memberof AnnotationLayer
121
+ */
122
+ update({ viewport }: AnnotationLayerParameters): void;
123
+ getEditableAnnotations(): any[];
124
+ getEditableAnnotation(id: any): any;
125
+ #private;
126
+ }
127
+ export class FreeTextAnnotationElement extends AnnotationElement {
128
+ constructor(parameters: any);
129
+ textContent: any;
130
+ textPosition: any;
131
+ annotationEditorType: number;
132
+ render(): HTMLElement | undefined;
133
+ }
134
+ export class HighlightAnnotationElement extends AnnotationElement {
135
+ constructor(parameters: any);
136
+ annotationEditorType: number;
137
+ render(): HTMLElement | undefined;
138
+ }
139
+ export class InkAnnotationElement extends AnnotationElement {
140
+ constructor(parameters: any);
141
+ containerClassName: string;
142
+ svgElementName: string;
143
+ annotationEditorType: number;
144
+ render(): HTMLElement | undefined;
145
+ getElementsToTriggerPopup(): any[];
146
+ #private;
147
+ }
148
+ export class StampAnnotationElement extends AnnotationElement {
149
+ constructor(parameters: any);
150
+ annotationEditorType: number;
151
+ render(): HTMLElement | undefined;
152
+ }
153
+ import { AnnotationStorage } from "./annotation_storage.js";
154
+ declare class AnnotationElement {
155
+ static _hasPopupData({ contentsObj, richText }: {
156
+ contentsObj: any;
157
+ richText: any;
158
+ }): boolean;
159
+ constructor(parameters: any, { isRenderable, ignoreBorder, createQuadrilaterals, }?: {
160
+ isRenderable?: boolean | undefined;
161
+ ignoreBorder?: boolean | undefined;
162
+ createQuadrilaterals?: boolean | undefined;
163
+ });
164
+ isRenderable: boolean;
165
+ data: any;
166
+ layer: any;
167
+ linkService: any;
168
+ downloadManager: any;
169
+ imageResourcesPath: any;
170
+ renderForms: any;
171
+ svgFactory: any;
172
+ annotationStorage: any;
173
+ enableScripting: any;
174
+ hasJSActions: any;
175
+ _fieldObjects: any;
176
+ parent: any;
177
+ container: HTMLElement | undefined;
178
+ get _isEditable(): any;
179
+ get hasPopupData(): boolean;
180
+ updateEdited(params: any): void;
181
+ popup: any;
182
+ resetEdited(): void;
183
+ /**
184
+ * Create an empty container for the annotation's HTML element.
185
+ *
186
+ * @private
187
+ * @param {boolean} ignoreBorder
188
+ * @memberof AnnotationElement
189
+ * @returns {HTMLElement} A section element.
190
+ */
191
+ private _createContainer;
192
+ setRotation(angle: any, container?: HTMLElement | undefined): void;
193
+ get _commonActions(): any;
194
+ _dispatchEventFromSandbox(actions: any, jsEvent: any): void;
195
+ _setDefaultPropertiesFromJS(element: any): void;
196
+ /**
197
+ * Create quadrilaterals from the annotation's quadpoints.
198
+ *
199
+ * @private
200
+ * @memberof AnnotationElement
201
+ */
202
+ private _createQuadrilaterals;
203
+ /**
204
+ * Create a popup for the annotation's HTML element. This is used for
205
+ * annotations that do not have a Popup entry in the dictionary, but
206
+ * are of a type that works with popups (such as Highlight annotations).
207
+ *
208
+ * @param {Object} [popupData] - The data for the popup, if any.
209
+ *
210
+ * @private
211
+ * @memberof AnnotationElement
212
+ */
213
+ private _createPopup;
214
+ get hasPopupElement(): boolean;
215
+ /**
216
+ * Render the annotation's HTML element(s).
217
+ *
218
+ * @public
219
+ * @memberof AnnotationElement
220
+ */
221
+ public render(): void;
222
+ /**
223
+ * @private
224
+ * @returns {Array}
225
+ */
226
+ private _getElementsByName;
227
+ show(): void;
228
+ hide(): void;
229
+ /**
230
+ * Get the HTML element(s) which can trigger a popup when clicked or hovered.
231
+ *
232
+ * @public
233
+ * @memberof AnnotationElement
234
+ * @returns {Array<HTMLElement>|HTMLElement} An array of elements or an
235
+ * element.
236
+ */
237
+ public getElementsToTriggerPopup(): Array<HTMLElement> | HTMLElement;
238
+ addHighlightArea(): void;
239
+ _editOnDoubleClick(): void;
240
+ get width(): number;
241
+ get height(): number;
242
+ #private;
243
+ }
244
+ export {};
tools/ui/node_modules/pdfjs-dist/types/src/display/annotation_storage.d.ts ADDED
@@ -0,0 +1,92 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * Key/value storage for annotation data in forms.
3
+ */
4
+ export class AnnotationStorage {
5
+ onSetModified: any;
6
+ onResetModified: any;
7
+ onAnnotationEditor: any;
8
+ /**
9
+ * Get the value for a given key if it exists, or return the default value.
10
+ * @param {string} key
11
+ * @param {Object} defaultValue
12
+ * @returns {Object}
13
+ */
14
+ getValue(key: string, defaultValue: Object): Object;
15
+ /**
16
+ * Get the value for a given key.
17
+ * @param {string} key
18
+ * @returns {Object}
19
+ */
20
+ getRawValue(key: string): Object;
21
+ /**
22
+ * Remove a value from the storage.
23
+ * @param {string} key
24
+ */
25
+ remove(key: string): void;
26
+ /**
27
+ * Set the value for a given key
28
+ * @param {string} key
29
+ * @param {Object} value
30
+ */
31
+ setValue(key: string, value: Object): void;
32
+ /**
33
+ * Check if the storage contains the given key.
34
+ * @param {string} key
35
+ * @returns {boolean}
36
+ */
37
+ has(key: string): boolean;
38
+ get size(): number;
39
+ resetModified(): void;
40
+ /**
41
+ * @returns {PrintAnnotationStorage}
42
+ */
43
+ get print(): PrintAnnotationStorage;
44
+ /**
45
+ * PLEASE NOTE: Only intended for usage within the API itself.
46
+ * @ignore
47
+ */
48
+ get serializable(): Readonly<{
49
+ map: null;
50
+ hash: "";
51
+ transfer: undefined;
52
+ }> | {
53
+ map: Map<any, any>;
54
+ hash: string;
55
+ transfer: any[];
56
+ };
57
+ get editorStats(): any;
58
+ resetModifiedIds(): void;
59
+ /**
60
+ * @returns {{ids: Set<string>, hash: string}}
61
+ */
62
+ get modifiedIds(): {
63
+ ids: Set<string>;
64
+ hash: string;
65
+ };
66
+ [Symbol.iterator](): MapIterator<[any, any]>;
67
+ #private;
68
+ }
69
+ /**
70
+ * A special `AnnotationStorage` for use during printing, where the serializable
71
+ * data is *frozen* upon initialization, to prevent scripting from modifying its
72
+ * contents. (Necessary since printing is triggered synchronously in browsers.)
73
+ */
74
+ export class PrintAnnotationStorage extends AnnotationStorage {
75
+ constructor(parent: any);
76
+ /**
77
+ * PLEASE NOTE: Only intended for usage within the API itself.
78
+ * @ignore
79
+ */
80
+ get serializable(): {
81
+ map: any;
82
+ hash: any;
83
+ transfer: any;
84
+ };
85
+ get modifiedIds(): any;
86
+ #private;
87
+ }
88
+ export const SerializableEmpty: Readonly<{
89
+ map: null;
90
+ hash: "";
91
+ transfer: undefined;
92
+ }>;
tools/ui/node_modules/pdfjs-dist/types/src/display/api.d.ts ADDED
@@ -0,0 +1,1567 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ export type TypedArray = Int8Array | Uint8Array | Uint8ClampedArray | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array;
2
+ export type RefProxy = {
3
+ num: number;
4
+ gen: number;
5
+ };
6
+ /**
7
+ * Document initialization / loading parameters object.
8
+ */
9
+ export type DocumentInitParameters = {
10
+ /**
11
+ * - The URL of the PDF.
12
+ */
13
+ url?: string | URL | undefined;
14
+ /**
15
+ * -
16
+ * Binary PDF data.
17
+ * Use TypedArrays (Uint8Array) to improve the memory usage. If PDF data is
18
+ * BASE64-encoded, use `atob()` to convert it to a binary string first.
19
+ *
20
+ * NOTE: If TypedArrays are used they will generally be transferred to the
21
+ * worker-thread. This will help reduce main-thread memory usage, however
22
+ * it will take ownership of the TypedArrays.
23
+ */
24
+ data?: string | number[] | ArrayBuffer | TypedArray | undefined;
25
+ /**
26
+ * - Basic authentication headers.
27
+ */
28
+ httpHeaders?: Object | undefined;
29
+ /**
30
+ * - Indicates whether or not
31
+ * cross-site Access-Control requests should be made using credentials such
32
+ * as cookies or authorization headers. The default is `false`.
33
+ */
34
+ withCredentials?: boolean | undefined;
35
+ /**
36
+ * - For decrypting password-protected PDFs.
37
+ */
38
+ password?: string | undefined;
39
+ /**
40
+ * - The PDF file length. It's used for progress
41
+ * reports and range requests operations.
42
+ */
43
+ length?: number | undefined;
44
+ /**
45
+ * - Allows for using a custom range
46
+ * transport implementation.
47
+ */
48
+ range?: PDFDataRangeTransport | undefined;
49
+ /**
50
+ * - Specify maximum number of bytes fetched
51
+ * per range request. The default value is 65536 (= 2^16).
52
+ */
53
+ rangeChunkSize?: number | undefined;
54
+ /**
55
+ * - The worker that will be used for loading and
56
+ * parsing the PDF data.
57
+ */
58
+ worker?: PDFWorker | undefined;
59
+ /**
60
+ * - Controls the logging level; the constants
61
+ * from {@link VerbosityLevel} should be used.
62
+ */
63
+ verbosity?: number | undefined;
64
+ /**
65
+ * - The base URL of the document, used when
66
+ * attempting to recover valid absolute URLs for annotations, and outline
67
+ * items, that (incorrectly) only specify relative URLs.
68
+ */
69
+ docBaseUrl?: string | undefined;
70
+ /**
71
+ * - The URL where the predefined Adobe CMaps are
72
+ * located. Include the trailing slash.
73
+ */
74
+ cMapUrl?: string | undefined;
75
+ /**
76
+ * - Specifies if the Adobe CMaps are binary
77
+ * packed or not. The default value is `true`.
78
+ */
79
+ cMapPacked?: boolean | undefined;
80
+ /**
81
+ * - The factory that will be used when
82
+ * reading built-in CMap files.
83
+ * The default value is {DOMCMapReaderFactory}.
84
+ */
85
+ CMapReaderFactory?: Object | undefined;
86
+ /**
87
+ * - The URL where the predefined ICC profiles are
88
+ * located. Include the trailing slash.
89
+ */
90
+ iccUrl?: string | undefined;
91
+ /**
92
+ * - When `true`, fonts that aren't
93
+ * embedded in the PDF document will fallback to a system font.
94
+ * The default value is `true` in web environments and `false` in Node.js;
95
+ * unless `disableFontFace === true` in which case this defaults to `false`
96
+ * regardless of the environment (to prevent completely broken fonts).
97
+ */
98
+ useSystemFonts?: boolean | undefined;
99
+ /**
100
+ * - The URL where the standard font
101
+ * files are located. Include the trailing slash.
102
+ */
103
+ standardFontDataUrl?: string | undefined;
104
+ /**
105
+ * - The factory that will be used
106
+ * when reading the standard font files.
107
+ * The default value is {DOMStandardFontDataFactory}.
108
+ */
109
+ StandardFontDataFactory?: Object | undefined;
110
+ /**
111
+ * - The URL where the wasm files are located.
112
+ * Include the trailing slash.
113
+ */
114
+ wasmUrl?: string | undefined;
115
+ /**
116
+ * - The factory that will be used
117
+ * when reading the wasm files.
118
+ * The default value is {DOMWasmFactory}.
119
+ */
120
+ WasmFactory?: Object | undefined;
121
+ /**
122
+ * - Enable using the Fetch API in the
123
+ * worker-thread when reading CMap and standard font files. When `true`,
124
+ * the `CMapReaderFactory`, `StandardFontDataFactory`, and `WasmFactory`
125
+ * options are ignored.
126
+ * The default value is `true` in web environments and `false` in Node.js.
127
+ */
128
+ useWorkerFetch?: boolean | undefined;
129
+ /**
130
+ * - Attempt to use WebAssembly in order to
131
+ * improve e.g. image decoding performance.
132
+ * The default value is `true`.
133
+ */
134
+ useWasm?: boolean | undefined;
135
+ /**
136
+ * - Reject certain promises, e.g.
137
+ * `getOperatorList`, `getTextContent`, and `RenderTask`, when the associated
138
+ * PDF data cannot be successfully parsed, instead of attempting to recover
139
+ * whatever possible of the data. The default value is `false`.
140
+ */
141
+ stopAtErrors?: boolean | undefined;
142
+ /**
143
+ * - The maximum allowed image size in total
144
+ * pixels, i.e. width * height. Images above this value will not be rendered.
145
+ * Use -1 for no limit, which is also the default value.
146
+ */
147
+ maxImageSize?: number | undefined;
148
+ /**
149
+ * - Determines if we can evaluate strings
150
+ * as JavaScript. Primarily used to improve performance of PDF functions.
151
+ * The default value is `true`.
152
+ */
153
+ isEvalSupported?: boolean | undefined;
154
+ /**
155
+ * - Determines if we can use
156
+ * `OffscreenCanvas` in the worker. Primarily used to improve performance of
157
+ * image conversion/rendering.
158
+ * The default value is `true` in web environments and `false` in Node.js.
159
+ */
160
+ isOffscreenCanvasSupported?: boolean | undefined;
161
+ /**
162
+ * - Determines if we can use
163
+ * `ImageDecoder` in the worker. Primarily used to improve performance of
164
+ * image conversion/rendering.
165
+ * The default value is `true` in web environments and `false` in Node.js.
166
+ *
167
+ * NOTE: Also temporarily disabled in Chromium browsers, until we no longer
168
+ * support the affected browser versions, because of various bugs:
169
+ *
170
+ * - Crashes when using the BMP decoder with huge images, e.g. issue6741.pdf;
171
+ * see https://issues.chromium.org/issues/374807001
172
+ *
173
+ * - Broken images when using the JPEG decoder with images that have custom
174
+ * colour profiles, e.g. GitHub discussion 19030;
175
+ * see https://issues.chromium.org/issues/378869810
176
+ */
177
+ isImageDecoderSupported?: boolean | undefined;
178
+ /**
179
+ * - The integer value is used to
180
+ * know when an image must be resized (uses `OffscreenCanvas` in the worker).
181
+ * If it's -1 then a possibly slow algorithm is used to guess the max value.
182
+ */
183
+ canvasMaxAreaInBytes?: number | undefined;
184
+ /**
185
+ * - By default fonts are converted to
186
+ * OpenType fonts and loaded via the Font Loading API or `@font-face` rules.
187
+ * If disabled, fonts will be rendered using a built-in font renderer that
188
+ * constructs the glyphs with primitive path commands.
189
+ * The default value is `false` in web environments and `true` in Node.js.
190
+ */
191
+ disableFontFace?: boolean | undefined;
192
+ /**
193
+ * - Include additional properties,
194
+ * which are unused during rendering of PDF documents, when exporting the
195
+ * parsed font data from the worker-thread. This may be useful for debugging
196
+ * purposes (and backwards compatibility), but note that it will lead to
197
+ * increased memory usage. The default value is `false`.
198
+ */
199
+ fontExtraProperties?: boolean | undefined;
200
+ /**
201
+ * - Render Xfa forms if any.
202
+ * The default value is `false`.
203
+ */
204
+ enableXfa?: boolean | undefined;
205
+ /**
206
+ * - Specify an explicit document
207
+ * context to create elements with and to load resources, such as fonts,
208
+ * into. Defaults to the current document.
209
+ */
210
+ ownerDocument?: HTMLDocument | undefined;
211
+ /**
212
+ * - Disable range request loading of PDF
213
+ * files. When enabled, and if the server supports partial content requests,
214
+ * then the PDF will be fetched in chunks. The default value is `false`.
215
+ */
216
+ disableRange?: boolean | undefined;
217
+ /**
218
+ * - Disable streaming of PDF file data.
219
+ * By default PDF.js attempts to load PDF files in chunks. The default value
220
+ * is `false`.
221
+ */
222
+ disableStream?: boolean | undefined;
223
+ /**
224
+ * - Disable pre-fetching of PDF file
225
+ * data. When range requests are enabled PDF.js will automatically keep
226
+ * fetching more data even if it isn't needed to display the current page.
227
+ * The default value is `false`.
228
+ *
229
+ * NOTE: It is also necessary to disable streaming, see above, in order for
230
+ * disabling of pre-fetching to work correctly.
231
+ */
232
+ disableAutoFetch?: boolean | undefined;
233
+ /**
234
+ * - Enables special hooks for debugging PDF.js
235
+ * (see `web/debugger.js`). The default value is `false`.
236
+ */
237
+ pdfBug?: boolean | undefined;
238
+ /**
239
+ * - The factory that will be used when
240
+ * creating canvases. The default value is {DOMCanvasFactory}.
241
+ */
242
+ CanvasFactory?: Object | undefined;
243
+ /**
244
+ * - The factory that will be used to
245
+ * create SVG filters when rendering some images on the main canvas.
246
+ * The default value is {DOMFilterFactory}.
247
+ */
248
+ FilterFactory?: Object | undefined;
249
+ /**
250
+ * - Enables hardware acceleration for
251
+ * rendering. The default value is `false`.
252
+ */
253
+ enableHWA?: boolean | undefined;
254
+ };
255
+ export type OnProgressParameters = {
256
+ /**
257
+ * - Currently loaded number of bytes.
258
+ */
259
+ loaded: number;
260
+ /**
261
+ * - Total number of bytes in the PDF file.
262
+ */
263
+ total: number;
264
+ };
265
+ /**
266
+ * Page getViewport parameters.
267
+ */
268
+ export type GetViewportParameters = {
269
+ /**
270
+ * - The desired scale of the viewport.
271
+ */
272
+ scale: number;
273
+ /**
274
+ * - The desired rotation, in degrees, of
275
+ * the viewport. If omitted it defaults to the page rotation.
276
+ */
277
+ rotation?: number | undefined;
278
+ /**
279
+ * - The horizontal, i.e. x-axis, offset.
280
+ * The default value is `0`.
281
+ */
282
+ offsetX?: number | undefined;
283
+ /**
284
+ * - The vertical, i.e. y-axis, offset.
285
+ * The default value is `0`.
286
+ */
287
+ offsetY?: number | undefined;
288
+ /**
289
+ * - If true, the y-axis will not be
290
+ * flipped. The default value is `false`.
291
+ */
292
+ dontFlip?: boolean | undefined;
293
+ };
294
+ /**
295
+ * Page getTextContent parameters.
296
+ */
297
+ export type getTextContentParameters = {
298
+ /**
299
+ * - When true include marked
300
+ * content items in the items array of TextContent. The default is `false`.
301
+ */
302
+ includeMarkedContent?: boolean | undefined;
303
+ /**
304
+ * - When true the text is *not*
305
+ * normalized in the worker-thread. The default is `false`.
306
+ */
307
+ disableNormalization?: boolean | undefined;
308
+ };
309
+ /**
310
+ * Page text content.
311
+ */
312
+ export type TextContent = {
313
+ /**
314
+ * - Array of
315
+ * {@link TextItem} and {@link TextMarkedContent} objects. TextMarkedContent
316
+ * items are included when includeMarkedContent is true.
317
+ */
318
+ items: Array<TextItem | TextMarkedContent>;
319
+ /**
320
+ * - {@link TextStyle} objects,
321
+ * indexed by font name.
322
+ */
323
+ styles: {
324
+ [x: string]: TextStyle;
325
+ };
326
+ /**
327
+ * - The document /Lang attribute.
328
+ */
329
+ lang: string | null;
330
+ };
331
+ /**
332
+ * Page text content part.
333
+ */
334
+ export type TextItem = {
335
+ /**
336
+ * - Text content.
337
+ */
338
+ str: string;
339
+ /**
340
+ * - Text direction: 'ttb', 'ltr' or 'rtl'.
341
+ */
342
+ dir: string;
343
+ /**
344
+ * - Transformation matrix.
345
+ */
346
+ transform: Array<any>;
347
+ /**
348
+ * - Width in device space.
349
+ */
350
+ width: number;
351
+ /**
352
+ * - Height in device space.
353
+ */
354
+ height: number;
355
+ /**
356
+ * - Font name used by PDF.js for converted font.
357
+ */
358
+ fontName: string;
359
+ /**
360
+ * - Indicating if the text content is followed by a
361
+ * line-break.
362
+ */
363
+ hasEOL: boolean;
364
+ };
365
+ /**
366
+ * Page text marked content part.
367
+ */
368
+ export type TextMarkedContent = {
369
+ /**
370
+ * - Either 'beginMarkedContent',
371
+ * 'beginMarkedContentProps', or 'endMarkedContent'.
372
+ */
373
+ type: string;
374
+ /**
375
+ * - The marked content identifier. Only used for type
376
+ * 'beginMarkedContentProps'.
377
+ */
378
+ id: string;
379
+ };
380
+ /**
381
+ * Text style.
382
+ */
383
+ export type TextStyle = {
384
+ /**
385
+ * - Font ascent.
386
+ */
387
+ ascent: number;
388
+ /**
389
+ * - Font descent.
390
+ */
391
+ descent: number;
392
+ /**
393
+ * - Whether or not the text is in vertical mode.
394
+ */
395
+ vertical: boolean;
396
+ /**
397
+ * - The possible font family.
398
+ */
399
+ fontFamily: string;
400
+ };
401
+ /**
402
+ * Page annotation parameters.
403
+ */
404
+ export type GetAnnotationsParameters = {
405
+ /**
406
+ * - Determines the annotations that are fetched,
407
+ * can be 'display' (viewable annotations), 'print' (printable annotations),
408
+ * or 'any' (all annotations). The default value is 'display'.
409
+ */
410
+ intent?: string | undefined;
411
+ };
412
+ /**
413
+ * Page render parameters.
414
+ */
415
+ export type RenderParameters = {
416
+ /**
417
+ * - 2D context of a DOM
418
+ * Canvas object for backwards compatibility; it is recommended to use the
419
+ * `canvas` parameter instead.
420
+ * If the context must absolutely be used to render the page, the canvas must
421
+ * be null.
422
+ */
423
+ canvasContext: CanvasRenderingContext2D;
424
+ /**
425
+ * - A DOM Canvas object. The default
426
+ * value is the canvas associated with the `canvasContext` parameter if no
427
+ * value is provided explicitly.
428
+ */
429
+ canvas: HTMLCanvasElement | null;
430
+ /**
431
+ * - Rendering viewport obtained by calling
432
+ * the `PDFPageProxy.getViewport` method.
433
+ */
434
+ viewport: PageViewport;
435
+ /**
436
+ * - Rendering intent, can be 'display', 'print',
437
+ * or 'any'. The default value is 'display'.
438
+ */
439
+ intent?: string | undefined;
440
+ /**
441
+ * Controls which annotations are rendered
442
+ * onto the canvas, for annotations with appearance-data; the values from
443
+ * {@link AnnotationMode} should be used. The following values are supported:
444
+ * - `AnnotationMode.DISABLE`, which disables all annotations.
445
+ * - `AnnotationMode.ENABLE`, which includes all possible annotations (thus
446
+ * it also depends on the `intent`-option, see above).
447
+ * - `AnnotationMode.ENABLE_FORMS`, which excludes annotations that contain
448
+ * interactive form elements (those will be rendered in the display layer).
449
+ * - `AnnotationMode.ENABLE_STORAGE`, which includes all possible annotations
450
+ * (as above) but where interactive form elements are updated with data
451
+ * from the {@link AnnotationStorage}-instance; useful e.g. for printing.
452
+ * The default value is `AnnotationMode.ENABLE`.
453
+ */
454
+ annotationMode?: number | undefined;
455
+ /**
456
+ * - Additional transform, applied just
457
+ * before viewport transform.
458
+ */
459
+ transform?: any[] | undefined;
460
+ /**
461
+ * - Background
462
+ * to use for the canvas.
463
+ * Any valid `canvas.fillStyle` can be used: a `DOMString` parsed as CSS
464
+ * <color> value, a `CanvasGradient` object (a linear or radial gradient) or
465
+ * a `CanvasPattern` object (a repetitive image). The default value is
466
+ * 'rgb(255,255,255)'.
467
+ *
468
+ * NOTE: This option may be partially, or completely, ignored when the
469
+ * `pageColors`-option is used.
470
+ */
471
+ background?: string | CanvasGradient | CanvasPattern | undefined;
472
+ /**
473
+ * - Overwrites background and foreground colors
474
+ * with user defined ones in order to improve readability in high contrast
475
+ * mode.
476
+ */
477
+ pageColors?: Object | undefined;
478
+ /**
479
+ * -
480
+ * A promise that should resolve with an {@link OptionalContentConfig}created from `PDFDocumentProxy.getOptionalContentConfig`. If `null`,
481
+ * the configuration will be fetched automatically with the default visibility
482
+ * states set.
483
+ */
484
+ optionalContentConfigPromise?: Promise<OptionalContentConfig> | undefined;
485
+ /**
486
+ * - Map some
487
+ * annotation ids with canvases used to render them.
488
+ */
489
+ annotationCanvasMap?: Map<string, HTMLCanvasElement> | undefined;
490
+ printAnnotationStorage?: PrintAnnotationStorage | undefined;
491
+ /**
492
+ * - Render the page in editing mode.
493
+ */
494
+ isEditing?: boolean | undefined;
495
+ };
496
+ /**
497
+ * Page getOperatorList parameters.
498
+ */
499
+ export type GetOperatorListParameters = {
500
+ /**
501
+ * - Rendering intent, can be 'display', 'print',
502
+ * or 'any'. The default value is 'display'.
503
+ */
504
+ intent?: string | undefined;
505
+ /**
506
+ * Controls which annotations are included
507
+ * in the operatorList, for annotations with appearance-data; the values from
508
+ * {@link AnnotationMode} should be used. The following values are supported:
509
+ * - `AnnotationMode.DISABLE`, which disables all annotations.
510
+ * - `AnnotationMode.ENABLE`, which includes all possible annotations (thus
511
+ * it also depends on the `intent`-option, see above).
512
+ * - `AnnotationMode.ENABLE_FORMS`, which excludes annotations that contain
513
+ * interactive form elements (those will be rendered in the display layer).
514
+ * - `AnnotationMode.ENABLE_STORAGE`, which includes all possible annotations
515
+ * (as above) but where interactive form elements are updated with data
516
+ * from the {@link AnnotationStorage}-instance; useful e.g. for printing.
517
+ * The default value is `AnnotationMode.ENABLE`.
518
+ */
519
+ annotationMode?: number | undefined;
520
+ printAnnotationStorage?: PrintAnnotationStorage | undefined;
521
+ /**
522
+ * - Render the page in editing mode.
523
+ */
524
+ isEditing?: boolean | undefined;
525
+ };
526
+ /**
527
+ * Structure tree node. The root node will have a role "Root".
528
+ */
529
+ export type StructTreeNode = {
530
+ /**
531
+ * - Array of
532
+ * {@link StructTreeNode} and {@link StructTreeContent} objects.
533
+ */
534
+ children: Array<StructTreeNode | StructTreeContent>;
535
+ /**
536
+ * - element's role, already mapped if a role map exists
537
+ * in the PDF.
538
+ */
539
+ role: string;
540
+ };
541
+ /**
542
+ * Structure tree content.
543
+ */
544
+ export type StructTreeContent = {
545
+ /**
546
+ * - either "content" for page and stream structure
547
+ * elements or "object" for object references.
548
+ */
549
+ type: string;
550
+ /**
551
+ * - unique id that will map to the text layer.
552
+ */
553
+ id: string;
554
+ };
555
+ /**
556
+ * PDF page operator list.
557
+ */
558
+ export type PDFOperatorList = {
559
+ /**
560
+ * - Array containing the operator functions.
561
+ */
562
+ fnArray: Array<number>;
563
+ /**
564
+ * - Array containing the arguments of the
565
+ * functions.
566
+ */
567
+ argsArray: Array<any>;
568
+ };
569
+ export type PDFWorkerParameters = {
570
+ /**
571
+ * - The name of the worker.
572
+ */
573
+ name?: string | undefined;
574
+ /**
575
+ * - The `workerPort` object.
576
+ */
577
+ port?: Worker | undefined;
578
+ /**
579
+ * - Controls the logging level;
580
+ * the constants from {@link VerbosityLevel} should be used.
581
+ */
582
+ verbosity?: number | undefined;
583
+ };
584
+ /** @type {string} */
585
+ export const build: string;
586
+ /**
587
+ * @typedef { Int8Array | Uint8Array | Uint8ClampedArray |
588
+ * Int16Array | Uint16Array |
589
+ * Int32Array | Uint32Array | Float32Array |
590
+ * Float64Array
591
+ * } TypedArray
592
+ */
593
+ /**
594
+ * @typedef {Object} RefProxy
595
+ * @property {number} num
596
+ * @property {number} gen
597
+ */
598
+ /**
599
+ * Document initialization / loading parameters object.
600
+ *
601
+ * @typedef {Object} DocumentInitParameters
602
+ * @property {string | URL} [url] - The URL of the PDF.
603
+ * @property {TypedArray | ArrayBuffer | Array<number> | string} [data] -
604
+ * Binary PDF data.
605
+ * Use TypedArrays (Uint8Array) to improve the memory usage. If PDF data is
606
+ * BASE64-encoded, use `atob()` to convert it to a binary string first.
607
+ *
608
+ * NOTE: If TypedArrays are used they will generally be transferred to the
609
+ * worker-thread. This will help reduce main-thread memory usage, however
610
+ * it will take ownership of the TypedArrays.
611
+ * @property {Object} [httpHeaders] - Basic authentication headers.
612
+ * @property {boolean} [withCredentials] - Indicates whether or not
613
+ * cross-site Access-Control requests should be made using credentials such
614
+ * as cookies or authorization headers. The default is `false`.
615
+ * @property {string} [password] - For decrypting password-protected PDFs.
616
+ * @property {number} [length] - The PDF file length. It's used for progress
617
+ * reports and range requests operations.
618
+ * @property {PDFDataRangeTransport} [range] - Allows for using a custom range
619
+ * transport implementation.
620
+ * @property {number} [rangeChunkSize] - Specify maximum number of bytes fetched
621
+ * per range request. The default value is 65536 (= 2^16).
622
+ * @property {PDFWorker} [worker] - The worker that will be used for loading and
623
+ * parsing the PDF data.
624
+ * @property {number} [verbosity] - Controls the logging level; the constants
625
+ * from {@link VerbosityLevel} should be used.
626
+ * @property {string} [docBaseUrl] - The base URL of the document, used when
627
+ * attempting to recover valid absolute URLs for annotations, and outline
628
+ * items, that (incorrectly) only specify relative URLs.
629
+ * @property {string} [cMapUrl] - The URL where the predefined Adobe CMaps are
630
+ * located. Include the trailing slash.
631
+ * @property {boolean} [cMapPacked] - Specifies if the Adobe CMaps are binary
632
+ * packed or not. The default value is `true`.
633
+ * @property {Object} [CMapReaderFactory] - The factory that will be used when
634
+ * reading built-in CMap files.
635
+ * The default value is {DOMCMapReaderFactory}.
636
+ * @property {string} [iccUrl] - The URL where the predefined ICC profiles are
637
+ * located. Include the trailing slash.
638
+ * @property {boolean} [useSystemFonts] - When `true`, fonts that aren't
639
+ * embedded in the PDF document will fallback to a system font.
640
+ * The default value is `true` in web environments and `false` in Node.js;
641
+ * unless `disableFontFace === true` in which case this defaults to `false`
642
+ * regardless of the environment (to prevent completely broken fonts).
643
+ * @property {string} [standardFontDataUrl] - The URL where the standard font
644
+ * files are located. Include the trailing slash.
645
+ * @property {Object} [StandardFontDataFactory] - The factory that will be used
646
+ * when reading the standard font files.
647
+ * The default value is {DOMStandardFontDataFactory}.
648
+ * @property {string} [wasmUrl] - The URL where the wasm files are located.
649
+ * Include the trailing slash.
650
+ * @property {Object} [WasmFactory] - The factory that will be used
651
+ * when reading the wasm files.
652
+ * The default value is {DOMWasmFactory}.
653
+ * @property {boolean} [useWorkerFetch] - Enable using the Fetch API in the
654
+ * worker-thread when reading CMap and standard font files. When `true`,
655
+ * the `CMapReaderFactory`, `StandardFontDataFactory`, and `WasmFactory`
656
+ * options are ignored.
657
+ * The default value is `true` in web environments and `false` in Node.js.
658
+ * @property {boolean} [useWasm] - Attempt to use WebAssembly in order to
659
+ * improve e.g. image decoding performance.
660
+ * The default value is `true`.
661
+ * @property {boolean} [stopAtErrors] - Reject certain promises, e.g.
662
+ * `getOperatorList`, `getTextContent`, and `RenderTask`, when the associated
663
+ * PDF data cannot be successfully parsed, instead of attempting to recover
664
+ * whatever possible of the data. The default value is `false`.
665
+ * @property {number} [maxImageSize] - The maximum allowed image size in total
666
+ * pixels, i.e. width * height. Images above this value will not be rendered.
667
+ * Use -1 for no limit, which is also the default value.
668
+ * @property {boolean} [isEvalSupported] - Determines if we can evaluate strings
669
+ * as JavaScript. Primarily used to improve performance of PDF functions.
670
+ * The default value is `true`.
671
+ * @property {boolean} [isOffscreenCanvasSupported] - Determines if we can use
672
+ * `OffscreenCanvas` in the worker. Primarily used to improve performance of
673
+ * image conversion/rendering.
674
+ * The default value is `true` in web environments and `false` in Node.js.
675
+ * @property {boolean} [isImageDecoderSupported] - Determines if we can use
676
+ * `ImageDecoder` in the worker. Primarily used to improve performance of
677
+ * image conversion/rendering.
678
+ * The default value is `true` in web environments and `false` in Node.js.
679
+ *
680
+ * NOTE: Also temporarily disabled in Chromium browsers, until we no longer
681
+ * support the affected browser versions, because of various bugs:
682
+ *
683
+ * - Crashes when using the BMP decoder with huge images, e.g. issue6741.pdf;
684
+ * see https://issues.chromium.org/issues/374807001
685
+ *
686
+ * - Broken images when using the JPEG decoder with images that have custom
687
+ * colour profiles, e.g. GitHub discussion 19030;
688
+ * see https://issues.chromium.org/issues/378869810
689
+ *
690
+ * @property {number} [canvasMaxAreaInBytes] - The integer value is used to
691
+ * know when an image must be resized (uses `OffscreenCanvas` in the worker).
692
+ * If it's -1 then a possibly slow algorithm is used to guess the max value.
693
+ * @property {boolean} [disableFontFace] - By default fonts are converted to
694
+ * OpenType fonts and loaded via the Font Loading API or `@font-face` rules.
695
+ * If disabled, fonts will be rendered using a built-in font renderer that
696
+ * constructs the glyphs with primitive path commands.
697
+ * The default value is `false` in web environments and `true` in Node.js.
698
+ * @property {boolean} [fontExtraProperties] - Include additional properties,
699
+ * which are unused during rendering of PDF documents, when exporting the
700
+ * parsed font data from the worker-thread. This may be useful for debugging
701
+ * purposes (and backwards compatibility), but note that it will lead to
702
+ * increased memory usage. The default value is `false`.
703
+ * @property {boolean} [enableXfa] - Render Xfa forms if any.
704
+ * The default value is `false`.
705
+ * @property {HTMLDocument} [ownerDocument] - Specify an explicit document
706
+ * context to create elements with and to load resources, such as fonts,
707
+ * into. Defaults to the current document.
708
+ * @property {boolean} [disableRange] - Disable range request loading of PDF
709
+ * files. When enabled, and if the server supports partial content requests,
710
+ * then the PDF will be fetched in chunks. The default value is `false`.
711
+ * @property {boolean} [disableStream] - Disable streaming of PDF file data.
712
+ * By default PDF.js attempts to load PDF files in chunks. The default value
713
+ * is `false`.
714
+ * @property {boolean} [disableAutoFetch] - Disable pre-fetching of PDF file
715
+ * data. When range requests are enabled PDF.js will automatically keep
716
+ * fetching more data even if it isn't needed to display the current page.
717
+ * The default value is `false`.
718
+ *
719
+ * NOTE: It is also necessary to disable streaming, see above, in order for
720
+ * disabling of pre-fetching to work correctly.
721
+ * @property {boolean} [pdfBug] - Enables special hooks for debugging PDF.js
722
+ * (see `web/debugger.js`). The default value is `false`.
723
+ * @property {Object} [CanvasFactory] - The factory that will be used when
724
+ * creating canvases. The default value is {DOMCanvasFactory}.
725
+ * @property {Object} [FilterFactory] - The factory that will be used to
726
+ * create SVG filters when rendering some images on the main canvas.
727
+ * The default value is {DOMFilterFactory}.
728
+ * @property {boolean} [enableHWA] - Enables hardware acceleration for
729
+ * rendering. The default value is `false`.
730
+ */
731
+ /**
732
+ * This is the main entry point for loading a PDF and interacting with it.
733
+ *
734
+ * NOTE: If a URL is used to fetch the PDF data a standard Fetch API call (or
735
+ * XHR as fallback) is used, which means it must follow same origin rules,
736
+ * e.g. no cross-domain requests without CORS.
737
+ *
738
+ * @param {string | URL | TypedArray | ArrayBuffer | DocumentInitParameters}
739
+ * src - Can be a URL where a PDF file is located, a typed array (Uint8Array)
740
+ * already populated with data, or a parameter object.
741
+ * @returns {PDFDocumentLoadingTask}
742
+ */
743
+ export function getDocument(src?: string | URL | TypedArray | ArrayBuffer | DocumentInitParameters): PDFDocumentLoadingTask;
744
+ /**
745
+ * Abstract class to support range requests file loading.
746
+ *
747
+ * NOTE: The TypedArrays passed to the constructor and relevant methods below
748
+ * will generally be transferred to the worker-thread. This will help reduce
749
+ * main-thread memory usage, however it will take ownership of the TypedArrays.
750
+ */
751
+ export class PDFDataRangeTransport {
752
+ /**
753
+ * @param {number} length
754
+ * @param {Uint8Array|null} initialData
755
+ * @param {boolean} [progressiveDone]
756
+ * @param {string} [contentDispositionFilename]
757
+ */
758
+ constructor(length: number, initialData: Uint8Array | null, progressiveDone?: boolean, contentDispositionFilename?: string);
759
+ length: number;
760
+ initialData: Uint8Array<ArrayBufferLike> | null;
761
+ progressiveDone: boolean;
762
+ contentDispositionFilename: string;
763
+ /**
764
+ * @param {function} listener
765
+ */
766
+ addRangeListener(listener: Function): void;
767
+ /**
768
+ * @param {function} listener
769
+ */
770
+ addProgressListener(listener: Function): void;
771
+ /**
772
+ * @param {function} listener
773
+ */
774
+ addProgressiveReadListener(listener: Function): void;
775
+ /**
776
+ * @param {function} listener
777
+ */
778
+ addProgressiveDoneListener(listener: Function): void;
779
+ /**
780
+ * @param {number} begin
781
+ * @param {Uint8Array|null} chunk
782
+ */
783
+ onDataRange(begin: number, chunk: Uint8Array | null): void;
784
+ /**
785
+ * @param {number} loaded
786
+ * @param {number|undefined} total
787
+ */
788
+ onDataProgress(loaded: number, total: number | undefined): void;
789
+ /**
790
+ * @param {Uint8Array|null} chunk
791
+ */
792
+ onDataProgressiveRead(chunk: Uint8Array | null): void;
793
+ onDataProgressiveDone(): void;
794
+ transportReady(): void;
795
+ /**
796
+ * @param {number} begin
797
+ * @param {number} end
798
+ */
799
+ requestDataRange(begin: number, end: number): void;
800
+ abort(): void;
801
+ #private;
802
+ }
803
+ /**
804
+ * @typedef {Object} OnProgressParameters
805
+ * @property {number} loaded - Currently loaded number of bytes.
806
+ * @property {number} total - Total number of bytes in the PDF file.
807
+ */
808
+ /**
809
+ * The loading task controls the operations required to load a PDF document
810
+ * (such as network requests) and provides a way to listen for completion,
811
+ * after which individual pages can be rendered.
812
+ */
813
+ export class PDFDocumentLoadingTask {
814
+ static "__#59@#docId": number;
815
+ /**
816
+ * @private
817
+ */
818
+ private _capability;
819
+ /**
820
+ * @private
821
+ */
822
+ private _transport;
823
+ /**
824
+ * @private
825
+ */
826
+ private _worker;
827
+ /**
828
+ * Unique identifier for the document loading task.
829
+ * @type {string}
830
+ */
831
+ docId: string;
832
+ /**
833
+ * Whether the loading task is destroyed or not.
834
+ * @type {boolean}
835
+ */
836
+ destroyed: boolean;
837
+ /**
838
+ * Callback to request a password if a wrong or no password was provided.
839
+ * The callback receives two parameters: a function that should be called
840
+ * with the new password, and a reason (see {@link PasswordResponses}).
841
+ * @type {function}
842
+ */
843
+ onPassword: Function;
844
+ /**
845
+ * Callback to be able to monitor the loading progress of the PDF file
846
+ * (necessary to implement e.g. a loading bar).
847
+ * The callback receives an {@link OnProgressParameters} argument.
848
+ * @type {function}
849
+ */
850
+ onProgress: Function;
851
+ /**
852
+ * Promise for document loading task completion.
853
+ * @type {Promise<PDFDocumentProxy>}
854
+ */
855
+ get promise(): Promise<PDFDocumentProxy>;
856
+ /**
857
+ * Abort all network requests and destroy the worker.
858
+ * @returns {Promise<void>} A promise that is resolved when destruction is
859
+ * completed.
860
+ */
861
+ destroy(): Promise<void>;
862
+ /**
863
+ * Attempt to fetch the raw data of the PDF document, when e.g.
864
+ * - An exception was thrown during document initialization.
865
+ * - An `onPassword` callback is delaying initialization.
866
+ * @returns {Promise<Uint8Array>}
867
+ */
868
+ getData(): Promise<Uint8Array>;
869
+ }
870
+ /**
871
+ * Proxy to a `PDFDocument` in the worker thread.
872
+ */
873
+ export class PDFDocumentProxy {
874
+ constructor(pdfInfo: any, transport: any);
875
+ _pdfInfo: any;
876
+ _transport: any;
877
+ /**
878
+ * @type {AnnotationStorage} Storage for annotation data in forms.
879
+ */
880
+ get annotationStorage(): AnnotationStorage;
881
+ /**
882
+ * @type {Object} The canvas factory instance.
883
+ */
884
+ get canvasFactory(): Object;
885
+ /**
886
+ * @type {Object} The filter factory instance.
887
+ */
888
+ get filterFactory(): Object;
889
+ /**
890
+ * @type {number} Total number of pages in the PDF file.
891
+ */
892
+ get numPages(): number;
893
+ /**
894
+ * @type {Array<string | null>} A (not guaranteed to be) unique ID to identify
895
+ * the PDF document.
896
+ * NOTE: The first element will always be defined for all PDF documents,
897
+ * whereas the second element is only defined for *modified* PDF documents.
898
+ */
899
+ get fingerprints(): Array<string | null>;
900
+ /**
901
+ * @type {boolean} True if only XFA form.
902
+ */
903
+ get isPureXfa(): boolean;
904
+ /**
905
+ * NOTE: This is (mostly) intended to support printing of XFA forms.
906
+ *
907
+ * @type {Object | null} An object representing a HTML tree structure
908
+ * to render the XFA, or `null` when no XFA form exists.
909
+ */
910
+ get allXfaHtml(): Object | null;
911
+ /**
912
+ * @param {number} pageNumber - The page number to get. The first page is 1.
913
+ * @returns {Promise<PDFPageProxy>} A promise that is resolved with
914
+ * a {@link PDFPageProxy} object.
915
+ */
916
+ getPage(pageNumber: number): Promise<PDFPageProxy>;
917
+ /**
918
+ * @param {RefProxy} ref - The page reference.
919
+ * @returns {Promise<number>} A promise that is resolved with the page index,
920
+ * starting from zero, that is associated with the reference.
921
+ */
922
+ getPageIndex(ref: RefProxy): Promise<number>;
923
+ /**
924
+ * @returns {Promise<Object<string, Array<any>>>} A promise that is resolved
925
+ * with a mapping from named destinations to references.
926
+ *
927
+ * This can be slow for large documents. Use `getDestination` instead.
928
+ */
929
+ getDestinations(): Promise<{
930
+ [x: string]: Array<any>;
931
+ }>;
932
+ /**
933
+ * @param {string} id - The named destination to get.
934
+ * @returns {Promise<Array<any> | null>} A promise that is resolved with all
935
+ * information of the given named destination, or `null` when the named
936
+ * destination is not present in the PDF file.
937
+ */
938
+ getDestination(id: string): Promise<Array<any> | null>;
939
+ /**
940
+ * @returns {Promise<Array<string> | null>} A promise that is resolved with
941
+ * an {Array} containing the page labels that correspond to the page
942
+ * indexes, or `null` when no page labels are present in the PDF file.
943
+ */
944
+ getPageLabels(): Promise<Array<string> | null>;
945
+ /**
946
+ * @returns {Promise<string>} A promise that is resolved with a {string}
947
+ * containing the page layout name.
948
+ */
949
+ getPageLayout(): Promise<string>;
950
+ /**
951
+ * @returns {Promise<string>} A promise that is resolved with a {string}
952
+ * containing the page mode name.
953
+ */
954
+ getPageMode(): Promise<string>;
955
+ /**
956
+ * @returns {Promise<Object | null>} A promise that is resolved with an
957
+ * {Object} containing the viewer preferences, or `null` when no viewer
958
+ * preferences are present in the PDF file.
959
+ */
960
+ getViewerPreferences(): Promise<Object | null>;
961
+ /**
962
+ * @returns {Promise<any | null>} A promise that is resolved with an {Array}
963
+ * containing the destination, or `null` when no open action is present
964
+ * in the PDF.
965
+ */
966
+ getOpenAction(): Promise<any | null>;
967
+ /**
968
+ * @returns {Promise<any>} A promise that is resolved with a lookup table
969
+ * for mapping named attachments to their content.
970
+ */
971
+ getAttachments(): Promise<any>;
972
+ /**
973
+ * @returns {Promise<Object | null>} A promise that is resolved with
974
+ * an {Object} with the JavaScript actions:
975
+ * - from the name tree.
976
+ * - from A or AA entries in the catalog dictionary.
977
+ * , or `null` if no JavaScript exists.
978
+ */
979
+ getJSActions(): Promise<Object | null>;
980
+ /**
981
+ * @typedef {Object} OutlineNode
982
+ * @property {string} title
983
+ * @property {boolean} bold
984
+ * @property {boolean} italic
985
+ * @property {Uint8ClampedArray} color - The color in RGB format to use for
986
+ * display purposes.
987
+ * @property {string | Array<any> | null} dest
988
+ * @property {string | null} url
989
+ * @property {string | undefined} unsafeUrl
990
+ * @property {boolean | undefined} newWindow
991
+ * @property {number | undefined} count
992
+ * @property {Array<OutlineNode>} items
993
+ */
994
+ /**
995
+ * @returns {Promise<Array<OutlineNode>>} A promise that is resolved with an
996
+ * {Array} that is a tree outline (if it has one) of the PDF file.
997
+ */
998
+ getOutline(): Promise<Array<{
999
+ title: string;
1000
+ bold: boolean;
1001
+ italic: boolean;
1002
+ /**
1003
+ * - The color in RGB format to use for
1004
+ * display purposes.
1005
+ */
1006
+ color: Uint8ClampedArray;
1007
+ dest: string | Array<any> | null;
1008
+ url: string | null;
1009
+ unsafeUrl: string | undefined;
1010
+ newWindow: boolean | undefined;
1011
+ count: number | undefined;
1012
+ items: Array</*elided*/ any>;
1013
+ }>>;
1014
+ /**
1015
+ * @typedef {Object} GetOptionalContentConfigParameters
1016
+ * @property {string} [intent] - Determines the optional content groups that
1017
+ * are visible by default; valid values are:
1018
+ * - 'display' (viewable groups).
1019
+ * - 'print' (printable groups).
1020
+ * - 'any' (all groups).
1021
+ * The default value is 'display'.
1022
+ */
1023
+ /**
1024
+ * @param {GetOptionalContentConfigParameters} [params] - Optional content
1025
+ * config parameters.
1026
+ * @returns {Promise<OptionalContentConfig>} A promise that is resolved with
1027
+ * an {@link OptionalContentConfig} that contains all the optional content
1028
+ * groups (assuming that the document has any).
1029
+ */
1030
+ getOptionalContentConfig({ intent }?: {
1031
+ /**
1032
+ * - Determines the optional content groups that
1033
+ * are visible by default; valid values are:
1034
+ * - 'display' (viewable groups).
1035
+ * - 'print' (printable groups).
1036
+ * - 'any' (all groups).
1037
+ * The default value is 'display'.
1038
+ */
1039
+ intent?: string | undefined;
1040
+ }): Promise<OptionalContentConfig>;
1041
+ /**
1042
+ * @returns {Promise<Array<number> | null>} A promise that is resolved with
1043
+ * an {Array} that contains the permission flags for the PDF document, or
1044
+ * `null` when no permissions are present in the PDF file.
1045
+ */
1046
+ getPermissions(): Promise<Array<number> | null>;
1047
+ /**
1048
+ * @returns {Promise<{ info: Object, metadata: Metadata }>} A promise that is
1049
+ * resolved with an {Object} that has `info` and `metadata` properties.
1050
+ * `info` is an {Object} filled with anything available in the information
1051
+ * dictionary and similarly `metadata` is a {Metadata} object with
1052
+ * information from the metadata section of the PDF.
1053
+ */
1054
+ getMetadata(): Promise<{
1055
+ info: Object;
1056
+ metadata: Metadata;
1057
+ }>;
1058
+ /**
1059
+ * @typedef {Object} MarkInfo
1060
+ * Properties correspond to Table 321 of the PDF 32000-1:2008 spec.
1061
+ * @property {boolean} Marked
1062
+ * @property {boolean} UserProperties
1063
+ * @property {boolean} Suspects
1064
+ */
1065
+ /**
1066
+ * @returns {Promise<MarkInfo | null>} A promise that is resolved with
1067
+ * a {MarkInfo} object that contains the MarkInfo flags for the PDF
1068
+ * document, or `null` when no MarkInfo values are present in the PDF file.
1069
+ */
1070
+ getMarkInfo(): Promise<{
1071
+ Marked: boolean;
1072
+ UserProperties: boolean;
1073
+ Suspects: boolean;
1074
+ } | null>;
1075
+ /**
1076
+ * @returns {Promise<Uint8Array>} A promise that is resolved with a
1077
+ * {Uint8Array} containing the raw data of the PDF document.
1078
+ */
1079
+ getData(): Promise<Uint8Array>;
1080
+ /**
1081
+ * @returns {Promise<Uint8Array>} A promise that is resolved with a
1082
+ * {Uint8Array} containing the full data of the saved document.
1083
+ */
1084
+ saveDocument(): Promise<Uint8Array>;
1085
+ /**
1086
+ * @returns {Promise<{ length: number }>} A promise that is resolved when the
1087
+ * document's data is loaded. It is resolved with an {Object} that contains
1088
+ * the `length` property that indicates size of the PDF data in bytes.
1089
+ */
1090
+ getDownloadInfo(): Promise<{
1091
+ length: number;
1092
+ }>;
1093
+ /**
1094
+ * Cleans up resources allocated by the document on both the main and worker
1095
+ * threads.
1096
+ *
1097
+ * NOTE: Do not, under any circumstances, call this method when rendering is
1098
+ * currently ongoing since that may lead to rendering errors.
1099
+ *
1100
+ * @param {boolean} [keepLoadedFonts] - Let fonts remain attached to the DOM.
1101
+ * NOTE: This will increase persistent memory usage, hence don't use this
1102
+ * option unless absolutely necessary. The default value is `false`.
1103
+ * @returns {Promise} A promise that is resolved when clean-up has finished.
1104
+ */
1105
+ cleanup(keepLoadedFonts?: boolean): Promise<any>;
1106
+ /**
1107
+ * Destroys the current document instance and terminates the worker.
1108
+ */
1109
+ destroy(): Promise<void>;
1110
+ /**
1111
+ * @param {RefProxy} ref - The page reference.
1112
+ * @returns {number | null} The page number, if it's cached.
1113
+ */
1114
+ cachedPageNumber(ref: RefProxy): number | null;
1115
+ /**
1116
+ * @type {DocumentInitParameters} A subset of the current
1117
+ * {DocumentInitParameters}, which are needed in the viewer.
1118
+ */
1119
+ get loadingParams(): DocumentInitParameters;
1120
+ /**
1121
+ * @type {PDFDocumentLoadingTask} The loadingTask for the current document.
1122
+ */
1123
+ get loadingTask(): PDFDocumentLoadingTask;
1124
+ /**
1125
+ * @returns {Promise<Object<string, Array<Object>> | null>} A promise that is
1126
+ * resolved with an {Object} containing /AcroForm field data for the JS
1127
+ * sandbox, or `null` when no field data is present in the PDF file.
1128
+ */
1129
+ getFieldObjects(): Promise<{
1130
+ [x: string]: Array<Object>;
1131
+ } | null>;
1132
+ /**
1133
+ * @returns {Promise<boolean>} A promise that is resolved with `true`
1134
+ * if some /AcroForm fields have JavaScript actions.
1135
+ */
1136
+ hasJSActions(): Promise<boolean>;
1137
+ /**
1138
+ * @returns {Promise<Array<string> | null>} A promise that is resolved with an
1139
+ * {Array<string>} containing IDs of annotations that have a calculation
1140
+ * action, or `null` when no such annotations are present in the PDF file.
1141
+ */
1142
+ getCalculationOrderIds(): Promise<Array<string> | null>;
1143
+ }
1144
+ /**
1145
+ * Page getViewport parameters.
1146
+ *
1147
+ * @typedef {Object} GetViewportParameters
1148
+ * @property {number} scale - The desired scale of the viewport.
1149
+ * @property {number} [rotation] - The desired rotation, in degrees, of
1150
+ * the viewport. If omitted it defaults to the page rotation.
1151
+ * @property {number} [offsetX] - The horizontal, i.e. x-axis, offset.
1152
+ * The default value is `0`.
1153
+ * @property {number} [offsetY] - The vertical, i.e. y-axis, offset.
1154
+ * The default value is `0`.
1155
+ * @property {boolean} [dontFlip] - If true, the y-axis will not be
1156
+ * flipped. The default value is `false`.
1157
+ */
1158
+ /**
1159
+ * Page getTextContent parameters.
1160
+ *
1161
+ * @typedef {Object} getTextContentParameters
1162
+ * @property {boolean} [includeMarkedContent] - When true include marked
1163
+ * content items in the items array of TextContent. The default is `false`.
1164
+ * @property {boolean} [disableNormalization] - When true the text is *not*
1165
+ * normalized in the worker-thread. The default is `false`.
1166
+ */
1167
+ /**
1168
+ * Page text content.
1169
+ *
1170
+ * @typedef {Object} TextContent
1171
+ * @property {Array<TextItem | TextMarkedContent>} items - Array of
1172
+ * {@link TextItem} and {@link TextMarkedContent} objects. TextMarkedContent
1173
+ * items are included when includeMarkedContent is true.
1174
+ * @property {Object<string, TextStyle>} styles - {@link TextStyle} objects,
1175
+ * indexed by font name.
1176
+ * @property {string | null} lang - The document /Lang attribute.
1177
+ */
1178
+ /**
1179
+ * Page text content part.
1180
+ *
1181
+ * @typedef {Object} TextItem
1182
+ * @property {string} str - Text content.
1183
+ * @property {string} dir - Text direction: 'ttb', 'ltr' or 'rtl'.
1184
+ * @property {Array<any>} transform - Transformation matrix.
1185
+ * @property {number} width - Width in device space.
1186
+ * @property {number} height - Height in device space.
1187
+ * @property {string} fontName - Font name used by PDF.js for converted font.
1188
+ * @property {boolean} hasEOL - Indicating if the text content is followed by a
1189
+ * line-break.
1190
+ */
1191
+ /**
1192
+ * Page text marked content part.
1193
+ *
1194
+ * @typedef {Object} TextMarkedContent
1195
+ * @property {string} type - Either 'beginMarkedContent',
1196
+ * 'beginMarkedContentProps', or 'endMarkedContent'.
1197
+ * @property {string} id - The marked content identifier. Only used for type
1198
+ * 'beginMarkedContentProps'.
1199
+ */
1200
+ /**
1201
+ * Text style.
1202
+ *
1203
+ * @typedef {Object} TextStyle
1204
+ * @property {number} ascent - Font ascent.
1205
+ * @property {number} descent - Font descent.
1206
+ * @property {boolean} vertical - Whether or not the text is in vertical mode.
1207
+ * @property {string} fontFamily - The possible font family.
1208
+ */
1209
+ /**
1210
+ * Page annotation parameters.
1211
+ *
1212
+ * @typedef {Object} GetAnnotationsParameters
1213
+ * @property {string} [intent] - Determines the annotations that are fetched,
1214
+ * can be 'display' (viewable annotations), 'print' (printable annotations),
1215
+ * or 'any' (all annotations). The default value is 'display'.
1216
+ */
1217
+ /**
1218
+ * Page render parameters.
1219
+ *
1220
+ * @typedef {Object} RenderParameters
1221
+ * @property {CanvasRenderingContext2D} canvasContext - 2D context of a DOM
1222
+ * Canvas object for backwards compatibility; it is recommended to use the
1223
+ * `canvas` parameter instead.
1224
+ * If the context must absolutely be used to render the page, the canvas must
1225
+ * be null.
1226
+ * @property {HTMLCanvasElement|null} canvas - A DOM Canvas object. The default
1227
+ * value is the canvas associated with the `canvasContext` parameter if no
1228
+ * value is provided explicitly.
1229
+ * @property {PageViewport} viewport - Rendering viewport obtained by calling
1230
+ * the `PDFPageProxy.getViewport` method.
1231
+ * @property {string} [intent] - Rendering intent, can be 'display', 'print',
1232
+ * or 'any'. The default value is 'display'.
1233
+ * @property {number} [annotationMode] Controls which annotations are rendered
1234
+ * onto the canvas, for annotations with appearance-data; the values from
1235
+ * {@link AnnotationMode} should be used. The following values are supported:
1236
+ * - `AnnotationMode.DISABLE`, which disables all annotations.
1237
+ * - `AnnotationMode.ENABLE`, which includes all possible annotations (thus
1238
+ * it also depends on the `intent`-option, see above).
1239
+ * - `AnnotationMode.ENABLE_FORMS`, which excludes annotations that contain
1240
+ * interactive form elements (those will be rendered in the display layer).
1241
+ * - `AnnotationMode.ENABLE_STORAGE`, which includes all possible annotations
1242
+ * (as above) but where interactive form elements are updated with data
1243
+ * from the {@link AnnotationStorage}-instance; useful e.g. for printing.
1244
+ * The default value is `AnnotationMode.ENABLE`.
1245
+ * @property {Array<any>} [transform] - Additional transform, applied just
1246
+ * before viewport transform.
1247
+ * @property {CanvasGradient | CanvasPattern | string} [background] - Background
1248
+ * to use for the canvas.
1249
+ * Any valid `canvas.fillStyle` can be used: a `DOMString` parsed as CSS
1250
+ * <color> value, a `CanvasGradient` object (a linear or radial gradient) or
1251
+ * a `CanvasPattern` object (a repetitive image). The default value is
1252
+ * 'rgb(255,255,255)'.
1253
+ *
1254
+ * NOTE: This option may be partially, or completely, ignored when the
1255
+ * `pageColors`-option is used.
1256
+ * @property {Object} [pageColors] - Overwrites background and foreground colors
1257
+ * with user defined ones in order to improve readability in high contrast
1258
+ * mode.
1259
+ * @property {Promise<OptionalContentConfig>} [optionalContentConfigPromise] -
1260
+ * A promise that should resolve with an {@link OptionalContentConfig}
1261
+ * created from `PDFDocumentProxy.getOptionalContentConfig`. If `null`,
1262
+ * the configuration will be fetched automatically with the default visibility
1263
+ * states set.
1264
+ * @property {Map<string, HTMLCanvasElement>} [annotationCanvasMap] - Map some
1265
+ * annotation ids with canvases used to render them.
1266
+ * @property {PrintAnnotationStorage} [printAnnotationStorage]
1267
+ * @property {boolean} [isEditing] - Render the page in editing mode.
1268
+ */
1269
+ /**
1270
+ * Page getOperatorList parameters.
1271
+ *
1272
+ * @typedef {Object} GetOperatorListParameters
1273
+ * @property {string} [intent] - Rendering intent, can be 'display', 'print',
1274
+ * or 'any'. The default value is 'display'.
1275
+ * @property {number} [annotationMode] Controls which annotations are included
1276
+ * in the operatorList, for annotations with appearance-data; the values from
1277
+ * {@link AnnotationMode} should be used. The following values are supported:
1278
+ * - `AnnotationMode.DISABLE`, which disables all annotations.
1279
+ * - `AnnotationMode.ENABLE`, which includes all possible annotations (thus
1280
+ * it also depends on the `intent`-option, see above).
1281
+ * - `AnnotationMode.ENABLE_FORMS`, which excludes annotations that contain
1282
+ * interactive form elements (those will be rendered in the display layer).
1283
+ * - `AnnotationMode.ENABLE_STORAGE`, which includes all possible annotations
1284
+ * (as above) but where interactive form elements are updated with data
1285
+ * from the {@link AnnotationStorage}-instance; useful e.g. for printing.
1286
+ * The default value is `AnnotationMode.ENABLE`.
1287
+ * @property {PrintAnnotationStorage} [printAnnotationStorage]
1288
+ * @property {boolean} [isEditing] - Render the page in editing mode.
1289
+ */
1290
+ /**
1291
+ * Structure tree node. The root node will have a role "Root".
1292
+ *
1293
+ * @typedef {Object} StructTreeNode
1294
+ * @property {Array<StructTreeNode | StructTreeContent>} children - Array of
1295
+ * {@link StructTreeNode} and {@link StructTreeContent} objects.
1296
+ * @property {string} role - element's role, already mapped if a role map exists
1297
+ * in the PDF.
1298
+ */
1299
+ /**
1300
+ * Structure tree content.
1301
+ *
1302
+ * @typedef {Object} StructTreeContent
1303
+ * @property {string} type - either "content" for page and stream structure
1304
+ * elements or "object" for object references.
1305
+ * @property {string} id - unique id that will map to the text layer.
1306
+ */
1307
+ /**
1308
+ * PDF page operator list.
1309
+ *
1310
+ * @typedef {Object} PDFOperatorList
1311
+ * @property {Array<number>} fnArray - Array containing the operator functions.
1312
+ * @property {Array<any>} argsArray - Array containing the arguments of the
1313
+ * functions.
1314
+ */
1315
+ /**
1316
+ * Proxy to a `PDFPage` in the worker thread.
1317
+ */
1318
+ export class PDFPageProxy {
1319
+ constructor(pageIndex: any, pageInfo: any, transport: any, pdfBug?: boolean);
1320
+ _pageIndex: any;
1321
+ _pageInfo: any;
1322
+ _transport: any;
1323
+ _stats: StatTimer | null;
1324
+ _pdfBug: boolean;
1325
+ /** @type {PDFObjects} */
1326
+ commonObjs: PDFObjects;
1327
+ objs: PDFObjects;
1328
+ _intentStates: Map<any, any>;
1329
+ destroyed: boolean;
1330
+ /**
1331
+ * @type {number} Page number of the page. First page is 1.
1332
+ */
1333
+ get pageNumber(): number;
1334
+ /**
1335
+ * @type {number} The number of degrees the page is rotated clockwise.
1336
+ */
1337
+ get rotate(): number;
1338
+ /**
1339
+ * @type {RefProxy | null} The reference that points to this page.
1340
+ */
1341
+ get ref(): RefProxy | null;
1342
+ /**
1343
+ * @type {number} The default size of units in 1/72nds of an inch.
1344
+ */
1345
+ get userUnit(): number;
1346
+ /**
1347
+ * @type {Array<number>} An array of the visible portion of the PDF page in
1348
+ * user space units [x1, y1, x2, y2].
1349
+ */
1350
+ get view(): Array<number>;
1351
+ /**
1352
+ * @param {GetViewportParameters} params - Viewport parameters.
1353
+ * @returns {PageViewport} Contains 'width' and 'height' properties
1354
+ * along with transforms required for rendering.
1355
+ */
1356
+ getViewport({ scale, rotation, offsetX, offsetY, dontFlip, }?: GetViewportParameters): PageViewport;
1357
+ /**
1358
+ * @param {GetAnnotationsParameters} [params] - Annotation parameters.
1359
+ * @returns {Promise<Array<any>>} A promise that is resolved with an
1360
+ * {Array} of the annotation objects.
1361
+ */
1362
+ getAnnotations({ intent }?: GetAnnotationsParameters): Promise<Array<any>>;
1363
+ /**
1364
+ * @returns {Promise<Object>} A promise that is resolved with an
1365
+ * {Object} with JS actions.
1366
+ */
1367
+ getJSActions(): Promise<Object>;
1368
+ /**
1369
+ * @type {Object} The filter factory instance.
1370
+ */
1371
+ get filterFactory(): Object;
1372
+ /**
1373
+ * @type {boolean} True if only XFA form.
1374
+ */
1375
+ get isPureXfa(): boolean;
1376
+ /**
1377
+ * @returns {Promise<Object | null>} A promise that is resolved with
1378
+ * an {Object} with a fake DOM object (a tree structure where elements
1379
+ * are {Object} with a name, attributes (class, style, ...), value and
1380
+ * children, very similar to a HTML DOM tree), or `null` if no XFA exists.
1381
+ */
1382
+ getXfa(): Promise<Object | null>;
1383
+ /**
1384
+ * Begins the process of rendering a page to the desired context.
1385
+ *
1386
+ * @param {RenderParameters} params - Page render parameters.
1387
+ * @returns {RenderTask} An object that contains a promise that is
1388
+ * resolved when the page finishes rendering.
1389
+ */
1390
+ render({ canvasContext, canvas, viewport, intent, annotationMode, transform, background, optionalContentConfigPromise, annotationCanvasMap, pageColors, printAnnotationStorage, isEditing, }: RenderParameters): RenderTask;
1391
+ /**
1392
+ * @param {GetOperatorListParameters} params - Page getOperatorList
1393
+ * parameters.
1394
+ * @returns {Promise<PDFOperatorList>} A promise resolved with an
1395
+ * {@link PDFOperatorList} object that represents the page's operator list.
1396
+ */
1397
+ getOperatorList({ intent, annotationMode, printAnnotationStorage, isEditing, }?: GetOperatorListParameters): Promise<PDFOperatorList>;
1398
+ /**
1399
+ * NOTE: All occurrences of whitespace will be replaced by
1400
+ * standard spaces (0x20).
1401
+ *
1402
+ * @param {getTextContentParameters} params - getTextContent parameters.
1403
+ * @returns {ReadableStream} Stream for reading text content chunks.
1404
+ */
1405
+ streamTextContent({ includeMarkedContent, disableNormalization, }?: getTextContentParameters): ReadableStream;
1406
+ /**
1407
+ * NOTE: All occurrences of whitespace will be replaced by
1408
+ * standard spaces (0x20).
1409
+ *
1410
+ * @param {getTextContentParameters} params - getTextContent parameters.
1411
+ * @returns {Promise<TextContent>} A promise that is resolved with a
1412
+ * {@link TextContent} object that represents the page's text content.
1413
+ */
1414
+ getTextContent(params?: getTextContentParameters): Promise<TextContent>;
1415
+ /**
1416
+ * @returns {Promise<StructTreeNode>} A promise that is resolved with a
1417
+ * {@link StructTreeNode} object that represents the page's structure tree,
1418
+ * or `null` when no structure tree is present for the current page.
1419
+ */
1420
+ getStructTree(): Promise<StructTreeNode>;
1421
+ /**
1422
+ * Destroys the page object.
1423
+ * @private
1424
+ */
1425
+ private _destroy;
1426
+ /**
1427
+ * Cleans up resources allocated by the page.
1428
+ *
1429
+ * @param {boolean} [resetStats] - Reset page stats, if enabled.
1430
+ * The default value is `false`.
1431
+ * @returns {boolean} Indicates if clean-up was successfully run.
1432
+ */
1433
+ cleanup(resetStats?: boolean): boolean;
1434
+ /**
1435
+ * @private
1436
+ */
1437
+ private _startRenderPage;
1438
+ /**
1439
+ * @private
1440
+ */
1441
+ private _renderPageChunk;
1442
+ /**
1443
+ * @private
1444
+ */
1445
+ private _pumpOperatorList;
1446
+ /**
1447
+ * @private
1448
+ */
1449
+ private _abortOperatorList;
1450
+ /**
1451
+ * @type {StatTimer | null} Returns page stats, if enabled; returns `null`
1452
+ * otherwise.
1453
+ */
1454
+ get stats(): StatTimer | null;
1455
+ #private;
1456
+ }
1457
+ /**
1458
+ * @typedef {Object} PDFWorkerParameters
1459
+ * @property {string} [name] - The name of the worker.
1460
+ * @property {Worker} [port] - The `workerPort` object.
1461
+ * @property {number} [verbosity] - Controls the logging level;
1462
+ * the constants from {@link VerbosityLevel} should be used.
1463
+ */
1464
+ /**
1465
+ * PDF.js web worker abstraction that controls the instantiation of PDF
1466
+ * documents. Message handlers are used to pass information from the main
1467
+ * thread to the worker thread and vice versa. If the creation of a web
1468
+ * worker is not possible, a "fake" worker will be used instead.
1469
+ *
1470
+ * @param {PDFWorkerParameters} params - The worker initialization parameters.
1471
+ */
1472
+ export class PDFWorker {
1473
+ static "__#62@#fakeWorkerId": number;
1474
+ static "__#62@#isWorkerDisabled": boolean;
1475
+ static "__#62@#workerPorts": WeakMap<object, any>;
1476
+ /**
1477
+ * @param {PDFWorkerParameters} params - The worker initialization parameters.
1478
+ * @returns {PDFWorker}
1479
+ */
1480
+ static create(params: PDFWorkerParameters): PDFWorker;
1481
+ /**
1482
+ * The current `workerSrc`, when it exists.
1483
+ * @type {string}
1484
+ */
1485
+ static get workerSrc(): string;
1486
+ static get "__#62@#mainThreadWorkerMessageHandler"(): any;
1487
+ static get _setupFakeWorkerGlobal(): any;
1488
+ constructor({ name, port, verbosity, }?: {
1489
+ name?: null | undefined;
1490
+ port?: null | undefined;
1491
+ verbosity?: number | undefined;
1492
+ });
1493
+ name: any;
1494
+ destroyed: boolean;
1495
+ verbosity: number;
1496
+ /**
1497
+ * Promise for worker initialization completion.
1498
+ * @type {Promise<void>}
1499
+ */
1500
+ get promise(): Promise<void>;
1501
+ /**
1502
+ * The current `workerPort`, when it exists.
1503
+ * @type {Worker}
1504
+ */
1505
+ get port(): Worker;
1506
+ /**
1507
+ * The current MessageHandler-instance.
1508
+ * @type {MessageHandler}
1509
+ */
1510
+ get messageHandler(): MessageHandler;
1511
+ /**
1512
+ * Destroys the worker instance.
1513
+ */
1514
+ destroy(): void;
1515
+ #private;
1516
+ }
1517
+ /**
1518
+ * Allows controlling of the rendering tasks.
1519
+ */
1520
+ export class RenderTask {
1521
+ constructor(internalRenderTask: any);
1522
+ /**
1523
+ * Callback for incremental rendering -- a function that will be called
1524
+ * each time the rendering is paused. To continue rendering call the
1525
+ * function that is the first argument to the callback.
1526
+ * @type {function}
1527
+ */
1528
+ onContinue: Function;
1529
+ /**
1530
+ * A function that will be synchronously called when the rendering tasks
1531
+ * finishes with an error (either because of an actual error, or because the
1532
+ * rendering is cancelled).
1533
+ *
1534
+ * @type {function}
1535
+ * @param {Error} error
1536
+ */
1537
+ onError: Function;
1538
+ /**
1539
+ * Promise for rendering task completion.
1540
+ * @type {Promise<void>}
1541
+ */
1542
+ get promise(): Promise<void>;
1543
+ /**
1544
+ * Cancels the rendering task. If the task is currently rendering it will
1545
+ * not be cancelled until graphics pauses with a timeout. The promise that
1546
+ * this object extends will be rejected when cancelled.
1547
+ *
1548
+ * @param {number} [extraDelay]
1549
+ */
1550
+ cancel(extraDelay?: number): void;
1551
+ /**
1552
+ * Whether form fields are rendered separately from the main operatorList.
1553
+ * @type {boolean}
1554
+ */
1555
+ get separateAnnots(): boolean;
1556
+ #private;
1557
+ }
1558
+ /** @type {string} */
1559
+ export const version: string;
1560
+ import { PageViewport } from "./display_utils.js";
1561
+ import { OptionalContentConfig } from "./optional_content_config.js";
1562
+ import { PrintAnnotationStorage } from "./annotation_storage.js";
1563
+ import { AnnotationStorage } from "./annotation_storage.js";
1564
+ import { Metadata } from "./metadata.js";
1565
+ import { StatTimer } from "./display_utils.js";
1566
+ import { PDFObjects } from "./pdf_objects.js";
1567
+ import { MessageHandler } from "../shared/message_handler.js";
tools/ui/node_modules/pdfjs-dist/types/src/display/api_utils.d.ts ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ export function getDataProp(val: any): Uint8Array<any>;
2
+ export function getFactoryUrlProp(val: any): string | null;
3
+ export function getUrlProp(val: any): string | null;
4
+ export function isNameProxy(v: any): boolean;
5
+ export function isRefProxy(v: any): boolean;
6
+ export const isValidExplicitDest: (dest?: any) => boolean;
7
+ export class LoopbackPort {
8
+ postMessage(obj: any, transfer: any): void;
9
+ addEventListener(name: any, listener: any, options?: null): void;
10
+ removeEventListener(name: any, listener: any): void;
11
+ terminate(): void;
12
+ #private;
13
+ }
tools/ui/node_modules/pdfjs-dist/types/src/display/canvas.d.ts ADDED
@@ -0,0 +1,205 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ export class CanvasGraphics {
2
+ constructor(canvasCtx: any, commonObjs: any, objs: any, canvasFactory: any, filterFactory: any, { optionalContentConfig, markedContentStack }: {
3
+ optionalContentConfig: any;
4
+ markedContentStack?: null | undefined;
5
+ }, annotationCanvasMap: any, pageColors: any);
6
+ ctx: any;
7
+ current: CanvasExtraState;
8
+ stateStack: any[];
9
+ pendingClip: {} | {} | null;
10
+ pendingEOFill: boolean;
11
+ res: any;
12
+ xobjs: any;
13
+ commonObjs: any;
14
+ objs: any;
15
+ canvasFactory: any;
16
+ filterFactory: any;
17
+ groupStack: any[];
18
+ baseTransform: any;
19
+ baseTransformStack: any[];
20
+ groupLevel: number;
21
+ smaskStack: any[];
22
+ smaskCounter: number;
23
+ tempSMask: any;
24
+ suspendedCtx: any;
25
+ contentVisible: boolean;
26
+ markedContentStack: never[];
27
+ optionalContentConfig: any;
28
+ cachedCanvases: CachedCanvases;
29
+ cachedPatterns: Map<any, any>;
30
+ annotationCanvasMap: any;
31
+ viewportScale: number;
32
+ outputScaleX: number;
33
+ outputScaleY: number;
34
+ pageColors: any;
35
+ _cachedScaleForStroking: number[];
36
+ _cachedGetSinglePixelWidth: number | null;
37
+ _cachedBitmapsMap: Map<any, any>;
38
+ getObject(data: any, fallback?: null): any;
39
+ beginDrawing({ transform, viewport, transparency, background, }: {
40
+ transform: any;
41
+ viewport: any;
42
+ transparency?: boolean | undefined;
43
+ background?: null | undefined;
44
+ }): void;
45
+ compositeCtx: any;
46
+ transparentCanvas: any;
47
+ executeOperatorList(operatorList: any, executionStartIdx: any, continueCallback: any, stepper: any): any;
48
+ endDrawing(): void;
49
+ _scaleImage(img: any, inverseTransform: any): {
50
+ img: any;
51
+ paintWidth: any;
52
+ paintHeight: any;
53
+ };
54
+ _createMaskCanvas(img: any): {
55
+ canvas: any;
56
+ offsetX: number;
57
+ offsetY: number;
58
+ };
59
+ setLineWidth(width: any): void;
60
+ setLineCap(style: any): void;
61
+ setLineJoin(style: any): void;
62
+ setMiterLimit(limit: any): void;
63
+ setDash(dashArray: any, dashPhase: any): void;
64
+ setRenderingIntent(intent: any): void;
65
+ setFlatness(flatness: any): void;
66
+ setGState(states: any): void;
67
+ get inSMaskMode(): boolean;
68
+ checkSMaskState(): void;
69
+ /**
70
+ * Soft mask mode takes the current main drawing canvas and replaces it with
71
+ * a temporary canvas. Any drawing operations that happen on the temporary
72
+ * canvas need to be composed with the main canvas that was suspended (see
73
+ * `compose()`). The temporary canvas also duplicates many of its operations
74
+ * on the suspended canvas to keep them in sync, so that when the soft mask
75
+ * mode ends any clipping paths or transformations will still be active and in
76
+ * the right order on the canvas' graphics state stack.
77
+ */
78
+ beginSMaskMode(): void;
79
+ endSMaskMode(): void;
80
+ compose(dirtyBox: any): void;
81
+ composeSMask(ctx: any, smask: any, layerCtx: any, layerBox: any): void;
82
+ genericComposeSMask(maskCtx: any, layerCtx: any, width: any, height: any, subtype: any, backdrop: any, transferMap: any, layerOffsetX: any, layerOffsetY: any, maskOffsetX: any, maskOffsetY: any): void;
83
+ save(): void;
84
+ restore(): void;
85
+ transform(a: any, b: any, c: any, d: any, e: any, f: any): void;
86
+ constructPath(op: any, data: any, minMax: any): void;
87
+ closePath(): void;
88
+ stroke(path: any, consumePath?: boolean): void;
89
+ closeStroke(path: any): void;
90
+ fill(path: any, consumePath?: boolean): void;
91
+ eoFill(path: any): void;
92
+ fillStroke(path: any): void;
93
+ eoFillStroke(path: any): void;
94
+ closeFillStroke(path: any): void;
95
+ closeEOFillStroke(path: any): void;
96
+ endPath(path: any): void;
97
+ rawFillPath(path: any): void;
98
+ clip(): void;
99
+ eoClip(): void;
100
+ beginText(): void;
101
+ endText(): void;
102
+ setCharSpacing(spacing: any): void;
103
+ setWordSpacing(spacing: any): void;
104
+ setHScale(scale: any): void;
105
+ setLeading(leading: any): void;
106
+ setFont(fontRefName: any, size: any): void;
107
+ setTextRenderingMode(mode: any): void;
108
+ setTextRise(rise: any): void;
109
+ moveText(x: any, y: any): void;
110
+ setLeadingMoveText(x: any, y: any): void;
111
+ setTextMatrix(matrix: any): void;
112
+ nextLine(): void;
113
+ paintChar(character: any, x: any, y: any, patternFillTransform: any, patternStrokeTransform: any): void;
114
+ get isFontSubpixelAAEnabled(): any;
115
+ showText(glyphs: any): void;
116
+ showType3Text(glyphs: any): void;
117
+ setCharWidth(xWidth: any, yWidth: any): void;
118
+ setCharWidthAndBounds(xWidth: any, yWidth: any, llx: any, lly: any, urx: any, ury: any): void;
119
+ getColorN_Pattern(IR: any): any;
120
+ setStrokeColorN(...args: any[]): void;
121
+ setFillColorN(...args: any[]): void;
122
+ setStrokeRGBColor(color: any): void;
123
+ setStrokeTransparent(): void;
124
+ setFillRGBColor(color: any): void;
125
+ setFillTransparent(): void;
126
+ _getPattern(objId: any, matrix?: null): any;
127
+ shadingFill(objId: any): void;
128
+ beginInlineImage(): void;
129
+ beginImageData(): void;
130
+ paintFormXObjectBegin(matrix: any, bbox: any): void;
131
+ paintFormXObjectEnd(): void;
132
+ beginGroup(group: any): void;
133
+ endGroup(group: any): void;
134
+ beginAnnotation(id: any, rect: any, transform: any, matrix: any, hasOwnCanvas: any): void;
135
+ annotationCanvas: any;
136
+ endAnnotation(): void;
137
+ paintImageMaskXObject(img: any): void;
138
+ paintImageMaskXObjectRepeat(img: any, scaleX: any, skewX: number | undefined, skewY: number | undefined, scaleY: any, positions: any): void;
139
+ paintImageMaskXObjectGroup(images: any): void;
140
+ paintImageXObject(objId: any): void;
141
+ paintImageXObjectRepeat(objId: any, scaleX: any, scaleY: any, positions: any): void;
142
+ applyTransferMapsToCanvas(ctx: any): any;
143
+ applyTransferMapsToBitmap(imgData: any): any;
144
+ paintInlineImageXObject(imgData: any): void;
145
+ paintInlineImageXObjectGroup(imgData: any, map: any): void;
146
+ paintSolidColorImageMask(): void;
147
+ markPoint(tag: any): void;
148
+ markPointProps(tag: any, properties: any): void;
149
+ beginMarkedContent(tag: any): void;
150
+ beginMarkedContentProps(tag: any, properties: any): void;
151
+ endMarkedContent(): void;
152
+ beginCompat(): void;
153
+ endCompat(): void;
154
+ consumePath(path: any, clipBox: any): void;
155
+ getSinglePixelWidth(): number;
156
+ getScaleForStroking(): number[];
157
+ rescaleAndStroke(path: any, saveRestore: any): void;
158
+ isContentVisible(): boolean;
159
+ #private;
160
+ }
161
+ declare class CanvasExtraState {
162
+ constructor(width: any, height: any);
163
+ alphaIsShape: boolean;
164
+ fontSize: number;
165
+ fontSizeScale: number;
166
+ textMatrix: null;
167
+ textMatrixScale: number;
168
+ fontMatrix: number[];
169
+ leading: number;
170
+ x: number;
171
+ y: number;
172
+ lineX: number;
173
+ lineY: number;
174
+ charSpacing: number;
175
+ wordSpacing: number;
176
+ textHScale: number;
177
+ textRenderingMode: number;
178
+ textRise: number;
179
+ fillColor: string;
180
+ strokeColor: string;
181
+ patternFill: boolean;
182
+ patternStroke: boolean;
183
+ fillAlpha: number;
184
+ strokeAlpha: number;
185
+ lineWidth: number;
186
+ activeSMask: null;
187
+ transferMaps: string;
188
+ clipBox: Float32Array<ArrayBuffer>;
189
+ minMax: Float32Array<ArrayBuffer>;
190
+ clone(): any;
191
+ getPathBoundingBox(pathType?: string, transform?: null): Float32Array<ArrayBuffer>;
192
+ updateClipFromPath(): void;
193
+ isEmptyClip(): boolean;
194
+ startNewPathAndClipBox(box: any): void;
195
+ getClippedPathBoundingBox(pathType?: string, transform?: null): number[] | null;
196
+ }
197
+ declare class CachedCanvases {
198
+ constructor(canvasFactory: any);
199
+ canvasFactory: any;
200
+ cache: any;
201
+ getCanvas(id: any, width: any, height: any): any;
202
+ delete(id: any): void;
203
+ clear(): void;
204
+ }
205
+ export {};
tools/ui/node_modules/pdfjs-dist/types/src/display/canvas_factory.d.ts ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ export class BaseCanvasFactory {
2
+ constructor({ enableHWA }: {
3
+ enableHWA?: boolean | undefined;
4
+ });
5
+ create(width: any, height: any): {
6
+ canvas: void;
7
+ context: any;
8
+ };
9
+ reset(canvasAndContext: any, width: any, height: any): void;
10
+ destroy(canvasAndContext: any): void;
11
+ /**
12
+ * @ignore
13
+ */
14
+ _createCanvas(width: any, height: any): void;
15
+ #private;
16
+ }
17
+ export class DOMCanvasFactory extends BaseCanvasFactory {
18
+ constructor({ ownerDocument, enableHWA }: {
19
+ ownerDocument?: Document | undefined;
20
+ enableHWA?: boolean | undefined;
21
+ });
22
+ _document: Document;
23
+ /**
24
+ * @ignore
25
+ */
26
+ _createCanvas(width: any, height: any): HTMLCanvasElement;
27
+ }
tools/ui/node_modules/pdfjs-dist/types/src/display/cmap_reader_factory.d.ts ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ export class BaseCMapReaderFactory {
2
+ constructor({ baseUrl, isCompressed }: {
3
+ baseUrl?: null | undefined;
4
+ isCompressed?: boolean | undefined;
5
+ });
6
+ baseUrl: any;
7
+ isCompressed: boolean;
8
+ fetch({ name }: {
9
+ name: any;
10
+ }): Promise<{
11
+ cMapData: Uint8Array<ArrayBufferLike>;
12
+ isCompressed: boolean;
13
+ }>;
14
+ /**
15
+ * @ignore
16
+ * @returns {Promise<Uint8Array>}
17
+ */
18
+ _fetch(url: any): Promise<Uint8Array>;
19
+ }
20
+ export class DOMCMapReaderFactory extends BaseCMapReaderFactory {
21
+ /**
22
+ * @ignore
23
+ */
24
+ _fetch(url: any): Promise<Uint8Array<any>>;
25
+ }
tools/ui/node_modules/pdfjs-dist/types/src/display/content_disposition.d.ts ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ /**
2
+ * Extract file name from the Content-Disposition HTTP response header.
3
+ *
4
+ * @param {string} contentDisposition
5
+ * @returns {string} Filename, if found in the Content-Disposition header.
6
+ */
7
+ export function getFilenameFromContentDispositionHeader(contentDisposition: string): string;
tools/ui/node_modules/pdfjs-dist/types/src/display/display_utils.d.ts ADDED
@@ -0,0 +1,258 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ export type PageViewportParameters = {
2
+ /**
3
+ * - The xMin, yMin, xMax and
4
+ * yMax coordinates.
5
+ */
6
+ viewBox: Array<number>;
7
+ /**
8
+ * - The size of units.
9
+ */
10
+ userUnit: number;
11
+ /**
12
+ * - The scale of the viewport.
13
+ */
14
+ scale: number;
15
+ /**
16
+ * - The rotation, in degrees, of the viewport.
17
+ */
18
+ rotation: number;
19
+ /**
20
+ * - The horizontal, i.e. x-axis, offset. The
21
+ * default value is `0`.
22
+ */
23
+ offsetX?: number | undefined;
24
+ /**
25
+ * - The vertical, i.e. y-axis, offset. The
26
+ * default value is `0`.
27
+ */
28
+ offsetY?: number | undefined;
29
+ /**
30
+ * - If true, the y-axis will not be flipped.
31
+ * The default value is `false`.
32
+ */
33
+ dontFlip?: boolean | undefined;
34
+ };
35
+ export type PageViewportCloneParameters = {
36
+ /**
37
+ * - The scale, overriding the one in the cloned
38
+ * viewport. The default value is `this.scale`.
39
+ */
40
+ scale?: number | undefined;
41
+ /**
42
+ * - The rotation, in degrees, overriding the one
43
+ * in the cloned viewport. The default value is `this.rotation`.
44
+ */
45
+ rotation?: number | undefined;
46
+ /**
47
+ * - The horizontal, i.e. x-axis, offset.
48
+ * The default value is `this.offsetX`.
49
+ */
50
+ offsetX?: number | undefined;
51
+ /**
52
+ * - The vertical, i.e. y-axis, offset.
53
+ * The default value is `this.offsetY`.
54
+ */
55
+ offsetY?: number | undefined;
56
+ /**
57
+ * - If true, the x-axis will not be flipped.
58
+ * The default value is `false`.
59
+ */
60
+ dontFlip?: boolean | undefined;
61
+ };
62
+ export function deprecated(details: any): void;
63
+ export function fetchData(url: any, type?: string): Promise<any>;
64
+ export function getColorValues(colors: any): void;
65
+ export function getCurrentTransform(ctx: any): any[];
66
+ export function getCurrentTransformInverse(ctx: any): any[];
67
+ /**
68
+ * Gets the filename from a given URL.
69
+ * @param {string} url
70
+ * @returns {string}
71
+ */
72
+ export function getFilenameFromUrl(url: string): string;
73
+ /**
74
+ * Returns the filename or guessed filename from the url (see issue 3455).
75
+ * @param {string} url - The original PDF location.
76
+ * @param {string} defaultFilename - The value returned if the filename is
77
+ * unknown, or the protocol is unsupported.
78
+ * @returns {string} Guessed PDF filename.
79
+ */
80
+ export function getPdfFilenameFromUrl(url: string, defaultFilename?: string): string;
81
+ export function getRGB(color: any): any;
82
+ /**
83
+ * NOTE: This is (mostly) intended to support printing of XFA forms.
84
+ */
85
+ export function getXfaPageViewport(xfaPage: any, { scale, rotation }: {
86
+ scale?: number | undefined;
87
+ rotation?: number | undefined;
88
+ }): PageViewport;
89
+ export function isDataScheme(url: any): boolean;
90
+ export function isPdfFile(filename: any): boolean;
91
+ export function isValidFetchUrl(url: any, baseUrl: any): boolean;
92
+ /**
93
+ * Event handler to suppress context menu.
94
+ */
95
+ export function noContextMenu(e: any): void;
96
+ /**
97
+ * Scale factors for the canvas, necessary with HiDPI displays.
98
+ */
99
+ export class OutputScale {
100
+ static get pixelRatio(): number;
101
+ static capPixels(maxPixels: any, capAreaFactor: any): any;
102
+ /**
103
+ * @type {number} Horizontal scale.
104
+ */
105
+ sx: number;
106
+ /**
107
+ * @type {number} Vertical scale.
108
+ */
109
+ sy: number;
110
+ /**
111
+ * @type {boolean} Returns `true` when scaling is required, `false` otherwise.
112
+ */
113
+ get scaled(): boolean;
114
+ /**
115
+ * @type {boolean} Returns `true` when scaling is symmetric,
116
+ * `false` otherwise.
117
+ */
118
+ get symmetric(): boolean;
119
+ /**
120
+ * @returns {boolean} Returns `true` if scaling was limited,
121
+ * `false` otherwise.
122
+ */
123
+ limitCanvas(width: any, height: any, maxPixels: any, maxDim: any, capAreaFactor?: number): boolean;
124
+ }
125
+ /**
126
+ * @typedef {Object} PageViewportParameters
127
+ * @property {Array<number>} viewBox - The xMin, yMin, xMax and
128
+ * yMax coordinates.
129
+ * @property {number} userUnit - The size of units.
130
+ * @property {number} scale - The scale of the viewport.
131
+ * @property {number} rotation - The rotation, in degrees, of the viewport.
132
+ * @property {number} [offsetX] - The horizontal, i.e. x-axis, offset. The
133
+ * default value is `0`.
134
+ * @property {number} [offsetY] - The vertical, i.e. y-axis, offset. The
135
+ * default value is `0`.
136
+ * @property {boolean} [dontFlip] - If true, the y-axis will not be flipped.
137
+ * The default value is `false`.
138
+ */
139
+ /**
140
+ * @typedef {Object} PageViewportCloneParameters
141
+ * @property {number} [scale] - The scale, overriding the one in the cloned
142
+ * viewport. The default value is `this.scale`.
143
+ * @property {number} [rotation] - The rotation, in degrees, overriding the one
144
+ * in the cloned viewport. The default value is `this.rotation`.
145
+ * @property {number} [offsetX] - The horizontal, i.e. x-axis, offset.
146
+ * The default value is `this.offsetX`.
147
+ * @property {number} [offsetY] - The vertical, i.e. y-axis, offset.
148
+ * The default value is `this.offsetY`.
149
+ * @property {boolean} [dontFlip] - If true, the x-axis will not be flipped.
150
+ * The default value is `false`.
151
+ */
152
+ /**
153
+ * PDF page viewport created based on scale, rotation and offset.
154
+ */
155
+ export class PageViewport {
156
+ /**
157
+ * @param {PageViewportParameters}
158
+ */
159
+ constructor({ viewBox, userUnit, scale, rotation, offsetX, offsetY, dontFlip, }: PageViewportParameters);
160
+ viewBox: number[];
161
+ userUnit: number;
162
+ scale: number;
163
+ rotation: number;
164
+ offsetX: number;
165
+ offsetY: number;
166
+ transform: number[];
167
+ width: number;
168
+ height: number;
169
+ /**
170
+ * The original, un-scaled, viewport dimensions.
171
+ * @type {Object}
172
+ */
173
+ get rawDims(): Object;
174
+ /**
175
+ * Clones viewport, with optional additional properties.
176
+ * @param {PageViewportCloneParameters} [params]
177
+ * @returns {PageViewport} Cloned viewport.
178
+ */
179
+ clone({ scale, rotation, offsetX, offsetY, dontFlip, }?: PageViewportCloneParameters): PageViewport;
180
+ /**
181
+ * Converts PDF point to the viewport coordinates. For examples, useful for
182
+ * converting PDF location into canvas pixel coordinates.
183
+ * @param {number} x - The x-coordinate.
184
+ * @param {number} y - The y-coordinate.
185
+ * @returns {Array} Array containing `x`- and `y`-coordinates of the
186
+ * point in the viewport coordinate space.
187
+ * @see {@link convertToPdfPoint}
188
+ * @see {@link convertToViewportRectangle}
189
+ */
190
+ convertToViewportPoint(x: number, y: number): any[];
191
+ /**
192
+ * Converts PDF rectangle to the viewport coordinates.
193
+ * @param {Array} rect - The xMin, yMin, xMax and yMax coordinates.
194
+ * @returns {Array} Array containing corresponding coordinates of the
195
+ * rectangle in the viewport coordinate space.
196
+ * @see {@link convertToViewportPoint}
197
+ */
198
+ convertToViewportRectangle(rect: any[]): any[];
199
+ /**
200
+ * Converts viewport coordinates to the PDF location. For examples, useful
201
+ * for converting canvas pixel location into PDF one.
202
+ * @param {number} x - The x-coordinate.
203
+ * @param {number} y - The y-coordinate.
204
+ * @returns {Array} Array containing `x`- and `y`-coordinates of the
205
+ * point in the PDF coordinate space.
206
+ * @see {@link convertToViewportPoint}
207
+ */
208
+ convertToPdfPoint(x: number, y: number): any[];
209
+ }
210
+ export class PDFDateString {
211
+ static "__#2@#regex": any;
212
+ /**
213
+ * Convert a PDF date string to a JavaScript `Date` object.
214
+ *
215
+ * The PDF date string format is described in section 7.9.4 of the official
216
+ * PDF 32000-1:2008 specification. However, in the PDF 1.7 reference (sixth
217
+ * edition) Adobe describes the same format including a trailing apostrophe.
218
+ * This syntax in incorrect, but Adobe Acrobat creates PDF files that contain
219
+ * them. We ignore all apostrophes as they are not necessary for date parsing.
220
+ *
221
+ * Moreover, Adobe Acrobat doesn't handle changing the date to universal time
222
+ * and doesn't use the user's time zone (effectively ignoring the HH' and mm'
223
+ * parts of the date string).
224
+ *
225
+ * @param {string} input
226
+ * @returns {Date|null}
227
+ */
228
+ static toDateObject(input: string): Date | null;
229
+ }
230
+ export class PixelsPerInch {
231
+ static CSS: number;
232
+ static PDF: number;
233
+ static PDF_TO_CSS_UNITS: number;
234
+ }
235
+ declare const RenderingCancelledException_base: any;
236
+ export class RenderingCancelledException extends RenderingCancelledException_base {
237
+ [x: string]: any;
238
+ constructor(msg: any, extraDelay?: number);
239
+ extraDelay: number;
240
+ }
241
+ /**
242
+ * @param {HTMLDivElement} div
243
+ * @param {PageViewport} viewport
244
+ * @param {boolean} mustFlip
245
+ * @param {boolean} mustRotate
246
+ */
247
+ export function setLayerDimensions(div: HTMLDivElement, viewport: PageViewport, mustFlip?: boolean, mustRotate?: boolean): void;
248
+ export class StatTimer {
249
+ started: any;
250
+ times: any[];
251
+ time(name: any): void;
252
+ timeEnd(name: any): void;
253
+ toString(): string;
254
+ }
255
+ export function stopEvent(e: any): void;
256
+ export const SupportedImageMimeTypes: string[];
257
+ export const SVG_NS: "http://www.w3.org/2000/svg";
258
+ export {};
tools/ui/node_modules/pdfjs-dist/types/src/display/draw_layer.d.ts ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * Manage the SVGs drawn on top of the page canvas.
3
+ * It's important to have them directly on top of the canvas because we want to
4
+ * be able to use mix-blend-mode for some of them.
5
+ */
6
+ export class DrawLayer {
7
+ static "__#34@#id": number;
8
+ static get _svgFactory(): any;
9
+ static "__#34@#setBox"(element: any, [x, y, width, height]: [any, any, any, any]): void;
10
+ constructor({ pageIndex }: {
11
+ pageIndex: any;
12
+ });
13
+ pageIndex: any;
14
+ setParent(parent: any): void;
15
+ draw(properties: any, isPathUpdatable?: boolean, hasClip?: boolean): {
16
+ id: number;
17
+ clipPathId: string;
18
+ };
19
+ drawOutline(properties: any, mustRemoveSelfIntersections: any): number;
20
+ finalizeDraw(id: any, properties: any): void;
21
+ updateProperties(elementOrId: any, properties: any): void;
22
+ updateParent(id: any, layer: any): void;
23
+ remove(id: any): void;
24
+ destroy(): void;
25
+ #private;
26
+ }
tools/ui/node_modules/pdfjs-dist/types/src/display/editor/alt_text.d.ts ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ export class AltText {
2
+ static "__#41@#l10nNewButton": null;
3
+ static _l10n: null;
4
+ static initialize(l10n: any): void;
5
+ constructor(editor: any);
6
+ render(): Promise<HTMLButtonElement>;
7
+ finish(): void;
8
+ isEmpty(): boolean;
9
+ hasData(): boolean;
10
+ get guessedText(): null;
11
+ setGuessedText(guessedText: any): Promise<void>;
12
+ toggleAltTextBadge(visibility?: boolean): void;
13
+ serialize(isForCopying: any): {
14
+ altText: null;
15
+ decorative: boolean;
16
+ guessedText: null;
17
+ textWithDisclaimer: null;
18
+ };
19
+ /**
20
+ * Set the alt text data.
21
+ */
22
+ set data({ altText, decorative, guessedText, textWithDisclaimer, cancel, }: {
23
+ altText: null;
24
+ decorative: boolean;
25
+ });
26
+ get data(): {
27
+ altText: null;
28
+ decorative: boolean;
29
+ };
30
+ toggle(enabled?: boolean): void;
31
+ shown(): void;
32
+ destroy(): void;
33
+ #private;
34
+ }
tools/ui/node_modules/pdfjs-dist/types/src/display/editor/annotation_editor_layer.d.ts ADDED
@@ -0,0 +1,230 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ export type AnnotationEditorUIManager = import("./tools.js").AnnotationEditorUIManager;
2
+ export type PageViewport = import("../display_utils.js").PageViewport;
3
+ export type TextAccessibilityManager = import("../../../web/text_accessibility.js").TextAccessibilityManager;
4
+ export type IL10n = import("../../../web/interfaces").IL10n;
5
+ export type AnnotationLayer = import("../annotation_layer.js").AnnotationLayer;
6
+ export type DrawLayer = import("../draw_layer.js").DrawLayer;
7
+ export type StructTreeLayerBuilder = any;
8
+ export type AnnotationEditorLayerOptions = {
9
+ mode: Object;
10
+ div: HTMLDivElement;
11
+ structTreeLayer: StructTreeLayerBuilder;
12
+ uiManager: AnnotationEditorUIManager;
13
+ enabled: boolean;
14
+ accessibilityManager?: import("../../../web/text_accessibility.js").TextAccessibilityManager | undefined;
15
+ pageIndex: number;
16
+ l10n: IL10n;
17
+ annotationLayer?: import("../annotation_layer.js").AnnotationLayer | undefined;
18
+ textLayer?: HTMLDivElement | undefined;
19
+ drawLayer: DrawLayer;
20
+ viewport: PageViewport;
21
+ };
22
+ export type RenderEditorLayerOptions = {
23
+ viewport: PageViewport;
24
+ };
25
+ /**
26
+ * @typedef {Object} AnnotationEditorLayerOptions
27
+ * @property {Object} mode
28
+ * @property {HTMLDivElement} div
29
+ * @property {StructTreeLayerBuilder} structTreeLayer
30
+ * @property {AnnotationEditorUIManager} uiManager
31
+ * @property {boolean} enabled
32
+ * @property {TextAccessibilityManager} [accessibilityManager]
33
+ * @property {number} pageIndex
34
+ * @property {IL10n} l10n
35
+ * @property {AnnotationLayer} [annotationLayer]
36
+ * @property {HTMLDivElement} [textLayer]
37
+ * @property {DrawLayer} drawLayer
38
+ * @property {PageViewport} viewport
39
+ */
40
+ /**
41
+ * @typedef {Object} RenderEditorLayerOptions
42
+ * @property {PageViewport} viewport
43
+ */
44
+ /**
45
+ * Manage all the different editors on a page.
46
+ */
47
+ export class AnnotationEditorLayer {
48
+ static _initialized: boolean;
49
+ static "__#35@#editorTypes": Map<number, typeof FreeTextEditor | typeof HighlightEditor | typeof InkEditor | typeof SignatureEditor | typeof StampEditor>;
50
+ /**
51
+ * @param {AnnotationEditorLayerOptions} options
52
+ */
53
+ constructor({ uiManager, pageIndex, div, structTreeLayer, accessibilityManager, annotationLayer, drawLayer, textLayer, viewport, l10n, }: AnnotationEditorLayerOptions);
54
+ pageIndex: number;
55
+ div: HTMLDivElement;
56
+ viewport: import("../display_utils.js").PageViewport;
57
+ drawLayer: import("../draw_layer.js").DrawLayer;
58
+ _structTree: any;
59
+ get isEmpty(): boolean;
60
+ get isInvisible(): boolean;
61
+ /**
62
+ * Update the toolbar if it's required to reflect the tool currently used.
63
+ * @param {Object} options
64
+ */
65
+ updateToolbar(options: Object): void;
66
+ /**
67
+ * The mode has changed: it must be updated.
68
+ * @param {number} mode
69
+ */
70
+ updateMode(mode?: number): void;
71
+ hasTextLayer(textLayer: any): boolean;
72
+ /**
73
+ * Set the editing state.
74
+ * @param {boolean} isEditing
75
+ */
76
+ setEditingState(isEditing: boolean): void;
77
+ /**
78
+ * Add some commands into the CommandManager (undo/redo stuff).
79
+ * @param {Object} params
80
+ */
81
+ addCommands(params: Object): void;
82
+ cleanUndoStack(type: any): void;
83
+ toggleDrawing(enabled?: boolean): void;
84
+ togglePointerEvents(enabled?: boolean): void;
85
+ toggleAnnotationLayerPointerEvents(enabled?: boolean): void;
86
+ /**
87
+ * Enable pointer events on the main div in order to enable
88
+ * editor creation.
89
+ */
90
+ enable(): Promise<void>;
91
+ /**
92
+ * Disable editor creation.
93
+ */
94
+ disable(): void;
95
+ getEditableAnnotation(id: any): any;
96
+ /**
97
+ * Set the current editor.
98
+ * @param {AnnotationEditor} editor
99
+ */
100
+ setActiveEditor(editor: AnnotationEditor): void;
101
+ enableTextSelection(): void;
102
+ disableTextSelection(): void;
103
+ enableClick(): void;
104
+ disableClick(): void;
105
+ attach(editor: any): void;
106
+ detach(editor: any): void;
107
+ /**
108
+ * Remove an editor.
109
+ * @param {AnnotationEditor} editor
110
+ */
111
+ remove(editor: AnnotationEditor): void;
112
+ /**
113
+ * An editor can have a different parent, for example after having
114
+ * being dragged and dropped from a page to another.
115
+ * @param {AnnotationEditor} editor
116
+ */
117
+ changeParent(editor: AnnotationEditor): void;
118
+ /**
119
+ * Add a new editor in the current view.
120
+ * @param {AnnotationEditor} editor
121
+ */
122
+ add(editor: AnnotationEditor): void;
123
+ moveEditorInDOM(editor: any): void;
124
+ /**
125
+ * Add or rebuild depending if it has been removed or not.
126
+ * @param {AnnotationEditor} editor
127
+ */
128
+ addOrRebuild(editor: AnnotationEditor): void;
129
+ /**
130
+ * Add a new editor and make this addition undoable.
131
+ * @param {AnnotationEditor} editor
132
+ */
133
+ addUndoableEditor(editor: AnnotationEditor): void;
134
+ /**
135
+ * Get an id for an editor.
136
+ * @returns {string}
137
+ */
138
+ getNextId(): string;
139
+ combinedSignal(ac: any): AbortSignal;
140
+ canCreateNewEmptyEditor(): boolean | undefined;
141
+ /**
142
+ * Paste some content into a new editor.
143
+ * @param {Object} options
144
+ * @param {Object} params
145
+ */
146
+ pasteEditor(options: Object, params: Object): Promise<void>;
147
+ /**
148
+ * Create a new editor
149
+ * @param {Object} data
150
+ * @returns {AnnotationEditor | null}
151
+ */
152
+ deserialize(data: Object): AnnotationEditor | null;
153
+ /**
154
+ * Create and add a new editor.
155
+ * @param {PointerEvent} event
156
+ * @param {boolean} isCentered
157
+ * @param [Object] data
158
+ * @returns {AnnotationEditor}
159
+ */
160
+ createAndAddNewEditor(event: PointerEvent, isCentered: boolean, data?: {}): AnnotationEditor;
161
+ /**
162
+ * Create and add a new editor.
163
+ */
164
+ addNewEditor(data?: {}): void;
165
+ /**
166
+ * Set the last selected editor.
167
+ * @param {AnnotationEditor} editor
168
+ */
169
+ setSelected(editor: AnnotationEditor): void;
170
+ /**
171
+ * Add or remove an editor the current selection.
172
+ * @param {AnnotationEditor} editor
173
+ */
174
+ toggleSelected(editor: AnnotationEditor): void;
175
+ /**
176
+ * Unselect an editor.
177
+ * @param {AnnotationEditor} editor
178
+ */
179
+ unselect(editor: AnnotationEditor): void;
180
+ /**
181
+ * Pointerup callback.
182
+ * @param {PointerEvent} event
183
+ */
184
+ pointerup(event: PointerEvent): void;
185
+ /**
186
+ * Pointerdown callback.
187
+ * @param {PointerEvent} event
188
+ */
189
+ pointerdown(event: PointerEvent): void;
190
+ startDrawingSession(event: any): void;
191
+ pause(on: any): void;
192
+ endDrawingSession(isAborted?: boolean): any;
193
+ /**
194
+ *
195
+ * @param {AnnotationEditor} editor
196
+ * @param {number} x
197
+ * @param {number} y
198
+ * @returns
199
+ */
200
+ findNewParent(editor: AnnotationEditor, x: number, y: number): boolean;
201
+ commitOrRemove(): boolean;
202
+ onScaleChanging(): void;
203
+ /**
204
+ * Destroy the main editor.
205
+ */
206
+ destroy(): void;
207
+ /**
208
+ * Render the main editor.
209
+ * @param {RenderEditorLayerOptions} parameters
210
+ */
211
+ render({ viewport }: RenderEditorLayerOptions): void;
212
+ /**
213
+ * Update the main editor.
214
+ * @param {RenderEditorLayerOptions} parameters
215
+ */
216
+ update({ viewport }: RenderEditorLayerOptions): void;
217
+ /**
218
+ * Get page dimensions.
219
+ * @returns {Object} dimensions.
220
+ */
221
+ get pageDimensions(): Object;
222
+ get scale(): number;
223
+ #private;
224
+ }
225
+ import { AnnotationEditor } from "./editor.js";
226
+ import { FreeTextEditor } from "./freetext.js";
227
+ import { HighlightEditor } from "./highlight.js";
228
+ import { InkEditor } from "./ink.js";
229
+ import { SignatureEditor } from "./signature.js";
230
+ import { StampEditor } from "./stamp.js";
tools/ui/node_modules/pdfjs-dist/types/src/display/editor/color_picker.d.ts ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * BasicColorPicker class provides a simple color picker.
3
+ * It displays an input element (with type="color") that allows the user
4
+ * to select a color for the annotation.
5
+ */
6
+ export class BasicColorPicker {
7
+ static "__#6@#l10nColor": null;
8
+ constructor(editor: any);
9
+ renderButton(): HTMLInputElement;
10
+ update(value: any): void;
11
+ destroy(): void;
12
+ hideDropdown(): void;
13
+ #private;
14
+ }
15
+ /**
16
+ * ColorPicker class provides a color picker for the annotation editor.
17
+ * It displays a dropdown with some predefined colors and allows the user
18
+ * to select a color for the annotation.
19
+ */
20
+ export class ColorPicker {
21
+ static "__#5@#l10nColor": null;
22
+ static get _keyboardManager(): any;
23
+ constructor({ editor, uiManager }: {
24
+ editor?: null | undefined;
25
+ uiManager?: null | undefined;
26
+ });
27
+ renderButton(): HTMLButtonElement;
28
+ renderMainDropdown(): HTMLDivElement;
29
+ _colorSelectFromKeyboard(event: any): void;
30
+ _moveToNext(event: any): void;
31
+ _moveToPrevious(event: any): void;
32
+ _moveToBeginning(event: any): void;
33
+ _moveToEnd(event: any): void;
34
+ hideDropdown(): void;
35
+ _hideDropdownFromKeyboard(): void;
36
+ updateColor(color: any): void;
37
+ destroy(): void;
38
+ #private;
39
+ }
tools/ui/node_modules/pdfjs-dist/types/src/display/editor/comment.d.ts ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ export class Comment {
2
+ constructor(editor: any);
3
+ toolbar: any;
4
+ render(): HTMLButtonElement | null;
5
+ edit(): void;
6
+ finish(): void;
7
+ isDeleted(): boolean;
8
+ hasBeenEdited(): boolean;
9
+ serialize(): {
10
+ text: null;
11
+ date: null;
12
+ deleted: boolean;
13
+ };
14
+ /**
15
+ * Set the comment data.
16
+ */
17
+ set data(text: {
18
+ text: null;
19
+ date: null;
20
+ deleted: boolean;
21
+ });
22
+ get data(): {
23
+ text: null;
24
+ date: null;
25
+ deleted: boolean;
26
+ };
27
+ setInitialText(text: any): void;
28
+ toggle(enabled?: boolean): void;
29
+ shown(): void;
30
+ destroy(): void;
31
+ #private;
32
+ }
tools/ui/node_modules/pdfjs-dist/types/src/display/editor/draw.d.ts ADDED
@@ -0,0 +1,121 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * Basic draw editor.
3
+ */
4
+ export class DrawingEditor extends AnnotationEditor {
5
+ static _currentDrawId: number;
6
+ static _currentParent: null;
7
+ static "__#27@#currentDraw": null;
8
+ static "__#27@#currentDrawingAC": null;
9
+ static "__#27@#currentDrawingOptions": null;
10
+ static "__#27@#currentPointerId": number;
11
+ static "__#27@#currentPointerType": null;
12
+ static "__#27@#currentPointerIds": null;
13
+ static "__#27@#currentMoveTimestamp": number;
14
+ static _INNER_MARGIN: number;
15
+ static _mergeSVGProperties(p1: any, p2: any): any;
16
+ /**
17
+ * @param {Object} options
18
+ * @return {DrawingOptions} the default options to use for a new editor.
19
+ */
20
+ static getDefaultDrawingOptions(_options: any): DrawingOptions;
21
+ /**
22
+ * @return {Map<AnnotationEditorParamsType, string>} a map between the
23
+ * parameter types and the name of the options.
24
+ */
25
+ static get typesMap(): Map<{
26
+ RESIZE: number;
27
+ CREATE: number;
28
+ FREETEXT_SIZE: number;
29
+ FREETEXT_COLOR: number;
30
+ FREETEXT_OPACITY: number;
31
+ INK_COLOR: number;
32
+ INK_THICKNESS: number;
33
+ INK_OPACITY: number;
34
+ HIGHLIGHT_COLOR: number;
35
+ HIGHLIGHT_THICKNESS: number;
36
+ HIGHLIGHT_FREE: number;
37
+ HIGHLIGHT_SHOW_ALL: number;
38
+ DRAW_STEP: number;
39
+ }, string>;
40
+ /**
41
+ * @returns {boolean} `true` if several drawings can be added to the
42
+ * annotation.
43
+ */
44
+ static get supportMultipleDrawings(): boolean;
45
+ /** @inheritdoc */
46
+ static updateDefaultParams(type: any, value: any): void;
47
+ /** @inheritdoc */
48
+ static get defaultPropertiesToUpdate(): any[][];
49
+ static onScaleChangingWhenDrawing(): void;
50
+ /**
51
+ * Create a new drawer instance.
52
+ * @param {number} x - The x coordinate of the event.
53
+ * @param {number} y - The y coordinate of the event.
54
+ * @param {number} parentWidth - The parent width.
55
+ * @param {number} parentHeight - The parent height.
56
+ * @param {number} rotation - The parent rotation.
57
+ */
58
+ static createDrawerInstance(_x: any, _y: any, _parentWidth: any, _parentHeight: any, _rotation: any): void;
59
+ static startDrawing(parent: any, uiManager: any, _isLTR: any, event: any): void;
60
+ static _drawMove(event: any): void;
61
+ static _cleanup(all: any): void;
62
+ static _endDraw(event: any): void;
63
+ static endDrawing(isAborted: any): any;
64
+ /**
65
+ * Deserialize the drawing outlines.
66
+ * @param {number} pageX - The x coordinate of the page.
67
+ * @param {number} pageY - The y coordinate of the page.
68
+ * @param {number} pageWidth - The width of the page.
69
+ * @param {number} pageHeight - The height of the page.
70
+ * @param {number} innerWidth - The inner width.
71
+ * @param {Object} data - The data to deserialize.
72
+ * @returns {Object} The deserialized outlines.
73
+ */
74
+ static deserializeDraw(_pageX: any, _pageY: any, _pageWidth: any, _pageHeight: any, _innerWidth: any, _data: any): Object;
75
+ /** @inheritdoc */
76
+ static deserialize(data: any, parent: any, uiManager: any): Promise<AnnotationEditor | null>;
77
+ constructor(params: any);
78
+ _colorPicker: null;
79
+ _drawId: null;
80
+ _addOutlines(params: any): void;
81
+ /** @inheritdoc */
82
+ updateParams(type: any, value: any): void;
83
+ /** @inheritdoc */
84
+ get propertiesToUpdate(): any[][];
85
+ /**
86
+ * Update a property and make this action undoable.
87
+ * @param {string} color
88
+ */
89
+ _updateProperty(type: any, name: any, value: any): void;
90
+ /** @inheritdoc */
91
+ _onTranslating(_x: any, _y: any): void;
92
+ /** @inheritdoc */
93
+ _onTranslated(): void;
94
+ /** @inheritdoc */
95
+ onceAdded(focus: any): void;
96
+ /** @inheritdoc */
97
+ rotate(): void;
98
+ onScaleChanging(): void;
99
+ /**
100
+ * Create the drawing options.
101
+ * @param {Object} _data
102
+ */
103
+ createDrawingOptions(_data: Object): void;
104
+ serializeDraw(isForCopying: any): any;
105
+ /** @inheritdoc */
106
+ renderAnnotationElement(annotation: any): null;
107
+ #private;
108
+ }
109
+ export class DrawingOptions {
110
+ updateProperty(name: any, value: any): void;
111
+ updateProperties(properties: any): void;
112
+ updateSVGProperty(name: any, value: any): void;
113
+ toSVGProperties(): {
114
+ root: any;
115
+ };
116
+ reset(): void;
117
+ updateAll(options?: this): void;
118
+ clone(): void;
119
+ #private;
120
+ }
121
+ import { AnnotationEditor } from "./editor.js";
tools/ui/node_modules/pdfjs-dist/types/src/display/editor/drawers/contour.d.ts ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ export class ContourDrawOutline extends InkDrawOutline {
2
+ }
3
+ import { InkDrawOutline } from "./inkdraw.js";
tools/ui/node_modules/pdfjs-dist/types/src/display/editor/drawers/freedraw.d.ts ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ export class FreeDrawOutline extends Outline {
2
+ constructor(outline: any, points: any, box: any, scaleFactor: any, innerMargin: any, isLTR: any);
3
+ lastPoint: number[];
4
+ serialize([blX, blY, trX, trY]: [any, any, any, any], rotation: any): {
5
+ outline: any[];
6
+ points: any[][];
7
+ };
8
+ get box(): Float32Array<ArrayBuffer>;
9
+ newOutliner(point: any, box: any, scaleFactor: any, thickness: any, isLTR: any, innerMargin?: number): FreeDrawOutliner;
10
+ getNewOutline(thickness: any, innerMargin: any): FreeDrawOutline;
11
+ #private;
12
+ }
13
+ export class FreeDrawOutliner {
14
+ static "__#21@#MIN_DIST": number;
15
+ static "__#21@#MIN_DIFF": number;
16
+ static "__#21@#MIN": number;
17
+ constructor({ x, y }: {
18
+ x: any;
19
+ y: any;
20
+ }, box: any, scaleFactor: any, thickness: any, isLTR: any, innerMargin?: number);
21
+ isEmpty(): boolean;
22
+ add({ x, y }: {
23
+ x: any;
24
+ y: any;
25
+ }): boolean;
26
+ toSVGPath(): string;
27
+ newFreeDrawOutline(outline: any, points: any, box: any, scaleFactor: any, innerMargin: any, isLTR: any): FreeDrawOutline;
28
+ getOutlines(): FreeDrawOutline;
29
+ #private;
30
+ }
31
+ import { Outline } from "./outline.js";
tools/ui/node_modules/pdfjs-dist/types/src/display/editor/drawers/highlight.d.ts ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ export class FreeHighlightOutliner extends FreeDrawOutliner {
2
+ }
3
+ export class HighlightOutliner {
4
+ /**
5
+ * Construct an outliner.
6
+ * @param {Array<Object>} boxes - An array of axis-aligned rectangles.
7
+ * @param {number} borderWidth - The width of the border of the boxes, it
8
+ * allows to make the boxes bigger (or smaller).
9
+ * @param {number} innerMargin - The margin between the boxes and the
10
+ * outlines. It's important to not have a null innerMargin when we want to
11
+ * draw the outline else the stroked outline could be clipped because of its
12
+ * width.
13
+ * @param {boolean} isLTR - true if we're in LTR mode. It's used to determine
14
+ * the last point of the boxes.
15
+ */
16
+ constructor(boxes: Array<Object>, borderWidth?: number, innerMargin?: number, isLTR?: boolean);
17
+ getOutlines(): HighlightOutline;
18
+ #private;
19
+ }
20
+ import { FreeDrawOutliner } from "./freedraw.js";
21
+ declare class HighlightOutline extends Outline {
22
+ constructor(outlines: any, box: any, lastPoint: any);
23
+ lastPoint: any;
24
+ /**
25
+ * Serialize the outlines into the PDF page coordinate system.
26
+ * @param {Array<number>} _bbox - the bounding box of the annotation.
27
+ * @param {number} _rotation - the rotation of the annotation.
28
+ * @returns {Array<Array<number>>}
29
+ */
30
+ serialize([blX, blY, trX, trY]: Array<number>, _rotation: number): Array<Array<number>>;
31
+ get box(): any;
32
+ get classNamesForOutlining(): string[];
33
+ #private;
34
+ }
35
+ import { Outline } from "./outline.js";
36
+ export {};
tools/ui/node_modules/pdfjs-dist/types/src/display/editor/drawers/inkdraw.d.ts ADDED
@@ -0,0 +1,129 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ export class InkDrawOutline extends Outline {
2
+ static deserialize(pageX: any, pageY: any, pageWidth: any, pageHeight: any, innerMargin: any, { paths: { lines, points }, rotation, thickness }: {
3
+ paths: {
4
+ lines: any;
5
+ points: any;
6
+ };
7
+ rotation: any;
8
+ thickness: any;
9
+ }): any;
10
+ build(lines: any, parentWidth: any, parentHeight: any, parentScale: any, rotation: any, thickness: any, innerMargin: any): void;
11
+ get thickness(): any;
12
+ setLastElement(element: any): {
13
+ path: {
14
+ d: string;
15
+ };
16
+ };
17
+ removeLastElement(): {
18
+ path: {
19
+ d: string;
20
+ };
21
+ };
22
+ serialize([pageX, pageY, pageWidth, pageHeight]: [any, any, any, any], isForCopying: any): {
23
+ lines: any[];
24
+ points: any[];
25
+ rect: any[];
26
+ };
27
+ get box(): any;
28
+ updateProperty(name: any, value: any): any;
29
+ updateParentDimensions([width, height]: [any, any], scale: any): any;
30
+ updateRotation(rotation: any): {
31
+ path: {
32
+ transform: string;
33
+ };
34
+ };
35
+ get viewBox(): any;
36
+ get defaultProperties(): {
37
+ root: {
38
+ viewBox: any;
39
+ };
40
+ path: {
41
+ "transform-origin": string;
42
+ };
43
+ };
44
+ get rotationTransform(): string;
45
+ getPathResizingSVGProperties([newX, newY, newWidth, newHeight]: [any, any, any, any]): {
46
+ path: {
47
+ "transform-origin": string;
48
+ transform: string;
49
+ };
50
+ };
51
+ getPathResizedSVGProperties([newX, newY, newWidth, newHeight]: [any, any, any, any]): {
52
+ root: {
53
+ viewBox: any;
54
+ };
55
+ path: {
56
+ "transform-origin": string;
57
+ transform: string | null;
58
+ d: string;
59
+ };
60
+ };
61
+ getPathTranslatedSVGProperties([newX, newY]: [any, any], parentDimensions: any): {
62
+ root: {
63
+ viewBox: any;
64
+ };
65
+ path: {
66
+ d: string;
67
+ "transform-origin": string;
68
+ };
69
+ };
70
+ get defaultSVGProperties(): {
71
+ root: {
72
+ viewBox: any;
73
+ };
74
+ rootClass: {
75
+ draw: boolean;
76
+ };
77
+ path: {
78
+ d: string;
79
+ "transform-origin": string;
80
+ transform: string | null;
81
+ };
82
+ bbox: any;
83
+ };
84
+ #private;
85
+ }
86
+ export class InkDrawOutliner {
87
+ constructor(x: any, y: any, parentWidth: any, parentHeight: any, rotation: any, thickness: any);
88
+ updateProperty(name: any, value: any): void;
89
+ isEmpty(): boolean;
90
+ isCancellable(): boolean;
91
+ add(x: any, y: any): {
92
+ path: {
93
+ d: string;
94
+ };
95
+ } | null;
96
+ end(x: any, y: any): {
97
+ path: {
98
+ d: string;
99
+ };
100
+ } | null;
101
+ startNew(x: any, y: any, parentWidth: any, parentHeight: any, rotation: any): null;
102
+ getLastElement(): {
103
+ line: any[];
104
+ points: any[];
105
+ } | undefined;
106
+ setLastElement(element: any): {
107
+ path: {
108
+ d: string;
109
+ };
110
+ };
111
+ removeLastElement(): {
112
+ path: {
113
+ d: string;
114
+ };
115
+ };
116
+ toSVGPath(): string;
117
+ getOutlines(parentWidth: any, parentHeight: any, scale: any, innerMargin: any): InkDrawOutline;
118
+ get defaultSVGProperties(): {
119
+ root: {
120
+ viewBox: string;
121
+ };
122
+ rootClass: {
123
+ draw: boolean;
124
+ };
125
+ bbox: number[];
126
+ };
127
+ #private;
128
+ }
129
+ import { Outline } from "./outline.js";
tools/ui/node_modules/pdfjs-dist/types/src/display/editor/drawers/outline.d.ts ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ export class Outline {
2
+ static PRECISION: number;
3
+ static _rescale(src: any, tx: any, ty: any, sx: any, sy: any, dest: any): any;
4
+ static _rescaleAndSwap(src: any, tx: any, ty: any, sx: any, sy: any, dest: any): any;
5
+ static _translate(src: any, tx: any, ty: any, dest: any): any;
6
+ static svgRound(x: any): number;
7
+ static _normalizePoint(x: any, y: any, parentWidth: any, parentHeight: any, rotation: any): number[];
8
+ static _normalizePagePoint(x: any, y: any, rotation: any): any[];
9
+ static createBezierPoints(x1: any, y1: any, x2: any, y2: any, x3: any, y3: any): number[];
10
+ /**
11
+ * @returns {string} The SVG path of the outline.
12
+ */
13
+ toSVGPath(): string;
14
+ /**
15
+ * @type {Object|null} The bounding box of the outline.
16
+ */
17
+ get box(): Object | null;
18
+ serialize(_bbox: any, _rotation: any): void;
19
+ }
tools/ui/node_modules/pdfjs-dist/types/src/display/editor/drawers/signaturedraw.d.ts ADDED
@@ -0,0 +1,79 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * Basic text editor in order to create a Signature annotation.
3
+ */
4
+ export class SignatureExtractor {
5
+ static "__#31@#PARAMETERS": {
6
+ maxDim: number;
7
+ sigmaSFactor: number;
8
+ sigmaR: number;
9
+ kernelSize: number;
10
+ };
11
+ static "__#31@#neighborIndexToId"(i0: any, j0: any, i: any, j: any): any;
12
+ static "__#31@#neighborIdToIndex": Int32Array<ArrayBuffer>;
13
+ static "__#31@#clockwiseNonZero"(buf: any, width: any, i0: any, j0: any, i: any, j: any, offset: any): number;
14
+ static "__#31@#counterClockwiseNonZero"(buf: any, width: any, i0: any, j0: any, i: any, j: any, offset: any): number;
15
+ static "__#31@#findContours"(buf: any, width: any, height: any, threshold: any): {
16
+ isHole: boolean;
17
+ points: number[];
18
+ id: number;
19
+ parent: number;
20
+ }[];
21
+ static "__#31@#douglasPeuckerHelper"(points: any, start: any, end: any, output: any): void;
22
+ static "__#31@#douglasPeucker"(points: any): any[] | null;
23
+ static "__#31@#bilateralFilter"(buf: any, width: any, height: any, sigmaS: any, sigmaR: any, kernelSize: any): (Uint32Array<ArrayBuffer> | Uint8Array<any>)[];
24
+ static "__#31@#getHistogram"(buf: any): Uint32Array<ArrayBuffer>;
25
+ static "__#31@#toUint8"(buf: any): Uint8ClampedArray<ArrayBuffer>;
26
+ static "__#31@#guessThreshold"(histogram: any): number;
27
+ static "__#31@#getGrayPixels"(bitmap: any): any[];
28
+ static extractContoursFromText(text: any, { fontFamily, fontStyle, fontWeight }: {
29
+ fontFamily: any;
30
+ fontStyle: any;
31
+ fontWeight: any;
32
+ }, pageWidth: any, pageHeight: any, rotation: any, innerMargin: any): {
33
+ outline: InkDrawOutline;
34
+ newCurves: any[];
35
+ areContours: any;
36
+ thickness: any;
37
+ width: any;
38
+ height: any;
39
+ } | null;
40
+ static process(bitmap: any, pageWidth: any, pageHeight: any, rotation: any, innerMargin: any): {
41
+ outline: InkDrawOutline;
42
+ newCurves: any[];
43
+ areContours: any;
44
+ thickness: any;
45
+ width: any;
46
+ height: any;
47
+ } | null;
48
+ static processDrawnLines({ lines, pageWidth, pageHeight, rotation, innerMargin, mustSmooth, areContours, }: {
49
+ lines: any;
50
+ pageWidth: any;
51
+ pageHeight: any;
52
+ rotation: any;
53
+ innerMargin: any;
54
+ mustSmooth: any;
55
+ areContours: any;
56
+ }): {
57
+ outline: InkDrawOutline;
58
+ newCurves: any[];
59
+ areContours: any;
60
+ thickness: any;
61
+ width: any;
62
+ height: any;
63
+ } | null;
64
+ static compressSignature({ outlines, areContours, thickness, width, height, }: {
65
+ outlines: any;
66
+ areContours: any;
67
+ thickness: any;
68
+ width: any;
69
+ height: any;
70
+ }): Promise<any>;
71
+ static decompressSignature(signatureData: any): Promise<{
72
+ areContours: boolean;
73
+ thickness: number;
74
+ outlines: Float32Array<ArrayBuffer>[];
75
+ width: number;
76
+ height: number;
77
+ } | null>;
78
+ }
79
+ import { InkDrawOutline } from "./inkdraw.js";
tools/ui/node_modules/pdfjs-dist/types/src/display/editor/editor.d.ts ADDED
@@ -0,0 +1,517 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ export type AnnotationEditorLayer = import("./annotation_editor_layer.js").AnnotationEditorLayer;
2
+ export type AnnotationEditorParameters = {
3
+ /**
4
+ * - the global manager
5
+ */
6
+ uiManager: AnnotationEditorUIManager;
7
+ /**
8
+ * - the layer containing this editor
9
+ */
10
+ parent: AnnotationEditorLayer;
11
+ /**
12
+ * - editor id
13
+ */
14
+ id: string;
15
+ /**
16
+ * - x-coordinate
17
+ */
18
+ x: number;
19
+ /**
20
+ * - y-coordinate
21
+ */
22
+ y: number;
23
+ };
24
+ /**
25
+ * @typedef {Object} AnnotationEditorParameters
26
+ * @property {AnnotationEditorUIManager} uiManager - the global manager
27
+ * @property {AnnotationEditorLayer} parent - the layer containing this editor
28
+ * @property {string} id - editor id
29
+ * @property {number} x - x-coordinate
30
+ * @property {number} y - y-coordinate
31
+ */
32
+ /**
33
+ * Base class for editors.
34
+ */
35
+ export class AnnotationEditor {
36
+ static _l10n: null;
37
+ static _l10nResizer: null;
38
+ static _borderLineWidth: number;
39
+ static _colorManager: ColorManager;
40
+ static _zIndex: number;
41
+ static _telemetryTimeout: number;
42
+ static get _resizerKeyboardManager(): any;
43
+ static get isDrawer(): boolean;
44
+ static get _defaultLineColor(): any;
45
+ static deleteAnnotationElement(editor: any): void;
46
+ /**
47
+ * Initialize the l10n stuff for this type of editor.
48
+ * @param {Object} l10n
49
+ */
50
+ static initialize(l10n: Object, _uiManager: any): void;
51
+ /**
52
+ * Update the default parameters for this type of editor.
53
+ * @param {number} _type
54
+ * @param {*} _value
55
+ */
56
+ static updateDefaultParams(_type: number, _value: any): void;
57
+ /**
58
+ * Get the default properties to set in the UI for this type of editor.
59
+ * @returns {Array}
60
+ */
61
+ static get defaultPropertiesToUpdate(): any[];
62
+ /**
63
+ * Check if this kind of editor is able to handle the given mime type for
64
+ * pasting.
65
+ * @param {string} mime
66
+ * @returns {boolean}
67
+ */
68
+ static isHandlingMimeForPasting(mime: string): boolean;
69
+ /**
70
+ * Extract the data from the clipboard item and delegate the creation of the
71
+ * editor to the parent.
72
+ * @param {DataTransferItem} item
73
+ * @param {AnnotationEditorLayer} parent
74
+ */
75
+ static paste(item: DataTransferItem, parent: AnnotationEditorLayer): void;
76
+ static "__#44@#rotatePoint"(x: any, y: any, angle: any): any[];
77
+ static _round(x: any): number;
78
+ /**
79
+ * Deserialize the editor.
80
+ * The result of the deserialization is a new editor.
81
+ *
82
+ * @param {Object} data
83
+ * @param {AnnotationEditorLayer} parent
84
+ * @param {AnnotationEditorUIManager} uiManager
85
+ * @returns {Promise<AnnotationEditor | null>}
86
+ */
87
+ static deserialize(data: Object, parent: AnnotationEditorLayer, uiManager: AnnotationEditorUIManager): Promise<AnnotationEditor | null>;
88
+ static get MIN_SIZE(): number;
89
+ static canCreateNewEmptyEditor(): boolean;
90
+ /**
91
+ * @param {AnnotationEditorParameters} parameters
92
+ */
93
+ constructor(parameters: AnnotationEditorParameters);
94
+ isSelected: boolean;
95
+ _isCopy: boolean;
96
+ _editToolbar: null;
97
+ _initialOptions: any;
98
+ _initialData: null;
99
+ _isVisible: boolean;
100
+ _uiManager: null;
101
+ _focusEventsAllowed: boolean;
102
+ parent: import("./annotation_editor_layer.js").AnnotationEditorLayer;
103
+ id: string;
104
+ width: any;
105
+ height: any;
106
+ pageIndex: number;
107
+ name: any;
108
+ div: HTMLDivElement | null;
109
+ annotationElementId: any;
110
+ _willKeepAspectRatio: boolean;
111
+ _structTreeParentId: any;
112
+ rotation: number;
113
+ pageRotation: number;
114
+ pageDimensions: any[];
115
+ pageTranslation: any[];
116
+ x: number;
117
+ y: number;
118
+ isAttachedToDOM: boolean;
119
+ deleted: boolean;
120
+ get editorType(): any;
121
+ get mode(): any;
122
+ /**
123
+ * Get the properties to update in the UI for this editor.
124
+ * @returns {Array}
125
+ */
126
+ get propertiesToUpdate(): any[];
127
+ set _isDraggable(value: boolean);
128
+ get _isDraggable(): boolean;
129
+ /**
130
+ * @returns {boolean} true if the editor handles the Enter key itself.
131
+ */
132
+ get isEnterHandled(): boolean;
133
+ center(): void;
134
+ /**
135
+ * Add some commands into the CommandManager (undo/redo stuff).
136
+ * @param {Object} params
137
+ */
138
+ addCommands(params: Object): void;
139
+ get currentLayer(): any;
140
+ /**
141
+ * This editor will be behind the others.
142
+ */
143
+ setInBackground(): void;
144
+ /**
145
+ * This editor will be in the foreground.
146
+ */
147
+ setInForeground(): void;
148
+ setParent(parent: any): void;
149
+ /**
150
+ * onfocus callback.
151
+ */
152
+ focusin(event: any): void;
153
+ /**
154
+ * onblur callback.
155
+ * @param {FocusEvent} event
156
+ */
157
+ focusout(event: FocusEvent): void;
158
+ commitOrRemove(): void;
159
+ /**
160
+ * Commit the data contained in this editor.
161
+ */
162
+ commit(): void;
163
+ addToAnnotationStorage(): void;
164
+ /**
165
+ * Set the editor position within its parent.
166
+ * @param {number} x
167
+ * @param {number} y
168
+ * @param {number} tx - x-translation in screen coordinates.
169
+ * @param {number} ty - y-translation in screen coordinates.
170
+ */
171
+ setAt(x: number, y: number, tx: number, ty: number): void;
172
+ _moveAfterPaste(baseX: any, baseY: any): void;
173
+ /**
174
+ * Translate the editor position within its parent.
175
+ * @param {number} x - x-translation in screen coordinates.
176
+ * @param {number} y - y-translation in screen coordinates.
177
+ */
178
+ translate(x: number, y: number): void;
179
+ /**
180
+ * Translate the editor position within its page and adjust the scroll
181
+ * in order to have the editor in the view.
182
+ * @param {number} x - x-translation in page coordinates.
183
+ * @param {number} y - y-translation in page coordinates.
184
+ */
185
+ translateInPage(x: number, y: number): void;
186
+ translationDone(): void;
187
+ drag(tx: any, ty: any): void;
188
+ /**
189
+ * Called when the editor is being translated.
190
+ * @param {number} x - in page coordinates.
191
+ * @param {number} y - in page coordinates.
192
+ */
193
+ _onTranslating(x: number, y: number): void;
194
+ /**
195
+ * Called when the editor has been translated.
196
+ * @param {number} x - in page coordinates.
197
+ * @param {number} y - in page coordinates.
198
+ */
199
+ _onTranslated(x: number, y: number): void;
200
+ get _hasBeenMoved(): boolean;
201
+ get _hasBeenResized(): boolean;
202
+ /**
203
+ * Get the translation to take into account the editor border.
204
+ * The CSS engine positions the element by taking the border into account so
205
+ * we must apply the opposite translation to have the editor in the right
206
+ * position.
207
+ * @returns {Array<number>}
208
+ */
209
+ getBaseTranslation(): Array<number>;
210
+ /**
211
+ * @returns {boolean} true if position must be fixed (i.e. make the x and y
212
+ * living in the page).
213
+ */
214
+ get _mustFixPosition(): boolean;
215
+ /**
216
+ * Fix the position of the editor in order to keep it inside its parent page.
217
+ * @param {number} [rotation] - the rotation of the page.
218
+ */
219
+ fixAndSetPosition(rotation?: number): void;
220
+ /**
221
+ * Convert a screen translation into a page one.
222
+ * @param {number} x
223
+ * @param {number} y
224
+ */
225
+ screenToPageTranslation(x: number, y: number): any[];
226
+ /**
227
+ * Convert a page translation into a screen one.
228
+ * @param {number} x
229
+ * @param {number} y
230
+ */
231
+ pageTranslationToScreen(x: number, y: number): any[];
232
+ get parentScale(): any;
233
+ get parentRotation(): number;
234
+ get parentDimensions(): number[];
235
+ /**
236
+ * Set the dimensions of this editor.
237
+ * @param {number} width
238
+ * @param {number} height
239
+ */
240
+ setDims(width: number, height: number): void;
241
+ fixDims(): void;
242
+ /**
243
+ * Get the translation used to position this editor when it's created.
244
+ * @returns {Array<number>}
245
+ */
246
+ getInitialTranslation(): Array<number>;
247
+ /**
248
+ * Called when the editor has been resized.
249
+ */
250
+ _onResized(): void;
251
+ /**
252
+ * Called when the editor is being resized.
253
+ */
254
+ _onResizing(): void;
255
+ /**
256
+ * Called when the alt text dialog is closed.
257
+ */
258
+ altTextFinish(): void;
259
+ /**
260
+ * Get the toolbar buttons for this editor.
261
+ * @returns {Array<Array<string|object|null>>|null}
262
+ */
263
+ get toolbarButtons(): Array<Array<string | object | null>> | null;
264
+ /**
265
+ * Add a toolbar for this editor.
266
+ * @returns {Promise<EditorToolbar|null>}
267
+ */
268
+ addEditToolbar(): Promise<EditorToolbar | null>;
269
+ removeEditToolbar(): void;
270
+ addContainer(container: any): void;
271
+ getClientDimensions(): DOMRect;
272
+ /**
273
+ * Create the alt text for this editor.
274
+ * @returns {object}
275
+ */
276
+ createAltText(): object;
277
+ /**
278
+ * Set the alt text data.
279
+ */
280
+ set altTextData(data: any);
281
+ get altTextData(): any;
282
+ get guessedAltText(): any;
283
+ setGuessedAltText(text: any): Promise<void>;
284
+ serializeAltText(isForCopying: any): any;
285
+ hasAltText(): boolean;
286
+ hasAltTextData(): any;
287
+ addCommentButton(): Comment;
288
+ get commentColor(): null;
289
+ set comment(text: {
290
+ text: any;
291
+ date: any;
292
+ deleted: any;
293
+ color: null;
294
+ });
295
+ get comment(): {
296
+ text: any;
297
+ date: any;
298
+ deleted: any;
299
+ color: null;
300
+ };
301
+ setCommentData(text: any): void;
302
+ get hasEditedComment(): any;
303
+ editComment(): Promise<void>;
304
+ addComment(serialized: any): void;
305
+ /**
306
+ * Render this editor in a div.
307
+ * @returns {HTMLDivElement | null}
308
+ */
309
+ render(): HTMLDivElement | null;
310
+ /**
311
+ * Onpointerdown callback.
312
+ * @param {PointerEvent} event
313
+ */
314
+ pointerdown(event: PointerEvent): void;
315
+ _onStartDragging(): void;
316
+ _onStopDragging(): void;
317
+ moveInDOM(): void;
318
+ _setParentAndPosition(parent: any, x: any, y: any): void;
319
+ /**
320
+ * Convert the current rect into a page one.
321
+ * @param {number} tx - x-translation in screen coordinates.
322
+ * @param {number} ty - y-translation in screen coordinates.
323
+ * @param {number} [rotation] - the rotation of the page.
324
+ */
325
+ getRect(tx: number, ty: number, rotation?: number): any[];
326
+ getRectInCurrentCoords(rect: any, pageHeight: any): any[];
327
+ /**
328
+ * Executed once this editor has been rendered.
329
+ * @param {boolean} focus - true if the editor should be focused.
330
+ */
331
+ onceAdded(focus: boolean): void;
332
+ /**
333
+ * Check if the editor contains something.
334
+ * @returns {boolean}
335
+ */
336
+ isEmpty(): boolean;
337
+ /**
338
+ * Enable edit mode.
339
+ * @returns {boolean} - true if the edit mode has been enabled.
340
+ */
341
+ enableEditMode(): boolean;
342
+ /**
343
+ * Disable edit mode.
344
+ * @returns {boolean} - true if the edit mode has been disabled.
345
+ */
346
+ disableEditMode(): boolean;
347
+ /**
348
+ * Check if the editor is edited.
349
+ * @returns {boolean}
350
+ */
351
+ isInEditMode(): boolean;
352
+ /**
353
+ * If it returns true, then this editor handles the keyboard
354
+ * events itself.
355
+ * @returns {boolean}
356
+ */
357
+ shouldGetKeyboardEvents(): boolean;
358
+ /**
359
+ * Check if this editor needs to be rebuilt or not.
360
+ * @returns {boolean}
361
+ */
362
+ needsToBeRebuilt(): boolean;
363
+ get isOnScreen(): boolean;
364
+ /**
365
+ * Rebuild the editor in case it has been removed on undo.
366
+ *
367
+ * To implement in subclasses.
368
+ */
369
+ rebuild(): void;
370
+ /**
371
+ * Rotate the editor when the page is rotated.
372
+ * @param {number} angle
373
+ */
374
+ rotate(_angle: any): void;
375
+ /**
376
+ * Resize the editor when the page is resized.
377
+ */
378
+ resize(): void;
379
+ /**
380
+ * Serialize the editor when it has been deleted.
381
+ * @returns {Object}
382
+ */
383
+ serializeDeleted(): Object;
384
+ /**
385
+ * Serialize the editor.
386
+ * The result of the serialization will be used to construct a
387
+ * new annotation to add to the pdf document.
388
+ *
389
+ * To implement in subclasses.
390
+ * @param {boolean} [isForCopying]
391
+ * @param {Object | null} [context]
392
+ * @returns {Object | null}
393
+ */
394
+ serialize(isForCopying?: boolean, context?: Object | null): Object | null;
395
+ /**
396
+ * Check if an existing annotation associated with this editor has been
397
+ * modified.
398
+ * @returns {boolean}
399
+ */
400
+ get hasBeenModified(): boolean;
401
+ /**
402
+ * Remove this editor.
403
+ * It's used on ctrl+backspace action.
404
+ */
405
+ remove(): void;
406
+ /**
407
+ * @returns {boolean} true if this editor can be resized.
408
+ */
409
+ get isResizable(): boolean;
410
+ /**
411
+ * Add the resizers to this editor.
412
+ */
413
+ makeResizable(): void;
414
+ get toolbarPosition(): null;
415
+ /**
416
+ * onkeydown callback.
417
+ * @param {KeyboardEvent} event
418
+ */
419
+ keydown(event: KeyboardEvent): void;
420
+ _resizeWithKeyboard(x: any, y: any): void;
421
+ _stopResizingWithKeyboard(): void;
422
+ /**
423
+ * Select this editor.
424
+ */
425
+ select(): void;
426
+ /**
427
+ * Unselect this editor.
428
+ */
429
+ unselect(): void;
430
+ /**
431
+ * Update some parameters which have been changed through the UI.
432
+ * @param {number} type
433
+ * @param {*} value
434
+ */
435
+ updateParams(type: number, value: any): void;
436
+ /**
437
+ * When the user disables the editing mode some editors can change some of
438
+ * their properties.
439
+ */
440
+ disableEditing(): void;
441
+ /**
442
+ * When the user enables the editing mode some editors can change some of
443
+ * their properties.
444
+ */
445
+ enableEditing(): void;
446
+ /**
447
+ * Check if the content of this editor can be changed.
448
+ * For example, a FreeText editor can be changed (the user can change the
449
+ * text), but a Stamp editor cannot.
450
+ * @returns {boolean}
451
+ */
452
+ get canChangeContent(): boolean;
453
+ /**
454
+ * The editor is about to be edited.
455
+ */
456
+ enterInEditMode(): void;
457
+ /**
458
+ * ondblclick callback.
459
+ * @param {MouseEvent} event
460
+ */
461
+ dblclick(event: MouseEvent): void;
462
+ /**
463
+ * @returns {HTMLElement | null} the element requiring an alt text.
464
+ */
465
+ getElementForAltText(): HTMLElement | null;
466
+ /**
467
+ * Get the div which really contains the displayed content.
468
+ * @returns {HTMLDivElement | undefined}
469
+ */
470
+ get contentDiv(): HTMLDivElement | undefined;
471
+ /**
472
+ * When set to true, it means that this editor is currently edited.
473
+ * @param {boolean} value
474
+ */
475
+ set isEditing(value: boolean);
476
+ /**
477
+ * If true then the editor is currently edited.
478
+ * @type {boolean}
479
+ */
480
+ get isEditing(): boolean;
481
+ /**
482
+ * Set the aspect ratio to use when resizing.
483
+ * @param {number} width
484
+ * @param {number} height
485
+ */
486
+ setAspectRatio(width: number, height: number): void;
487
+ /**
488
+ * Get the data to report to the telemetry when the editor is added.
489
+ * @returns {Object}
490
+ */
491
+ get telemetryInitialData(): Object;
492
+ /**
493
+ * The telemetry data to use when saving/printing.
494
+ * @returns {Object|null}
495
+ */
496
+ get telemetryFinalData(): Object | null;
497
+ _reportTelemetry(data: any, mustWait?: boolean): void;
498
+ /**
499
+ * Show or hide this editor.
500
+ * @param {boolean|undefined} visible
501
+ */
502
+ show(visible?: boolean | undefined): void;
503
+ enable(): void;
504
+ disable(): void;
505
+ /**
506
+ * Render an annotation in the annotation layer.
507
+ * @param {Object} annotation
508
+ * @returns {HTMLElement|null}
509
+ */
510
+ renderAnnotationElement(annotation: Object): HTMLElement | null;
511
+ resetAnnotationElement(annotation: any): void;
512
+ #private;
513
+ }
514
+ import { AnnotationEditorUIManager } from "./tools.js";
515
+ import { EditorToolbar } from "./toolbar.js";
516
+ import { Comment } from "./comment.js";
517
+ import { ColorManager } from "./tools.js";
tools/ui/node_modules/pdfjs-dist/types/src/display/editor/freetext.d.ts ADDED
@@ -0,0 +1,61 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ export type AnnotationEditorLayer = import("./annotation_editor_layer.js").AnnotationEditorLayer;
2
+ /**
3
+ * Basic text editor in order to create a FreeTex annotation.
4
+ */
5
+ export class FreeTextEditor extends AnnotationEditor {
6
+ static _freeTextDefaultContent: string;
7
+ static _internalPadding: number;
8
+ static _defaultColor: null;
9
+ static _defaultFontSize: number;
10
+ static get _keyboardManager(): any;
11
+ static _type: string;
12
+ static _editorType: number;
13
+ /** @inheritdoc */
14
+ static initialize(l10n: any, uiManager: any): void;
15
+ /** @inheritdoc */
16
+ static updateDefaultParams(type: any, value: any): void;
17
+ /** @inheritdoc */
18
+ static get defaultPropertiesToUpdate(): any[][];
19
+ static "__#20@#getNodeContent"(node: any): any;
20
+ static "__#20@#deserializeContent"(content: any): any;
21
+ /** @inheritdoc */
22
+ static deserialize(data: any, parent: any, uiManager: any): Promise<AnnotationEditor | null>;
23
+ constructor(params: any);
24
+ _colorPicker: null;
25
+ /** @inheritdoc */
26
+ updateParams(type: any, value: any): void;
27
+ /** @inheritdoc */
28
+ get propertiesToUpdate(): any[][];
29
+ /** @inheritdoc */
30
+ get toolbarButtons(): (string | null)[][];
31
+ get colorType(): number;
32
+ get colorValue(): any;
33
+ /**
34
+ * Helper to translate the editor with the keyboard when it's empty.
35
+ * @param {number} x in page units.
36
+ * @param {number} y in page units.
37
+ */
38
+ _translateEmpty(x: number, y: number): void;
39
+ /** @inheritdoc */
40
+ onceAdded(focus: any): void;
41
+ /**
42
+ * Commit the content we have in this editor.
43
+ * @returns {undefined}
44
+ */
45
+ commit(): undefined;
46
+ /** @inheritdoc */
47
+ keydown(event: any): void;
48
+ editorDivKeydown(event: any): void;
49
+ editorDivFocus(event: any): void;
50
+ editorDivBlur(event: any): void;
51
+ editorDivInput(event: any): void;
52
+ editorDiv: HTMLDivElement | undefined;
53
+ overlayDiv: HTMLDivElement | undefined;
54
+ editorDivPaste(event: any): void;
55
+ /** @inheritdoc */
56
+ serialize(isForCopying?: boolean): Object | null;
57
+ /** @inheritdoc */
58
+ renderAnnotationElement(annotation: any): HTMLElement | null;
59
+ #private;
60
+ }
61
+ import { AnnotationEditor } from "./editor.js";
tools/ui/node_modules/pdfjs-dist/types/src/display/editor/highlight.d.ts ADDED
@@ -0,0 +1,74 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * Basic draw editor in order to generate an Highlight annotation.
3
+ */
4
+ export class HighlightEditor extends AnnotationEditor {
5
+ static _defaultColor: null;
6
+ static _defaultOpacity: number;
7
+ static _defaultThickness: number;
8
+ static _type: string;
9
+ static _editorType: number;
10
+ static _freeHighlightId: number;
11
+ static _freeHighlight: null;
12
+ static _freeHighlightClipId: string;
13
+ static get _keyboardManager(): any;
14
+ static computeTelemetryFinalData(data: any): {
15
+ numberOfColors: any;
16
+ };
17
+ /** @inheritdoc */
18
+ static initialize(l10n: any, uiManager: any): void;
19
+ /** @inheritdoc */
20
+ static updateDefaultParams(type: any, value: any): void;
21
+ static get defaultPropertiesToUpdate(): (number | null)[][];
22
+ static "__#25@#rotateBbox"([x, y, width, height]: [any, any, any, any], angle: any): any[];
23
+ static startHighlighting(parent: any, isLTR: any, { target: textLayer, x, y }: {
24
+ target: any;
25
+ x: any;
26
+ y: any;
27
+ }): void;
28
+ static "__#25@#highlightMove"(parent: any, event: any): void;
29
+ static "__#25@#endHighlight"(parent: any, event: any): void;
30
+ /** @inheritdoc */
31
+ static deserialize(data: any, parent: any, uiManager: any): Promise<AnnotationEditor | null>;
32
+ constructor(params: any);
33
+ color: any;
34
+ defaultL10nId: string;
35
+ /** @inheritdoc */
36
+ get telemetryInitialData(): {
37
+ action: string;
38
+ type: string;
39
+ color: any;
40
+ thickness: any;
41
+ methodOfCreation: string;
42
+ };
43
+ /** @inheritdoc */
44
+ get telemetryFinalData(): {
45
+ type: string;
46
+ color: any;
47
+ };
48
+ get commentColor(): any;
49
+ /** @inheritdoc */
50
+ translateInPage(x: any, y: any): void;
51
+ /** @inheritdoc */
52
+ updateParams(type: any, value: any): void;
53
+ /** @inheritdoc */
54
+ get propertiesToUpdate(): any[][];
55
+ /** @inheritdoc */
56
+ get toolbarButtons(): any;
57
+ /** @inheritdoc */
58
+ fixAndSetPosition(): void;
59
+ /** @inheritdoc */
60
+ getRect(tx: any, ty: any): any[];
61
+ /** @inheritdoc */
62
+ onceAdded(focus: any): void;
63
+ /** @inheritdoc */
64
+ rotate(angle: any): void;
65
+ pointerover(): void;
66
+ pointerleave(): void;
67
+ _moveCaret(direction: any): void;
68
+ /** @inheritdoc */
69
+ serialize(isForCopying?: boolean): Object | null;
70
+ /** @inheritdoc */
71
+ renderAnnotationElement(annotation: any): null;
72
+ #private;
73
+ }
74
+ import { AnnotationEditor } from "./editor.js";
tools/ui/node_modules/pdfjs-dist/types/src/display/editor/ink.d.ts ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ export class InkDrawingOptions extends DrawingOptions {
2
+ constructor(viewerParameters: any);
3
+ _viewParameters: any;
4
+ clone(): InkDrawingOptions;
5
+ }
6
+ /**
7
+ * Basic draw editor in order to generate an Ink annotation.
8
+ */
9
+ export class InkEditor extends DrawingEditor {
10
+ static _type: string;
11
+ static _editorType: number;
12
+ static _defaultDrawingOptions: null;
13
+ /** @inheritdoc */
14
+ static initialize(l10n: any, uiManager: any): void;
15
+ /** @inheritdoc */
16
+ static getDefaultDrawingOptions(options: any): any;
17
+ /** @inheritdoc */
18
+ static get typesMap(): any;
19
+ /** @inheritdoc */
20
+ static createDrawerInstance(x: any, y: any, parentWidth: any, parentHeight: any, rotation: any): InkDrawOutliner;
21
+ /** @inheritdoc */
22
+ static deserializeDraw(pageX: any, pageY: any, pageWidth: any, pageHeight: any, innerMargin: any, data: any): any;
23
+ defaultL10nId: string;
24
+ /** @inheritdoc */
25
+ get toolbarButtons(): (string | null)[][];
26
+ get colorType(): number;
27
+ get colorValue(): any;
28
+ /** @inheritdoc */
29
+ createDrawingOptions({ color, thickness, opacity }: {
30
+ color: any;
31
+ thickness: any;
32
+ opacity: any;
33
+ }): void;
34
+ _drawingOptions: any;
35
+ /** @inheritdoc */
36
+ serialize(isForCopying?: boolean): Object | null;
37
+ #private;
38
+ }
39
+ import { DrawingOptions } from "./draw.js";
40
+ import { DrawingEditor } from "./draw.js";
41
+ import { InkDrawOutliner } from "./drawers/inkdraw.js";
tools/ui/node_modules/pdfjs-dist/types/src/display/editor/signature.d.ts ADDED
@@ -0,0 +1,82 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * Basic editor in order to generate an Stamp annotation annotation containing
3
+ * a signature drawing.
4
+ */
5
+ export class SignatureEditor extends DrawingEditor {
6
+ static _type: string;
7
+ static _editorType: number;
8
+ static _defaultDrawingOptions: null;
9
+ /** @inheritdoc */
10
+ static initialize(l10n: any, uiManager: any): void;
11
+ /** @inheritdoc */
12
+ static getDefaultDrawingOptions(options: any): any;
13
+ static get typesMap(): any;
14
+ static computeTelemetryFinalData(data: any): {
15
+ hasAltText: any;
16
+ hasNoAltText: any;
17
+ };
18
+ /** @inheritdoc */
19
+ static deserializeDraw(pageX: any, pageY: any, pageWidth: any, pageHeight: any, innerMargin: any, data: any): any;
20
+ defaultL10nId: string;
21
+ /** @inheritdoc */
22
+ get telemetryFinalData(): {
23
+ type: string;
24
+ hasDescription: boolean;
25
+ };
26
+ setUuid(uuid: any): void;
27
+ getUuid(): null;
28
+ set description(description: null);
29
+ get description(): null;
30
+ getSignaturePreview(): {
31
+ areContours: any;
32
+ outline: InkDrawOutline;
33
+ };
34
+ /** @inheritdoc */
35
+ get toolbarButtons(): any[][] | null;
36
+ addSignature(data: any, heightInPage: any, description: any, uuid: any): void;
37
+ getFromImage(bitmap: any): {
38
+ outline: InkDrawOutline;
39
+ newCurves: any[];
40
+ areContours: any;
41
+ thickness: any;
42
+ width: any;
43
+ height: any;
44
+ } | null;
45
+ getFromText(text: any, fontInfo: any): {
46
+ outline: InkDrawOutline;
47
+ newCurves: any[];
48
+ areContours: any;
49
+ thickness: any;
50
+ width: any;
51
+ height: any;
52
+ } | null;
53
+ getDrawnSignature(curves: any): {
54
+ outline: InkDrawOutline;
55
+ newCurves: any[];
56
+ areContours: any;
57
+ thickness: any;
58
+ width: any;
59
+ height: any;
60
+ } | null;
61
+ /** @inheritdoc */
62
+ createDrawingOptions({ areContours, thickness }: {
63
+ areContours: any;
64
+ thickness: any;
65
+ }): void;
66
+ _drawingOptions: any;
67
+ /** @inheritdoc */
68
+ serialize(isForCopying?: boolean): {
69
+ annotationType: number;
70
+ isSignature: boolean;
71
+ areContours: boolean;
72
+ color: number[];
73
+ thickness: any;
74
+ pageIndex: number;
75
+ rect: any;
76
+ rotation: number;
77
+ structTreeParentId: any;
78
+ } | null;
79
+ #private;
80
+ }
81
+ import { DrawingEditor } from "./draw.js";
82
+ import { InkDrawOutline } from "./drawers/inkdraw.js";
tools/ui/node_modules/pdfjs-dist/types/src/display/editor/stamp.d.ts ADDED
@@ -0,0 +1,49 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * Basic text editor in order to create a FreeTex annotation.
3
+ */
4
+ export class StampEditor extends AnnotationEditor {
5
+ static _type: string;
6
+ static _editorType: number;
7
+ /** @inheritdoc */
8
+ static initialize(l10n: any, uiManager: any): void;
9
+ /** @inheritdoc */
10
+ static isHandlingMimeForPasting(mime: any): boolean;
11
+ /** @inheritdoc */
12
+ static paste(item: any, parent: any): void;
13
+ static computeTelemetryFinalData(data: any): {
14
+ hasAltText: any;
15
+ hasNoAltText: any;
16
+ };
17
+ /** @inheritdoc */
18
+ static deserialize(data: any, parent: any, uiManager: any): Promise<AnnotationEditor | null>;
19
+ constructor(params: any);
20
+ defaultL10nId: string;
21
+ /** @inheritdoc */
22
+ get telemetryFinalData(): {
23
+ type: string;
24
+ hasAltText: boolean;
25
+ };
26
+ mlGuessAltText(imageData?: null, updateAltTextData?: boolean): Promise<any>;
27
+ /** @inheritdoc */
28
+ onceAdded(focus: any): void;
29
+ /** @inheritdoc */
30
+ get toolbarButtons(): (string | object)[][];
31
+ setCanvas(annotationElementId: any, canvas: any): void;
32
+ onScaleChanging(): void;
33
+ copyCanvas(maxDataDimension: any, maxPreviewDimension: any, createImageData?: boolean): {
34
+ canvas: HTMLCanvasElement | null;
35
+ width: any;
36
+ height: any;
37
+ imageData: {
38
+ width: any;
39
+ height: any;
40
+ data: Uint8ClampedArray<ArrayBufferLike>;
41
+ } | null;
42
+ };
43
+ /** @inheritdoc */
44
+ serialize(isForCopying?: boolean, context?: null): Object | null;
45
+ /** @inheritdoc */
46
+ renderAnnotationElement(annotation: any): null;
47
+ #private;
48
+ }
49
+ import { AnnotationEditor } from "./editor.js";
tools/ui/node_modules/pdfjs-dist/types/src/display/editor/toolbar.d.ts ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ export class EditorToolbar {
2
+ static "__#3@#l10nRemove": null;
3
+ static "__#3@#pointerDown"(e: any): void;
4
+ constructor(editor: any);
5
+ render(): HTMLDivElement;
6
+ get div(): null;
7
+ hide(): void;
8
+ show(): void;
9
+ addDeleteButton(): void;
10
+ addAltText(altText: any): Promise<void>;
11
+ addComment(comment: any): void;
12
+ addColorPicker(colorPicker: any): void;
13
+ addEditSignatureButton(signatureManager: any): Promise<void>;
14
+ addButton(name: any, tool: any): Promise<void>;
15
+ updateEditSignatureButton(description: any): void;
16
+ remove(): void;
17
+ #private;
18
+ }
19
+ export class HighlightToolbar {
20
+ constructor(uiManager: any);
21
+ show(parent: any, boxes: any, isLTR: any): void;
22
+ hide(): void;
23
+ #private;
24
+ }
tools/ui/node_modules/pdfjs-dist/types/src/display/editor/tools.d.ts ADDED
@@ -0,0 +1,429 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ export type AnnotationEditor = import("./editor.js").AnnotationEditor;
2
+ export type AnnotationEditorLayer = import("./annotation_editor_layer.js").AnnotationEditorLayer;
3
+ /**
4
+ * A pdf has several pages and each of them when it will rendered
5
+ * will have an AnnotationEditorLayer which will contain the some
6
+ * new Annotations associated to an editor in order to modify them.
7
+ *
8
+ * This class is used to manage all the different layers, editors and
9
+ * some action like copy/paste, undo/redo, ...
10
+ */
11
+ export class AnnotationEditorUIManager {
12
+ static TRANSLATE_SMALL: number;
13
+ static TRANSLATE_BIG: number;
14
+ static get _keyboardManager(): any;
15
+ constructor(container: any, viewer: any, viewerAlert: any, altTextManager: any, commentManager: any, signatureManager: any, eventBus: any, pdfDocument: any, pageColors: any, highlightColors: any, enableHighlightFloatingButton: any, enableUpdatedAddImage: any, enableNewAltTextWhenAddingImage: any, mlManager: any, editorUndoBar: any, supportsPinchToZoom: any);
16
+ _editorUndoBar: null;
17
+ _signal: AbortSignal;
18
+ _eventBus: any;
19
+ viewParameters: {
20
+ realScale: number;
21
+ rotation: number;
22
+ };
23
+ isShiftKeyDown: boolean;
24
+ _supportsPinchToZoom: boolean;
25
+ destroy(): void;
26
+ combinedSignal(ac: any): AbortSignal;
27
+ get mlManager(): null;
28
+ get useNewAltTextFlow(): boolean;
29
+ get useNewAltTextWhenAddingImage(): boolean;
30
+ get hcmFilter(): any;
31
+ get direction(): any;
32
+ get _highlightColors(): any;
33
+ get highlightColors(): any;
34
+ get highlightColorNames(): any;
35
+ getNonHCMColor(color: any): any;
36
+ getNonHCMColorName(color: any): any;
37
+ /**
38
+ * Set the current drawing session.
39
+ * @param {AnnotationEditorLayer} layer
40
+ */
41
+ setCurrentDrawingSession(layer: AnnotationEditorLayer): void;
42
+ setMainHighlightColorPicker(colorPicker: any): void;
43
+ editAltText(editor: any, firstTime?: boolean): void;
44
+ hasCommentManager(): boolean;
45
+ editComment(editor: any, position: any): void;
46
+ getSignature(editor: any): void;
47
+ get signatureManager(): null;
48
+ switchToMode(mode: any, callback: any): void;
49
+ setPreference(name: any, value: any): void;
50
+ onSetPreference({ name, value }: {
51
+ name: any;
52
+ value: any;
53
+ }): void;
54
+ onPageChanging({ pageNumber }: {
55
+ pageNumber: any;
56
+ }): void;
57
+ focusMainContainer(): void;
58
+ findParent(x: any, y: any): any;
59
+ disableUserSelect(value?: boolean): void;
60
+ addShouldRescale(editor: any): void;
61
+ removeShouldRescale(editor: any): void;
62
+ onScaleChanging({ scale }: {
63
+ scale: any;
64
+ }): void;
65
+ onRotationChanging({ pagesRotation }: {
66
+ pagesRotation: any;
67
+ }): void;
68
+ highlightSelection(methodOfCreation?: string): void;
69
+ /**
70
+ * Add an editor in the annotation storage.
71
+ * @param {AnnotationEditor} editor
72
+ */
73
+ addToAnnotationStorage(editor: AnnotationEditor): void;
74
+ a11yAlert(messageId: any, args?: null): void;
75
+ blur(): void;
76
+ focus(): void;
77
+ addEditListeners(): void;
78
+ removeEditListeners(): void;
79
+ dragOver(event: any): void;
80
+ /**
81
+ * Drop callback.
82
+ * @param {DragEvent} event
83
+ */
84
+ drop(event: DragEvent): void;
85
+ /**
86
+ * Copy callback.
87
+ * @param {ClipboardEvent} event
88
+ */
89
+ copy(event: ClipboardEvent): void;
90
+ /**
91
+ * Cut callback.
92
+ * @param {ClipboardEvent} event
93
+ */
94
+ cut(event: ClipboardEvent): void;
95
+ /**
96
+ * Paste callback.
97
+ * @param {ClipboardEvent} event
98
+ */
99
+ paste(event: ClipboardEvent): Promise<void>;
100
+ /**
101
+ * Keydown callback.
102
+ * @param {KeyboardEvent} event
103
+ */
104
+ keydown(event: KeyboardEvent): void;
105
+ /**
106
+ * Keyup callback.
107
+ * @param {KeyboardEvent} event
108
+ */
109
+ keyup(event: KeyboardEvent): void;
110
+ /**
111
+ * Execute an action for a given name.
112
+ * For example, the user can click on the "Undo" entry in the context menu
113
+ * and it'll trigger the undo action.
114
+ */
115
+ onEditingAction({ name }: {
116
+ name: any;
117
+ }): void;
118
+ /**
119
+ * Set the editing state.
120
+ * It can be useful to temporarily disable it when the user is editing a
121
+ * FreeText annotation.
122
+ * @param {boolean} isEditing
123
+ */
124
+ setEditingState(isEditing: boolean): void;
125
+ registerEditorTypes(types: any): void;
126
+ /**
127
+ * Get an id.
128
+ * @returns {string}
129
+ */
130
+ getId(): string;
131
+ get currentLayer(): any;
132
+ getLayer(pageIndex: any): any;
133
+ get currentPageIndex(): number;
134
+ /**
135
+ * Add a new layer for a page which will contains the editors.
136
+ * @param {AnnotationEditorLayer} layer
137
+ */
138
+ addLayer(layer: AnnotationEditorLayer): void;
139
+ /**
140
+ * Remove a layer.
141
+ * @param {AnnotationEditorLayer} layer
142
+ */
143
+ removeLayer(layer: AnnotationEditorLayer): void;
144
+ /**
145
+ * Change the editor mode (None, FreeText, Ink, ...)
146
+ * @param {number} mode
147
+ * @param {string|null} editId
148
+ * @param {boolean} [isFromKeyboard] - true if the mode change is due to a
149
+ * keyboard action.
150
+ * @param {boolean} [mustEnterInEditMode] - true if the editor must enter in
151
+ * edit mode.
152
+ * @param {boolean} [editComment] - true if the mode change is due to a
153
+ * comment edit.
154
+ */
155
+ updateMode(mode: number, editId?: string | null, isFromKeyboard?: boolean, mustEnterInEditMode?: boolean, editComment?: boolean): Promise<void>;
156
+ addNewEditorFromKeyboard(): void;
157
+ /**
158
+ * Update the toolbar if it's required to reflect the tool currently used.
159
+ * @param {Object} options
160
+ * @param {number} mode
161
+ * @returns {undefined}
162
+ */
163
+ updateToolbar(options: Object): undefined;
164
+ /**
165
+ * Update a parameter in the current editor or globally.
166
+ * @param {number} type
167
+ * @param {*} value
168
+ */
169
+ updateParams(type: number, value: any): void;
170
+ showAllEditors(type: any, visible: any, updateButton?: boolean): void;
171
+ enableWaiting(mustWait?: boolean): void;
172
+ /**
173
+ * Get all the editors belonging to a given page.
174
+ * @param {number} pageIndex
175
+ * @returns {Array<AnnotationEditor>}
176
+ */
177
+ getEditors(pageIndex: number): Array<AnnotationEditor>;
178
+ /**
179
+ * Get an editor with the given id.
180
+ * @param {string} id
181
+ * @returns {AnnotationEditor}
182
+ */
183
+ getEditor(id: string): AnnotationEditor;
184
+ /**
185
+ * Add a new editor.
186
+ * @param {AnnotationEditor} editor
187
+ */
188
+ addEditor(editor: AnnotationEditor): void;
189
+ /**
190
+ * Remove an editor.
191
+ * @param {AnnotationEditor} editor
192
+ */
193
+ removeEditor(editor: AnnotationEditor): void;
194
+ /**
195
+ * The annotation element with the given id has been deleted.
196
+ * @param {AnnotationEditor} editor
197
+ */
198
+ addDeletedAnnotationElement(editor: AnnotationEditor): void;
199
+ /**
200
+ * Check if the annotation element with the given id has been deleted.
201
+ * @param {string} annotationElementId
202
+ * @returns {boolean}
203
+ */
204
+ isDeletedAnnotationElement(annotationElementId: string): boolean;
205
+ /**
206
+ * The annotation element with the given id have been restored.
207
+ * @param {AnnotationEditor} editor
208
+ */
209
+ removeDeletedAnnotationElement(editor: AnnotationEditor): void;
210
+ /**
211
+ * Set the given editor as the active one.
212
+ * @param {AnnotationEditor} editor
213
+ */
214
+ setActiveEditor(editor: AnnotationEditor): void;
215
+ /**
216
+ * Update the UI of the active editor.
217
+ * @param {AnnotationEditor} editor
218
+ */
219
+ updateUI(editor: AnnotationEditor): void;
220
+ updateUIForDefaultProperties(editorType: any): void;
221
+ /**
222
+ * Add or remove an editor the current selection.
223
+ * @param {AnnotationEditor} editor
224
+ */
225
+ toggleSelected(editor: AnnotationEditor): void;
226
+ /**
227
+ * Set the last selected editor.
228
+ * @param {AnnotationEditor} editor
229
+ */
230
+ setSelected(editor: AnnotationEditor): void;
231
+ /**
232
+ * Check if the editor is selected.
233
+ * @param {AnnotationEditor} editor
234
+ */
235
+ isSelected(editor: AnnotationEditor): boolean;
236
+ get firstSelectedEditor(): any;
237
+ /**
238
+ * Unselect an editor.
239
+ * @param {AnnotationEditor} editor
240
+ */
241
+ unselect(editor: AnnotationEditor): void;
242
+ get hasSelection(): boolean;
243
+ get isEnterHandled(): any;
244
+ /**
245
+ * Undo the last command.
246
+ */
247
+ undo(): void;
248
+ /**
249
+ * Redo the last undoed command.
250
+ */
251
+ redo(): void;
252
+ /**
253
+ * Add a command to execute (cmd) and another one to undo it.
254
+ * @param {Object} params
255
+ */
256
+ addCommands(params: Object): void;
257
+ cleanUndoStack(type: any): void;
258
+ /**
259
+ * Delete the current editor or all.
260
+ */
261
+ delete(): void;
262
+ commitOrRemove(): void;
263
+ hasSomethingToControl(): boolean;
264
+ /**
265
+ * Select all the editors.
266
+ */
267
+ selectAll(): void;
268
+ /**
269
+ * Unselect all the selected editors.
270
+ */
271
+ unselectAll(): void;
272
+ translateSelectedEditors(x: any, y: any, noCommit?: boolean): void;
273
+ /**
274
+ * Set up the drag session for moving the selected editors.
275
+ */
276
+ setUpDragSession(): void;
277
+ /**
278
+ * Ends the drag session.
279
+ * @returns {boolean} true if at least one editor has been moved.
280
+ */
281
+ endDragSession(): boolean;
282
+ /**
283
+ * Drag the set of selected editors.
284
+ * @param {number} tx
285
+ * @param {number} ty
286
+ */
287
+ dragSelectedEditors(tx: number, ty: number): void;
288
+ /**
289
+ * Rebuild the editor (usually on undo/redo actions) on a potentially
290
+ * non-rendered page.
291
+ * @param {AnnotationEditor} editor
292
+ */
293
+ rebuild(editor: AnnotationEditor): void;
294
+ get isEditorHandlingKeyboard(): any;
295
+ /**
296
+ * Is the current editor the one passed as argument?
297
+ * @param {AnnotationEditor} editor
298
+ * @returns
299
+ */
300
+ isActive(editor: AnnotationEditor): editor is never;
301
+ /**
302
+ * Get the current active editor.
303
+ * @returns {AnnotationEditor|null}
304
+ */
305
+ getActive(): AnnotationEditor | null;
306
+ /**
307
+ * Get the current editor mode.
308
+ * @returns {number}
309
+ */
310
+ getMode(): number;
311
+ get imageManager(): any;
312
+ getSelectionBoxes(textLayer: any): {
313
+ x: number;
314
+ y: number;
315
+ width: number;
316
+ height: number;
317
+ }[] | null;
318
+ addChangedExistingAnnotation({ annotationElementId, id }: {
319
+ annotationElementId: any;
320
+ id: any;
321
+ }): void;
322
+ removeChangedExistingAnnotation({ annotationElementId }: {
323
+ annotationElementId: any;
324
+ }): void;
325
+ renderAnnotationElement(annotation: any): void;
326
+ setMissingCanvas(annotationId: any, annotationElementId: any, canvas: any): void;
327
+ addMissingCanvas(annotationId: any, editor: any): void;
328
+ #private;
329
+ }
330
+ export function bindEvents(obj: any, element: any, names: any): void;
331
+ export class ColorManager {
332
+ static _colorsMapping: Map<string, number[]>;
333
+ get _colors(): any;
334
+ /**
335
+ * In High Contrast Mode, the color on the screen is not always the
336
+ * real color used in the pdf.
337
+ * For example in some cases white can appear to be black but when saving
338
+ * we want to have white.
339
+ * @param {string} color
340
+ * @returns {Array<number>}
341
+ */
342
+ convert(color: string): Array<number>;
343
+ /**
344
+ * An input element must have its color value as a hex string
345
+ * and not as color name.
346
+ * So this function converts a name into an hex string.
347
+ * @param {string} name
348
+ * @returns {string}
349
+ */
350
+ getHexCode(name: string): string;
351
+ }
352
+ /**
353
+ * Class to handle undo/redo.
354
+ * Commands are just saved in a buffer.
355
+ * If we hit some memory issues we could likely use a circular buffer.
356
+ * It has to be used as a singleton.
357
+ */
358
+ export class CommandManager {
359
+ constructor(maxSize?: number);
360
+ /**
361
+ * @typedef {Object} addOptions
362
+ * @property {function} cmd
363
+ * @property {function} undo
364
+ * @property {function} [post]
365
+ * @property {boolean} mustExec
366
+ * @property {number} type
367
+ * @property {boolean} overwriteIfSameType
368
+ * @property {boolean} keepUndo
369
+ */
370
+ /**
371
+ * Add a new couple of commands to be used in case of redo/undo.
372
+ * @param {addOptions} options
373
+ */
374
+ add({ cmd, undo, post, mustExec, type, overwriteIfSameType, keepUndo, }: {
375
+ cmd: Function;
376
+ undo: Function;
377
+ post?: Function | undefined;
378
+ mustExec: boolean;
379
+ type: number;
380
+ overwriteIfSameType: boolean;
381
+ keepUndo: boolean;
382
+ }): void;
383
+ /**
384
+ * Undo the last command.
385
+ */
386
+ undo(): void;
387
+ /**
388
+ * Redo the last command.
389
+ */
390
+ redo(): void;
391
+ /**
392
+ * Check if there is something to undo.
393
+ * @returns {boolean}
394
+ */
395
+ hasSomethingToUndo(): boolean;
396
+ /**
397
+ * Check if there is something to redo.
398
+ * @returns {boolean}
399
+ */
400
+ hasSomethingToRedo(): boolean;
401
+ cleanType(type: any): void;
402
+ destroy(): void;
403
+ #private;
404
+ }
405
+ /**
406
+ * Class to handle the different keyboards shortcuts we can have on mac or
407
+ * non-mac OSes.
408
+ */
409
+ export class KeyboardManager {
410
+ /**
411
+ * Create a new keyboard manager class.
412
+ * @param {Array<Array>} callbacks - an array containing an array of shortcuts
413
+ * and a callback to call.
414
+ * A shortcut is a string like `ctrl+c` or `mac+ctrl+c` for mac OS.
415
+ */
416
+ constructor(callbacks: Array<any[]>);
417
+ buffer: any[];
418
+ callbacks: Map<any, any>;
419
+ allKeys: Set<any>;
420
+ /**
421
+ * Execute a callback, if any, for a given keyboard event.
422
+ * The self is used as `this` in the callback.
423
+ * @param {Object} self
424
+ * @param {KeyboardEvent} event
425
+ * @returns
426
+ */
427
+ exec(self: Object, event: KeyboardEvent): void;
428
+ #private;
429
+ }
tools/ui/node_modules/pdfjs-dist/types/src/display/fetch_stream.d.ts ADDED
@@ -0,0 +1,60 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /** @implements {IPDFStream} */
2
+ export class PDFFetchStream implements IPDFStream {
3
+ constructor(source: any);
4
+ _responseOrigin: null;
5
+ source: any;
6
+ isHttp: boolean;
7
+ headers: Headers;
8
+ _fullRequestReader: PDFFetchStreamReader | null;
9
+ _rangeRequestReaders: any[];
10
+ get _progressiveDataLength(): number;
11
+ getFullReader(): PDFFetchStreamReader;
12
+ getRangeReader(begin: any, end: any): PDFFetchStreamRangeReader | null;
13
+ cancelAllRequests(reason: any): void;
14
+ }
15
+ /** @implements {IPDFStreamReader} */
16
+ declare class PDFFetchStreamReader implements IPDFStreamReader {
17
+ constructor(stream: any);
18
+ _stream: any;
19
+ _reader: ReadableStreamDefaultReader<Uint8Array<ArrayBufferLike>> | null;
20
+ _loaded: number;
21
+ _filename: string | null;
22
+ _withCredentials: any;
23
+ _contentLength: any;
24
+ _headersCapability: any;
25
+ _disableRange: any;
26
+ _rangeChunkSize: any;
27
+ _abortController: AbortController;
28
+ _isStreamingSupported: boolean;
29
+ _isRangeSupported: boolean;
30
+ onProgress: any;
31
+ get headersReady(): any;
32
+ get filename(): string | null;
33
+ get contentLength(): any;
34
+ get isRangeSupported(): boolean;
35
+ get isStreamingSupported(): boolean;
36
+ read(): Promise<{
37
+ value: any;
38
+ done: boolean;
39
+ }>;
40
+ cancel(reason: any): void;
41
+ }
42
+ /** @implements {IPDFStreamRangeReader} */
43
+ declare class PDFFetchStreamRangeReader implements IPDFStreamRangeReader {
44
+ constructor(stream: any, begin: any, end: any);
45
+ _stream: any;
46
+ _reader: ReadableStreamDefaultReader<Uint8Array<ArrayBufferLike>> | null;
47
+ _loaded: number;
48
+ _withCredentials: any;
49
+ _readCapability: any;
50
+ _isStreamingSupported: boolean;
51
+ _abortController: AbortController;
52
+ onProgress: any;
53
+ get isStreamingSupported(): boolean;
54
+ read(): Promise<{
55
+ value: any;
56
+ done: boolean;
57
+ }>;
58
+ cancel(reason: any): void;
59
+ }
60
+ export {};
tools/ui/node_modules/pdfjs-dist/types/src/display/filter_factory.d.ts ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ export class BaseFilterFactory {
2
+ addFilter(maps: any): string;
3
+ addHCMFilter(fgColor: any, bgColor: any): string;
4
+ addAlphaFilter(map: any): string;
5
+ addLuminosityFilter(map: any): string;
6
+ addHighlightHCMFilter(filterName: any, fgColor: any, bgColor: any, newFgColor: any, newBgColor: any): string;
7
+ destroy(keepHCM?: boolean): void;
8
+ }
9
+ /**
10
+ * FilterFactory aims to create some SVG filters we can use when drawing an
11
+ * image (or whatever) on a canvas.
12
+ * Filters aren't applied with ctx.putImageData because it just overwrites the
13
+ * underlying pixels.
14
+ * With these filters, it's possible for example to apply some transfer maps on
15
+ * an image without the need to apply them on the pixel arrays: the renderer
16
+ * does the magic for us.
17
+ */
18
+ export class DOMFilterFactory extends BaseFilterFactory {
19
+ constructor({ docId, ownerDocument }: {
20
+ docId: any;
21
+ ownerDocument?: Document | undefined;
22
+ });
23
+ addFilter(maps: any): any;
24
+ addHCMFilter(fgColor: any, bgColor: any): any;
25
+ addAlphaFilter(map: any): any;
26
+ addLuminosityFilter(map: any): any;
27
+ addHighlightHCMFilter(filterName: any, fgColor: any, bgColor: any, newFgColor: any, newBgColor: any): any;
28
+ #private;
29
+ }
tools/ui/node_modules/pdfjs-dist/types/src/display/font_loader.d.ts ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ export class FontFaceObject {
2
+ constructor(translatedData: any, inspectFont?: null);
3
+ compiledGlyphs: any;
4
+ _inspectFont: any;
5
+ createNativeFontFace(): FontFace | null;
6
+ createFontFaceRule(): string | null;
7
+ getPathGenerator(objs: any, character: any): any;
8
+ }
9
+ export class FontLoader {
10
+ constructor({ ownerDocument, styleElement, }: {
11
+ ownerDocument?: Document | undefined;
12
+ styleElement?: null | undefined;
13
+ });
14
+ _document: Document;
15
+ nativeFontFaces: Set<any>;
16
+ styleElement: HTMLStyleElement | null;
17
+ loadingRequests: any[] | undefined;
18
+ loadTestFontId: number | undefined;
19
+ addNativeFontFace(nativeFontFace: any): void;
20
+ removeNativeFontFace(nativeFontFace: any): void;
21
+ insertRule(rule: any): void;
22
+ clear(): void;
23
+ loadSystemFont({ systemFontInfo: info, disableFontFace, _inspectFont, }: {
24
+ systemFontInfo: any;
25
+ disableFontFace: any;
26
+ _inspectFont: any;
27
+ }): Promise<void>;
28
+ bind(font: any): Promise<void>;
29
+ get isFontLoadingAPISupported(): any;
30
+ get isSyncFontLoadingSupported(): any;
31
+ _queueLoadingCallback(callback: any): {
32
+ done: boolean;
33
+ complete: () => void;
34
+ callback: any;
35
+ };
36
+ get _loadTestFont(): any;
37
+ _prepareFontLoadEvent(font: any, request: any): void;
38
+ #private;
39
+ }
tools/ui/node_modules/pdfjs-dist/types/src/display/metadata.d.ts ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ export class Metadata {
2
+ constructor({ parsedData, rawData }: {
3
+ parsedData: any;
4
+ rawData: any;
5
+ });
6
+ getRaw(): any;
7
+ get(name: any): any;
8
+ [Symbol.iterator](): any;
9
+ #private;
10
+ }
tools/ui/node_modules/pdfjs-dist/types/src/display/network.d.ts ADDED
@@ -0,0 +1,86 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /** @implements {IPDFStream} */
2
+ export class PDFNetworkStream implements IPDFStream {
3
+ constructor(source: any);
4
+ _source: any;
5
+ _manager: NetworkManager;
6
+ _rangeChunkSize: any;
7
+ _fullRequestReader: PDFNetworkStreamFullRequestReader | null;
8
+ _rangeRequestReaders: any[];
9
+ _onRangeRequestReaderClosed(reader: any): void;
10
+ getFullReader(): PDFNetworkStreamFullRequestReader;
11
+ getRangeReader(begin: any, end: any): PDFNetworkStreamRangeRequestReader;
12
+ cancelAllRequests(reason: any): void;
13
+ }
14
+ declare class NetworkManager {
15
+ constructor({ url, httpHeaders, withCredentials }: {
16
+ url: any;
17
+ httpHeaders: any;
18
+ withCredentials: any;
19
+ });
20
+ _responseOrigin: null;
21
+ url: any;
22
+ isHttp: boolean;
23
+ headers: Headers;
24
+ withCredentials: any;
25
+ currXhrId: number;
26
+ pendingRequests: any;
27
+ request(args: any): number;
28
+ onProgress(xhrId: any, evt: any): void;
29
+ onStateChange(xhrId: any, evt: any): void;
30
+ getRequestXhr(xhrId: any): any;
31
+ isPendingRequest(xhrId: any): boolean;
32
+ abortRequest(xhrId: any): void;
33
+ }
34
+ /** @implements {IPDFStreamReader} */
35
+ declare class PDFNetworkStreamFullRequestReader implements IPDFStreamReader {
36
+ constructor(manager: any, source: any);
37
+ _manager: any;
38
+ _url: any;
39
+ _fullRequestId: any;
40
+ _headersCapability: any;
41
+ _disableRange: any;
42
+ _contentLength: any;
43
+ _rangeChunkSize: any;
44
+ _isStreamingSupported: boolean;
45
+ _isRangeSupported: boolean;
46
+ _cachedChunks: any[];
47
+ _requests: any[];
48
+ _done: boolean;
49
+ _storedError: import("../shared/util.js").ResponseException | undefined;
50
+ _filename: string | null;
51
+ onProgress: any;
52
+ _onHeadersReceived(): void;
53
+ _onDone(data: any): void;
54
+ _onError(status: any): void;
55
+ _onProgress(evt: any): void;
56
+ get filename(): string | null;
57
+ get isRangeSupported(): boolean;
58
+ get isStreamingSupported(): boolean;
59
+ get contentLength(): any;
60
+ get headersReady(): any;
61
+ read(): Promise<any>;
62
+ cancel(reason: any): void;
63
+ _fullRequestReader: any;
64
+ }
65
+ /** @implements {IPDFStreamRangeReader} */
66
+ declare class PDFNetworkStreamRangeRequestReader implements IPDFStreamRangeReader {
67
+ constructor(manager: any, begin: any, end: any);
68
+ _manager: any;
69
+ _url: any;
70
+ _requestId: any;
71
+ _requests: any[];
72
+ _queuedChunk: any;
73
+ _done: boolean;
74
+ _storedError: Error | undefined;
75
+ onProgress: any;
76
+ onClosed: any;
77
+ _onHeadersReceived(): void;
78
+ _close(): void;
79
+ _onDone(data: any): void;
80
+ _onError(status: any): void;
81
+ _onProgress(evt: any): void;
82
+ get isStreamingSupported(): boolean;
83
+ read(): Promise<any>;
84
+ cancel(reason: any): void;
85
+ }
86
+ export {};
tools/ui/node_modules/pdfjs-dist/types/src/display/network_utils.d.ts ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ export function createHeaders(isHttp: any, httpHeaders: any): Headers;
2
+ export function createResponseError(status: any, url: any): ResponseException;
3
+ export function extractFilenameFromHeader(responseHeaders: any): string | null;
4
+ export function getResponseOrigin(url: any): string | null;
5
+ export function validateRangeRequestCapabilities({ responseHeaders, isHttp, rangeChunkSize, disableRange, }: {
6
+ responseHeaders: any;
7
+ isHttp: any;
8
+ rangeChunkSize: any;
9
+ disableRange: any;
10
+ }): {
11
+ allowRangeRequests: boolean;
12
+ suggestedLength: undefined;
13
+ };
14
+ export function validateResponseStatus(status: any): boolean;
15
+ import { ResponseException } from "../shared/util.js";
tools/ui/node_modules/pdfjs-dist/types/src/display/node_stream.d.ts ADDED
@@ -0,0 +1,54 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ export class PDFNodeStream {
2
+ constructor(source: any);
3
+ source: any;
4
+ url: URL;
5
+ _fullRequestReader: PDFNodeStreamFsFullReader | null;
6
+ _rangeRequestReaders: any[];
7
+ get _progressiveDataLength(): number;
8
+ getFullReader(): PDFNodeStreamFsFullReader;
9
+ getRangeReader(start: any, end: any): PDFNodeStreamFsRangeReader | null;
10
+ cancelAllRequests(reason: any): void;
11
+ }
12
+ declare class PDFNodeStreamFsFullReader {
13
+ constructor(stream: any);
14
+ _url: any;
15
+ _done: boolean;
16
+ _storedError: any;
17
+ onProgress: any;
18
+ _contentLength: any;
19
+ _loaded: number;
20
+ _filename: any;
21
+ _disableRange: any;
22
+ _rangeChunkSize: any;
23
+ _isStreamingSupported: boolean;
24
+ _isRangeSupported: boolean;
25
+ _readableStream: any;
26
+ _readCapability: any;
27
+ _headersCapability: any;
28
+ get headersReady(): any;
29
+ get filename(): any;
30
+ get contentLength(): any;
31
+ get isRangeSupported(): boolean;
32
+ get isStreamingSupported(): boolean;
33
+ read(): any;
34
+ cancel(reason: any): void;
35
+ _error(reason: any): void;
36
+ _setReadableStream(readableStream: any): void;
37
+ }
38
+ declare class PDFNodeStreamFsRangeReader {
39
+ constructor(stream: any, start: any, end: any);
40
+ _url: any;
41
+ _done: boolean;
42
+ _storedError: any;
43
+ onProgress: any;
44
+ _loaded: number;
45
+ _readableStream: any;
46
+ _readCapability: any;
47
+ _isStreamingSupported: boolean;
48
+ get isStreamingSupported(): boolean;
49
+ read(): any;
50
+ cancel(reason: any): void;
51
+ _error(reason: any): void;
52
+ _setReadableStream(readableStream: any): void;
53
+ }
54
+ export {};
tools/ui/node_modules/pdfjs-dist/types/src/display/node_utils.d.ts ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ export function fetchData(url: any): Promise<Uint8Array<ArrayBuffer>>;
2
+ export class NodeCanvasFactory extends BaseCanvasFactory {
3
+ /**
4
+ * @ignore
5
+ */
6
+ _createCanvas(width: any, height: any): import("@napi-rs/canvas").Canvas;
7
+ }
8
+ export class NodeCMapReaderFactory extends BaseCMapReaderFactory {
9
+ /**
10
+ * @ignore
11
+ */
12
+ _fetch(url: any): Promise<Uint8Array<ArrayBuffer>>;
13
+ }
14
+ export class NodeFilterFactory extends BaseFilterFactory {
15
+ }
16
+ export class NodeStandardFontDataFactory extends BaseStandardFontDataFactory {
17
+ /**
18
+ * @ignore
19
+ */
20
+ _fetch(url: any): Promise<Uint8Array<ArrayBuffer>>;
21
+ }
22
+ export class NodeWasmFactory extends BaseWasmFactory {
23
+ /**
24
+ * @ignore
25
+ */
26
+ _fetch(url: any): Promise<Uint8Array<ArrayBuffer>>;
27
+ }
28
+ import { BaseCanvasFactory } from "./canvas_factory.js";
29
+ import { BaseCMapReaderFactory } from "./cmap_reader_factory.js";
30
+ import { BaseFilterFactory } from "./filter_factory.js";
31
+ import { BaseStandardFontDataFactory } from "./standard_fontdata_factory.js";
32
+ import { BaseWasmFactory } from "./wasm_factory.js";