unpdf 1.3.2 → 1.5.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 +22 -38
- package/dist/index.d.cts +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/pdfjs.mjs +107 -1
- package/dist/types/src/display/annotation_layer.d.ts +42 -17
- package/dist/types/src/display/annotation_storage.d.ts +10 -8
- package/dist/types/src/display/api.d.ts +93 -63
- package/dist/types/src/display/api_utils.d.ts +1 -1
- package/dist/types/src/display/binary_data_factory.d.ts +26 -0
- package/dist/types/src/display/canvas.d.ts +19 -16
- package/dist/types/src/display/canvas_dependency_tracker.d.ts +99 -27
- package/dist/types/src/display/canvas_factory.d.ts +3 -1
- package/dist/types/src/display/display_utils.d.ts +25 -2
- 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 +11 -14
- package/dist/types/src/display/editor/color_picker.d.ts +2 -2
- package/dist/types/src/display/editor/comment.d.ts +32 -5
- package/dist/types/src/display/editor/draw.d.ts +3 -7
- 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 +81 -26
- package/dist/types/src/display/editor/freetext.d.ts +3 -3
- package/dist/types/src/display/editor/highlight.d.ts +6 -4
- package/dist/types/src/display/editor/ink.d.ts +2 -1
- package/dist/types/src/display/editor/signature.d.ts +0 -5
- package/dist/types/src/display/editor/toolbar.d.ts +5 -3
- package/dist/types/src/display/editor/tools.d.ts +58 -4
- 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/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 +9 -1
- 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/util.d.ts +14 -5
- package/dist/types/web/annotation_editor_layer_builder.d.ts +7 -8
- package/dist/types/web/annotation_layer_builder.d.ts +15 -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 +6 -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/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 +9 -11
- package/dist/types/web/pdf_history.d.ts +3 -3
- package/dist/types/web/pdf_link_service.d.ts +4 -8
- package/dist/types/web/pdf_page_detail_view.d.ts +1 -7
- package/dist/types/web/pdf_page_view.d.ts +23 -12
- package/dist/types/web/pdf_rendering_queue.d.ts +10 -14
- package/dist/types/web/pdf_thumbnail_view.d.ts +18 -42
- 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 +40 -28
- 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 +25 -20
- 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 -174
|
@@ -2,29 +2,29 @@
|
|
|
2
2
|
* Basic text editor in order to create a Signature annotation.
|
|
3
3
|
*/
|
|
4
4
|
export class SignatureExtractor {
|
|
5
|
-
static #PARAMETERS: {
|
|
5
|
+
static "__#private@#PARAMETERS": {
|
|
6
6
|
maxDim: number;
|
|
7
7
|
sigmaSFactor: number;
|
|
8
8
|
sigmaR: number;
|
|
9
9
|
kernelSize: number;
|
|
10
10
|
};
|
|
11
|
-
static #neighborIndexToId(i0: any, j0: any, i: any, j: any): any;
|
|
12
|
-
static #neighborIdToIndex: Int32Array<ArrayBuffer>;
|
|
13
|
-
static #clockwiseNonZero(buf: any, width: any, i0: any, j0: any, i: any, j: any, offset: any): number;
|
|
14
|
-
static #counterClockwiseNonZero(buf: any, width: any, i0: any, j0: any, i: any, j: any, offset: any): number;
|
|
15
|
-
static #findContours(buf: any, width: any, height: any, threshold: any): {
|
|
11
|
+
static "__#private@#neighborIndexToId"(i0: any, j0: any, i: any, j: any): any;
|
|
12
|
+
static "__#private@#neighborIdToIndex": Int32Array<ArrayBuffer>;
|
|
13
|
+
static "__#private@#clockwiseNonZero"(buf: any, width: any, i0: any, j0: any, i: any, j: any, offset: any): number;
|
|
14
|
+
static "__#private@#counterClockwiseNonZero"(buf: any, width: any, i0: any, j0: any, i: any, j: any, offset: any): number;
|
|
15
|
+
static "__#private@#findContours"(buf: any, width: any, height: any, threshold: any): {
|
|
16
16
|
isHole: boolean;
|
|
17
17
|
points: number[];
|
|
18
18
|
id: number;
|
|
19
19
|
parent: number;
|
|
20
20
|
}[];
|
|
21
|
-
static #douglasPeuckerHelper(points: any, start: any, end: any, output: any): void;
|
|
22
|
-
static #douglasPeucker(points: any): any[] | null;
|
|
23
|
-
static #bilateralFilter(buf: any, width: any, height: any, sigmaS: any, sigmaR: any, kernelSize: any): (Uint32Array<ArrayBuffer> | Uint8Array<any>)[];
|
|
24
|
-
static #getHistogram(buf: any): Uint32Array<ArrayBuffer>;
|
|
25
|
-
static #toUint8(buf: any): Uint8ClampedArray<ArrayBuffer>;
|
|
26
|
-
static #guessThreshold(histogram: any): number;
|
|
27
|
-
static #getGrayPixels(bitmap: any): any[];
|
|
21
|
+
static "__#private@#douglasPeuckerHelper"(points: any, start: any, end: any, output: any): void;
|
|
22
|
+
static "__#private@#douglasPeucker"(points: any): any[] | null;
|
|
23
|
+
static "__#private@#bilateralFilter"(buf: any, width: any, height: any, sigmaS: any, sigmaR: any, kernelSize: any): (Uint32Array<ArrayBuffer> | Uint8Array<any>)[];
|
|
24
|
+
static "__#private@#getHistogram"(buf: any): Uint32Array<ArrayBuffer>;
|
|
25
|
+
static "__#private@#toUint8"(buf: any): Uint8ClampedArray<ArrayBuffer>;
|
|
26
|
+
static "__#private@#guessThreshold"(histogram: any): number;
|
|
27
|
+
static "__#private@#getGrayPixels"(bitmap: any): any[];
|
|
28
28
|
static extractContoursFromText(text: any, { fontFamily, fontStyle, fontWeight }: {
|
|
29
29
|
fontFamily: any;
|
|
30
30
|
fontStyle: any;
|
|
@@ -73,7 +73,7 @@ export class AnnotationEditor {
|
|
|
73
73
|
* @param {AnnotationEditorLayer} parent
|
|
74
74
|
*/
|
|
75
75
|
static paste(item: DataTransferItem, parent: AnnotationEditorLayer): void;
|
|
76
|
-
static #rotatePoint(x: any, y: any, angle: any): any[];
|
|
76
|
+
static "__#private@#rotatePoint"(x: any, y: any, angle: any): any[];
|
|
77
77
|
static _round(x: any): number;
|
|
78
78
|
/**
|
|
79
79
|
* Deserialize the editor.
|
|
@@ -109,6 +109,9 @@ export class AnnotationEditor {
|
|
|
109
109
|
annotationElementId: any;
|
|
110
110
|
_willKeepAspectRatio: boolean;
|
|
111
111
|
_structTreeParentId: any;
|
|
112
|
+
creationDate: any;
|
|
113
|
+
modificationDate: any;
|
|
114
|
+
canAddComment: boolean;
|
|
112
115
|
rotation: number;
|
|
113
116
|
pageRotation: number;
|
|
114
117
|
pageDimensions: any[];
|
|
@@ -117,6 +120,7 @@ export class AnnotationEditor {
|
|
|
117
120
|
y: number;
|
|
118
121
|
isAttachedToDOM: boolean;
|
|
119
122
|
deleted: boolean;
|
|
123
|
+
updatePageIndex(newPageIndex: any): void;
|
|
120
124
|
get editorType(): any;
|
|
121
125
|
get mode(): any;
|
|
122
126
|
/**
|
|
@@ -126,6 +130,7 @@ export class AnnotationEditor {
|
|
|
126
130
|
get propertiesToUpdate(): any[];
|
|
127
131
|
set _isDraggable(value: boolean);
|
|
128
132
|
get _isDraggable(): boolean;
|
|
133
|
+
get uid(): any;
|
|
129
134
|
/**
|
|
130
135
|
* @returns {boolean} true if the editor handles the Enter key itself.
|
|
131
136
|
*/
|
|
@@ -234,11 +239,8 @@ export class AnnotationEditor {
|
|
|
234
239
|
get parentDimensions(): number[];
|
|
235
240
|
/**
|
|
236
241
|
* Set the dimensions of this editor.
|
|
237
|
-
* @param {number} width
|
|
238
|
-
* @param {number} height
|
|
239
242
|
*/
|
|
240
|
-
setDims(
|
|
241
|
-
fixDims(): void;
|
|
243
|
+
setDims(): void;
|
|
242
244
|
/**
|
|
243
245
|
* Get the translation used to position this editor when it's created.
|
|
244
246
|
* @returns {Array<number>}
|
|
@@ -266,6 +268,8 @@ export class AnnotationEditor {
|
|
|
266
268
|
* @returns {Promise<EditorToolbar|null>}
|
|
267
269
|
*/
|
|
268
270
|
addEditToolbar(): Promise<EditorToolbar | null>;
|
|
271
|
+
addCommentButtonInToolbar(): void;
|
|
272
|
+
removeCommentButtonFromToolbar(): void;
|
|
269
273
|
removeEditToolbar(): void;
|
|
270
274
|
addContainer(container: any): void;
|
|
271
275
|
getClientDimensions(): DOMRect;
|
|
@@ -284,24 +288,46 @@ export class AnnotationEditor {
|
|
|
284
288
|
serializeAltText(isForCopying: any): any;
|
|
285
289
|
hasAltText(): boolean;
|
|
286
290
|
hasAltTextData(): any;
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
291
|
+
focusCommentButton(): void;
|
|
292
|
+
addCommentButton(): Comment | null;
|
|
293
|
+
addStandaloneCommentButton(): void;
|
|
294
|
+
removeStandaloneCommentButton(): void;
|
|
295
|
+
hideStandaloneCommentButton(): void;
|
|
296
|
+
set comment(value: {
|
|
297
|
+
text: never;
|
|
298
|
+
richText: never;
|
|
299
|
+
date: never;
|
|
300
|
+
deleted: never;
|
|
301
|
+
color: any;
|
|
302
|
+
opacity: any;
|
|
303
|
+
} | null);
|
|
295
304
|
get comment(): {
|
|
296
|
-
text:
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
305
|
+
text: never;
|
|
306
|
+
richText: never;
|
|
307
|
+
date: never;
|
|
308
|
+
deleted: never;
|
|
309
|
+
color: any;
|
|
310
|
+
opacity: any;
|
|
311
|
+
} | null;
|
|
312
|
+
setCommentData({ comment, popupRef, richText }: {
|
|
313
|
+
comment: any;
|
|
314
|
+
popupRef: any;
|
|
315
|
+
richText: any;
|
|
316
|
+
}): void;
|
|
302
317
|
get hasEditedComment(): any;
|
|
303
|
-
|
|
318
|
+
get hasDeletedComment(): any;
|
|
319
|
+
get hasComment(): boolean;
|
|
320
|
+
editComment(options: any): Promise<void>;
|
|
321
|
+
toggleComment(isSelected: any, visibility?: undefined): void;
|
|
322
|
+
setSelectedCommentButton(selected: any): void;
|
|
304
323
|
addComment(serialized: any): void;
|
|
324
|
+
updateFromAnnotationLayer({ popup: { contents, deleted } }: {
|
|
325
|
+
popup: {
|
|
326
|
+
contents: any;
|
|
327
|
+
deleted: any;
|
|
328
|
+
};
|
|
329
|
+
}): void;
|
|
330
|
+
get parentBoundingClientRect(): DOMRect;
|
|
305
331
|
/**
|
|
306
332
|
* Render this editor in a div.
|
|
307
333
|
* @returns {HTMLDivElement | null}
|
|
@@ -330,6 +356,25 @@ export class AnnotationEditor {
|
|
|
330
356
|
* @returns {Array<number>}
|
|
331
357
|
*/
|
|
332
358
|
getPDFRect(): Array<number>;
|
|
359
|
+
getNonHCMColor(): any;
|
|
360
|
+
/**
|
|
361
|
+
* The color has been changed.
|
|
362
|
+
*/
|
|
363
|
+
onUpdatedColor(): void;
|
|
364
|
+
getData(): {
|
|
365
|
+
id: any;
|
|
366
|
+
pageIndex: number;
|
|
367
|
+
rect: number[];
|
|
368
|
+
richText: any;
|
|
369
|
+
contentsObj: {
|
|
370
|
+
str: any;
|
|
371
|
+
};
|
|
372
|
+
creationDate: any;
|
|
373
|
+
modificationDate: any;
|
|
374
|
+
popupRef: boolean;
|
|
375
|
+
color: any;
|
|
376
|
+
opacity: any;
|
|
377
|
+
};
|
|
333
378
|
/**
|
|
334
379
|
* Executed once this editor has been rendered.
|
|
335
380
|
* @param {boolean} focus - true if the editor should be focused.
|
|
@@ -418,6 +463,19 @@ export class AnnotationEditor {
|
|
|
418
463
|
*/
|
|
419
464
|
makeResizable(): void;
|
|
420
465
|
get toolbarPosition(): null;
|
|
466
|
+
/**
|
|
467
|
+
* Get the position of the comment button.
|
|
468
|
+
* @returns {Array<number>|null}
|
|
469
|
+
*/
|
|
470
|
+
get commentButtonPosition(): Array<number> | null;
|
|
471
|
+
get commentButtonPositionInPage(): number[];
|
|
472
|
+
get commentButtonColor(): any;
|
|
473
|
+
set commentPopupPosition(pos: any);
|
|
474
|
+
get commentPopupPosition(): any;
|
|
475
|
+
hasDefaultPopupPosition(): any;
|
|
476
|
+
get commentButtonWidth(): any;
|
|
477
|
+
get elementBeforePopup(): HTMLDivElement | null;
|
|
478
|
+
setCommentButtonStates(options: any): void;
|
|
421
479
|
/**
|
|
422
480
|
* onkeydown callback.
|
|
423
481
|
* @param {KeyboardEvent} event
|
|
@@ -429,10 +487,12 @@ export class AnnotationEditor {
|
|
|
429
487
|
* Select this editor.
|
|
430
488
|
*/
|
|
431
489
|
select(): void;
|
|
490
|
+
focus(): void;
|
|
432
491
|
/**
|
|
433
492
|
* Unselect this editor.
|
|
434
493
|
*/
|
|
435
494
|
unselect(): void;
|
|
495
|
+
hideCommentPopup(): void;
|
|
436
496
|
/**
|
|
437
497
|
* Update some parameters which have been changed through the UI.
|
|
438
498
|
* @param {number} type
|
|
@@ -484,12 +544,6 @@ export class AnnotationEditor {
|
|
|
484
544
|
* @type {boolean}
|
|
485
545
|
*/
|
|
486
546
|
get isEditing(): boolean;
|
|
487
|
-
/**
|
|
488
|
-
* Set the aspect ratio to use when resizing.
|
|
489
|
-
* @param {number} width
|
|
490
|
-
* @param {number} height
|
|
491
|
-
*/
|
|
492
|
-
setAspectRatio(width: number, height: number): void;
|
|
493
547
|
/**
|
|
494
548
|
* Get the data to report to the telemetry when the editor is added.
|
|
495
549
|
* @returns {Object}
|
|
@@ -508,6 +562,7 @@ export class AnnotationEditor {
|
|
|
508
562
|
show(visible?: boolean | undefined): void;
|
|
509
563
|
enable(): void;
|
|
510
564
|
disable(): void;
|
|
565
|
+
updateFakeAnnotationElement(annotationLayer: any): void;
|
|
511
566
|
/**
|
|
512
567
|
* Render an annotation in the annotation layer.
|
|
513
568
|
* @param {Object} annotation
|
|
@@ -16,12 +16,13 @@ export class FreeTextEditor extends AnnotationEditor {
|
|
|
16
16
|
static updateDefaultParams(type: any, value: any): void;
|
|
17
17
|
/** @inheritdoc */
|
|
18
18
|
static get defaultPropertiesToUpdate(): any[][];
|
|
19
|
-
static #getNodeContent(node: any): any;
|
|
20
|
-
static #deserializeContent(content: any): any;
|
|
19
|
+
static "__#private@#getNodeContent"(node: any): any;
|
|
20
|
+
static "__#private@#deserializeContent"(content: any): any;
|
|
21
21
|
/** @inheritdoc */
|
|
22
22
|
static deserialize(data: any, parent: any, uiManager: any): Promise<AnnotationEditor | null>;
|
|
23
23
|
constructor(params: any);
|
|
24
24
|
_colorPicker: null;
|
|
25
|
+
color: any;
|
|
25
26
|
/** @inheritdoc */
|
|
26
27
|
updateParams(type: any, value: any): void;
|
|
27
28
|
/** @inheritdoc */
|
|
@@ -29,7 +30,6 @@ export class FreeTextEditor extends AnnotationEditor {
|
|
|
29
30
|
/** @inheritdoc */
|
|
30
31
|
get toolbarButtons(): (string | null)[][];
|
|
31
32
|
get colorType(): number;
|
|
32
|
-
get colorValue(): any;
|
|
33
33
|
/**
|
|
34
34
|
* Helper to translate the editor with the keyboard when it's empty.
|
|
35
35
|
* @param {number} x in page units.
|
|
@@ -19,18 +19,19 @@ export class HighlightEditor extends AnnotationEditor {
|
|
|
19
19
|
/** @inheritdoc */
|
|
20
20
|
static updateDefaultParams(type: any, value: any): void;
|
|
21
21
|
static get defaultPropertiesToUpdate(): (number | null)[][];
|
|
22
|
-
static #rotateBbox([x, y, width, height]: [any, any, any, any], angle: any): any[];
|
|
22
|
+
static "__#private@#rotateBbox"([x, y, width, height]: [any, any, any, any], angle: any): any[];
|
|
23
23
|
static startHighlighting(parent: any, isLTR: any, { target: textLayer, x, y }: {
|
|
24
24
|
target: any;
|
|
25
25
|
x: any;
|
|
26
26
|
y: any;
|
|
27
27
|
}): void;
|
|
28
|
-
static #highlightMove(parent: any, event: any): void;
|
|
29
|
-
static #endHighlight(parent: any, event: any): void;
|
|
28
|
+
static "__#private@#highlightMove"(parent: any, event: any): void;
|
|
29
|
+
static "__#private@#endHighlight"(parent: any, event: any): void;
|
|
30
30
|
/** @inheritdoc */
|
|
31
31
|
static deserialize(data: any, parent: any, uiManager: any): Promise<AnnotationEditor | null>;
|
|
32
32
|
constructor(params: any);
|
|
33
33
|
color: any;
|
|
34
|
+
opacity: any;
|
|
34
35
|
defaultL10nId: string;
|
|
35
36
|
/** @inheritdoc */
|
|
36
37
|
get telemetryInitialData(): {
|
|
@@ -45,10 +46,11 @@ export class HighlightEditor extends AnnotationEditor {
|
|
|
45
46
|
type: string;
|
|
46
47
|
color: any;
|
|
47
48
|
};
|
|
48
|
-
get commentColor(): any;
|
|
49
49
|
/** @inheritdoc */
|
|
50
50
|
translateInPage(x: any, y: any): void;
|
|
51
51
|
/** @inheritdoc */
|
|
52
|
+
get commentButtonPosition(): null;
|
|
53
|
+
/** @inheritdoc */
|
|
52
54
|
updateParams(type: any, value: any): void;
|
|
53
55
|
/** @inheritdoc */
|
|
54
56
|
get propertiesToUpdate(): any[][];
|
|
@@ -24,7 +24,8 @@ export class InkEditor extends DrawingEditor {
|
|
|
24
24
|
/** @inheritdoc */
|
|
25
25
|
get toolbarButtons(): (string | null)[][];
|
|
26
26
|
get colorType(): number;
|
|
27
|
-
get
|
|
27
|
+
get color(): any;
|
|
28
|
+
get opacity(): any;
|
|
28
29
|
/** @inheritdoc */
|
|
29
30
|
createDrawingOptions({ color, thickness, opacity }: {
|
|
30
31
|
color: any;
|
|
@@ -66,15 +66,10 @@ export class SignatureEditor extends DrawingEditor {
|
|
|
66
66
|
_drawingOptions: any;
|
|
67
67
|
/** @inheritdoc */
|
|
68
68
|
serialize(isForCopying?: boolean): {
|
|
69
|
-
annotationType: number;
|
|
70
69
|
isSignature: boolean;
|
|
71
70
|
areContours: boolean;
|
|
72
71
|
color: number[];
|
|
73
72
|
thickness: any;
|
|
74
|
-
pageIndex: number;
|
|
75
|
-
rect: any;
|
|
76
|
-
rotation: number;
|
|
77
|
-
structTreeParentId: any;
|
|
78
73
|
} | null;
|
|
79
74
|
#private;
|
|
80
75
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export class EditorToolbar {
|
|
2
|
-
static #l10nRemove: null;
|
|
3
|
-
static #pointerDown(e: any): void;
|
|
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;
|
|
@@ -8,10 +8,12 @@ export class EditorToolbar {
|
|
|
8
8
|
show(): void;
|
|
9
9
|
addDeleteButton(): void;
|
|
10
10
|
addAltText(altText: any): Promise<void>;
|
|
11
|
-
addComment(comment: any): void;
|
|
11
|
+
addComment(comment: any, beforeElement?: null): void;
|
|
12
12
|
addColorPicker(colorPicker: any): void;
|
|
13
13
|
addEditSignatureButton(signatureManager: any): Promise<void>;
|
|
14
|
+
removeButton(name: any): void;
|
|
14
15
|
addButton(name: any, tool: any): Promise<void>;
|
|
16
|
+
addButtonBefore(name: any, tool: any, beforeSelector: any): Promise<void>;
|
|
15
17
|
updateEditSignatureButton(description: any): void;
|
|
16
18
|
remove(): void;
|
|
17
19
|
#private;
|
|
@@ -42,7 +42,21 @@ export class AnnotationEditorUIManager {
|
|
|
42
42
|
setMainHighlightColorPicker(colorPicker: any): void;
|
|
43
43
|
editAltText(editor: any, firstTime?: boolean): void;
|
|
44
44
|
hasCommentManager(): boolean;
|
|
45
|
-
editComment(editor: any,
|
|
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>;
|
|
46
60
|
getSignature(editor: any): void;
|
|
47
61
|
get signatureManager(): null;
|
|
48
62
|
switchToMode(mode: any, callback: any): void;
|
|
@@ -54,6 +68,7 @@ export class AnnotationEditorUIManager {
|
|
|
54
68
|
onPageChanging({ pageNumber }: {
|
|
55
69
|
pageNumber: any;
|
|
56
70
|
}): void;
|
|
71
|
+
deletePage(id: any): void;
|
|
57
72
|
focusMainContainer(): void;
|
|
58
73
|
findParent(x: any, y: any): any;
|
|
59
74
|
disableUserSelect(value?: boolean): void;
|
|
@@ -67,6 +82,15 @@ export class AnnotationEditorUIManager {
|
|
|
67
82
|
}): void;
|
|
68
83
|
highlightSelection(methodOfCreation?: string, comment?: boolean): void;
|
|
69
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;
|
|
70
94
|
/**
|
|
71
95
|
* Add an editor in the annotation storage.
|
|
72
96
|
* @param {AnnotationEditor} editor
|
|
@@ -116,6 +140,11 @@ export class AnnotationEditorUIManager {
|
|
|
116
140
|
onEditingAction({ name }: {
|
|
117
141
|
name: any;
|
|
118
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[]>;
|
|
119
148
|
/**
|
|
120
149
|
* Set the editing state.
|
|
121
150
|
* It can be useful to temporarily disable it when the user is editing a
|
|
@@ -146,6 +175,8 @@ export class AnnotationEditorUIManager {
|
|
|
146
175
|
* Change the editor mode (None, FreeText, Ink, ...)
|
|
147
176
|
* @param {number} mode
|
|
148
177
|
* @param {string|null} editId
|
|
178
|
+
* @param {boolean} [isFromUser] - true if the mode change is due to a
|
|
179
|
+
* user action.
|
|
149
180
|
* @param {boolean} [isFromKeyboard] - true if the mode change is due to a
|
|
150
181
|
* keyboard action.
|
|
151
182
|
* @param {boolean} [mustEnterInEditMode] - true if the editor must enter in
|
|
@@ -153,7 +184,7 @@ export class AnnotationEditorUIManager {
|
|
|
153
184
|
* @param {boolean} [editComment] - true if the mode change is due to a
|
|
154
185
|
* comment edit.
|
|
155
186
|
*/
|
|
156
|
-
updateMode(mode: number, editId?: string | null, isFromKeyboard?: boolean, mustEnterInEditMode?: boolean, editComment?: boolean): Promise<void>;
|
|
187
|
+
updateMode(mode: number, editId?: string | null, isFromUser?: boolean, isFromKeyboard?: boolean, mustEnterInEditMode?: boolean, editComment?: boolean): Promise<void>;
|
|
157
188
|
addNewEditorFromKeyboard(): void;
|
|
158
189
|
/**
|
|
159
190
|
* Update the toolbar if it's required to reflect the tool currently used.
|
|
@@ -173,9 +204,9 @@ export class AnnotationEditorUIManager {
|
|
|
173
204
|
/**
|
|
174
205
|
* Get all the editors belonging to a given page.
|
|
175
206
|
* @param {number} pageIndex
|
|
176
|
-
* @
|
|
207
|
+
* @yields {AnnotationEditor}
|
|
177
208
|
*/
|
|
178
|
-
getEditors(pageIndex: number):
|
|
209
|
+
getEditors(pageIndex: number): Generator<any, void, unknown>;
|
|
179
210
|
/**
|
|
180
211
|
* Get an editor with the given id.
|
|
181
212
|
* @param {string} id
|
|
@@ -309,6 +340,7 @@ export class AnnotationEditorUIManager {
|
|
|
309
340
|
* @returns {number}
|
|
310
341
|
*/
|
|
311
342
|
getMode(): number;
|
|
343
|
+
isEditingMode(): boolean;
|
|
312
344
|
get imageManager(): any;
|
|
313
345
|
getSelectionBoxes(textLayer: any): {
|
|
314
346
|
x: number;
|
|
@@ -403,6 +435,28 @@ export class CommandManager {
|
|
|
403
435
|
destroy(): void;
|
|
404
436
|
#private;
|
|
405
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
|
+
}
|
|
406
460
|
/**
|
|
407
461
|
* Class to handle the different keyboards shortcuts we can have on mac or
|
|
408
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<ArrayBuffer>> | 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<ArrayBuffer>> | 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";
|