pdfjs-serverless 0.6.0 → 0.7.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/dist/index.d.mts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.mjs +1 -1
- package/dist/types/src/display/annotation_layer.d.ts +11 -1
- package/dist/types/src/display/api.d.ts +79 -35
- package/dist/types/src/display/canvas.d.ts +2 -1
- package/dist/types/src/display/canvas_factory.d.ts +27 -0
- package/dist/types/src/display/cmap_reader_factory.d.ts +25 -0
- package/dist/types/src/display/display_utils.d.ts +29 -60
- package/dist/types/src/display/draw_layer.d.ts +6 -19
- package/dist/types/src/display/editor/alt_text.d.ts +3 -2
- package/dist/types/src/display/editor/annotation_editor_layer.d.ts +13 -9
- package/dist/types/src/display/editor/color_picker.d.ts +1 -0
- package/dist/types/src/display/editor/draw.d.ts +120 -0
- package/dist/types/src/display/editor/drawers/freedraw.d.ts +31 -0
- package/dist/types/src/display/editor/drawers/highlight.d.ts +36 -0
- package/dist/types/src/display/editor/drawers/inkdraw.d.ts +128 -0
- package/dist/types/src/display/editor/drawers/outline.d.ts +19 -0
- package/dist/types/src/display/editor/editor.d.ts +51 -12
- package/dist/types/src/display/editor/freetext.d.ts +5 -16
- package/dist/types/src/display/editor/highlight.d.ts +7 -25
- package/dist/types/src/display/editor/ink.d.ts +15 -74
- package/dist/types/src/display/editor/stamp.d.ts +13 -17
- package/dist/types/src/display/editor/toolbar.d.ts +3 -2
- package/dist/types/src/display/editor/tools.d.ts +13 -3
- package/dist/types/src/display/fetch_stream.d.ts +6 -13
- package/dist/types/src/display/filter_factory.d.ts +29 -0
- package/dist/types/src/display/font_loader.d.ts +3 -1
- package/dist/types/src/display/network.d.ts +10 -6
- package/dist/types/src/display/network_utils.d.ts +5 -3
- package/dist/types/src/display/node_stream.d.ts +6 -22
- package/dist/types/src/display/node_utils.d.ts +8 -11
- package/dist/types/src/display/optional_content_config.d.ts +1 -1
- package/dist/types/src/display/standard_fontdata_factory.d.ts +20 -0
- package/dist/types/src/display/svg_factory.d.ts +14 -0
- package/dist/types/src/display/text_layer.d.ts +12 -9
- package/dist/types/src/display/touch_manager.d.ts +14 -0
- package/dist/types/src/display/transport_stream.d.ts +1 -1
- package/dist/types/src/display/worker_options.d.ts +2 -2
- package/dist/types/src/interfaces.d.ts +4 -0
- package/dist/types/src/pdf.d.ts +5 -3
- package/dist/types/src/shared/message_handler.d.ts +10 -4
- package/dist/types/src/shared/util.d.ts +9 -20
- package/dist/types/web/annotation_editor_layer_builder.d.ts +5 -2
- package/dist/types/web/annotation_layer_builder.d.ts +2 -1
- package/dist/types/web/app_options.d.ts +1 -1
- package/dist/types/web/event_utils.d.ts +2 -2
- package/dist/types/web/genericl10n.d.ts +5 -5
- package/dist/types/web/interfaces.d.ts +5 -5
- package/dist/types/web/l10n.d.ts +2 -2
- package/dist/types/web/pdf_link_service.d.ts +2 -2
- package/dist/types/web/pdf_page_view.d.ts +5 -11
- package/dist/types/web/pdf_rendering_queue.d.ts +1 -1
- package/dist/types/web/pdf_thumbnail_view.d.ts +1 -1
- package/dist/types/web/pdf_viewer.d.ts +13 -16
- package/dist/types/web/struct_tree_layer_builder.d.ts +4 -2
- package/dist/types/web/text_accessibility.d.ts +1 -1
- package/dist/types/web/text_layer_builder.d.ts +5 -5
- package/dist/types/web/ui_utils.d.ts +3 -19
- package/package.json +15 -15
- package/dist/types/src/display/base_factory.d.ts +0 -60
- package/dist/types/src/display/editor/outliner.d.ts +0 -70
|
@@ -5,7 +5,6 @@ export class HighlightEditor extends AnnotationEditor {
|
|
|
5
5
|
static _defaultColor: null;
|
|
6
6
|
static _defaultOpacity: number;
|
|
7
7
|
static _defaultThickness: number;
|
|
8
|
-
static _l10nPromise: any;
|
|
9
8
|
static _type: string;
|
|
10
9
|
static _editorType: number;
|
|
11
10
|
static _freeHighlightId: number;
|
|
@@ -20,17 +19,7 @@ export class HighlightEditor extends AnnotationEditor {
|
|
|
20
19
|
/** @inheritdoc */
|
|
21
20
|
static updateDefaultParams(type: any, value: any): void;
|
|
22
21
|
static get defaultPropertiesToUpdate(): (number | null)[][];
|
|
23
|
-
static "__#24@#rotateBbox"(
|
|
24
|
-
x: any;
|
|
25
|
-
y: any;
|
|
26
|
-
width: any;
|
|
27
|
-
height: any;
|
|
28
|
-
}, angle: any): {
|
|
29
|
-
x: any;
|
|
30
|
-
y: any;
|
|
31
|
-
width: any;
|
|
32
|
-
height: any;
|
|
33
|
-
};
|
|
22
|
+
static "__#24@#rotateBbox"([x, y, width, height]: [any, any, any, any], angle: any): any[];
|
|
34
23
|
static startHighlighting(parent: any, isLTR: any, { target: textLayer, x, y }: {
|
|
35
24
|
target: any;
|
|
36
25
|
x: any;
|
|
@@ -39,7 +28,7 @@ export class HighlightEditor extends AnnotationEditor {
|
|
|
39
28
|
static "__#24@#highlightMove"(parent: any, event: any): void;
|
|
40
29
|
static "__#24@#endHighlight"(parent: any, event: any): void;
|
|
41
30
|
/** @inheritdoc */
|
|
42
|
-
static deserialize(data: any, parent: any, uiManager: any): AnnotationEditor | null
|
|
31
|
+
static deserialize(data: any, parent: any, uiManager: any): Promise<AnnotationEditor | null>;
|
|
43
32
|
constructor(params: any);
|
|
44
33
|
color: any;
|
|
45
34
|
/** @inheritdoc */
|
|
@@ -66,23 +55,16 @@ export class HighlightEditor extends AnnotationEditor {
|
|
|
66
55
|
/** @inheritdoc */
|
|
67
56
|
getRect(tx: any, ty: any): any[];
|
|
68
57
|
/** @inheritdoc */
|
|
58
|
+
onceAdded(focus: any): void;
|
|
59
|
+
/** @inheritdoc */
|
|
69
60
|
rotate(angle: any): void;
|
|
70
61
|
pointerover(): void;
|
|
71
62
|
pointerleave(): void;
|
|
72
63
|
_moveCaret(direction: any): void;
|
|
73
64
|
/** @inheritdoc */
|
|
74
|
-
serialize(isForCopying?: boolean):
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
opacity: any;
|
|
78
|
-
thickness: any;
|
|
79
|
-
quadPoints: Float32Array | null;
|
|
80
|
-
outlines: any;
|
|
81
|
-
pageIndex: number;
|
|
82
|
-
rect: any[];
|
|
83
|
-
rotation: number;
|
|
84
|
-
structTreeParentId: any;
|
|
85
|
-
} | null;
|
|
65
|
+
serialize(isForCopying?: boolean): Object | null;
|
|
66
|
+
/** @inheritdoc */
|
|
67
|
+
renderAnnotationElement(annotation: any): null;
|
|
86
68
|
#private;
|
|
87
69
|
}
|
|
88
70
|
import { AnnotationEditor } from "./editor.js";
|
|
@@ -1,90 +1,31 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Basic draw editor in order to generate an Ink annotation.
|
|
3
3
|
*/
|
|
4
|
-
export class InkEditor extends
|
|
5
|
-
static _defaultColor: null;
|
|
6
|
-
static _defaultOpacity: number;
|
|
7
|
-
static _defaultThickness: number;
|
|
4
|
+
export class InkEditor extends DrawingEditor {
|
|
8
5
|
static _type: string;
|
|
9
6
|
static _editorType: number;
|
|
7
|
+
static _defaultDrawingOptions: null;
|
|
10
8
|
/** @inheritdoc */
|
|
11
9
|
static initialize(l10n: any, uiManager: any): void;
|
|
12
10
|
/** @inheritdoc */
|
|
13
|
-
static
|
|
11
|
+
static getDefaultDrawingOptions(options: any): any;
|
|
14
12
|
/** @inheritdoc */
|
|
15
|
-
static get
|
|
16
|
-
/**
|
|
17
|
-
* Convert into a Path2D.
|
|
18
|
-
* @param {Array<Array<number>>} bezier
|
|
19
|
-
* @returns {Path2D}
|
|
20
|
-
*/
|
|
21
|
-
static "__#25@#buildPath2D"(bezier: Array<Array<number>>): Path2D;
|
|
22
|
-
static "__#25@#toPDFCoordinates"(points: any, rect: any, rotation: any): any;
|
|
23
|
-
static "__#25@#fromPDFCoordinates"(points: any, rect: any, rotation: any): any;
|
|
13
|
+
static get typesMap(): any;
|
|
24
14
|
/** @inheritdoc */
|
|
25
|
-
static
|
|
26
|
-
constructor(params: any);
|
|
27
|
-
color: any;
|
|
28
|
-
thickness: any;
|
|
29
|
-
opacity: any;
|
|
30
|
-
paths: any[];
|
|
31
|
-
bezierPath2D: any[];
|
|
32
|
-
allRawPaths: any[];
|
|
33
|
-
currentPath: any[];
|
|
34
|
-
scaleFactor: number;
|
|
35
|
-
translationX: number;
|
|
36
|
-
translationY: number;
|
|
15
|
+
static createDrawerInstance(x: any, y: any, parentWidth: any, parentHeight: any, rotation: any): InkDrawOutliner;
|
|
37
16
|
/** @inheritdoc */
|
|
38
|
-
|
|
17
|
+
static deserializeDraw(pageX: any, pageY: any, pageWidth: any, pageHeight: any, innerMargin: any, data: any): InkDrawOutline;
|
|
39
18
|
/** @inheritdoc */
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
onScaleChanging(): void;
|
|
43
|
-
pointerdownAC: any;
|
|
44
|
-
/**
|
|
45
|
-
* onpointerdown callback for the canvas we're drawing on.
|
|
46
|
-
* @param {PointerEvent} event
|
|
47
|
-
*/
|
|
48
|
-
canvasPointerdown(event: PointerEvent): void;
|
|
49
|
-
/**
|
|
50
|
-
* onpointermove callback for the canvas we're drawing on.
|
|
51
|
-
* @param {PointerEvent} event
|
|
52
|
-
*/
|
|
53
|
-
canvasPointermove(event: PointerEvent): void;
|
|
54
|
-
/**
|
|
55
|
-
* onpointerup callback for the canvas we're drawing on.
|
|
56
|
-
* @param {PointerEvent} event
|
|
57
|
-
*/
|
|
58
|
-
canvasPointerup(event: PointerEvent): void;
|
|
59
|
-
/**
|
|
60
|
-
* onpointerleave callback for the canvas we're drawing on.
|
|
61
|
-
* @param {PointerEvent} event
|
|
62
|
-
*/
|
|
63
|
-
canvasPointerleave(event: PointerEvent): void;
|
|
64
|
-
ctx: CanvasRenderingContext2D | null | undefined;
|
|
65
|
-
/**
|
|
66
|
-
* When the dimensions of the div change the inner canvas must
|
|
67
|
-
* renew its dimensions, hence it must redraw its own contents.
|
|
68
|
-
* @param {number} width - the new width of the div
|
|
69
|
-
* @param {number} height - the new height of the div
|
|
70
|
-
* @returns
|
|
71
|
-
*/
|
|
72
|
-
setDimensions(width: number, height: number): void;
|
|
73
|
-
/** @inheritdoc */
|
|
74
|
-
serialize(): {
|
|
75
|
-
annotationType: number;
|
|
76
|
-
color: number[];
|
|
19
|
+
createDrawingOptions({ color, thickness, opacity }: {
|
|
20
|
+
color: any;
|
|
77
21
|
thickness: any;
|
|
78
22
|
opacity: any;
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
pageIndex: number;
|
|
84
|
-
rect: any[];
|
|
85
|
-
rotation: number;
|
|
86
|
-
structTreeParentId: any;
|
|
87
|
-
} | null;
|
|
23
|
+
}): void;
|
|
24
|
+
_drawingOptions: any;
|
|
25
|
+
/** @inheritdoc */
|
|
26
|
+
serialize(isForCopying?: boolean): Object | null;
|
|
88
27
|
#private;
|
|
89
28
|
}
|
|
90
|
-
import {
|
|
29
|
+
import { DrawingEditor } from "./draw.js";
|
|
30
|
+
import { InkDrawOutliner } from "./drawers/inkdraw.js";
|
|
31
|
+
import { InkDrawOutline } from "./drawers/inkdraw.js";
|
|
@@ -17,7 +17,7 @@ export class StampEditor extends AnnotationEditor {
|
|
|
17
17
|
hasNoAltText: any;
|
|
18
18
|
};
|
|
19
19
|
/** @inheritdoc */
|
|
20
|
-
static deserialize(data: any, parent: any, uiManager: any): AnnotationEditor | null
|
|
20
|
+
static deserialize(data: any, parent: any, uiManager: any): Promise<AnnotationEditor | null>;
|
|
21
21
|
constructor(params: any);
|
|
22
22
|
/** @inheritdoc */
|
|
23
23
|
get telemetryFinalData(): {
|
|
@@ -25,29 +25,25 @@ export class StampEditor extends AnnotationEditor {
|
|
|
25
25
|
hasAltText: boolean;
|
|
26
26
|
};
|
|
27
27
|
mlGuessAltText(imageData?: null, updateAltTextData?: boolean): Promise<any>;
|
|
28
|
-
|
|
29
|
-
|
|
28
|
+
/** @inheritdoc */
|
|
29
|
+
onceAdded(focus: any): void;
|
|
30
|
+
onScaleChanging(): void;
|
|
31
|
+
copyCanvas(maxDataDimension: any, maxPreviewDimension: any, createImageData?: boolean): {
|
|
32
|
+
canvas: HTMLCanvasElement | null;
|
|
33
|
+
width: any;
|
|
34
|
+
height: any;
|
|
30
35
|
imageData: {
|
|
31
36
|
width: any;
|
|
32
37
|
height: any;
|
|
33
|
-
data: Uint8ClampedArray
|
|
34
|
-
};
|
|
35
|
-
} | {
|
|
36
|
-
canvas: HTMLCanvasElement;
|
|
37
|
-
imageData: null;
|
|
38
|
+
data: Uint8ClampedArray<ArrayBufferLike>;
|
|
39
|
+
} | null;
|
|
38
40
|
};
|
|
39
41
|
/** @inheritdoc */
|
|
40
42
|
getImageForAltText(): null;
|
|
41
43
|
/** @inheritdoc */
|
|
42
|
-
serialize(isForCopying?: boolean, context?: null):
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
pageIndex: number;
|
|
46
|
-
rect: any[];
|
|
47
|
-
rotation: number;
|
|
48
|
-
isSvg: boolean;
|
|
49
|
-
structTreeParentId: any;
|
|
50
|
-
} | null;
|
|
44
|
+
serialize(isForCopying?: boolean, context?: null): Object | null;
|
|
45
|
+
/** @inheritdoc */
|
|
46
|
+
renderAnnotationElement(annotation: any): null;
|
|
51
47
|
#private;
|
|
52
48
|
}
|
|
53
49
|
import { AnnotationEditor } from "./editor.js";
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
export class EditorToolbar {
|
|
2
|
-
static "__#
|
|
3
|
-
static "__#
|
|
2
|
+
static "__#3@#l10nRemove": null;
|
|
3
|
+
static "__#3@#pointerDown"(e: any): void;
|
|
4
4
|
constructor(editor: any);
|
|
5
5
|
render(): HTMLDivElement;
|
|
6
|
+
get div(): null;
|
|
6
7
|
hide(): void;
|
|
7
8
|
show(): void;
|
|
8
9
|
addAltText(altText: any): Promise<void>;
|
|
@@ -12,7 +12,8 @@ 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, eventBus: any, pdfDocument: any, pageColors: any, highlightColors: any, enableHighlightFloatingButton: any, enableUpdatedAddImage: any, enableNewAltTextWhenAddingImage: any, mlManager: any);
|
|
15
|
+
constructor(container: any, viewer: any, altTextManager: any, eventBus: any, pdfDocument: any, pageColors: any, highlightColors: any, enableHighlightFloatingButton: any, enableUpdatedAddImage: any, enableNewAltTextWhenAddingImage: any, mlManager: any, editorUndoBar: any, supportsPinchToZoom: any);
|
|
16
|
+
_editorUndoBar: null;
|
|
16
17
|
_signal: AbortSignal;
|
|
17
18
|
_eventBus: any;
|
|
18
19
|
viewParameters: {
|
|
@@ -20,6 +21,7 @@ export class AnnotationEditorUIManager {
|
|
|
20
21
|
rotation: number;
|
|
21
22
|
};
|
|
22
23
|
isShiftKeyDown: boolean;
|
|
24
|
+
_supportsPinchToZoom: boolean;
|
|
23
25
|
destroy(): void;
|
|
24
26
|
combinedSignal(ac: any): AbortSignal;
|
|
25
27
|
get mlManager(): null;
|
|
@@ -29,6 +31,11 @@ export class AnnotationEditorUIManager {
|
|
|
29
31
|
get direction(): any;
|
|
30
32
|
get highlightColors(): any;
|
|
31
33
|
get highlightColorNames(): any;
|
|
34
|
+
/**
|
|
35
|
+
* Set the current drawing session.
|
|
36
|
+
* @param {AnnotationEditorLayer} layer
|
|
37
|
+
*/
|
|
38
|
+
setCurrentDrawingSession(layer: AnnotationEditorLayer): void;
|
|
32
39
|
setMainHighlightColorPicker(colorPicker: any): void;
|
|
33
40
|
editAltText(editor: any, firstTime?: boolean): void;
|
|
34
41
|
switchToMode(mode: any, callback: any): void;
|
|
@@ -81,7 +88,7 @@ export class AnnotationEditorUIManager {
|
|
|
81
88
|
* Paste callback.
|
|
82
89
|
* @param {ClipboardEvent} event
|
|
83
90
|
*/
|
|
84
|
-
paste(event: ClipboardEvent): void
|
|
91
|
+
paste(event: ClipboardEvent): Promise<void>;
|
|
85
92
|
/**
|
|
86
93
|
* Keydown callback.
|
|
87
94
|
* @param {KeyboardEvent} event
|
|
@@ -133,7 +140,7 @@ export class AnnotationEditorUIManager {
|
|
|
133
140
|
* @param {boolean} [isFromKeyboard] - true if the mode change is due to a
|
|
134
141
|
* keyboard action.
|
|
135
142
|
*/
|
|
136
|
-
updateMode(mode: number, editId?: string | null, isFromKeyboard?: boolean
|
|
143
|
+
updateMode(mode: number, editId?: string | null, isFromKeyboard?: boolean): Promise<void>;
|
|
137
144
|
addNewEditorFromKeyboard(): void;
|
|
138
145
|
/**
|
|
139
146
|
* Update the toolbar if it's required to reflect the tool currently used.
|
|
@@ -197,6 +204,7 @@ export class AnnotationEditorUIManager {
|
|
|
197
204
|
* @param {AnnotationEditor} editor
|
|
198
205
|
*/
|
|
199
206
|
updateUI(editor: AnnotationEditor): void;
|
|
207
|
+
updateUIForDefaultProperties(editorType: any): void;
|
|
200
208
|
/**
|
|
201
209
|
* Add or remove an editor the current selection.
|
|
202
210
|
* @param {AnnotationEditor} editor
|
|
@@ -233,6 +241,7 @@ export class AnnotationEditorUIManager {
|
|
|
233
241
|
* @param {Object} params
|
|
234
242
|
*/
|
|
235
243
|
addCommands(params: Object): void;
|
|
244
|
+
cleanUndoStack(type: any): void;
|
|
236
245
|
/**
|
|
237
246
|
* Delete the current editor or all.
|
|
238
247
|
*/
|
|
@@ -374,6 +383,7 @@ export class CommandManager {
|
|
|
374
383
|
* @returns {boolean}
|
|
375
384
|
*/
|
|
376
385
|
hasSomethingToRedo(): boolean;
|
|
386
|
+
cleanType(type: any): void;
|
|
377
387
|
destroy(): void;
|
|
378
388
|
#private;
|
|
379
389
|
}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
/** @implements {IPDFStream} */
|
|
2
2
|
export class PDFFetchStream implements IPDFStream {
|
|
3
3
|
constructor(source: any);
|
|
4
|
+
_responseOrigin: null;
|
|
4
5
|
source: any;
|
|
5
6
|
isHttp: boolean;
|
|
6
|
-
|
|
7
|
+
headers: Headers;
|
|
7
8
|
_fullRequestReader: PDFFetchStreamReader | null;
|
|
8
9
|
_rangeRequestReaders: any[];
|
|
9
10
|
get _progressiveDataLength(): number;
|
|
@@ -15,7 +16,7 @@ export class PDFFetchStream implements IPDFStream {
|
|
|
15
16
|
declare class PDFFetchStreamReader implements IPDFStreamReader {
|
|
16
17
|
constructor(stream: any);
|
|
17
18
|
_stream: any;
|
|
18
|
-
_reader: ReadableStreamDefaultReader<Uint8Array
|
|
19
|
+
_reader: ReadableStreamDefaultReader<Uint8Array<ArrayBufferLike>> | null;
|
|
19
20
|
_loaded: number;
|
|
20
21
|
_filename: string | null;
|
|
21
22
|
_withCredentials: any;
|
|
@@ -26,7 +27,6 @@ declare class PDFFetchStreamReader implements IPDFStreamReader {
|
|
|
26
27
|
_abortController: AbortController;
|
|
27
28
|
_isStreamingSupported: boolean;
|
|
28
29
|
_isRangeSupported: boolean;
|
|
29
|
-
_headers: Headers;
|
|
30
30
|
onProgress: any;
|
|
31
31
|
get headersReady(): any;
|
|
32
32
|
get filename(): string | null;
|
|
@@ -34,10 +34,7 @@ declare class PDFFetchStreamReader implements IPDFStreamReader {
|
|
|
34
34
|
get isRangeSupported(): boolean;
|
|
35
35
|
get isStreamingSupported(): boolean;
|
|
36
36
|
read(): Promise<{
|
|
37
|
-
value:
|
|
38
|
-
done: true;
|
|
39
|
-
} | {
|
|
40
|
-
value: ArrayBufferLike;
|
|
37
|
+
value: any;
|
|
41
38
|
done: boolean;
|
|
42
39
|
}>;
|
|
43
40
|
cancel(reason: any): void;
|
|
@@ -46,20 +43,16 @@ declare class PDFFetchStreamReader implements IPDFStreamReader {
|
|
|
46
43
|
declare class PDFFetchStreamRangeReader implements IPDFStreamRangeReader {
|
|
47
44
|
constructor(stream: any, begin: any, end: any);
|
|
48
45
|
_stream: any;
|
|
49
|
-
_reader: ReadableStreamDefaultReader<Uint8Array
|
|
46
|
+
_reader: ReadableStreamDefaultReader<Uint8Array<ArrayBufferLike>> | null;
|
|
50
47
|
_loaded: number;
|
|
51
48
|
_withCredentials: any;
|
|
52
49
|
_readCapability: any;
|
|
53
50
|
_isStreamingSupported: boolean;
|
|
54
51
|
_abortController: AbortController;
|
|
55
|
-
_headers: Headers;
|
|
56
52
|
onProgress: any;
|
|
57
53
|
get isStreamingSupported(): boolean;
|
|
58
54
|
read(): Promise<{
|
|
59
|
-
value:
|
|
60
|
-
done: true;
|
|
61
|
-
} | {
|
|
62
|
-
value: ArrayBufferLike;
|
|
55
|
+
value: any;
|
|
63
56
|
done: boolean;
|
|
64
57
|
}>;
|
|
65
58
|
cancel(reason: any): void;
|
|
@@ -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
|
+
}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
export class FontFaceObject {
|
|
2
|
-
constructor(translatedData: any, { disableFontFace, inspectFont }: {
|
|
2
|
+
constructor(translatedData: any, { disableFontFace, fontExtraProperties, inspectFont }: {
|
|
3
3
|
disableFontFace?: boolean | undefined;
|
|
4
|
+
fontExtraProperties?: boolean | undefined;
|
|
4
5
|
inspectFont?: null | undefined;
|
|
5
6
|
});
|
|
6
7
|
compiledGlyphs: any;
|
|
7
8
|
disableFontFace: boolean;
|
|
9
|
+
fontExtraProperties: boolean;
|
|
8
10
|
_inspectFont: any;
|
|
9
11
|
createNativeFontFace(): FontFace | null;
|
|
10
12
|
createFontFaceRule(): string | null;
|
|
@@ -12,15 +12,18 @@ export class PDFNetworkStream implements IPDFStream {
|
|
|
12
12
|
cancelAllRequests(reason: any): void;
|
|
13
13
|
}
|
|
14
14
|
declare class NetworkManager {
|
|
15
|
-
constructor(url
|
|
15
|
+
constructor({ url, httpHeaders, withCredentials }: {
|
|
16
|
+
url: any;
|
|
17
|
+
httpHeaders: any;
|
|
18
|
+
withCredentials: any;
|
|
19
|
+
});
|
|
20
|
+
_responseOrigin: null;
|
|
16
21
|
url: any;
|
|
17
22
|
isHttp: boolean;
|
|
18
|
-
|
|
23
|
+
headers: Headers;
|
|
19
24
|
withCredentials: any;
|
|
20
25
|
currXhrId: number;
|
|
21
26
|
pendingRequests: any;
|
|
22
|
-
requestRange(begin: any, end: any, listeners: any): number;
|
|
23
|
-
requestFull(listeners: any): number;
|
|
24
27
|
request(args: any): number;
|
|
25
28
|
onProgress(xhrId: any, evt: any): void;
|
|
26
29
|
onStateChange(xhrId: any, evt: any): void;
|
|
@@ -34,7 +37,7 @@ declare class PDFNetworkStreamFullRequestReader implements IPDFStreamReader {
|
|
|
34
37
|
_manager: any;
|
|
35
38
|
_url: any;
|
|
36
39
|
_fullRequestId: any;
|
|
37
|
-
|
|
40
|
+
_headersCapability: any;
|
|
38
41
|
_disableRange: any;
|
|
39
42
|
_contentLength: any;
|
|
40
43
|
_rangeChunkSize: any;
|
|
@@ -68,9 +71,10 @@ declare class PDFNetworkStreamRangeRequestReader implements IPDFStreamRangeReade
|
|
|
68
71
|
_requests: any[];
|
|
69
72
|
_queuedChunk: any;
|
|
70
73
|
_done: boolean;
|
|
71
|
-
_storedError:
|
|
74
|
+
_storedError: Error | undefined;
|
|
72
75
|
onProgress: any;
|
|
73
76
|
onClosed: any;
|
|
77
|
+
_onHeadersReceived(): void;
|
|
74
78
|
_close(): void;
|
|
75
79
|
_onDone(data: any): void;
|
|
76
80
|
_onError(status: any): void;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
export function createHeaders(isHttp: any, httpHeaders: any): Headers;
|
|
1
2
|
export function createResponseStatusError(status: any, url: any): MissingPDFException | UnexpectedResponseException;
|
|
2
|
-
export function extractFilenameFromHeader(
|
|
3
|
-
export function
|
|
4
|
-
|
|
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;
|
|
5
7
|
isHttp: any;
|
|
6
8
|
rangeChunkSize: any;
|
|
7
9
|
disableRange: any;
|
|
@@ -2,30 +2,14 @@ export class PDFNodeStream {
|
|
|
2
2
|
constructor(source: any);
|
|
3
3
|
source: any;
|
|
4
4
|
url: URL;
|
|
5
|
-
|
|
6
|
-
isFsUrl: boolean;
|
|
7
|
-
httpHeaders: any;
|
|
8
|
-
_fullRequestReader: PDFNodeStreamFsFullReader | PDFNodeStreamFullReader | null;
|
|
5
|
+
_fullRequestReader: PDFNodeStreamFsFullReader | null;
|
|
9
6
|
_rangeRequestReaders: any[];
|
|
10
7
|
get _progressiveDataLength(): number;
|
|
11
|
-
getFullReader(): PDFNodeStreamFsFullReader
|
|
12
|
-
getRangeReader(start: any, end: any): PDFNodeStreamFsRangeReader |
|
|
8
|
+
getFullReader(): PDFNodeStreamFsFullReader;
|
|
9
|
+
getRangeReader(start: any, end: any): PDFNodeStreamFsRangeReader | null;
|
|
13
10
|
cancelAllRequests(reason: any): void;
|
|
14
11
|
}
|
|
15
|
-
declare class PDFNodeStreamFsFullReader
|
|
16
|
-
}
|
|
17
|
-
declare class PDFNodeStreamFullReader extends BaseFullReader {
|
|
18
|
-
_request: any;
|
|
19
|
-
}
|
|
20
|
-
declare class PDFNodeStreamFsRangeReader extends BaseRangeReader {
|
|
21
|
-
constructor(stream: any, start: any, end: any);
|
|
22
|
-
}
|
|
23
|
-
declare class PDFNodeStreamRangeReader extends BaseRangeReader {
|
|
24
|
-
constructor(stream: any, start: any, end: any);
|
|
25
|
-
_httpHeaders: {};
|
|
26
|
-
_request: any;
|
|
27
|
-
}
|
|
28
|
-
declare class BaseFullReader {
|
|
12
|
+
declare class PDFNodeStreamFsFullReader {
|
|
29
13
|
constructor(stream: any);
|
|
30
14
|
_url: any;
|
|
31
15
|
_done: boolean;
|
|
@@ -51,8 +35,8 @@ declare class BaseFullReader {
|
|
|
51
35
|
_error(reason: any): void;
|
|
52
36
|
_setReadableStream(readableStream: any): void;
|
|
53
37
|
}
|
|
54
|
-
declare class
|
|
55
|
-
constructor(stream: any);
|
|
38
|
+
declare class PDFNodeStreamFsRangeReader {
|
|
39
|
+
constructor(stream: any, start: any, end: any);
|
|
56
40
|
_url: any;
|
|
57
41
|
_done: boolean;
|
|
58
42
|
_storedError: any;
|
|
@@ -1,28 +1,25 @@
|
|
|
1
|
+
export function fetchData(url: any): Promise<Uint8Array<ArrayBuffer>>;
|
|
1
2
|
export class NodeCanvasFactory extends BaseCanvasFactory {
|
|
2
3
|
/**
|
|
3
4
|
* @ignore
|
|
4
5
|
*/
|
|
5
|
-
_createCanvas(width: any, height: any):
|
|
6
|
+
_createCanvas(width: any, height: any): import("@napi-rs/canvas").Canvas;
|
|
6
7
|
}
|
|
7
8
|
export class NodeCMapReaderFactory extends BaseCMapReaderFactory {
|
|
8
9
|
/**
|
|
9
10
|
* @ignore
|
|
10
11
|
*/
|
|
11
|
-
|
|
12
|
+
_fetch(url: any): Promise<Uint8Array<ArrayBuffer>>;
|
|
12
13
|
}
|
|
13
14
|
export class NodeFilterFactory extends BaseFilterFactory {
|
|
14
15
|
}
|
|
15
|
-
export class NodePackages {
|
|
16
|
-
static get promise(): any;
|
|
17
|
-
static get(name: any): any;
|
|
18
|
-
}
|
|
19
16
|
export class NodeStandardFontDataFactory extends BaseStandardFontDataFactory {
|
|
20
17
|
/**
|
|
21
18
|
* @ignore
|
|
22
19
|
*/
|
|
23
|
-
|
|
20
|
+
_fetch(url: any): Promise<Uint8Array<ArrayBuffer>>;
|
|
24
21
|
}
|
|
25
|
-
import { BaseCanvasFactory } from "./
|
|
26
|
-
import { BaseCMapReaderFactory } from "./
|
|
27
|
-
import { BaseFilterFactory } from "./
|
|
28
|
-
import { BaseStandardFontDataFactory } from "./
|
|
22
|
+
import { BaseCanvasFactory } from "./canvas_factory.js";
|
|
23
|
+
import { BaseCMapReaderFactory } from "./cmap_reader_factory.js";
|
|
24
|
+
import { BaseFilterFactory } from "./filter_factory.js";
|
|
25
|
+
import { BaseStandardFontDataFactory } from "./standard_fontdata_factory.js";
|
|
@@ -4,7 +4,7 @@ export class OptionalContentConfig {
|
|
|
4
4
|
name: any;
|
|
5
5
|
creator: any;
|
|
6
6
|
isVisible(group: any): any;
|
|
7
|
-
setVisibility(id: any, visible?: boolean): void;
|
|
7
|
+
setVisibility(id: any, visible?: boolean, preserveRB?: boolean): void;
|
|
8
8
|
setOCGState({ state, preserveRB }: {
|
|
9
9
|
state: any;
|
|
10
10
|
preserveRB: any;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export class BaseStandardFontDataFactory {
|
|
2
|
+
constructor({ baseUrl }: {
|
|
3
|
+
baseUrl?: null | undefined;
|
|
4
|
+
});
|
|
5
|
+
baseUrl: any;
|
|
6
|
+
fetch({ filename }: {
|
|
7
|
+
filename: any;
|
|
8
|
+
}): Promise<Uint8Array<ArrayBufferLike>>;
|
|
9
|
+
/**
|
|
10
|
+
* @ignore
|
|
11
|
+
* @returns {Promise<Uint8Array>}
|
|
12
|
+
*/
|
|
13
|
+
_fetch(url: any): Promise<Uint8Array>;
|
|
14
|
+
}
|
|
15
|
+
export class DOMStandardFontDataFactory extends BaseStandardFontDataFactory {
|
|
16
|
+
/**
|
|
17
|
+
* @ignore
|
|
18
|
+
*/
|
|
19
|
+
_fetch(url: any): Promise<Uint8Array<any>>;
|
|
20
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export class BaseSVGFactory {
|
|
2
|
+
create(width: any, height: any, skipDimensions?: boolean): void;
|
|
3
|
+
createElement(type: any): void;
|
|
4
|
+
/**
|
|
5
|
+
* @ignore
|
|
6
|
+
*/
|
|
7
|
+
_createSVG(type: any): void;
|
|
8
|
+
}
|
|
9
|
+
export class DOMSVGFactory extends BaseSVGFactory {
|
|
10
|
+
/**
|
|
11
|
+
* @ignore
|
|
12
|
+
*/
|
|
13
|
+
_createSVG(type: any): any;
|
|
14
|
+
}
|
|
@@ -31,21 +31,24 @@ export type TextLayerUpdateParameters = {
|
|
|
31
31
|
onBefore?: Function | undefined;
|
|
32
32
|
};
|
|
33
33
|
export class TextLayer {
|
|
34
|
-
static "__#
|
|
35
|
-
static "__#
|
|
36
|
-
static "__#
|
|
37
|
-
static "__#
|
|
34
|
+
static "__#53@#ascentCache": Map<any, any>;
|
|
35
|
+
static "__#53@#canvasContexts": Map<any, any>;
|
|
36
|
+
static "__#53@#canvasCtxFonts": WeakMap<object, any>;
|
|
37
|
+
static "__#53@#minFontSize": null;
|
|
38
|
+
static "__#53@#pendingTextLayers": Set<any>;
|
|
39
|
+
static get fontFamilyMap(): any;
|
|
38
40
|
/**
|
|
39
41
|
* Clean-up global textLayer data.
|
|
40
42
|
* @returns {undefined}
|
|
41
43
|
*/
|
|
42
44
|
static cleanup(): undefined;
|
|
43
|
-
static "__#
|
|
45
|
+
static "__#53@#getCtx"(lang?: null): any;
|
|
46
|
+
static "__#53@#ensureCtxFont"(ctx: any, size: any, family: any): void;
|
|
44
47
|
/**
|
|
45
48
|
* Compute the minimum font size enforced by the browser.
|
|
46
49
|
*/
|
|
47
|
-
static "__#
|
|
48
|
-
static "__#
|
|
50
|
+
static "__#53@#ensureMinFontSizeComputed"(): void;
|
|
51
|
+
static "__#53@#getAscent"(fontFamily: any, lang: any): any;
|
|
49
52
|
/**
|
|
50
53
|
* @param {TextLayerParameters} options
|
|
51
54
|
*/
|
|
@@ -71,12 +74,12 @@ export class TextLayer {
|
|
|
71
74
|
* of the textContent input.
|
|
72
75
|
* This is output and will initially be set to an empty array.
|
|
73
76
|
*/
|
|
74
|
-
get textDivs(): HTMLElement
|
|
77
|
+
get textDivs(): Array<HTMLElement>;
|
|
75
78
|
/**
|
|
76
79
|
* @type {Array<string>} Strings that correspond to the `str` property of
|
|
77
80
|
* the text items of the textContent input.
|
|
78
81
|
* This is output and will initially be set to an empty array
|
|
79
82
|
*/
|
|
80
|
-
get textContentItemsStr(): string
|
|
83
|
+
get textContentItemsStr(): Array<string>;
|
|
81
84
|
#private;
|
|
82
85
|
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export class TouchManager {
|
|
2
|
+
constructor({ container, isPinchingDisabled, isPinchingStopped, onPinchStart, onPinching, onPinchEnd, signal, }: {
|
|
3
|
+
container: any;
|
|
4
|
+
isPinchingDisabled?: null | undefined;
|
|
5
|
+
isPinchingStopped?: null | undefined;
|
|
6
|
+
onPinchStart?: null | undefined;
|
|
7
|
+
onPinching?: null | undefined;
|
|
8
|
+
onPinchEnd?: null | undefined;
|
|
9
|
+
signal: any;
|
|
10
|
+
});
|
|
11
|
+
get MIN_TOUCH_DISTANCE_TO_PINCH(): any;
|
|
12
|
+
destroy(): void;
|
|
13
|
+
#private;
|
|
14
|
+
}
|