pdfjs-serverless 1.0.1 → 1.1.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.
Files changed (48) hide show
  1. package/README.md +1 -1
  2. package/dist/index.mjs +1 -1
  3. package/dist/types/src/display/annotation_layer.d.ts +10 -2
  4. package/dist/types/src/display/api.d.ts +53 -75
  5. package/dist/types/src/display/api_utils.d.ts +13 -0
  6. package/dist/types/src/display/canvas.d.ts +82 -80
  7. package/dist/types/src/display/canvas_dependency_tracker.d.ts +144 -0
  8. package/dist/types/src/display/display_utils.d.ts +3 -2
  9. package/dist/types/src/display/draw_layer.d.ts +2 -2
  10. package/dist/types/src/display/editor/alt_text.d.ts +1 -1
  11. package/dist/types/src/display/editor/annotation_editor_layer.d.ts +6 -6
  12. package/dist/types/src/display/editor/color_picker.d.ts +20 -1
  13. package/dist/types/src/display/editor/comment.d.ts +32 -0
  14. package/dist/types/src/display/editor/draw.d.ts +8 -8
  15. package/dist/types/src/display/editor/drawers/freedraw.d.ts +3 -3
  16. package/dist/types/src/display/editor/drawers/signaturedraw.d.ts +13 -13
  17. package/dist/types/src/display/editor/editor.d.ts +54 -5
  18. package/dist/types/src/display/editor/freetext.d.ts +11 -7
  19. package/dist/types/src/display/editor/highlight.d.ts +6 -3
  20. package/dist/types/src/display/editor/ink.d.ts +4 -0
  21. package/dist/types/src/display/editor/signature.d.ts +2 -0
  22. package/dist/types/src/display/editor/stamp.d.ts +3 -1
  23. package/dist/types/src/display/editor/toolbar.d.ts +6 -3
  24. package/dist/types/src/display/editor/tools.d.ts +16 -4
  25. package/dist/types/src/display/fetch_stream.d.ts +2 -2
  26. package/dist/types/src/display/pdf_objects.d.ts +40 -0
  27. package/dist/types/src/display/text_layer.d.ts +9 -9
  28. package/dist/types/src/display/worker_options.d.ts +2 -2
  29. package/dist/types/src/pdf.d.ts +3 -2
  30. package/dist/types/src/shared/scripting_utils.d.ts +2 -0
  31. package/dist/types/src/shared/util.d.ts +9 -5
  32. package/dist/types/web/annotation_layer_builder.d.ts +4 -1
  33. package/dist/types/web/app_options.d.ts +1 -1
  34. package/dist/types/web/autolinker.d.ts +2 -2
  35. package/dist/types/web/base_pdf_page_view.d.ts +2 -1
  36. package/dist/types/web/event_utils.d.ts +1 -1
  37. package/dist/types/web/genericl10n.d.ts +5 -5
  38. package/dist/types/web/interfaces.d.ts +7 -0
  39. package/dist/types/web/l10n.d.ts +2 -2
  40. package/dist/types/web/pdf_find_controller.d.ts +1 -1
  41. package/dist/types/web/pdf_link_service.d.ts +7 -0
  42. package/dist/types/web/pdf_page_detail_view.d.ts +1 -0
  43. package/dist/types/web/pdf_page_view.d.ts +18 -7
  44. package/dist/types/web/pdf_thumbnail_view.d.ts +2 -10
  45. package/dist/types/web/pdf_viewer.d.ts +55 -1
  46. package/dist/types/web/text_accessibility.d.ts +1 -1
  47. package/dist/types/web/text_layer_builder.d.ts +4 -4
  48. package/package.json +10 -10
@@ -98,6 +98,7 @@ export function noContextMenu(e: any): void;
98
98
  */
99
99
  export class OutputScale {
100
100
  static get pixelRatio(): number;
101
+ static capPixels(maxPixels: any, capAreaFactor: any): any;
101
102
  /**
102
103
  * @type {number} Horizontal scale.
103
104
  */
@@ -119,7 +120,7 @@ export class OutputScale {
119
120
  * @returns {boolean} Returns `true` if scaling was limited,
120
121
  * `false` otherwise.
121
122
  */
122
- limitCanvas(width: any, height: any, maxPixels: any, maxDim: any): boolean;
123
+ limitCanvas(width: any, height: any, maxPixels: any, maxDim: any, capAreaFactor?: number): boolean;
123
124
  }
124
125
  /**
125
126
  * @typedef {Object} PageViewportParameters
@@ -207,7 +208,7 @@ export class PageViewport {
207
208
  convertToPdfPoint(x: number, y: number): any[];
208
209
  }
209
210
  export class PDFDateString {
210
- static "__#2@#regex": any;
211
+ static #regex: any;
211
212
  /**
212
213
  * Convert a PDF date string to a JavaScript `Date` object.
213
214
  *
@@ -4,9 +4,9 @@
4
4
  * be able to use mix-blend-mode for some of them.
5
5
  */
6
6
  export class DrawLayer {
7
- static "__#33@#id": number;
7
+ static #id: number;
8
8
  static get _svgFactory(): any;
9
- static "__#33@#setBox"(element: any, [x, y, width, height]: [any, any, any, any]): void;
9
+ static #setBox(element: any, [x, y, width, height]: [any, any, any, any]): void;
10
10
  constructor({ pageIndex }: {
11
11
  pageIndex: any;
12
12
  });
@@ -1,5 +1,5 @@
1
1
  export class AltText {
2
- static "__#40@#l10nNewButton": null;
2
+ static #l10nNewButton: null;
3
3
  static _l10n: null;
4
4
  static initialize(l10n: any): void;
5
5
  constructor(editor: any);
@@ -46,7 +46,7 @@ export type RenderEditorLayerOptions = {
46
46
  */
47
47
  export class AnnotationEditorLayer {
48
48
  static _initialized: boolean;
49
- static "__#34@#editorTypes": Map<number, typeof FreeTextEditor | typeof HighlightEditor | typeof InkEditor | typeof SignatureEditor | typeof StampEditor>;
49
+ static #editorTypes: Map<number, typeof FreeTextEditor | typeof HighlightEditor | typeof InkEditor | typeof SignatureEditor | typeof StampEditor>;
50
50
  /**
51
51
  * @param {AnnotationEditorLayerOptions} options
52
52
  */
@@ -60,9 +60,9 @@ export class AnnotationEditorLayer {
60
60
  get isInvisible(): boolean;
61
61
  /**
62
62
  * Update the toolbar if it's required to reflect the tool currently used.
63
- * @param {number} mode
63
+ * @param {Object} options
64
64
  */
65
- updateToolbar(mode: number): void;
65
+ updateToolbar(options: Object): void;
66
66
  /**
67
67
  * The mode has changed: it must be updated.
68
68
  * @param {number} mode
@@ -111,7 +111,7 @@ export class AnnotationEditorLayer {
111
111
  remove(editor: AnnotationEditor): void;
112
112
  /**
113
113
  * An editor can have a different parent, for example after having
114
- * being dragged and droped from a page to another.
114
+ * being dragged and dropped from a page to another.
115
115
  * @param {AnnotationEditor} editor
116
116
  */
117
117
  changeParent(editor: AnnotationEditor): void;
@@ -140,10 +140,10 @@ export class AnnotationEditorLayer {
140
140
  canCreateNewEmptyEditor(): boolean | undefined;
141
141
  /**
142
142
  * Paste some content into a new editor.
143
- * @param {number} mode
143
+ * @param {Object} options
144
144
  * @param {Object} params
145
145
  */
146
- pasteEditor(mode: number, params: Object): Promise<void>;
146
+ pasteEditor(options: Object, params: Object): Promise<void>;
147
147
  /**
148
148
  * Create a new editor
149
149
  * @param {Object} data
@@ -1,5 +1,24 @@
1
+ /**
2
+ * BasicColorPicker class provides a simple color picker.
3
+ * It displays an input element (with type="color") that allows the user
4
+ * to select a color for the annotation.
5
+ */
6
+ export class BasicColorPicker {
7
+ static #l10nColor: null;
8
+ constructor(editor: any);
9
+ renderButton(): HTMLInputElement;
10
+ update(value: any): void;
11
+ destroy(): void;
12
+ hideDropdown(): void;
13
+ #private;
14
+ }
15
+ /**
16
+ * ColorPicker class provides a color picker for the annotation editor.
17
+ * It displays a dropdown with some predefined colors and allows the user
18
+ * to select a color for the annotation.
19
+ */
1
20
  export class ColorPicker {
2
- static "__#23@#l10nColor": null;
21
+ static #l10nColor: null;
3
22
  static get _keyboardManager(): any;
4
23
  constructor({ editor, uiManager }: {
5
24
  editor?: null | undefined;
@@ -0,0 +1,32 @@
1
+ export class Comment {
2
+ constructor(editor: any);
3
+ toolbar: any;
4
+ render(): HTMLButtonElement | null;
5
+ edit(): void;
6
+ finish(): void;
7
+ isDeleted(): boolean;
8
+ hasBeenEdited(): boolean;
9
+ serialize(): {
10
+ text: null;
11
+ date: null;
12
+ deleted: boolean;
13
+ };
14
+ /**
15
+ * Set the comment data.
16
+ */
17
+ set data(text: {
18
+ text: null;
19
+ date: null;
20
+ deleted: boolean;
21
+ });
22
+ get data(): {
23
+ text: null;
24
+ date: null;
25
+ deleted: boolean;
26
+ };
27
+ setInitialText(text: any): void;
28
+ toggle(enabled?: boolean): void;
29
+ shown(): void;
30
+ destroy(): void;
31
+ #private;
32
+ }
@@ -4,13 +4,13 @@
4
4
  export class DrawingEditor extends AnnotationEditor {
5
5
  static _currentDrawId: number;
6
6
  static _currentParent: null;
7
- static "__#26@#currentDraw": null;
8
- static "__#26@#currentDrawingAC": null;
9
- static "__#26@#currentDrawingOptions": null;
10
- static "__#26@#currentPointerId": number;
11
- static "__#26@#currentPointerType": null;
12
- static "__#26@#currentPointerIds": null;
13
- static "__#26@#currentMoveTimestamp": number;
7
+ static #currentDraw: null;
8
+ static #currentDrawingAC: null;
9
+ static #currentDrawingOptions: null;
10
+ static #currentPointerId: number;
11
+ static #currentPointerType: null;
12
+ static #currentPointerIds: null;
13
+ static #currentMoveTimestamp: number;
14
14
  static _INNER_MARGIN: number;
15
15
  static _mergeSVGProperties(p1: any, p2: any): any;
16
16
  /**
@@ -32,7 +32,6 @@ export class DrawingEditor extends AnnotationEditor {
32
32
  INK_THICKNESS: number;
33
33
  INK_OPACITY: number;
34
34
  HIGHLIGHT_COLOR: number;
35
- HIGHLIGHT_DEFAULT_COLOR: number;
36
35
  HIGHLIGHT_THICKNESS: number;
37
36
  HIGHLIGHT_FREE: number;
38
37
  HIGHLIGHT_SHOW_ALL: number;
@@ -76,6 +75,7 @@ export class DrawingEditor extends AnnotationEditor {
76
75
  /** @inheritdoc */
77
76
  static deserialize(data: any, parent: any, uiManager: any): Promise<AnnotationEditor | null>;
78
77
  constructor(params: any);
78
+ _colorPicker: null;
79
79
  _drawId: null;
80
80
  _addOutlines(params: any): void;
81
81
  /** @inheritdoc */
@@ -11,9 +11,9 @@ export class FreeDrawOutline extends Outline {
11
11
  #private;
12
12
  }
13
13
  export class FreeDrawOutliner {
14
- static "__#19@#MIN_DIST": number;
15
- static "__#19@#MIN_DIFF": number;
16
- static "__#19@#MIN": number;
14
+ static #MIN_DIST: number;
15
+ static #MIN_DIFF: number;
16
+ static #MIN: number;
17
17
  constructor({ x, y }: {
18
18
  x: any;
19
19
  y: any;
@@ -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 "__#30@#PARAMETERS": {
5
+ static #PARAMETERS: {
6
6
  maxDim: number;
7
7
  sigmaSFactor: number;
8
8
  sigmaR: number;
9
9
  kernelSize: number;
10
10
  };
11
- static "__#30@#neighborIndexToId"(i0: any, j0: any, i: any, j: any): any;
12
- static "__#30@#neighborIdToIndex": Int32Array<ArrayBuffer>;
13
- static "__#30@#clockwiseNonZero"(buf: any, width: any, i0: any, j0: any, i: any, j: any, offset: any): number;
14
- static "__#30@#counterClockwiseNonZero"(buf: any, width: any, i0: any, j0: any, i: any, j: any, offset: any): number;
15
- static "__#30@#findContours"(buf: any, width: any, height: any, threshold: any): {
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): {
16
16
  isHole: boolean;
17
17
  points: number[];
18
18
  id: number;
19
19
  parent: number;
20
20
  }[];
21
- static "__#30@#douglasPeuckerHelper"(points: any, start: any, end: any, output: any): void;
22
- static "__#30@#douglasPeucker"(points: any): any[] | null;
23
- static "__#30@#bilateralFilter"(buf: any, width: any, height: any, sigmaS: any, sigmaR: any, kernelSize: any): (Uint32Array<ArrayBuffer> | Uint8Array<any>)[];
24
- static "__#30@#getHistogram"(buf: any): Uint32Array<ArrayBuffer>;
25
- static "__#30@#toUint8"(buf: any): Uint8ClampedArray<ArrayBuffer>;
26
- static "__#30@#guessThreshold"(histogram: any): number;
27
- static "__#30@#getGrayPixels"(bitmap: any): any[];
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[];
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 "__#42@#rotatePoint"(x: any, y: any, angle: any): any[];
76
+ static #rotatePoint(x: any, y: any, angle: any): any[];
77
77
  static _round(x: any): number;
78
78
  /**
79
79
  * Deserialize the editor.
@@ -91,6 +91,7 @@ export class AnnotationEditor {
91
91
  * @param {AnnotationEditorParameters} parameters
92
92
  */
93
93
  constructor(parameters: AnnotationEditorParameters);
94
+ isSelected: boolean;
94
95
  _isCopy: boolean;
95
96
  _editToolbar: null;
96
97
  _initialOptions: any;
@@ -117,6 +118,7 @@ export class AnnotationEditor {
117
118
  isAttachedToDOM: boolean;
118
119
  deleted: boolean;
119
120
  get editorType(): any;
121
+ get mode(): any;
120
122
  /**
121
123
  * Get the properties to update in the UI for this editor.
122
124
  * @returns {Array}
@@ -254,6 +256,11 @@ export class AnnotationEditor {
254
256
  * Called when the alt text dialog is closed.
255
257
  */
256
258
  altTextFinish(): void;
259
+ /**
260
+ * Get the toolbar buttons for this editor.
261
+ * @returns {Array<Array<string|object|null>>|null}
262
+ */
263
+ get toolbarButtons(): Array<Array<string | object | null>> | null;
257
264
  /**
258
265
  * Add a toolbar for this editor.
259
266
  * @returns {Promise<EditorToolbar|null>}
@@ -262,7 +269,11 @@ export class AnnotationEditor {
262
269
  removeEditToolbar(): void;
263
270
  addContainer(container: any): void;
264
271
  getClientDimensions(): DOMRect;
265
- addAltTextButton(): Promise<void>;
272
+ /**
273
+ * Create the alt text for this editor.
274
+ * @returns {object}
275
+ */
276
+ createAltText(): object;
266
277
  /**
267
278
  * Set the alt text data.
268
279
  */
@@ -273,6 +284,24 @@ export class AnnotationEditor {
273
284
  serializeAltText(isForCopying: any): any;
274
285
  hasAltText(): boolean;
275
286
  hasAltTextData(): any;
287
+ addCommentButton(): Comment;
288
+ get commentColor(): null;
289
+ set comment(text: {
290
+ text: any;
291
+ date: any;
292
+ deleted: any;
293
+ color: null;
294
+ });
295
+ get comment(): {
296
+ text: any;
297
+ date: any;
298
+ deleted: any;
299
+ color: null;
300
+ };
301
+ setCommentData(text: any): void;
302
+ get hasEditedComment(): any;
303
+ editComment(): Promise<void>;
304
+ addComment(serialized: any): void;
276
305
  /**
277
306
  * Render this editor in a div.
278
307
  * @returns {HTMLDivElement | null}
@@ -283,7 +312,6 @@ export class AnnotationEditor {
283
312
  * @param {PointerEvent} event
284
313
  */
285
314
  pointerdown(event: PointerEvent): void;
286
- get isSelected(): any;
287
315
  _onStartDragging(): void;
288
316
  _onStopDragging(): void;
289
317
  moveInDOM(): void;
@@ -296,6 +324,12 @@ export class AnnotationEditor {
296
324
  */
297
325
  getRect(tx: number, ty: number, rotation?: number): any[];
298
326
  getRectInCurrentCoords(rect: any, pageHeight: any): any[];
327
+ /**
328
+ * Get the rect in page coordinates without any translation.
329
+ * It's used when serializing the editor.
330
+ * @returns {Array<number>}
331
+ */
332
+ getPDFRect(): Array<number>;
299
333
  /**
300
334
  * Executed once this editor has been rendered.
301
335
  * @param {boolean} focus - true if the editor should be focused.
@@ -308,12 +342,14 @@ export class AnnotationEditor {
308
342
  isEmpty(): boolean;
309
343
  /**
310
344
  * Enable edit mode.
345
+ * @returns {boolean} - true if the edit mode has been enabled.
311
346
  */
312
- enableEditMode(): void;
347
+ enableEditMode(): boolean;
313
348
  /**
314
349
  * Disable edit mode.
350
+ * @returns {boolean} - true if the edit mode has been disabled.
315
351
  */
316
- disableEditMode(): void;
352
+ disableEditMode(): boolean;
317
353
  /**
318
354
  * Check if the editor is edited.
319
355
  * @returns {boolean}
@@ -413,10 +449,22 @@ export class AnnotationEditor {
413
449
  * their properties.
414
450
  */
415
451
  enableEditing(): void;
452
+ /**
453
+ * Check if the content of this editor can be changed.
454
+ * For example, a FreeText editor can be changed (the user can change the
455
+ * text), but a Stamp editor cannot.
456
+ * @returns {boolean}
457
+ */
458
+ get canChangeContent(): boolean;
416
459
  /**
417
460
  * The editor is about to be edited.
418
461
  */
419
462
  enterInEditMode(): void;
463
+ /**
464
+ * ondblclick callback.
465
+ * @param {MouseEvent} event
466
+ */
467
+ dblclick(event: MouseEvent): void;
420
468
  /**
421
469
  * @returns {HTMLElement | null} the element requiring an alt text.
422
470
  */
@@ -471,4 +519,5 @@ export class AnnotationEditor {
471
519
  }
472
520
  import { AnnotationEditorUIManager } from "./tools.js";
473
521
  import { EditorToolbar } from "./toolbar.js";
522
+ import { Comment } from "./comment.js";
474
523
  import { ColorManager } from "./tools.js";
@@ -16,15 +16,20 @@ 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 "__#18@#getNodeContent"(node: any): any;
20
- static "__#18@#deserializeContent"(content: any): any;
19
+ static #getNodeContent(node: any): any;
20
+ static #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
+ _colorPicker: null;
24
25
  /** @inheritdoc */
25
26
  updateParams(type: any, value: any): void;
26
27
  /** @inheritdoc */
27
28
  get propertiesToUpdate(): any[][];
29
+ /** @inheritdoc */
30
+ get toolbarButtons(): (string | null)[][];
31
+ get colorType(): number;
32
+ get colorValue(): any;
28
33
  /**
29
34
  * Helper to translate the editor with the keyboard when it's empty.
30
35
  * @param {number} x in page units.
@@ -38,11 +43,8 @@ export class FreeTextEditor extends AnnotationEditor {
38
43
  * @returns {undefined}
39
44
  */
40
45
  commit(): undefined;
41
- /**
42
- * ondblclick callback.
43
- * @param {MouseEvent} event
44
- */
45
- dblclick(event: MouseEvent): void;
46
+ /** @inheritdoc */
47
+ keydown(event: any): void;
46
48
  editorDivKeydown(event: any): void;
47
49
  editorDivFocus(event: any): void;
48
50
  editorDivBlur(event: any): void;
@@ -51,6 +53,8 @@ export class FreeTextEditor extends AnnotationEditor {
51
53
  overlayDiv: HTMLDivElement | undefined;
52
54
  editorDivPaste(event: any): void;
53
55
  /** @inheritdoc */
56
+ getPDFRect(): any[];
57
+ /** @inheritdoc */
54
58
  serialize(isForCopying?: boolean): Object | null;
55
59
  /** @inheritdoc */
56
60
  renderAnnotationElement(annotation: any): HTMLElement | null;
@@ -19,14 +19,14 @@ 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 "__#24@#rotateBbox"([x, y, width, height]: [any, any, any, any], angle: any): any[];
22
+ static #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 "__#24@#highlightMove"(parent: any, event: any): void;
29
- static "__#24@#endHighlight"(parent: any, event: any): void;
28
+ static #highlightMove(parent: any, event: any): void;
29
+ static #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);
@@ -45,6 +45,7 @@ export class HighlightEditor extends AnnotationEditor {
45
45
  type: string;
46
46
  color: any;
47
47
  };
48
+ get commentColor(): any;
48
49
  /** @inheritdoc */
49
50
  translateInPage(x: any, y: any): void;
50
51
  /** @inheritdoc */
@@ -52,6 +53,8 @@ export class HighlightEditor extends AnnotationEditor {
52
53
  /** @inheritdoc */
53
54
  get propertiesToUpdate(): any[][];
54
55
  /** @inheritdoc */
56
+ get toolbarButtons(): any;
57
+ /** @inheritdoc */
55
58
  fixAndSetPosition(): void;
56
59
  /** @inheritdoc */
57
60
  getRect(tx: any, ty: any): any[];
@@ -22,6 +22,10 @@ export class InkEditor extends DrawingEditor {
22
22
  static deserializeDraw(pageX: any, pageY: any, pageWidth: any, pageHeight: any, innerMargin: any, data: any): any;
23
23
  defaultL10nId: string;
24
24
  /** @inheritdoc */
25
+ get toolbarButtons(): (string | null)[][];
26
+ get colorType(): number;
27
+ get colorValue(): any;
28
+ /** @inheritdoc */
25
29
  createDrawingOptions({ color, thickness, opacity }: {
26
30
  color: any;
27
31
  thickness: any;
@@ -31,6 +31,8 @@ export class SignatureEditor extends DrawingEditor {
31
31
  areContours: any;
32
32
  outline: InkDrawOutline;
33
33
  };
34
+ /** @inheritdoc */
35
+ get toolbarButtons(): any[][] | null;
34
36
  addSignature(data: any, heightInPage: any, description: any, uuid: any): void;
35
37
  getFromImage(bitmap: any): {
36
38
  outline: InkDrawOutline;
@@ -26,6 +26,8 @@ export class StampEditor extends AnnotationEditor {
26
26
  mlGuessAltText(imageData?: null, updateAltTextData?: boolean): Promise<any>;
27
27
  /** @inheritdoc */
28
28
  onceAdded(focus: any): void;
29
+ /** @inheritdoc */
30
+ get toolbarButtons(): (string | object)[][];
29
31
  setCanvas(annotationElementId: any, canvas: any): void;
30
32
  onScaleChanging(): void;
31
33
  copyCanvas(maxDataDimension: any, maxPreviewDimension: any, createImageData?: boolean): {
@@ -35,7 +37,7 @@ export class StampEditor extends AnnotationEditor {
35
37
  imageData: {
36
38
  width: any;
37
39
  height: any;
38
- data: Uint8ClampedArray<ArrayBufferLike>;
40
+ data: ImageDataArray;
39
41
  } | null;
40
42
  };
41
43
  /** @inheritdoc */
@@ -1,19 +1,22 @@
1
1
  export class EditorToolbar {
2
- static "__#3@#l10nRemove": null;
3
- static "__#3@#pointerDown"(e: any): void;
2
+ static #l10nRemove: null;
3
+ static #pointerDown(e: any): void;
4
4
  constructor(editor: any);
5
5
  render(): HTMLDivElement;
6
6
  get div(): null;
7
7
  hide(): void;
8
8
  show(): void;
9
+ addDeleteButton(): void;
9
10
  addAltText(altText: any): Promise<void>;
11
+ addComment(comment: any): void;
10
12
  addColorPicker(colorPicker: any): void;
11
13
  addEditSignatureButton(signatureManager: any): Promise<void>;
14
+ addButton(name: any, tool: any): Promise<void>;
12
15
  updateEditSignatureButton(description: any): void;
13
16
  remove(): void;
14
17
  #private;
15
18
  }
16
- export class HighlightToolbar {
19
+ export class FloatingToolbar {
17
20
  constructor(uiManager: any);
18
21
  show(parent: any, boxes: any, isLTR: any): void;
19
22
  hide(): void;
@@ -12,7 +12,7 @@ export class AnnotationEditorUIManager {
12
12
  static TRANSLATE_SMALL: number;
13
13
  static TRANSLATE_BIG: number;
14
14
  static get _keyboardManager(): any;
15
- constructor(container: any, viewer: any, altTextManager: any, signatureManager: any, eventBus: any, pdfDocument: any, pageColors: any, highlightColors: any, enableHighlightFloatingButton: any, enableUpdatedAddImage: any, enableNewAltTextWhenAddingImage: any, mlManager: any, editorUndoBar: any, supportsPinchToZoom: any);
15
+ constructor(container: any, viewer: any, viewerAlert: any, altTextManager: any, commentManager: any, signatureManager: any, eventBus: any, pdfDocument: any, pageColors: any, highlightColors: any, enableHighlightFloatingButton: any, enableUpdatedAddImage: any, enableNewAltTextWhenAddingImage: any, mlManager: any, editorUndoBar: any, supportsPinchToZoom: any);
16
16
  _editorUndoBar: null;
17
17
  _signal: AbortSignal;
18
18
  _eventBus: any;
@@ -29,8 +29,11 @@ export class AnnotationEditorUIManager {
29
29
  get useNewAltTextWhenAddingImage(): boolean;
30
30
  get hcmFilter(): any;
31
31
  get direction(): any;
32
+ get _highlightColors(): any;
32
33
  get highlightColors(): any;
33
34
  get highlightColorNames(): any;
35
+ getNonHCMColor(color: any): any;
36
+ getNonHCMColorName(color: any): any;
34
37
  /**
35
38
  * Set the current drawing session.
36
39
  * @param {AnnotationEditorLayer} layer
@@ -38,6 +41,8 @@ export class AnnotationEditorUIManager {
38
41
  setCurrentDrawingSession(layer: AnnotationEditorLayer): void;
39
42
  setMainHighlightColorPicker(colorPicker: any): void;
40
43
  editAltText(editor: any, firstTime?: boolean): void;
44
+ hasCommentManager(): boolean;
45
+ editComment(editor: any, position: any): void;
41
46
  getSignature(editor: any): void;
42
47
  get signatureManager(): null;
43
48
  switchToMode(mode: any, callback: any): void;
@@ -60,12 +65,14 @@ export class AnnotationEditorUIManager {
60
65
  onRotationChanging({ pagesRotation }: {
61
66
  pagesRotation: any;
62
67
  }): void;
63
- highlightSelection(methodOfCreation?: string): void;
68
+ highlightSelection(methodOfCreation?: string, comment?: boolean): void;
69
+ commentSelection(methodOfCreation?: string): void;
64
70
  /**
65
71
  * Add an editor in the annotation storage.
66
72
  * @param {AnnotationEditor} editor
67
73
  */
68
74
  addToAnnotationStorage(editor: AnnotationEditor): void;
75
+ a11yAlert(messageId: any, args?: null): void;
69
76
  blur(): void;
70
77
  focus(): void;
71
78
  addEditListeners(): void;
@@ -141,15 +148,20 @@ export class AnnotationEditorUIManager {
141
148
  * @param {string|null} editId
142
149
  * @param {boolean} [isFromKeyboard] - true if the mode change is due to a
143
150
  * keyboard action.
151
+ * @param {boolean} [mustEnterInEditMode] - true if the editor must enter in
152
+ * edit mode.
153
+ * @param {boolean} [editComment] - true if the mode change is due to a
154
+ * comment edit.
144
155
  */
145
- updateMode(mode: number, editId?: string | null, isFromKeyboard?: boolean): Promise<void>;
156
+ updateMode(mode: number, editId?: string | null, isFromKeyboard?: boolean, mustEnterInEditMode?: boolean, editComment?: boolean): Promise<void>;
146
157
  addNewEditorFromKeyboard(): void;
147
158
  /**
148
159
  * Update the toolbar if it's required to reflect the tool currently used.
160
+ * @param {Object} options
149
161
  * @param {number} mode
150
162
  * @returns {undefined}
151
163
  */
152
- updateToolbar(mode: number): undefined;
164
+ updateToolbar(options: Object): undefined;
153
165
  /**
154
166
  * Update a parameter in the current editor or globally.
155
167
  * @param {number} type
@@ -16,7 +16,7 @@ export class PDFFetchStream implements IPDFStream {
16
16
  declare class PDFFetchStreamReader implements IPDFStreamReader {
17
17
  constructor(stream: any);
18
18
  _stream: any;
19
- _reader: ReadableStreamDefaultReader<Uint8Array<ArrayBufferLike>> | null;
19
+ _reader: ReadableStreamDefaultReader<Uint8Array<ArrayBuffer>> | null;
20
20
  _loaded: number;
21
21
  _filename: string | null;
22
22
  _withCredentials: any;
@@ -43,7 +43,7 @@ declare class PDFFetchStreamReader implements IPDFStreamReader {
43
43
  declare class PDFFetchStreamRangeReader implements IPDFStreamRangeReader {
44
44
  constructor(stream: any, begin: any, end: any);
45
45
  _stream: any;
46
- _reader: ReadableStreamDefaultReader<Uint8Array<ArrayBufferLike>> | null;
46
+ _reader: ReadableStreamDefaultReader<Uint8Array<ArrayBuffer>> | null;
47
47
  _loaded: number;
48
48
  _withCredentials: any;
49
49
  _readCapability: any;
@@ -0,0 +1,40 @@
1
+ /**
2
+ * A PDF document and page is built of many objects. E.g. there are objects for
3
+ * fonts, images, rendering code, etc. These objects may get processed inside of
4
+ * a worker. This class implements some basic methods to manage these objects.
5
+ */
6
+ export class PDFObjects {
7
+ /**
8
+ * If called *without* callback, this returns the data of `objId` but the
9
+ * object needs to be resolved. If it isn't, this method throws.
10
+ *
11
+ * If called *with* a callback, the callback is called with the data of the
12
+ * object once the object is resolved. That means, if you call this method
13
+ * and the object is already resolved, the callback gets called right away.
14
+ *
15
+ * @param {string} objId
16
+ * @param {function} [callback]
17
+ * @returns {any}
18
+ */
19
+ get(objId: string, callback?: Function): any;
20
+ /**
21
+ * @param {string} objId
22
+ * @returns {boolean}
23
+ */
24
+ has(objId: string): boolean;
25
+ /**
26
+ * @param {string} objId
27
+ * @returns {boolean}
28
+ */
29
+ delete(objId: string): boolean;
30
+ /**
31
+ * Resolves the object `objId` with optional `data`.
32
+ *
33
+ * @param {string} objId
34
+ * @param {any} [data]
35
+ */
36
+ resolve(objId: string, data?: any): void;
37
+ clear(): void;
38
+ [Symbol.iterator](): Generator<any[], void, unknown>;
39
+ #private;
40
+ }