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
|
@@ -31,6 +31,8 @@ export class SignatureEditor extends DrawingEditor {
|
|
|
31
31
|
areContours: any;
|
|
32
32
|
outline: InkDrawOutline;
|
|
33
33
|
};
|
|
34
|
+
/** @inheritdoc */
|
|
35
|
+
get toolbarButtons(): any[][] | null;
|
|
34
36
|
addSignature(data: any, heightInPage: any, description: any, uuid: any): void;
|
|
35
37
|
getFromImage(bitmap: any): {
|
|
36
38
|
outline: InkDrawOutline;
|
|
@@ -64,15 +66,10 @@ export class SignatureEditor extends DrawingEditor {
|
|
|
64
66
|
_drawingOptions: any;
|
|
65
67
|
/** @inheritdoc */
|
|
66
68
|
serialize(isForCopying?: boolean): {
|
|
67
|
-
annotationType: number;
|
|
68
69
|
isSignature: boolean;
|
|
69
70
|
areContours: boolean;
|
|
70
71
|
color: number[];
|
|
71
72
|
thickness: any;
|
|
72
|
-
pageIndex: number;
|
|
73
|
-
rect: any;
|
|
74
|
-
rotation: number;
|
|
75
|
-
structTreeParentId: any;
|
|
76
73
|
} | null;
|
|
77
74
|
#private;
|
|
78
75
|
}
|
|
@@ -26,6 +26,8 @@ export class StampEditor extends AnnotationEditor {
|
|
|
26
26
|
mlGuessAltText(imageData?: null, updateAltTextData?: boolean): Promise<any>;
|
|
27
27
|
/** @inheritdoc */
|
|
28
28
|
onceAdded(focus: any): void;
|
|
29
|
+
/** @inheritdoc */
|
|
30
|
+
get toolbarButtons(): (string | object)[][];
|
|
29
31
|
setCanvas(annotationElementId: any, canvas: any): void;
|
|
30
32
|
onScaleChanging(): void;
|
|
31
33
|
copyCanvas(maxDataDimension: any, maxPreviewDimension: any, createImageData?: boolean): {
|
|
@@ -35,7 +37,7 @@ export class StampEditor extends AnnotationEditor {
|
|
|
35
37
|
imageData: {
|
|
36
38
|
width: any;
|
|
37
39
|
height: any;
|
|
38
|
-
data:
|
|
40
|
+
data: ImageDataArray;
|
|
39
41
|
} | null;
|
|
40
42
|
};
|
|
41
43
|
/** @inheritdoc */
|
|
@@ -1,19 +1,24 @@
|
|
|
1
1
|
export class EditorToolbar {
|
|
2
|
-
static "__#
|
|
3
|
-
static "__#
|
|
2
|
+
static "__#private@#l10nRemove": null;
|
|
3
|
+
static "__#private@#pointerDown"(e: any): void;
|
|
4
4
|
constructor(editor: any);
|
|
5
5
|
render(): HTMLDivElement;
|
|
6
6
|
get div(): null;
|
|
7
7
|
hide(): void;
|
|
8
8
|
show(): void;
|
|
9
|
+
addDeleteButton(): void;
|
|
9
10
|
addAltText(altText: any): Promise<void>;
|
|
11
|
+
addComment(comment: any, beforeElement?: null): void;
|
|
10
12
|
addColorPicker(colorPicker: any): void;
|
|
11
13
|
addEditSignatureButton(signatureManager: any): Promise<void>;
|
|
14
|
+
removeButton(name: any): void;
|
|
15
|
+
addButton(name: any, tool: any): Promise<void>;
|
|
16
|
+
addButtonBefore(name: any, tool: any, beforeSelector: any): Promise<void>;
|
|
12
17
|
updateEditSignatureButton(description: any): void;
|
|
13
18
|
remove(): void;
|
|
14
19
|
#private;
|
|
15
20
|
}
|
|
16
|
-
export class
|
|
21
|
+
export class FloatingToolbar {
|
|
17
22
|
constructor(uiManager: any);
|
|
18
23
|
show(parent: any, boxes: any, isLTR: any): void;
|
|
19
24
|
hide(): void;
|
|
@@ -12,7 +12,7 @@ export class AnnotationEditorUIManager {
|
|
|
12
12
|
static TRANSLATE_SMALL: number;
|
|
13
13
|
static TRANSLATE_BIG: number;
|
|
14
14
|
static get _keyboardManager(): any;
|
|
15
|
-
constructor(container: any, viewer: any, altTextManager: any, signatureManager: any, eventBus: any, pdfDocument: any, pageColors: any, highlightColors: any, enableHighlightFloatingButton: any, enableUpdatedAddImage: any, enableNewAltTextWhenAddingImage: any, mlManager: any, editorUndoBar: any, supportsPinchToZoom: 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
16
|
_editorUndoBar: null;
|
|
17
17
|
_signal: AbortSignal;
|
|
18
18
|
_eventBus: any;
|
|
@@ -29,8 +29,11 @@ export class AnnotationEditorUIManager {
|
|
|
29
29
|
get useNewAltTextWhenAddingImage(): boolean;
|
|
30
30
|
get hcmFilter(): any;
|
|
31
31
|
get direction(): any;
|
|
32
|
+
get _highlightColors(): any;
|
|
32
33
|
get highlightColors(): any;
|
|
33
34
|
get highlightColorNames(): any;
|
|
35
|
+
getNonHCMColor(color: any): any;
|
|
36
|
+
getNonHCMColorName(color: any): any;
|
|
34
37
|
/**
|
|
35
38
|
* Set the current drawing session.
|
|
36
39
|
* @param {AnnotationEditorLayer} layer
|
|
@@ -38,6 +41,22 @@ export class AnnotationEditorUIManager {
|
|
|
38
41
|
setCurrentDrawingSession(layer: AnnotationEditorLayer): void;
|
|
39
42
|
setMainHighlightColorPicker(colorPicker: any): void;
|
|
40
43
|
editAltText(editor: any, firstTime?: boolean): void;
|
|
44
|
+
hasCommentManager(): boolean;
|
|
45
|
+
editComment(editor: any, posX: any, posY: any, options: any): void;
|
|
46
|
+
selectComment(pageIndex: any, uid: any): void;
|
|
47
|
+
updateComment(editor: any): void;
|
|
48
|
+
updatePopupColor(editor: any): void;
|
|
49
|
+
removeComment(editor: any): void;
|
|
50
|
+
/**
|
|
51
|
+
* Delete a comment from an editor with undo support.
|
|
52
|
+
* @param {AnnotationEditor} editor - The editor whose comment to delete.
|
|
53
|
+
* @param {Object} savedData - The comment data to save for undo.
|
|
54
|
+
*/
|
|
55
|
+
deleteComment(editor: AnnotationEditor, savedData: Object): void;
|
|
56
|
+
toggleComment(editor: any, isSelected: any, visibility?: undefined): void;
|
|
57
|
+
makeCommentColor(color: any, opacity: any): any;
|
|
58
|
+
getCommentDialogElement(): any;
|
|
59
|
+
waitForEditorsRendered(pageNumber: any): Promise<void>;
|
|
41
60
|
getSignature(editor: any): void;
|
|
42
61
|
get signatureManager(): null;
|
|
43
62
|
switchToMode(mode: any, callback: any): void;
|
|
@@ -49,6 +68,7 @@ export class AnnotationEditorUIManager {
|
|
|
49
68
|
onPageChanging({ pageNumber }: {
|
|
50
69
|
pageNumber: any;
|
|
51
70
|
}): void;
|
|
71
|
+
deletePage(id: any): void;
|
|
52
72
|
focusMainContainer(): void;
|
|
53
73
|
findParent(x: any, y: any): any;
|
|
54
74
|
disableUserSelect(value?: boolean): void;
|
|
@@ -60,12 +80,23 @@ export class AnnotationEditorUIManager {
|
|
|
60
80
|
onRotationChanging({ pagesRotation }: {
|
|
61
81
|
pagesRotation: any;
|
|
62
82
|
}): void;
|
|
63
|
-
highlightSelection(methodOfCreation?: string): void;
|
|
83
|
+
highlightSelection(methodOfCreation?: string, comment?: boolean): void;
|
|
84
|
+
commentSelection(methodOfCreation?: string): void;
|
|
85
|
+
/**
|
|
86
|
+
* Some annotations may have been modified in the annotation layer
|
|
87
|
+
* (e.g. comments added or modified).
|
|
88
|
+
* So this function retrieves the data from the storage and removes
|
|
89
|
+
* them from the storage in order to be able to save them later.
|
|
90
|
+
* @param {string} annotationId
|
|
91
|
+
* @returns {Object|null} The data associated to the annotation or null.
|
|
92
|
+
*/
|
|
93
|
+
getAndRemoveDataFromAnnotationStorage(annotationId: string): Object | null;
|
|
64
94
|
/**
|
|
65
95
|
* Add an editor in the annotation storage.
|
|
66
96
|
* @param {AnnotationEditor} editor
|
|
67
97
|
*/
|
|
68
98
|
addToAnnotationStorage(editor: AnnotationEditor): void;
|
|
99
|
+
a11yAlert(messageId: any, args?: null): void;
|
|
69
100
|
blur(): void;
|
|
70
101
|
focus(): void;
|
|
71
102
|
addEditListeners(): void;
|
|
@@ -109,6 +140,11 @@ export class AnnotationEditorUIManager {
|
|
|
109
140
|
onEditingAction({ name }: {
|
|
110
141
|
name: any;
|
|
111
142
|
}): void;
|
|
143
|
+
updatePageIndex(oldPageIndex: any, newPageIndex: any): void;
|
|
144
|
+
startUpdatePages(): void;
|
|
145
|
+
endUpdatePages(): void;
|
|
146
|
+
clonePage(pageIndex: any, newPageIndex: any): void;
|
|
147
|
+
findClonesForPage(layer: any): Promise<any[]>;
|
|
112
148
|
/**
|
|
113
149
|
* Set the editing state.
|
|
114
150
|
* It can be useful to temporarily disable it when the user is editing a
|
|
@@ -139,17 +175,24 @@ export class AnnotationEditorUIManager {
|
|
|
139
175
|
* Change the editor mode (None, FreeText, Ink, ...)
|
|
140
176
|
* @param {number} mode
|
|
141
177
|
* @param {string|null} editId
|
|
178
|
+
* @param {boolean} [isFromUser] - true if the mode change is due to a
|
|
179
|
+
* user action.
|
|
142
180
|
* @param {boolean} [isFromKeyboard] - true if the mode change is due to a
|
|
143
181
|
* keyboard action.
|
|
182
|
+
* @param {boolean} [mustEnterInEditMode] - true if the editor must enter in
|
|
183
|
+
* edit mode.
|
|
184
|
+
* @param {boolean} [editComment] - true if the mode change is due to a
|
|
185
|
+
* comment edit.
|
|
144
186
|
*/
|
|
145
|
-
updateMode(mode: number, editId?: string | null, isFromKeyboard?: boolean): Promise<void>;
|
|
187
|
+
updateMode(mode: number, editId?: string | null, isFromUser?: boolean, isFromKeyboard?: boolean, mustEnterInEditMode?: boolean, editComment?: boolean): Promise<void>;
|
|
146
188
|
addNewEditorFromKeyboard(): void;
|
|
147
189
|
/**
|
|
148
190
|
* Update the toolbar if it's required to reflect the tool currently used.
|
|
191
|
+
* @param {Object} options
|
|
149
192
|
* @param {number} mode
|
|
150
193
|
* @returns {undefined}
|
|
151
194
|
*/
|
|
152
|
-
updateToolbar(
|
|
195
|
+
updateToolbar(options: Object): undefined;
|
|
153
196
|
/**
|
|
154
197
|
* Update a parameter in the current editor or globally.
|
|
155
198
|
* @param {number} type
|
|
@@ -161,9 +204,9 @@ export class AnnotationEditorUIManager {
|
|
|
161
204
|
/**
|
|
162
205
|
* Get all the editors belonging to a given page.
|
|
163
206
|
* @param {number} pageIndex
|
|
164
|
-
* @
|
|
207
|
+
* @yields {AnnotationEditor}
|
|
165
208
|
*/
|
|
166
|
-
getEditors(pageIndex: number):
|
|
209
|
+
getEditors(pageIndex: number): Generator<any, void, unknown>;
|
|
167
210
|
/**
|
|
168
211
|
* Get an editor with the given id.
|
|
169
212
|
* @param {string} id
|
|
@@ -297,6 +340,7 @@ export class AnnotationEditorUIManager {
|
|
|
297
340
|
* @returns {number}
|
|
298
341
|
*/
|
|
299
342
|
getMode(): number;
|
|
343
|
+
isEditingMode(): boolean;
|
|
300
344
|
get imageManager(): any;
|
|
301
345
|
getSelectionBoxes(textLayer: any): {
|
|
302
346
|
x: number;
|
|
@@ -391,6 +435,28 @@ export class CommandManager {
|
|
|
391
435
|
destroy(): void;
|
|
392
436
|
#private;
|
|
393
437
|
}
|
|
438
|
+
/**
|
|
439
|
+
* Class to store current pointers used by the editor to be able to handle
|
|
440
|
+
* multiple pointers (e.g. two fingers, a pen, a mouse, ...).
|
|
441
|
+
*/
|
|
442
|
+
export class CurrentPointers {
|
|
443
|
+
static "__#private@#pointerId": number;
|
|
444
|
+
static "__#private@#pointerIds": null;
|
|
445
|
+
static "__#private@#moveTimestamp": number;
|
|
446
|
+
static "__#private@#pointerType": null;
|
|
447
|
+
static initializeAndAddPointerId(pointerId: any): void;
|
|
448
|
+
static setPointer(pointerType: any, pointerId: any): void;
|
|
449
|
+
static setTimeStamp(timeStamp: any): void;
|
|
450
|
+
static isSamePointerId(pointerId: any): boolean;
|
|
451
|
+
static isSamePointerIdOrRemove(pointerId: any): boolean;
|
|
452
|
+
static isSamePointerType(pointerType: any): boolean;
|
|
453
|
+
static isInitializedAndDifferentPointerType(pointerType: any): boolean;
|
|
454
|
+
static isSameTimeStamp(timeStamp: any): boolean;
|
|
455
|
+
static isUsingMultiplePointers(): boolean;
|
|
456
|
+
static clearPointerType(): void;
|
|
457
|
+
static clearPointerIds(): void;
|
|
458
|
+
static clearTimeStamp(): void;
|
|
459
|
+
}
|
|
394
460
|
/**
|
|
395
461
|
* Class to handle the different keyboards shortcuts we can have on mac or
|
|
396
462
|
* non-mac OSes.
|
|
@@ -1,60 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
export class PDFFetchStream
|
|
1
|
+
export function getArrayBuffer(val: any): ArrayBufferLike;
|
|
2
|
+
export class PDFFetchStream extends BasePDFStream {
|
|
3
3
|
constructor(source: any);
|
|
4
4
|
_responseOrigin: null;
|
|
5
|
-
source: any;
|
|
6
|
-
isHttp: boolean;
|
|
7
5
|
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
6
|
}
|
|
15
|
-
|
|
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 {};
|
|
7
|
+
import { BasePDFStream } from "../shared/base_pdf_stream.js";
|
|
@@ -1,10 +1,37 @@
|
|
|
1
1
|
export class FontFaceObject {
|
|
2
|
-
constructor(translatedData: any, inspectFont
|
|
2
|
+
constructor(translatedData: any, inspectFont: null | undefined, charProcOperatorList: any, extra: any);
|
|
3
3
|
compiledGlyphs: any;
|
|
4
4
|
_inspectFont: any;
|
|
5
|
+
charProcOperatorList: any;
|
|
5
6
|
createNativeFontFace(): FontFace | null;
|
|
6
7
|
createFontFaceRule(): string | null;
|
|
7
8
|
getPathGenerator(objs: any, character: any): any;
|
|
9
|
+
get black(): any;
|
|
10
|
+
get bold(): any;
|
|
11
|
+
set disableFontFace(value: any);
|
|
12
|
+
get disableFontFace(): any;
|
|
13
|
+
get fontExtraProperties(): any;
|
|
14
|
+
get isInvalidPDFjsFont(): any;
|
|
15
|
+
get isType3Font(): any;
|
|
16
|
+
get italic(): any;
|
|
17
|
+
get missingFile(): any;
|
|
18
|
+
get remeasure(): any;
|
|
19
|
+
get vertical(): any;
|
|
20
|
+
get ascent(): any;
|
|
21
|
+
get defaultWidth(): any;
|
|
22
|
+
get descent(): any;
|
|
23
|
+
get bbox(): any;
|
|
24
|
+
get fontMatrix(): any;
|
|
25
|
+
get fallbackName(): any;
|
|
26
|
+
get loadedName(): any;
|
|
27
|
+
get mimetype(): any;
|
|
28
|
+
get name(): any;
|
|
29
|
+
get data(): any;
|
|
30
|
+
clearData(): void;
|
|
31
|
+
get cssFontInfo(): any;
|
|
32
|
+
get systemFontInfo(): any;
|
|
33
|
+
get defaultVMetrics(): any;
|
|
34
|
+
#private;
|
|
8
35
|
}
|
|
9
36
|
export class FontLoader {
|
|
10
37
|
constructor({ ownerDocument, styleElement, }: {
|
|
@@ -1,86 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
export class PDFNetworkStream implements IPDFStream {
|
|
1
|
+
export class PDFNetworkStream extends BasePDFStream {
|
|
3
2
|
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
3
|
_responseOrigin: null;
|
|
21
4
|
url: any;
|
|
22
5
|
isHttp: boolean;
|
|
23
6
|
headers: Headers;
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
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;
|
|
7
|
+
/**
|
|
8
|
+
* @ignore
|
|
9
|
+
*/
|
|
10
|
+
_request(args: any): XMLHttpRequest;
|
|
11
|
+
/**
|
|
12
|
+
* Abort the request, if it's pending.
|
|
13
|
+
* @ignore
|
|
14
|
+
*/
|
|
15
|
+
_abortRequest(xhr: any): void;
|
|
16
|
+
getRangeReader(begin: any, end: any): BasePDFStreamRangeReader;
|
|
17
|
+
#private;
|
|
85
18
|
}
|
|
86
|
-
|
|
19
|
+
import { BasePDFStream } from "../shared/base_pdf_stream.js";
|
|
20
|
+
import { BasePDFStreamRangeReader } from "../shared/base_pdf_stream.js";
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export function createHeaders(isHttp: any, httpHeaders: any): Headers;
|
|
2
2
|
export function createResponseError(status: any, url: any): ResponseException;
|
|
3
|
+
export function ensureResponseOrigin(rangeOrigin: any, origin: any): void;
|
|
3
4
|
export function extractFilenameFromHeader(responseHeaders: any): string | null;
|
|
4
5
|
export function getResponseOrigin(url: any): string | null;
|
|
5
6
|
export function validateRangeRequestCapabilities({ responseHeaders, isHttp, rangeChunkSize, disableRange, }: {
|
|
@@ -8,8 +9,7 @@ export function validateRangeRequestCapabilities({ responseHeaders, isHttp, rang
|
|
|
8
9
|
rangeChunkSize: any;
|
|
9
10
|
disableRange: any;
|
|
10
11
|
}): {
|
|
11
|
-
|
|
12
|
-
|
|
12
|
+
contentLength: number;
|
|
13
|
+
isRangeSupported: boolean;
|
|
13
14
|
};
|
|
14
|
-
export function validateResponseStatus(status: any): boolean;
|
|
15
15
|
import { ResponseException } from "../shared/util.js";
|
|
@@ -1,54 +1,4 @@
|
|
|
1
|
-
export class PDFNodeStream {
|
|
1
|
+
export class PDFNodeStream extends BasePDFStream {
|
|
2
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
3
|
}
|
|
12
|
-
|
|
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 {};
|
|
4
|
+
import { BasePDFStream } from "../shared/base_pdf_stream.js";
|
|
@@ -1,32 +1,18 @@
|
|
|
1
1
|
export function fetchData(url: any): Promise<Uint8Array<ArrayBuffer>>;
|
|
2
|
-
export class
|
|
2
|
+
export class NodeBinaryDataFactory extends BaseBinaryDataFactory {
|
|
3
3
|
/**
|
|
4
4
|
* @ignore
|
|
5
5
|
*/
|
|
6
|
-
|
|
6
|
+
_fetch(url: any, kind: any): Promise<Uint8Array<ArrayBuffer>>;
|
|
7
7
|
}
|
|
8
|
-
export class
|
|
8
|
+
export class NodeCanvasFactory extends BaseCanvasFactory {
|
|
9
9
|
/**
|
|
10
10
|
* @ignore
|
|
11
11
|
*/
|
|
12
|
-
|
|
12
|
+
_createCanvas(width: any, height: any): import("@napi-rs/canvas").Canvas;
|
|
13
13
|
}
|
|
14
14
|
export class NodeFilterFactory extends BaseFilterFactory {
|
|
15
15
|
}
|
|
16
|
-
|
|
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
|
-
}
|
|
16
|
+
import { BaseBinaryDataFactory } from "./binary_data_factory.js";
|
|
28
17
|
import { BaseCanvasFactory } from "./canvas_factory.js";
|
|
29
|
-
import { BaseCMapReaderFactory } from "./cmap_reader_factory.js";
|
|
30
18
|
import { BaseFilterFactory } from "./filter_factory.js";
|
|
31
|
-
import { BaseStandardFontDataFactory } from "./standard_fontdata_factory.js";
|
|
32
|
-
import { BaseWasmFactory } from "./wasm_factory.js";
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
export class CssFontInfo {
|
|
2
|
+
constructor(buffer: any);
|
|
3
|
+
get fontFamily(): string;
|
|
4
|
+
get fontWeight(): string;
|
|
5
|
+
get italicAngle(): string;
|
|
6
|
+
#private;
|
|
7
|
+
}
|
|
8
|
+
export class FontInfo {
|
|
9
|
+
constructor({ buffer, extra }: {
|
|
10
|
+
buffer: any;
|
|
11
|
+
extra: any;
|
|
12
|
+
});
|
|
13
|
+
get black(): boolean | undefined;
|
|
14
|
+
get bold(): boolean | undefined;
|
|
15
|
+
get disableFontFace(): boolean | undefined;
|
|
16
|
+
get fontExtraProperties(): boolean | undefined;
|
|
17
|
+
get isInvalidPDFjsFont(): boolean | undefined;
|
|
18
|
+
get isType3Font(): boolean | undefined;
|
|
19
|
+
get italic(): boolean | undefined;
|
|
20
|
+
get missingFile(): boolean | undefined;
|
|
21
|
+
get remeasure(): boolean | undefined;
|
|
22
|
+
get vertical(): boolean | undefined;
|
|
23
|
+
get ascent(): number;
|
|
24
|
+
get defaultWidth(): number;
|
|
25
|
+
get descent(): number;
|
|
26
|
+
get bbox(): any[] | undefined;
|
|
27
|
+
get fontMatrix(): any[] | undefined;
|
|
28
|
+
get defaultVMetrics(): any[] | undefined;
|
|
29
|
+
get fallbackName(): string;
|
|
30
|
+
get loadedName(): string;
|
|
31
|
+
get mimetype(): string;
|
|
32
|
+
get name(): string;
|
|
33
|
+
get data(): Uint8Array<any> | undefined;
|
|
34
|
+
clearData(): void;
|
|
35
|
+
get cssFontInfo(): CssFontInfo | null;
|
|
36
|
+
get systemFontInfo(): SystemFontInfo | null;
|
|
37
|
+
#private;
|
|
38
|
+
}
|
|
39
|
+
export class FontPathInfo {
|
|
40
|
+
constructor(buffer: any);
|
|
41
|
+
get path(): Float32Array<any> | Float16Array<any>;
|
|
42
|
+
#private;
|
|
43
|
+
}
|
|
44
|
+
export class PatternInfo {
|
|
45
|
+
constructor(buffer: any);
|
|
46
|
+
buffer: any;
|
|
47
|
+
view: DataView<any>;
|
|
48
|
+
data: Uint8Array<any>;
|
|
49
|
+
getIR(): (string | number | number[] | Uint8Array<any> | Float32Array<any> | {
|
|
50
|
+
type: number;
|
|
51
|
+
coords: Int32Array<any>;
|
|
52
|
+
colors: Int32Array<any>;
|
|
53
|
+
}[] | null)[] | (string | number | number[] | (string | number)[][] | null)[];
|
|
54
|
+
}
|
|
55
|
+
export class SystemFontInfo {
|
|
56
|
+
constructor(buffer: any);
|
|
57
|
+
get guessFallback(): boolean;
|
|
58
|
+
get css(): string;
|
|
59
|
+
get loadedName(): string;
|
|
60
|
+
get baseFontName(): string;
|
|
61
|
+
get src(): string;
|
|
62
|
+
get style(): {
|
|
63
|
+
style: string;
|
|
64
|
+
weight: string;
|
|
65
|
+
};
|
|
66
|
+
#private;
|
|
67
|
+
}
|