pdfjs-serverless 1.0.1 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +14 -44
- package/dist/index.d.mts +1 -1
- package/dist/index.mjs +1 -1
- package/dist/types/src/display/annotation_layer.d.ts +49 -16
- package/dist/types/src/display/annotation_storage.d.ts +10 -8
- package/dist/types/src/display/api.d.ts +134 -126
- package/dist/types/src/display/api_utils.d.ts +13 -0
- package/dist/types/src/display/binary_data_factory.d.ts +26 -0
- package/dist/types/src/display/canvas.d.ts +97 -92
- package/dist/types/src/display/canvas_dependency_tracker.d.ts +216 -0
- package/dist/types/src/display/canvas_factory.d.ts +3 -1
- package/dist/types/src/display/display_utils.d.ts +27 -3
- package/dist/types/src/display/draw_layer.d.ts +2 -6
- package/dist/types/src/display/editor/alt_text.d.ts +1 -1
- package/dist/types/src/display/editor/annotation_editor_layer.d.ts +16 -19
- package/dist/types/src/display/editor/color_picker.d.ts +20 -1
- package/dist/types/src/display/editor/comment.d.ts +59 -0
- package/dist/types/src/display/editor/draw.d.ts +4 -8
- package/dist/types/src/display/editor/drawers/freedraw.d.ts +4 -3
- package/dist/types/src/display/editor/drawers/highlight.d.ts +2 -1
- package/dist/types/src/display/editor/drawers/signaturedraw.d.ts +13 -13
- package/dist/types/src/display/editor/editor.d.ts +119 -15
- package/dist/types/src/display/editor/freetext.d.ts +11 -7
- package/dist/types/src/display/editor/highlight.d.ts +8 -3
- package/dist/types/src/display/editor/ink.d.ts +5 -0
- package/dist/types/src/display/editor/signature.d.ts +2 -5
- package/dist/types/src/display/editor/stamp.d.ts +3 -1
- package/dist/types/src/display/editor/toolbar.d.ts +8 -3
- package/dist/types/src/display/editor/tools.d.ts +72 -6
- package/dist/types/src/display/fetch_stream.d.ts +3 -56
- package/dist/types/src/display/font_loader.d.ts +28 -1
- package/dist/types/src/display/network.d.ts +14 -80
- package/dist/types/src/display/network_stream.d.ts +2 -0
- package/dist/types/src/display/network_utils.d.ts +3 -3
- package/dist/types/src/display/node_stream.d.ts +2 -52
- package/dist/types/src/display/node_utils.d.ts +5 -19
- package/dist/types/src/display/obj_bin_transform_display.d.ts +67 -0
- package/dist/types/src/display/pages_mapper.d.ts +72 -0
- package/dist/types/src/display/pattern_helper.d.ts +9 -4
- package/dist/types/src/display/pdf_objects.d.ts +40 -0
- package/dist/types/src/display/text_layer.d.ts +16 -10
- package/dist/types/src/display/text_layer_images.d.ts +10 -0
- package/dist/types/src/display/transport_stream.d.ts +8 -64
- package/dist/types/src/display/webgpu_mesh.d.ts +3 -0
- package/dist/types/src/display/worker_options.d.ts +2 -2
- package/dist/types/src/display/xfa_layer.d.ts +3 -3
- package/dist/types/src/pdf.d.ts +11 -2
- package/dist/types/src/{interfaces.d.ts → shared/base_pdf_stream.d.ts} +26 -27
- package/dist/types/src/shared/obj_bin_transform_utils.d.ts +26 -0
- package/dist/types/src/shared/scripting_utils.d.ts +2 -0
- package/dist/types/src/shared/util.d.ts +21 -8
- package/dist/types/web/annotation_editor_layer_builder.d.ts +7 -8
- package/dist/types/web/annotation_layer_builder.d.ts +18 -23
- package/dist/types/web/app_options.d.ts +1 -1
- package/dist/types/web/autolinker.d.ts +3 -2
- package/dist/types/web/base_download_manager.d.ts +24 -0
- package/dist/types/web/base_pdf_page_view.d.ts +7 -6
- package/dist/types/web/comment_manager.d.ts +20 -0
- package/dist/types/web/download_manager.d.ts +3 -12
- package/dist/types/web/draw_layer_builder.d.ts +0 -12
- package/dist/types/web/event_utils.d.ts +1 -1
- package/dist/types/web/genericl10n.d.ts +6 -10
- package/dist/types/web/l10n.d.ts +3 -6
- package/dist/types/web/menu.d.ts +11 -0
- package/dist/types/web/pdf_find_controller.d.ts +10 -12
- package/dist/types/web/pdf_history.d.ts +3 -3
- package/dist/types/web/pdf_link_service.d.ts +10 -7
- package/dist/types/web/pdf_page_detail_view.d.ts +2 -7
- package/dist/types/web/pdf_page_view.d.ts +39 -17
- package/dist/types/web/pdf_rendering_queue.d.ts +10 -14
- package/dist/types/web/pdf_thumbnail_view.d.ts +18 -50
- package/dist/types/web/pdf_thumbnail_viewer.d.ts +57 -13
- package/dist/types/web/pdf_viewer.component.d.ts +1 -1
- package/dist/types/web/pdf_viewer.d.ts +95 -29
- package/dist/types/web/renderable_view.d.ts +33 -0
- package/dist/types/web/sidebar.d.ts +65 -0
- package/dist/types/web/struct_tree_layer_builder.d.ts +1 -1
- package/dist/types/web/text_accessibility.d.ts +1 -1
- package/dist/types/web/text_layer_builder.d.ts +11 -6
- package/dist/types/web/ui_utils.d.ts +3 -11
- package/dist/types/web/xfa_layer_builder.d.ts +4 -4
- package/package.json +18 -15
- package/dist/types/src/display/cmap_reader_factory.d.ts +0 -25
- package/dist/types/src/display/standard_fontdata_factory.d.ts +0 -20
- package/dist/types/src/display/wasm_factory.d.ts +0 -20
- package/dist/types/web/interfaces.d.ts +0 -167
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
export type PDFPageProxy = import("./api").PDFPageProxy;
|
|
2
2
|
export type PageViewport = import("./display_utils").PageViewport;
|
|
3
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
4
|
export type AnnotationEditorUIManager = any;
|
|
7
5
|
export type StructTreeLayerBuilder = import("../../web/struct_tree_layer_builder.js").StructTreeLayerBuilder;
|
|
6
|
+
export type CommentManager = import("../../web/comment_manager.js").CommentManager;
|
|
7
|
+
export type PDFLinkService = import("../../web/pdf_link_service.js").PDFLinkService;
|
|
8
|
+
export type BaseDownloadManager = import("../../web/base_download_manager.js").BaseDownloadManager;
|
|
8
9
|
export type AnnotationElementParameters = {
|
|
9
10
|
data: Object;
|
|
10
11
|
layer: HTMLDivElement;
|
|
11
|
-
linkService:
|
|
12
|
-
downloadManager?: import("../../web/
|
|
12
|
+
linkService: PDFLinkService;
|
|
13
|
+
downloadManager?: import("../../web/base_download_manager.js").BaseDownloadManager | undefined;
|
|
13
14
|
annotationStorage?: AnnotationStorage | undefined;
|
|
14
15
|
/**
|
|
15
16
|
* - Path for image resources, mainly
|
|
@@ -27,8 +28,8 @@ export type AnnotationLayerParameters = {
|
|
|
27
28
|
div: HTMLDivElement;
|
|
28
29
|
annotations: any[];
|
|
29
30
|
page: PDFPageProxy;
|
|
30
|
-
linkService:
|
|
31
|
-
downloadManager?: import("../../web/
|
|
31
|
+
linkService: PDFLinkService;
|
|
32
|
+
downloadManager?: import("../../web/base_download_manager.js").BaseDownloadManager | undefined;
|
|
32
33
|
annotationStorage?: AnnotationStorage | undefined;
|
|
33
34
|
/**
|
|
34
35
|
* - Path for image resources, mainly
|
|
@@ -52,6 +53,10 @@ export type AnnotationLayerParameters = {
|
|
|
52
53
|
accessibilityManager?: import("../../web/text_accessibility.js").TextAccessibilityManager | undefined;
|
|
53
54
|
annotationEditorUIManager?: AnnotationEditorUIManager;
|
|
54
55
|
structTreeLayer?: import("../../web/struct_tree_layer_builder.js").StructTreeLayerBuilder | undefined;
|
|
56
|
+
/**
|
|
57
|
+
* - The comment manager instance.
|
|
58
|
+
*/
|
|
59
|
+
commentManager?: import("../../web/comment_manager.js").CommentManager | undefined;
|
|
55
60
|
};
|
|
56
61
|
/**
|
|
57
62
|
* @typedef {Object} AnnotationLayerParameters
|
|
@@ -59,8 +64,8 @@ export type AnnotationLayerParameters = {
|
|
|
59
64
|
* @property {HTMLDivElement} div
|
|
60
65
|
* @property {Array} annotations
|
|
61
66
|
* @property {PDFPageProxy} page
|
|
62
|
-
* @property {
|
|
63
|
-
* @property {
|
|
67
|
+
* @property {PDFLinkService} linkService
|
|
68
|
+
* @property {BaseDownloadManager} [downloadManager]
|
|
64
69
|
* @property {AnnotationStorage} [annotationStorage]
|
|
65
70
|
* @property {string} [imageResourcesPath] - Path for image resources, mainly
|
|
66
71
|
* for annotation icons. Include trailing slash.
|
|
@@ -73,6 +78,7 @@ export type AnnotationLayerParameters = {
|
|
|
73
78
|
* @property {TextAccessibilityManager} [accessibilityManager]
|
|
74
79
|
* @property {AnnotationEditorUIManager} [annotationEditorUIManager]
|
|
75
80
|
* @property {StructTreeLayerBuilder} [structTreeLayer]
|
|
81
|
+
* @property {CommentManager} [commentManager] - The comment manager instance.
|
|
76
82
|
*/
|
|
77
83
|
/**
|
|
78
84
|
* Manage the layer containing all the annotations.
|
|
@@ -82,7 +88,7 @@ export class AnnotationLayer {
|
|
|
82
88
|
* @private
|
|
83
89
|
*/
|
|
84
90
|
private static get _defaultBorderStyle();
|
|
85
|
-
constructor({ div, accessibilityManager, annotationCanvasMap, annotationEditorUIManager, page, viewport, structTreeLayer, }: {
|
|
91
|
+
constructor({ div, accessibilityManager, annotationCanvasMap, annotationEditorUIManager, page, viewport, structTreeLayer, commentManager, linkService, annotationStorage, }: {
|
|
86
92
|
div: any;
|
|
87
93
|
accessibilityManager: any;
|
|
88
94
|
annotationCanvasMap: any;
|
|
@@ -90,12 +96,16 @@ export class AnnotationLayer {
|
|
|
90
96
|
page: any;
|
|
91
97
|
viewport: any;
|
|
92
98
|
structTreeLayer: any;
|
|
99
|
+
commentManager: any;
|
|
100
|
+
linkService: any;
|
|
101
|
+
annotationStorage: any;
|
|
93
102
|
});
|
|
94
103
|
div: any;
|
|
95
104
|
page: any;
|
|
96
105
|
viewport: any;
|
|
97
106
|
zIndex: number;
|
|
98
107
|
_annotationEditorUIManager: any;
|
|
108
|
+
_commentManager: any;
|
|
99
109
|
popupShow: any[] | undefined;
|
|
100
110
|
hasEditableAnnotations(): boolean;
|
|
101
111
|
/**
|
|
@@ -109,10 +119,8 @@ export class AnnotationLayer {
|
|
|
109
119
|
* Add link annotations to the annotation layer.
|
|
110
120
|
*
|
|
111
121
|
* @param {Array<Object>} annotations
|
|
112
|
-
* @param {IPDFLinkService} linkService
|
|
113
|
-
* @memberof AnnotationLayer
|
|
114
122
|
*/
|
|
115
|
-
addLinkAnnotations(annotations: Array<Object
|
|
123
|
+
addLinkAnnotations(annotations: Array<Object>): Promise<void>;
|
|
116
124
|
/**
|
|
117
125
|
* Update the annotation elements on existing annotation layer.
|
|
118
126
|
*
|
|
@@ -120,8 +128,12 @@ export class AnnotationLayer {
|
|
|
120
128
|
* @memberof AnnotationLayer
|
|
121
129
|
*/
|
|
122
130
|
update({ viewport }: AnnotationLayerParameters): void;
|
|
123
|
-
getEditableAnnotations(): any
|
|
131
|
+
getEditableAnnotations(): MapIterator<any>;
|
|
124
132
|
getEditableAnnotation(id: any): any;
|
|
133
|
+
addFakeAnnotation(editor: any): EditorAnnotationElement;
|
|
134
|
+
removeAnnotation(id: any): void;
|
|
135
|
+
updateFakeAnnotations(editors: any): void;
|
|
136
|
+
togglePointerEvents(enabled?: boolean): void;
|
|
125
137
|
#private;
|
|
126
138
|
}
|
|
127
139
|
export class FreeTextAnnotationElement extends AnnotationElement {
|
|
@@ -151,9 +163,15 @@ export class StampAnnotationElement extends AnnotationElement {
|
|
|
151
163
|
render(): HTMLElement | undefined;
|
|
152
164
|
}
|
|
153
165
|
import { AnnotationStorage } from "./annotation_storage.js";
|
|
166
|
+
declare class EditorAnnotationElement extends AnnotationElement {
|
|
167
|
+
constructor(parameters: any);
|
|
168
|
+
editor: any;
|
|
169
|
+
render(): HTMLElement | undefined;
|
|
170
|
+
createOrUpdatePopup(): void;
|
|
171
|
+
remove(): void;
|
|
172
|
+
}
|
|
154
173
|
declare class AnnotationElement {
|
|
155
|
-
static _hasPopupData({
|
|
156
|
-
titleObj: any;
|
|
174
|
+
static _hasPopupData({ contentsObj, richText }: {
|
|
157
175
|
contentsObj: any;
|
|
158
176
|
richText: any;
|
|
159
177
|
}): boolean;
|
|
@@ -171,13 +189,24 @@ declare class AnnotationElement {
|
|
|
171
189
|
renderForms: any;
|
|
172
190
|
svgFactory: any;
|
|
173
191
|
annotationStorage: any;
|
|
192
|
+
enableComment: any;
|
|
174
193
|
enableScripting: any;
|
|
175
194
|
hasJSActions: any;
|
|
176
195
|
_fieldObjects: any;
|
|
177
196
|
parent: any;
|
|
197
|
+
hasOwnCommentButton: boolean;
|
|
198
|
+
contentElement: HTMLElement | undefined;
|
|
178
199
|
container: HTMLElement | undefined;
|
|
179
200
|
get _isEditable(): any;
|
|
180
|
-
get hasPopupData():
|
|
201
|
+
get hasPopupData(): any;
|
|
202
|
+
get commentData(): any;
|
|
203
|
+
get hasCommentButton(): any;
|
|
204
|
+
get commentButtonPosition(): any;
|
|
205
|
+
_normalizePoint(point: any): any;
|
|
206
|
+
set commentText(text: any);
|
|
207
|
+
get commentText(): any;
|
|
208
|
+
removePopup(): void;
|
|
209
|
+
popup: any;
|
|
181
210
|
updateEdited(params: any): void;
|
|
182
211
|
resetEdited(): void;
|
|
183
212
|
/**
|
|
@@ -205,10 +234,14 @@ declare class AnnotationElement {
|
|
|
205
234
|
* annotations that do not have a Popup entry in the dictionary, but
|
|
206
235
|
* are of a type that works with popups (such as Highlight annotations).
|
|
207
236
|
*
|
|
237
|
+
* @param {Object} [popupData] - The data for the popup, if any.
|
|
238
|
+
*
|
|
208
239
|
* @private
|
|
209
240
|
* @memberof AnnotationElement
|
|
210
241
|
*/
|
|
211
242
|
private _createPopup;
|
|
243
|
+
get hasPopupElement(): boolean;
|
|
244
|
+
get extraPopupElement(): null;
|
|
212
245
|
/**
|
|
213
246
|
* Render the annotation's HTML element(s).
|
|
214
247
|
*
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
* Key/value storage for annotation data in forms.
|
|
3
3
|
*/
|
|
4
4
|
export class AnnotationStorage {
|
|
5
|
-
onSetModified:
|
|
6
|
-
onResetModified:
|
|
7
|
-
onAnnotationEditor:
|
|
5
|
+
onSetModified: null;
|
|
6
|
+
onResetModified: null;
|
|
7
|
+
onAnnotationEditor: null;
|
|
8
8
|
/**
|
|
9
9
|
* Get the value for a given key if it exists, or return the default value.
|
|
10
10
|
* @param {string} key
|
|
@@ -56,6 +56,8 @@ export class AnnotationStorage {
|
|
|
56
56
|
};
|
|
57
57
|
get editorStats(): any;
|
|
58
58
|
resetModifiedIds(): void;
|
|
59
|
+
updateEditor(annotationId: any, data: any): boolean;
|
|
60
|
+
getEditor(annotationId: any): any;
|
|
59
61
|
/**
|
|
60
62
|
* @returns {{ids: Set<string>, hash: string}}
|
|
61
63
|
*/
|
|
@@ -77,11 +79,11 @@ export class PrintAnnotationStorage extends AnnotationStorage {
|
|
|
77
79
|
* PLEASE NOTE: Only intended for usage within the API itself.
|
|
78
80
|
* @ignore
|
|
79
81
|
*/
|
|
80
|
-
get serializable(): {
|
|
81
|
-
map:
|
|
82
|
-
hash:
|
|
83
|
-
transfer:
|
|
84
|
-
}
|
|
82
|
+
get serializable(): Readonly<{
|
|
83
|
+
map: null;
|
|
84
|
+
hash: "";
|
|
85
|
+
transfer: undefined;
|
|
86
|
+
}>;
|
|
85
87
|
get modifiedIds(): any;
|
|
86
88
|
#private;
|
|
87
89
|
}
|