unpdf 0.10.0 → 0.11.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 +9 -7
- package/dist/index.cjs +15 -19
- package/dist/index.d.cts +32 -13
- package/dist/index.d.mts +32 -13
- package/dist/index.d.ts +32 -13
- package/dist/index.mjs +15 -19
- package/dist/pdfjs.d.mts +1 -0
- package/dist/pdfjs.d.ts +1 -0
- package/dist/pdfjs.mjs +1 -1
- package/dist/types/src/display/annotation_layer.d.ts +10 -3
- package/dist/types/src/display/annotation_storage.d.ts +1 -0
- package/dist/types/src/display/api.d.ts +54 -26
- package/dist/types/src/display/base_factory.d.ts +3 -1
- package/dist/types/src/display/canvas.d.ts +2 -0
- package/dist/types/src/display/display_utils.d.ts +7 -5
- package/dist/types/src/display/draw_layer.d.ts +38 -0
- package/dist/types/src/display/editor/alt_text.d.ts +22 -0
- package/dist/types/src/display/editor/annotation_editor_layer.d.ts +24 -2
- package/dist/types/src/display/editor/color_picker.d.ts +19 -0
- package/dist/types/src/display/editor/editor.d.ts +78 -16
- package/dist/types/src/display/editor/freetext.d.ts +6 -1
- package/dist/types/src/display/editor/highlight.d.ts +88 -0
- package/dist/types/src/display/editor/ink.d.ts +4 -4
- package/dist/types/src/display/editor/outliner.d.ts +70 -0
- package/dist/types/src/display/editor/stamp.d.ts +1 -1
- package/dist/types/src/display/editor/toolbar.d.ts +17 -0
- package/dist/types/src/display/editor/tools.d.ts +39 -4
- package/dist/types/src/display/fetch_stream.d.ts +3 -4
- package/dist/types/src/display/font_loader.d.ts +1 -5
- package/dist/types/src/display/network.d.ts +2 -3
- package/dist/types/src/display/node_stream.d.ts +4 -5
- package/dist/types/src/display/node_utils.d.ts +6 -5
- package/dist/types/src/display/optional_content_config.d.ts +6 -1
- package/dist/types/src/display/text_layer.d.ts +40 -108
- package/dist/types/src/display/transport_stream.d.ts +3 -7
- package/dist/types/src/display/worker_options.d.ts +20 -22
- package/dist/types/src/pdf.d.ts +6 -3
- package/dist/types/src/shared/util.d.ts +24 -23
- package/dist/types/web/annotation_editor_layer_builder.d.ts +10 -13
- package/dist/types/web/annotation_layer_builder.d.ts +7 -4
- package/dist/types/web/app_options.d.ts +1 -2
- package/dist/types/web/draw_layer_builder.d.ts +23 -0
- package/dist/types/web/genericl10n.d.ts +5 -3
- package/dist/types/web/interfaces.d.ts +11 -8
- package/dist/types/web/l10n.d.ts +5 -2
- package/dist/types/web/pdf_find_controller.d.ts +1 -2
- package/dist/types/web/pdf_history.d.ts +1 -53
- package/dist/types/web/pdf_link_service.d.ts +6 -109
- package/dist/types/web/pdf_page_view.d.ts +5 -16
- package/dist/types/web/pdf_scripting_manager.d.ts +6 -10
- package/dist/types/web/pdf_single_page_viewer.d.ts +2 -2
- package/dist/types/web/pdf_thumbnail_view.d.ts +1 -13
- package/dist/types/web/pdf_thumbnail_viewer.d.ts +1 -17
- package/dist/types/web/pdf_viewer.component.d.ts +1 -2
- package/dist/types/web/pdf_viewer.d.ts +90 -42
- package/dist/types/web/text_accessibility.d.ts +1 -1
- package/dist/types/web/text_highlighter.d.ts +1 -1
- package/dist/types/web/text_layer_builder.d.ts +17 -29
- package/dist/types/web/ui_utils.d.ts +1 -1
- package/package.json +21 -30
- package/dist/types/web/l10n_utils.d.ts +0 -9
|
@@ -36,7 +36,7 @@ export class AnnotationEditor {
|
|
|
36
36
|
static _borderLineWidth: number;
|
|
37
37
|
static _colorManager: ColorManager;
|
|
38
38
|
static _zIndex: number;
|
|
39
|
-
static
|
|
39
|
+
static _telemetryTimeout: number;
|
|
40
40
|
static get _resizerKeyboardManager(): any;
|
|
41
41
|
static get _defaultLineColor(): any;
|
|
42
42
|
static deleteAnnotationElement(editor: any): void;
|
|
@@ -44,7 +44,7 @@ export class AnnotationEditor {
|
|
|
44
44
|
* Initialize the l10n stuff for this type of editor.
|
|
45
45
|
* @param {Object} l10n
|
|
46
46
|
*/
|
|
47
|
-
static initialize(l10n: Object, options
|
|
47
|
+
static initialize(l10n: Object, _uiManager: any, options: any): void;
|
|
48
48
|
/**
|
|
49
49
|
* Update the default parameters for this type of editor.
|
|
50
50
|
* @param {number} _type
|
|
@@ -70,7 +70,7 @@ export class AnnotationEditor {
|
|
|
70
70
|
* @param {AnnotationEditorLayer} parent
|
|
71
71
|
*/
|
|
72
72
|
static paste(item: DataTransferItem, parent: AnnotationEditorLayer): void;
|
|
73
|
-
static "__#
|
|
73
|
+
static "__#34@#rotatePoint"(x: any, y: any, angle: any): any[];
|
|
74
74
|
/**
|
|
75
75
|
* Deserialize the editor.
|
|
76
76
|
* The result of the deserialization is a new editor.
|
|
@@ -82,11 +82,13 @@ export class AnnotationEditor {
|
|
|
82
82
|
*/
|
|
83
83
|
static deserialize(data: Object, parent: AnnotationEditorLayer, uiManager: AnnotationEditorUIManager): AnnotationEditor | null;
|
|
84
84
|
static get MIN_SIZE(): number;
|
|
85
|
+
static canCreateNewEmptyEditor(): boolean;
|
|
85
86
|
/**
|
|
86
87
|
* @param {AnnotationEditorParameters} parameters
|
|
87
88
|
*/
|
|
88
89
|
constructor(parameters: AnnotationEditorParameters);
|
|
89
90
|
_initialOptions: any;
|
|
91
|
+
_isVisible: boolean;
|
|
90
92
|
_uiManager: null;
|
|
91
93
|
_focusEventsAllowed: boolean;
|
|
92
94
|
_l10nPromise: null;
|
|
@@ -114,7 +116,7 @@ export class AnnotationEditor {
|
|
|
114
116
|
* @returns {Array}
|
|
115
117
|
*/
|
|
116
118
|
get propertiesToUpdate(): any[];
|
|
117
|
-
set _isDraggable(
|
|
119
|
+
set _isDraggable(value: boolean);
|
|
118
120
|
get _isDraggable(): boolean;
|
|
119
121
|
/**
|
|
120
122
|
* @returns {boolean} true if the editor handles the Enter key itself.
|
|
@@ -173,7 +175,25 @@ export class AnnotationEditor {
|
|
|
173
175
|
*/
|
|
174
176
|
translateInPage(x: number, y: number): void;
|
|
175
177
|
drag(tx: any, ty: any): void;
|
|
176
|
-
|
|
178
|
+
get _hasBeenMoved(): boolean;
|
|
179
|
+
/**
|
|
180
|
+
* Get the translation to take into account the editor border.
|
|
181
|
+
* The CSS engine positions the element by taking the border into account so
|
|
182
|
+
* we must apply the opposite translation to have the editor in the right
|
|
183
|
+
* position.
|
|
184
|
+
* @returns {Array<number>}
|
|
185
|
+
*/
|
|
186
|
+
getBaseTranslation(): Array<number>;
|
|
187
|
+
/**
|
|
188
|
+
* @returns {boolean} true if position must be fixed (i.e. make the x and y
|
|
189
|
+
* living in the page).
|
|
190
|
+
*/
|
|
191
|
+
get _mustFixPosition(): boolean;
|
|
192
|
+
/**
|
|
193
|
+
* Fix the position of the editor in order to keep it inside its parent page.
|
|
194
|
+
* @param {number} [rotation] - the rotation of the page.
|
|
195
|
+
*/
|
|
196
|
+
fixAndSetPosition(rotation?: number | undefined): void;
|
|
177
197
|
/**
|
|
178
198
|
* Convert a screen translation into a page one.
|
|
179
199
|
* @param {number} x
|
|
@@ -201,20 +221,21 @@ export class AnnotationEditor {
|
|
|
201
221
|
* @returns {Array<number>}
|
|
202
222
|
*/
|
|
203
223
|
getInitialTranslation(): Array<number>;
|
|
204
|
-
addAltTextButton(): Promise<void>;
|
|
205
224
|
altTextFinish(): void;
|
|
225
|
+
/**
|
|
226
|
+
* Add a toolbar for this editor.
|
|
227
|
+
* @returns {Promise<EditorToolbar|null>}
|
|
228
|
+
*/
|
|
229
|
+
addEditToolbar(): Promise<EditorToolbar | null>;
|
|
230
|
+
removeEditToolbar(): void;
|
|
206
231
|
getClientDimensions(): DOMRect;
|
|
232
|
+
addAltTextButton(): Promise<void>;
|
|
207
233
|
/**
|
|
208
234
|
* Set the alt text data.
|
|
209
235
|
*/
|
|
210
|
-
set altTextData(
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
});
|
|
214
|
-
get altTextData(): {
|
|
215
|
-
altText: string;
|
|
216
|
-
decorative: boolean;
|
|
217
|
-
};
|
|
236
|
+
set altTextData(data: any);
|
|
237
|
+
get altTextData(): any;
|
|
238
|
+
hasAltText(): boolean;
|
|
218
239
|
/**
|
|
219
240
|
* Render this editor in a div.
|
|
220
241
|
* @returns {HTMLDivElement | null}
|
|
@@ -229,8 +250,11 @@ export class AnnotationEditor {
|
|
|
229
250
|
_setParentAndPosition(parent: any, x: any, y: any): void;
|
|
230
251
|
/**
|
|
231
252
|
* Convert the current rect into a page one.
|
|
253
|
+
* @param {number} tx - x-translation in screen coordinates.
|
|
254
|
+
* @param {number} ty - y-translation in screen coordinates.
|
|
255
|
+
* @param {number} [rotation] - the rotation of the page.
|
|
232
256
|
*/
|
|
233
|
-
getRect(tx:
|
|
257
|
+
getRect(tx: number, ty: number, rotation?: number | undefined): any[];
|
|
234
258
|
getRectInCurrentCoords(rect: any, pageHeight: any): any[];
|
|
235
259
|
/**
|
|
236
260
|
* Executed once this editor has been rendered.
|
|
@@ -271,6 +295,11 @@ export class AnnotationEditor {
|
|
|
271
295
|
* To implement in subclasses.
|
|
272
296
|
*/
|
|
273
297
|
rebuild(): void;
|
|
298
|
+
/**
|
|
299
|
+
* Rotate the editor.
|
|
300
|
+
* @param {number} angle
|
|
301
|
+
*/
|
|
302
|
+
rotate(_angle: any): void;
|
|
274
303
|
/**
|
|
275
304
|
* Serialize the editor.
|
|
276
305
|
* The result of the serialization will be used to construct a
|
|
@@ -282,6 +311,12 @@ export class AnnotationEditor {
|
|
|
282
311
|
* @returns {Object | null}
|
|
283
312
|
*/
|
|
284
313
|
serialize(isForCopying?: boolean | undefined, context?: Object | null | undefined): Object | null;
|
|
314
|
+
/**
|
|
315
|
+
* Check if an existing annotation associated with this editor has been
|
|
316
|
+
* modified.
|
|
317
|
+
* @returns {boolean}
|
|
318
|
+
*/
|
|
319
|
+
get hasBeenModified(): boolean;
|
|
285
320
|
/**
|
|
286
321
|
* Remove this editor.
|
|
287
322
|
* It's used on ctrl+backspace action.
|
|
@@ -295,6 +330,7 @@ export class AnnotationEditor {
|
|
|
295
330
|
* Add the resizers to this editor.
|
|
296
331
|
*/
|
|
297
332
|
makeResizable(): void;
|
|
333
|
+
get toolbarPosition(): null;
|
|
298
334
|
/**
|
|
299
335
|
* onkeydown callback.
|
|
300
336
|
* @param {KeyboardEvent} event
|
|
@@ -343,7 +379,7 @@ export class AnnotationEditor {
|
|
|
343
379
|
* When set to true, it means that this editor is currently edited.
|
|
344
380
|
* @param {boolean} value
|
|
345
381
|
*/
|
|
346
|
-
set isEditing(
|
|
382
|
+
set isEditing(value: boolean);
|
|
347
383
|
/**
|
|
348
384
|
* If true then the editor is currently edited.
|
|
349
385
|
* @type {boolean}
|
|
@@ -355,7 +391,33 @@ export class AnnotationEditor {
|
|
|
355
391
|
* @param {number} height
|
|
356
392
|
*/
|
|
357
393
|
setAspectRatio(width: number, height: number): void;
|
|
394
|
+
/**
|
|
395
|
+
* Get the data to report to the telemetry when the editor is added.
|
|
396
|
+
* @returns {Object}
|
|
397
|
+
*/
|
|
398
|
+
get telemetryInitialData(): Object;
|
|
399
|
+
/**
|
|
400
|
+
* The telemetry data to use when saving/printing.
|
|
401
|
+
* @returns {Object|null}
|
|
402
|
+
*/
|
|
403
|
+
get telemetryFinalData(): Object | null;
|
|
404
|
+
_reportTelemetry(data: any, mustWait?: boolean): void;
|
|
405
|
+
/**
|
|
406
|
+
* Show or hide this editor.
|
|
407
|
+
* @param {boolean|undefined} visible
|
|
408
|
+
*/
|
|
409
|
+
show(visible?: boolean | undefined): void;
|
|
410
|
+
enable(): void;
|
|
411
|
+
disable(): void;
|
|
412
|
+
/**
|
|
413
|
+
* Render an annotation in the annotation layer.
|
|
414
|
+
* @param {Object} annotation
|
|
415
|
+
* @returns {HTMLElement}
|
|
416
|
+
*/
|
|
417
|
+
renderAnnotationElement(annotation: Object): HTMLElement;
|
|
418
|
+
resetAnnotationElement(annotation: any): void;
|
|
358
419
|
#private;
|
|
359
420
|
}
|
|
360
421
|
import { AnnotationEditorUIManager } from "./tools.js";
|
|
422
|
+
import { EditorToolbar } from "./toolbar.js";
|
|
361
423
|
import { ColorManager } from "./tools.js";
|
|
@@ -11,11 +11,13 @@ export class FreeTextEditor extends AnnotationEditor {
|
|
|
11
11
|
static _type: string;
|
|
12
12
|
static _editorType: number;
|
|
13
13
|
/** @inheritdoc */
|
|
14
|
-
static initialize(l10n: any): void;
|
|
14
|
+
static initialize(l10n: any, uiManager: any): void;
|
|
15
15
|
/** @inheritdoc */
|
|
16
16
|
static updateDefaultParams(type: any, value: any): void;
|
|
17
17
|
/** @inheritdoc */
|
|
18
18
|
static get defaultPropertiesToUpdate(): any[][];
|
|
19
|
+
static "__#17@#getNodeContent"(node: any): any;
|
|
20
|
+
static "__#17@#deserializeContent"(content: any): any;
|
|
19
21
|
/** @inheritdoc */
|
|
20
22
|
static deserialize(data: any, parent: any, uiManager: any): AnnotationEditor | null;
|
|
21
23
|
constructor(params: any);
|
|
@@ -45,6 +47,7 @@ export class FreeTextEditor extends AnnotationEditor {
|
|
|
45
47
|
editorDivInput(event: any): void;
|
|
46
48
|
editorDiv: HTMLDivElement | undefined;
|
|
47
49
|
overlayDiv: HTMLDivElement | undefined;
|
|
50
|
+
editorDivPaste(event: any): void;
|
|
48
51
|
/** @inheritdoc */
|
|
49
52
|
serialize(isForCopying?: boolean): {
|
|
50
53
|
annotationType: number;
|
|
@@ -60,6 +63,8 @@ export class FreeTextEditor extends AnnotationEditor {
|
|
|
60
63
|
id: any;
|
|
61
64
|
deleted: boolean;
|
|
62
65
|
} | null;
|
|
66
|
+
/** @inheritdoc */
|
|
67
|
+
renderAnnotationElement(annotation: any): HTMLElement;
|
|
63
68
|
#private;
|
|
64
69
|
}
|
|
65
70
|
import { AnnotationEditor } from "./editor.js";
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Basic draw editor in order to generate an Highlight annotation.
|
|
3
|
+
*/
|
|
4
|
+
export class HighlightEditor extends AnnotationEditor {
|
|
5
|
+
static _defaultColor: null;
|
|
6
|
+
static _defaultOpacity: number;
|
|
7
|
+
static _defaultThickness: number;
|
|
8
|
+
static _l10nPromise: any;
|
|
9
|
+
static _type: string;
|
|
10
|
+
static _editorType: number;
|
|
11
|
+
static _freeHighlightId: number;
|
|
12
|
+
static _freeHighlight: null;
|
|
13
|
+
static _freeHighlightClipId: string;
|
|
14
|
+
static get _keyboardManager(): any;
|
|
15
|
+
static computeTelemetryFinalData(data: any): {
|
|
16
|
+
numberOfColors: any;
|
|
17
|
+
};
|
|
18
|
+
/** @inheritdoc */
|
|
19
|
+
static initialize(l10n: any, uiManager: any): void;
|
|
20
|
+
/** @inheritdoc */
|
|
21
|
+
static updateDefaultParams(type: any, value: any): void;
|
|
22
|
+
static get defaultPropertiesToUpdate(): (number | null)[][];
|
|
23
|
+
static "__#23@#rotateBbox"({ x, y, width, height }: {
|
|
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
|
+
};
|
|
34
|
+
static startHighlighting(parent: any, isLTR: any, { target: textLayer, x, y }: {
|
|
35
|
+
target: any;
|
|
36
|
+
x: any;
|
|
37
|
+
y: any;
|
|
38
|
+
}): void;
|
|
39
|
+
static "__#23@#highlightMove"(parent: any, event: any): void;
|
|
40
|
+
static "__#23@#endHighlight"(parent: any, event: any): void;
|
|
41
|
+
/** @inheritdoc */
|
|
42
|
+
static deserialize(data: any, parent: any, uiManager: any): AnnotationEditor | null;
|
|
43
|
+
constructor(params: any);
|
|
44
|
+
color: any;
|
|
45
|
+
/** @inheritdoc */
|
|
46
|
+
get telemetryInitialData(): {
|
|
47
|
+
action: string;
|
|
48
|
+
type: string;
|
|
49
|
+
color: any;
|
|
50
|
+
thickness: any;
|
|
51
|
+
methodOfCreation: string;
|
|
52
|
+
};
|
|
53
|
+
/** @inheritdoc */
|
|
54
|
+
get telemetryFinalData(): {
|
|
55
|
+
type: string;
|
|
56
|
+
color: any;
|
|
57
|
+
};
|
|
58
|
+
/** @inheritdoc */
|
|
59
|
+
translateInPage(x: any, y: any): void;
|
|
60
|
+
/** @inheritdoc */
|
|
61
|
+
updateParams(type: any, value: any): void;
|
|
62
|
+
/** @inheritdoc */
|
|
63
|
+
get propertiesToUpdate(): any[][];
|
|
64
|
+
/** @inheritdoc */
|
|
65
|
+
fixAndSetPosition(): void;
|
|
66
|
+
/** @inheritdoc */
|
|
67
|
+
getRect(tx: any, ty: any): any[];
|
|
68
|
+
/** @inheritdoc */
|
|
69
|
+
rotate(angle: any): void;
|
|
70
|
+
pointerover(): void;
|
|
71
|
+
pointerleave(): void;
|
|
72
|
+
_moveCaret(direction: any): void;
|
|
73
|
+
/** @inheritdoc */
|
|
74
|
+
serialize(isForCopying?: boolean): {
|
|
75
|
+
annotationType: number;
|
|
76
|
+
color: number[];
|
|
77
|
+
opacity: any;
|
|
78
|
+
thickness: any;
|
|
79
|
+
quadPoints: any[] | null;
|
|
80
|
+
outlines: any;
|
|
81
|
+
pageIndex: number;
|
|
82
|
+
rect: any[];
|
|
83
|
+
rotation: number;
|
|
84
|
+
structTreeParentId: any;
|
|
85
|
+
} | null;
|
|
86
|
+
#private;
|
|
87
|
+
}
|
|
88
|
+
import { AnnotationEditor } from "./editor.js";
|
|
@@ -8,7 +8,7 @@ export class InkEditor extends AnnotationEditor {
|
|
|
8
8
|
static _type: string;
|
|
9
9
|
static _editorType: number;
|
|
10
10
|
/** @inheritdoc */
|
|
11
|
-
static initialize(l10n: any): void;
|
|
11
|
+
static initialize(l10n: any, uiManager: any): void;
|
|
12
12
|
/** @inheritdoc */
|
|
13
13
|
static updateDefaultParams(type: any, value: any): void;
|
|
14
14
|
/** @inheritdoc */
|
|
@@ -18,9 +18,9 @@ export class InkEditor extends AnnotationEditor {
|
|
|
18
18
|
* @param {Array<Array<number>>} bezier
|
|
19
19
|
* @returns {Path2D}
|
|
20
20
|
*/
|
|
21
|
-
static "__#
|
|
22
|
-
static "__#
|
|
23
|
-
static "__#
|
|
21
|
+
static "__#24@#buildPath2D"(bezier: Array<Array<number>>): Path2D;
|
|
22
|
+
static "__#24@#toPDFCoordinates"(points: any, rect: any, rotation: any): any;
|
|
23
|
+
static "__#24@#fromPDFCoordinates"(points: any, rect: any, rotation: any): any;
|
|
24
24
|
/** @inheritdoc */
|
|
25
25
|
static deserialize(data: any, parent: any, uiManager: any): AnnotationEditor | null;
|
|
26
26
|
constructor(params: any);
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
export class FreeOutliner {
|
|
2
|
+
static "__#20@#MIN_DIST": number;
|
|
3
|
+
static "__#20@#MIN_DIFF": number;
|
|
4
|
+
static "__#20@#MIN": number;
|
|
5
|
+
constructor({ x, y }: {
|
|
6
|
+
x: any;
|
|
7
|
+
y: any;
|
|
8
|
+
}, box: any, scaleFactor: any, thickness: any, isLTR: any, innerMargin?: number);
|
|
9
|
+
get free(): boolean;
|
|
10
|
+
isEmpty(): boolean;
|
|
11
|
+
add({ x, y }: {
|
|
12
|
+
x: any;
|
|
13
|
+
y: any;
|
|
14
|
+
}): boolean;
|
|
15
|
+
toSVGPath(): string;
|
|
16
|
+
getOutlines(): FreeHighlightOutline;
|
|
17
|
+
#private;
|
|
18
|
+
}
|
|
19
|
+
export class Outliner {
|
|
20
|
+
/**
|
|
21
|
+
* Construct an outliner.
|
|
22
|
+
* @param {Array<Object>} boxes - An array of axis-aligned rectangles.
|
|
23
|
+
* @param {number} borderWidth - The width of the border of the boxes, it
|
|
24
|
+
* allows to make the boxes bigger (or smaller).
|
|
25
|
+
* @param {number} innerMargin - The margin between the boxes and the
|
|
26
|
+
* outlines. It's important to not have a null innerMargin when we want to
|
|
27
|
+
* draw the outline else the stroked outline could be clipped because of its
|
|
28
|
+
* width.
|
|
29
|
+
* @param {boolean} isLTR - true if we're in LTR mode. It's used to determine
|
|
30
|
+
* the last point of the boxes.
|
|
31
|
+
*/
|
|
32
|
+
constructor(boxes: Array<Object>, borderWidth?: number, innerMargin?: number, isLTR?: boolean);
|
|
33
|
+
getOutlines(): HighlightOutline;
|
|
34
|
+
#private;
|
|
35
|
+
}
|
|
36
|
+
declare class FreeHighlightOutline extends Outline {
|
|
37
|
+
constructor(outline: any, points: any, box: any, scaleFactor: any, innerMargin: any, isLTR: any);
|
|
38
|
+
serialize([blX, blY, trX, trY]: [any, any, any, any], rotation: any): {
|
|
39
|
+
outline: number[];
|
|
40
|
+
points: number[][];
|
|
41
|
+
};
|
|
42
|
+
get box(): null;
|
|
43
|
+
getNewOutline(thickness: any, innerMargin: any): FreeHighlightOutline;
|
|
44
|
+
#private;
|
|
45
|
+
}
|
|
46
|
+
declare class HighlightOutline extends Outline {
|
|
47
|
+
constructor(outlines: any, box: any);
|
|
48
|
+
/**
|
|
49
|
+
* Serialize the outlines into the PDF page coordinate system.
|
|
50
|
+
* @param {Array<number>} _bbox - the bounding box of the annotation.
|
|
51
|
+
* @param {number} _rotation - the rotation of the annotation.
|
|
52
|
+
* @returns {Array<Array<number>>}
|
|
53
|
+
*/
|
|
54
|
+
serialize([blX, blY, trX, trY]: Array<number>, _rotation: number): Array<Array<number>>;
|
|
55
|
+
get box(): any;
|
|
56
|
+
#private;
|
|
57
|
+
}
|
|
58
|
+
declare class Outline {
|
|
59
|
+
/**
|
|
60
|
+
* @returns {string} The SVG path of the outline.
|
|
61
|
+
*/
|
|
62
|
+
toSVGPath(): string;
|
|
63
|
+
/**
|
|
64
|
+
* @type {Object|null} The bounding box of the outline.
|
|
65
|
+
*/
|
|
66
|
+
get box(): Object | null;
|
|
67
|
+
serialize(_bbox: any, _rotation: any): void;
|
|
68
|
+
get free(): any;
|
|
69
|
+
}
|
|
70
|
+
export {};
|
|
@@ -5,7 +5,7 @@ export class StampEditor extends AnnotationEditor {
|
|
|
5
5
|
static _type: string;
|
|
6
6
|
static _editorType: number;
|
|
7
7
|
/** @inheritdoc */
|
|
8
|
-
static initialize(l10n: any): void;
|
|
8
|
+
static initialize(l10n: any, uiManager: any): void;
|
|
9
9
|
static get supportedTypes(): any;
|
|
10
10
|
static get supportedTypesStr(): any;
|
|
11
11
|
/** @inheritdoc */
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export class EditorToolbar {
|
|
2
|
+
static "__#3@#pointerDown"(e: any): void;
|
|
3
|
+
constructor(editor: any);
|
|
4
|
+
render(): HTMLDivElement;
|
|
5
|
+
hide(): void;
|
|
6
|
+
show(): void;
|
|
7
|
+
addAltTextButton(button: any): void;
|
|
8
|
+
addColorPicker(colorPicker: any): void;
|
|
9
|
+
remove(): void;
|
|
10
|
+
#private;
|
|
11
|
+
}
|
|
12
|
+
export class HighlightToolbar {
|
|
13
|
+
constructor(uiManager: any);
|
|
14
|
+
show(parent: any, boxes: any, isLTR: any): void;
|
|
15
|
+
hide(): void;
|
|
16
|
+
#private;
|
|
17
|
+
}
|
|
@@ -12,15 +12,21 @@ 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);
|
|
15
|
+
constructor(container: any, viewer: any, altTextManager: any, eventBus: any, pdfDocument: any, pageColors: any, highlightColors: any, enableHighlightFloatingButton: any, mlManager: any);
|
|
16
16
|
_eventBus: any;
|
|
17
17
|
viewParameters: {
|
|
18
18
|
realScale: number;
|
|
19
19
|
rotation: number;
|
|
20
20
|
};
|
|
21
|
+
isShiftKeyDown: boolean;
|
|
21
22
|
destroy(): void;
|
|
23
|
+
mlGuess(data: any): Promise<any>;
|
|
24
|
+
get hasMLManager(): boolean;
|
|
22
25
|
get hcmFilter(): any;
|
|
23
26
|
get direction(): any;
|
|
27
|
+
get highlightColors(): any;
|
|
28
|
+
get highlightColorNames(): any;
|
|
29
|
+
setMainHighlightColorPicker(colorPicker: any): void;
|
|
24
30
|
editAltText(editor: any): void;
|
|
25
31
|
onPageChanging({ pageNumber }: {
|
|
26
32
|
pageNumber: any;
|
|
@@ -36,6 +42,7 @@ export class AnnotationEditorUIManager {
|
|
|
36
42
|
onRotationChanging({ pagesRotation }: {
|
|
37
43
|
pagesRotation: any;
|
|
38
44
|
}): void;
|
|
45
|
+
highlightSelection(methodOfCreation?: string): void;
|
|
39
46
|
/**
|
|
40
47
|
* Add an editor in the annotation storage.
|
|
41
48
|
* @param {AnnotationEditor} editor
|
|
@@ -65,13 +72,19 @@ export class AnnotationEditorUIManager {
|
|
|
65
72
|
* @param {KeyboardEvent} event
|
|
66
73
|
*/
|
|
67
74
|
keydown(event: KeyboardEvent): void;
|
|
75
|
+
/**
|
|
76
|
+
* Keyup callback.
|
|
77
|
+
* @param {KeyboardEvent} event
|
|
78
|
+
*/
|
|
79
|
+
keyup(event: KeyboardEvent): void;
|
|
68
80
|
/**
|
|
69
81
|
* Execute an action for a given name.
|
|
70
82
|
* For example, the user can click on the "Undo" entry in the context menu
|
|
71
83
|
* and it'll trigger the undo action.
|
|
72
|
-
* @param {Object} details
|
|
73
84
|
*/
|
|
74
|
-
onEditingAction(
|
|
85
|
+
onEditingAction({ name }: {
|
|
86
|
+
name: any;
|
|
87
|
+
}): void;
|
|
75
88
|
/**
|
|
76
89
|
* Set the editing state.
|
|
77
90
|
* It can be useful to temporarily disable it when the user is editing a
|
|
@@ -119,6 +132,7 @@ export class AnnotationEditorUIManager {
|
|
|
119
132
|
* @param {*} value
|
|
120
133
|
*/
|
|
121
134
|
updateParams(type: number, value: any): void;
|
|
135
|
+
showAllEditors(type: any, visible: any, updateButton?: boolean): void;
|
|
122
136
|
enableWaiting(mustWait?: boolean): void;
|
|
123
137
|
/**
|
|
124
138
|
* Get all the editors belonging to a given page.
|
|
@@ -163,6 +177,11 @@ export class AnnotationEditorUIManager {
|
|
|
163
177
|
* @param {AnnotationEditor} editor
|
|
164
178
|
*/
|
|
165
179
|
setActiveEditor(editor: AnnotationEditor): void;
|
|
180
|
+
/**
|
|
181
|
+
* Update the UI of the active editor.
|
|
182
|
+
* @param {AnnotationEditor} editor
|
|
183
|
+
*/
|
|
184
|
+
updateUI(editor: AnnotationEditor): void;
|
|
166
185
|
/**
|
|
167
186
|
* Add or remove an editor the current selection.
|
|
168
187
|
* @param {AnnotationEditor} editor
|
|
@@ -253,6 +272,20 @@ export class AnnotationEditorUIManager {
|
|
|
253
272
|
*/
|
|
254
273
|
getMode(): number;
|
|
255
274
|
get imageManager(): any;
|
|
275
|
+
getSelectionBoxes(textLayer: any): {
|
|
276
|
+
x: number;
|
|
277
|
+
y: number;
|
|
278
|
+
width: number;
|
|
279
|
+
height: number;
|
|
280
|
+
}[] | null;
|
|
281
|
+
addChangedExistingAnnotation({ annotationElementId, id }: {
|
|
282
|
+
annotationElementId: any;
|
|
283
|
+
id: any;
|
|
284
|
+
}): void;
|
|
285
|
+
removeChangedExistingAnnotation({ annotationElementId }: {
|
|
286
|
+
annotationElementId: any;
|
|
287
|
+
}): void;
|
|
288
|
+
renderAnnotationElement(annotation: any): void;
|
|
256
289
|
#private;
|
|
257
290
|
}
|
|
258
291
|
export function bindEvents(obj: any, element: any, names: any): void;
|
|
@@ -289,6 +322,7 @@ export class CommandManager {
|
|
|
289
322
|
* @typedef {Object} addOptions
|
|
290
323
|
* @property {function} cmd
|
|
291
324
|
* @property {function} undo
|
|
325
|
+
* @property {function} [post]
|
|
292
326
|
* @property {boolean} mustExec
|
|
293
327
|
* @property {number} type
|
|
294
328
|
* @property {boolean} overwriteIfSameType
|
|
@@ -298,9 +332,10 @@ export class CommandManager {
|
|
|
298
332
|
* Add a new couple of commands to be used in case of redo/undo.
|
|
299
333
|
* @param {addOptions} options
|
|
300
334
|
*/
|
|
301
|
-
add({ cmd, undo, mustExec, type, overwriteIfSameType, keepUndo, }: {
|
|
335
|
+
add({ cmd, undo, post, mustExec, type, overwriteIfSameType, keepUndo, }: {
|
|
302
336
|
cmd: Function;
|
|
303
337
|
undo: Function;
|
|
338
|
+
post?: Function | undefined;
|
|
304
339
|
mustExec: boolean;
|
|
305
340
|
type: number;
|
|
306
341
|
overwriteIfSameType: boolean;
|
|
@@ -20,7 +20,7 @@ declare class PDFFetchStreamReader implements IPDFStreamReader {
|
|
|
20
20
|
_filename: string | null;
|
|
21
21
|
_withCredentials: any;
|
|
22
22
|
_contentLength: any;
|
|
23
|
-
_headersCapability:
|
|
23
|
+
_headersCapability: any;
|
|
24
24
|
_disableRange: any;
|
|
25
25
|
_rangeChunkSize: any;
|
|
26
26
|
_abortController: AbortController;
|
|
@@ -28,7 +28,7 @@ declare class PDFFetchStreamReader implements IPDFStreamReader {
|
|
|
28
28
|
_isRangeSupported: boolean;
|
|
29
29
|
_headers: Headers;
|
|
30
30
|
onProgress: any;
|
|
31
|
-
get headersReady():
|
|
31
|
+
get headersReady(): any;
|
|
32
32
|
get filename(): string | null;
|
|
33
33
|
get contentLength(): any;
|
|
34
34
|
get isRangeSupported(): boolean;
|
|
@@ -49,7 +49,7 @@ declare class PDFFetchStreamRangeReader implements IPDFStreamRangeReader {
|
|
|
49
49
|
_reader: ReadableStreamDefaultReader<Uint8Array> | null;
|
|
50
50
|
_loaded: number;
|
|
51
51
|
_withCredentials: any;
|
|
52
|
-
_readCapability:
|
|
52
|
+
_readCapability: any;
|
|
53
53
|
_isStreamingSupported: boolean;
|
|
54
54
|
_abortController: AbortController;
|
|
55
55
|
_headers: Headers;
|
|
@@ -64,5 +64,4 @@ declare class PDFFetchStreamRangeReader implements IPDFStreamRangeReader {
|
|
|
64
64
|
}>;
|
|
65
65
|
cancel(reason: any): void;
|
|
66
66
|
}
|
|
67
|
-
import { PromiseCapability } from "../shared/util.js";
|
|
68
67
|
export {};
|
|
@@ -1,14 +1,10 @@
|
|
|
1
1
|
export class FontFaceObject {
|
|
2
|
-
constructor(translatedData: any, {
|
|
3
|
-
isEvalSupported?: boolean | undefined;
|
|
2
|
+
constructor(translatedData: any, { disableFontFace, inspectFont }: {
|
|
4
3
|
disableFontFace?: boolean | undefined;
|
|
5
|
-
ignoreErrors?: boolean | undefined;
|
|
6
4
|
inspectFont?: null | undefined;
|
|
7
5
|
});
|
|
8
6
|
compiledGlyphs: any;
|
|
9
|
-
isEvalSupported: boolean;
|
|
10
7
|
disableFontFace: boolean;
|
|
11
|
-
ignoreErrors: boolean;
|
|
12
8
|
_inspectFont: any;
|
|
13
9
|
createNativeFontFace(): FontFace | null;
|
|
14
10
|
createFontFaceRule(): string | null;
|
|
@@ -34,7 +34,7 @@ declare class PDFNetworkStreamFullRequestReader implements IPDFStreamReader {
|
|
|
34
34
|
_manager: any;
|
|
35
35
|
_url: any;
|
|
36
36
|
_fullRequestId: any;
|
|
37
|
-
_headersReceivedCapability:
|
|
37
|
+
_headersReceivedCapability: any;
|
|
38
38
|
_disableRange: any;
|
|
39
39
|
_contentLength: any;
|
|
40
40
|
_rangeChunkSize: any;
|
|
@@ -54,7 +54,7 @@ declare class PDFNetworkStreamFullRequestReader implements IPDFStreamReader {
|
|
|
54
54
|
get isRangeSupported(): boolean;
|
|
55
55
|
get isStreamingSupported(): boolean;
|
|
56
56
|
get contentLength(): any;
|
|
57
|
-
get headersReady():
|
|
57
|
+
get headersReady(): any;
|
|
58
58
|
read(): Promise<any>;
|
|
59
59
|
cancel(reason: any): void;
|
|
60
60
|
_fullRequestReader: any;
|
|
@@ -79,5 +79,4 @@ declare class PDFNetworkStreamRangeRequestReader implements IPDFStreamRangeReade
|
|
|
79
79
|
read(): Promise<any>;
|
|
80
80
|
cancel(reason: any): void;
|
|
81
81
|
}
|
|
82
|
-
import { PromiseCapability } from "../shared/util.js";
|
|
83
82
|
export {};
|
|
@@ -39,9 +39,9 @@ declare class BaseFullReader {
|
|
|
39
39
|
_isStreamingSupported: boolean;
|
|
40
40
|
_isRangeSupported: boolean;
|
|
41
41
|
_readableStream: any;
|
|
42
|
-
_readCapability:
|
|
43
|
-
_headersCapability:
|
|
44
|
-
get headersReady():
|
|
42
|
+
_readCapability: any;
|
|
43
|
+
_headersCapability: any;
|
|
44
|
+
get headersReady(): any;
|
|
45
45
|
get filename(): any;
|
|
46
46
|
get contentLength(): any;
|
|
47
47
|
get isRangeSupported(): boolean;
|
|
@@ -59,7 +59,7 @@ declare class BaseRangeReader {
|
|
|
59
59
|
onProgress: any;
|
|
60
60
|
_loaded: number;
|
|
61
61
|
_readableStream: any;
|
|
62
|
-
_readCapability:
|
|
62
|
+
_readCapability: any;
|
|
63
63
|
_isStreamingSupported: boolean;
|
|
64
64
|
get isStreamingSupported(): boolean;
|
|
65
65
|
read(): any;
|
|
@@ -67,5 +67,4 @@ declare class BaseRangeReader {
|
|
|
67
67
|
_error(reason: any): void;
|
|
68
68
|
_setReadableStream(readableStream: any): void;
|
|
69
69
|
}
|
|
70
|
-
import { PromiseCapability } from "../shared/util.js";
|
|
71
70
|
export {};
|
|
@@ -8,18 +8,19 @@ export class NodeCMapReaderFactory extends BaseCMapReaderFactory {
|
|
|
8
8
|
/**
|
|
9
9
|
* @ignore
|
|
10
10
|
*/
|
|
11
|
-
_fetchData(url: any, compressionType: any):
|
|
12
|
-
cMapData: any;
|
|
13
|
-
compressionType: any;
|
|
14
|
-
}>;
|
|
11
|
+
_fetchData(url: any, compressionType: any): any;
|
|
15
12
|
}
|
|
16
13
|
export class NodeFilterFactory extends BaseFilterFactory {
|
|
17
14
|
}
|
|
15
|
+
export class NodePackages {
|
|
16
|
+
static get promise(): any;
|
|
17
|
+
static get(name: any): any;
|
|
18
|
+
}
|
|
18
19
|
export class NodeStandardFontDataFactory extends BaseStandardFontDataFactory {
|
|
19
20
|
/**
|
|
20
21
|
* @ignore
|
|
21
22
|
*/
|
|
22
|
-
_fetchData(url: any):
|
|
23
|
+
_fetchData(url: any): any;
|
|
23
24
|
}
|
|
24
25
|
import { BaseCanvasFactory } from "./base_factory.js";
|
|
25
26
|
import { BaseCMapReaderFactory } from "./base_factory.js";
|