pdfjs-serverless 0.5.1 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (66) hide show
  1. package/README.md +1 -1
  2. package/dist/index.d.mts +1 -0
  3. package/dist/index.d.ts +1 -0
  4. package/dist/index.mjs +1 -1
  5. package/dist/types/src/display/annotation_layer.d.ts +14 -4
  6. package/dist/types/src/display/annotation_storage.d.ts +9 -0
  7. package/dist/types/src/display/api.d.ts +119 -53
  8. package/dist/types/src/display/canvas.d.ts +4 -1
  9. package/dist/types/src/display/canvas_factory.d.ts +27 -0
  10. package/dist/types/src/display/cmap_reader_factory.d.ts +25 -0
  11. package/dist/types/src/display/display_utils.d.ts +29 -59
  12. package/dist/types/src/display/draw_layer.d.ts +6 -19
  13. package/dist/types/src/display/editor/alt_text.d.ts +17 -5
  14. package/dist/types/src/display/editor/annotation_editor_layer.d.ts +15 -9
  15. package/dist/types/src/display/editor/color_picker.d.ts +1 -0
  16. package/dist/types/src/display/editor/draw.d.ts +120 -0
  17. package/dist/types/src/display/editor/drawers/freedraw.d.ts +31 -0
  18. package/dist/types/src/display/editor/drawers/highlight.d.ts +36 -0
  19. package/dist/types/src/display/editor/drawers/inkdraw.d.ts +128 -0
  20. package/dist/types/src/display/editor/drawers/outline.d.ts +19 -0
  21. package/dist/types/src/display/editor/editor.d.ts +60 -12
  22. package/dist/types/src/display/editor/freetext.d.ts +7 -18
  23. package/dist/types/src/display/editor/highlight.d.ts +9 -27
  24. package/dist/types/src/display/editor/ink.d.ts +15 -73
  25. package/dist/types/src/display/editor/stamp.d.ts +27 -10
  26. package/dist/types/src/display/editor/toolbar.d.ts +3 -1
  27. package/dist/types/src/display/editor/tools.d.ts +32 -7
  28. package/dist/types/src/display/fetch_stream.d.ts +6 -13
  29. package/dist/types/src/display/filter_factory.d.ts +29 -0
  30. package/dist/types/src/display/font_loader.d.ts +3 -1
  31. package/dist/types/src/display/network.d.ts +10 -6
  32. package/dist/types/src/display/network_utils.d.ts +5 -3
  33. package/dist/types/src/display/node_stream.d.ts +7 -23
  34. package/dist/types/src/display/node_utils.d.ts +8 -11
  35. package/dist/types/src/display/optional_content_config.d.ts +1 -1
  36. package/dist/types/src/display/standard_fontdata_factory.d.ts +20 -0
  37. package/dist/types/src/display/svg_factory.d.ts +14 -0
  38. package/dist/types/src/display/text_layer.d.ts +15 -13
  39. package/dist/types/src/display/touch_manager.d.ts +14 -0
  40. package/dist/types/src/display/transport_stream.d.ts +1 -1
  41. package/dist/types/src/display/worker_options.d.ts +2 -2
  42. package/dist/types/src/interfaces.d.ts +4 -0
  43. package/dist/types/src/pdf.d.ts +5 -6
  44. package/dist/types/src/shared/message_handler.d.ts +10 -4
  45. package/dist/types/src/shared/util.d.ts +12 -20
  46. package/dist/types/web/annotation_editor_layer_builder.d.ts +5 -2
  47. package/dist/types/web/annotation_layer_builder.d.ts +3 -1
  48. package/dist/types/web/app_options.d.ts +4 -2
  49. package/dist/types/web/download_manager.d.ts +1 -2
  50. package/dist/types/web/event_utils.d.ts +10 -8
  51. package/dist/types/web/genericl10n.d.ts +5 -5
  52. package/dist/types/web/interfaces.d.ts +7 -14
  53. package/dist/types/web/l10n.d.ts +6 -2
  54. package/dist/types/web/pdf_find_controller.d.ts +24 -0
  55. package/dist/types/web/pdf_link_service.d.ts +2 -2
  56. package/dist/types/web/pdf_page_view.d.ts +17 -17
  57. package/dist/types/web/pdf_rendering_queue.d.ts +1 -1
  58. package/dist/types/web/pdf_thumbnail_view.d.ts +11 -3
  59. package/dist/types/web/pdf_thumbnail_viewer.d.ts +16 -1
  60. package/dist/types/web/pdf_viewer.d.ts +24 -11
  61. package/dist/types/web/struct_tree_layer_builder.d.ts +4 -2
  62. package/dist/types/web/text_layer_builder.d.ts +5 -5
  63. package/dist/types/web/ui_utils.d.ts +10 -21
  64. package/package.json +19 -19
  65. package/dist/types/src/display/base_factory.d.ts +0 -56
  66. package/dist/types/src/display/editor/outliner.d.ts +0 -70
@@ -33,18 +33,21 @@ export type AnnotationEditorParameters = {
33
33
  * Base class for editors.
34
34
  */
35
35
  export class AnnotationEditor {
36
+ static _l10n: null;
37
+ static _l10nResizer: null;
36
38
  static _borderLineWidth: number;
37
39
  static _colorManager: ColorManager;
38
40
  static _zIndex: number;
39
41
  static _telemetryTimeout: number;
40
42
  static get _resizerKeyboardManager(): any;
43
+ static get isDrawer(): boolean;
41
44
  static get _defaultLineColor(): any;
42
45
  static deleteAnnotationElement(editor: any): void;
43
46
  /**
44
47
  * Initialize the l10n stuff for this type of editor.
45
48
  * @param {Object} l10n
46
49
  */
47
- static initialize(l10n: Object, _uiManager: any, options: any): void;
50
+ static initialize(l10n: Object, _uiManager: any): void;
48
51
  /**
49
52
  * Update the default parameters for this type of editor.
50
53
  * @param {number} _type
@@ -70,7 +73,8 @@ export class AnnotationEditor {
70
73
  * @param {AnnotationEditorLayer} parent
71
74
  */
72
75
  static paste(item: DataTransferItem, parent: AnnotationEditorLayer): void;
73
- static "__#34@#rotatePoint"(x: any, y: any, angle: any): any[];
76
+ static "__#41@#rotatePoint"(x: any, y: any, angle: any): any[];
77
+ static _round(x: any): number;
74
78
  /**
75
79
  * Deserialize the editor.
76
80
  * The result of the deserialization is a new editor.
@@ -78,20 +82,21 @@ export class AnnotationEditor {
78
82
  * @param {Object} data
79
83
  * @param {AnnotationEditorLayer} parent
80
84
  * @param {AnnotationEditorUIManager} uiManager
81
- * @returns {AnnotationEditor | null}
85
+ * @returns {Promise<AnnotationEditor | null>}
82
86
  */
83
- static deserialize(data: Object, parent: AnnotationEditorLayer, uiManager: AnnotationEditorUIManager): AnnotationEditor | null;
87
+ static deserialize(data: Object, parent: AnnotationEditorLayer, uiManager: AnnotationEditorUIManager): Promise<AnnotationEditor | null>;
84
88
  static get MIN_SIZE(): number;
85
89
  static canCreateNewEmptyEditor(): boolean;
86
90
  /**
87
91
  * @param {AnnotationEditorParameters} parameters
88
92
  */
89
93
  constructor(parameters: AnnotationEditorParameters);
94
+ _editToolbar: null;
90
95
  _initialOptions: any;
96
+ _initialData: null;
91
97
  _isVisible: boolean;
92
98
  _uiManager: null;
93
99
  _focusEventsAllowed: boolean;
94
- _l10nPromise: null;
95
100
  parent: import("./annotation_editor_layer.js").AnnotationEditorLayer;
96
101
  id: string;
97
102
  width: any;
@@ -175,7 +180,20 @@ export class AnnotationEditor {
175
180
  */
176
181
  translateInPage(x: number, y: number): void;
177
182
  drag(tx: any, ty: any): void;
183
+ /**
184
+ * Called when the editor is being translated.
185
+ * @param {number} x - in page coordinates.
186
+ * @param {number} y - in page coordinates.
187
+ */
188
+ _onTranslating(x: number, y: number): void;
189
+ /**
190
+ * Called when the editor has been translated.
191
+ * @param {number} x - in page coordinates.
192
+ * @param {number} y - in page coordinates.
193
+ */
194
+ _onTranslated(x: number, y: number): void;
178
195
  get _hasBeenMoved(): boolean;
196
+ get _hasBeenResized(): boolean;
179
197
  /**
180
198
  * Get the translation to take into account the editor border.
181
199
  * The CSS engine positions the element by taking the border into account so
@@ -193,7 +211,7 @@ export class AnnotationEditor {
193
211
  * Fix the position of the editor in order to keep it inside its parent page.
194
212
  * @param {number} [rotation] - the rotation of the page.
195
213
  */
196
- fixAndSetPosition(rotation?: number | undefined): void;
214
+ fixAndSetPosition(rotation?: number): void;
197
215
  /**
198
216
  * Convert a screen translation into a page one.
199
217
  * @param {number} x
@@ -221,6 +239,17 @@ export class AnnotationEditor {
221
239
  * @returns {Array<number>}
222
240
  */
223
241
  getInitialTranslation(): Array<number>;
242
+ /**
243
+ * Called when the editor has been resized.
244
+ */
245
+ _onResized(): void;
246
+ /**
247
+ * Called when the editor is being resized.
248
+ */
249
+ _onResizing(): void;
250
+ /**
251
+ * Called when the alt text dialog is closed.
252
+ */
224
253
  altTextFinish(): void;
225
254
  /**
226
255
  * Add a toolbar for this editor.
@@ -228,6 +257,7 @@ export class AnnotationEditor {
228
257
  */
229
258
  addEditToolbar(): Promise<EditorToolbar | null>;
230
259
  removeEditToolbar(): void;
260
+ addContainer(container: any): void;
231
261
  getClientDimensions(): DOMRect;
232
262
  addAltTextButton(): Promise<void>;
233
263
  /**
@@ -235,7 +265,11 @@ export class AnnotationEditor {
235
265
  */
236
266
  set altTextData(data: any);
237
267
  get altTextData(): any;
268
+ get guessedAltText(): any;
269
+ setGuessedAltText(text: any): Promise<void>;
270
+ serializeAltText(isForCopying: any): any;
238
271
  hasAltText(): boolean;
272
+ hasAltTextData(): any;
239
273
  /**
240
274
  * Render this editor in a div.
241
275
  * @returns {HTMLDivElement | null}
@@ -246,6 +280,9 @@ export class AnnotationEditor {
246
280
  * @param {PointerEvent} event
247
281
  */
248
282
  pointerdown(event: PointerEvent): void;
283
+ get isSelected(): any;
284
+ _onStartDragging(): void;
285
+ _onStopDragging(): void;
249
286
  moveInDOM(): void;
250
287
  _setParentAndPosition(parent: any, x: any, y: any): void;
251
288
  /**
@@ -254,12 +291,13 @@ export class AnnotationEditor {
254
291
  * @param {number} ty - y-translation in screen coordinates.
255
292
  * @param {number} [rotation] - the rotation of the page.
256
293
  */
257
- getRect(tx: number, ty: number, rotation?: number | undefined): any[];
294
+ getRect(tx: number, ty: number, rotation?: number): any[];
258
295
  getRectInCurrentCoords(rect: any, pageHeight: any): any[];
259
296
  /**
260
297
  * Executed once this editor has been rendered.
298
+ * @param {boolean} focus - true if the editor should be focused.
261
299
  */
262
- onceAdded(): void;
300
+ onceAdded(focus: boolean): void;
263
301
  /**
264
302
  * Check if the editor contains something.
265
303
  * @returns {boolean}
@@ -289,6 +327,7 @@ export class AnnotationEditor {
289
327
  * @returns {boolean}
290
328
  */
291
329
  needsToBeRebuilt(): boolean;
330
+ get isOnScreen(): boolean;
292
331
  /**
293
332
  * Rebuild the editor in case it has been removed on undo.
294
333
  *
@@ -296,10 +335,19 @@ export class AnnotationEditor {
296
335
  */
297
336
  rebuild(): void;
298
337
  /**
299
- * Rotate the editor.
338
+ * Rotate the editor when the page is rotated.
300
339
  * @param {number} angle
301
340
  */
302
341
  rotate(_angle: any): void;
342
+ /**
343
+ * Resize the editor when the page is resized.
344
+ */
345
+ resize(): void;
346
+ /**
347
+ * Serialize the editor when it has been deleted.
348
+ * @returns {Object}
349
+ */
350
+ serializeDeleted(): Object;
303
351
  /**
304
352
  * Serialize the editor.
305
353
  * The result of the serialization will be used to construct a
@@ -310,7 +358,7 @@ export class AnnotationEditor {
310
358
  * @param {Object | null} [context]
311
359
  * @returns {Object | null}
312
360
  */
313
- serialize(isForCopying?: boolean | undefined, context?: Object | null | undefined): Object | null;
361
+ serialize(isForCopying?: boolean, context?: Object | null): Object | null;
314
362
  /**
315
363
  * Check if an existing annotation associated with this editor has been
316
364
  * modified.
@@ -412,9 +460,9 @@ export class AnnotationEditor {
412
460
  /**
413
461
  * Render an annotation in the annotation layer.
414
462
  * @param {Object} annotation
415
- * @returns {HTMLElement}
463
+ * @returns {HTMLElement|null}
416
464
  */
417
- renderAnnotationElement(annotation: Object): HTMLElement;
465
+ renderAnnotationElement(annotation: Object): HTMLElement | null;
418
466
  resetAnnotationElement(annotation: any): void;
419
467
  #private;
420
468
  }
@@ -16,10 +16,10 @@ 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 "__#17@#getNodeContent"(node: any): any;
20
- static "__#17@#deserializeContent"(content: any): any;
19
+ static "__#18@#getNodeContent"(node: any): any;
20
+ static "__#18@#deserializeContent"(content: any): any;
21
21
  /** @inheritdoc */
22
- static deserialize(data: any, parent: any, uiManager: any): AnnotationEditor | null;
22
+ static deserialize(data: any, parent: any, uiManager: any): Promise<AnnotationEditor | null>;
23
23
  constructor(params: any);
24
24
  /** @inheritdoc */
25
25
  updateParams(type: any, value: any): void;
@@ -31,6 +31,8 @@ export class FreeTextEditor extends AnnotationEditor {
31
31
  * @param {number} y in page units.
32
32
  */
33
33
  _translateEmpty(x: number, y: number): void;
34
+ /** @inheritdoc */
35
+ onceAdded(focus: any): void;
34
36
  /**
35
37
  * Commit the content we have in this editor.
36
38
  * @returns {undefined}
@@ -49,22 +51,9 @@ export class FreeTextEditor extends AnnotationEditor {
49
51
  overlayDiv: HTMLDivElement | undefined;
50
52
  editorDivPaste(event: any): void;
51
53
  /** @inheritdoc */
52
- serialize(isForCopying?: boolean): {
53
- annotationType: number;
54
- color: number[];
55
- fontSize: any;
56
- value: string;
57
- pageIndex: number;
58
- rect: any[];
59
- rotation: number;
60
- structTreeParentId: any;
61
- } | {
62
- pageIndex: number;
63
- id: any;
64
- deleted: boolean;
65
- } | null;
54
+ serialize(isForCopying?: boolean): Object | null;
66
55
  /** @inheritdoc */
67
- renderAnnotationElement(annotation: any): HTMLElement;
56
+ renderAnnotationElement(annotation: any): HTMLElement | null;
68
57
  #private;
69
58
  }
70
59
  import { AnnotationEditor } from "./editor.js";
@@ -5,7 +5,6 @@ export class HighlightEditor extends AnnotationEditor {
5
5
  static _defaultColor: null;
6
6
  static _defaultOpacity: number;
7
7
  static _defaultThickness: number;
8
- static _l10nPromise: any;
9
8
  static _type: string;
10
9
  static _editorType: number;
11
10
  static _freeHighlightId: number;
@@ -20,26 +19,16 @@ export class HighlightEditor extends AnnotationEditor {
20
19
  /** @inheritdoc */
21
20
  static updateDefaultParams(type: any, value: any): void;
22
21
  static get defaultPropertiesToUpdate(): (number | null)[][];
23
- static "__#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
- };
22
+ static "__#24@#rotateBbox"([x, y, width, height]: [any, any, any, any], angle: any): any[];
34
23
  static startHighlighting(parent: any, isLTR: any, { target: textLayer, x, y }: {
35
24
  target: any;
36
25
  x: any;
37
26
  y: any;
38
27
  }): void;
39
- static "__#23@#highlightMove"(parent: any, event: any): void;
40
- static "__#23@#endHighlight"(parent: any, event: any): void;
28
+ static "__#24@#highlightMove"(parent: any, event: any): void;
29
+ static "__#24@#endHighlight"(parent: any, event: any): void;
41
30
  /** @inheritdoc */
42
- static deserialize(data: any, parent: any, uiManager: any): AnnotationEditor | null;
31
+ static deserialize(data: any, parent: any, uiManager: any): Promise<AnnotationEditor | null>;
43
32
  constructor(params: any);
44
33
  color: any;
45
34
  /** @inheritdoc */
@@ -66,23 +55,16 @@ export class HighlightEditor extends AnnotationEditor {
66
55
  /** @inheritdoc */
67
56
  getRect(tx: any, ty: any): any[];
68
57
  /** @inheritdoc */
58
+ onceAdded(focus: any): void;
59
+ /** @inheritdoc */
69
60
  rotate(angle: any): void;
70
61
  pointerover(): void;
71
62
  pointerleave(): void;
72
63
  _moveCaret(direction: any): void;
73
64
  /** @inheritdoc */
74
- serialize(isForCopying?: boolean): {
75
- 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;
65
+ serialize(isForCopying?: boolean): Object | null;
66
+ /** @inheritdoc */
67
+ renderAnnotationElement(annotation: any): null;
86
68
  #private;
87
69
  }
88
70
  import { AnnotationEditor } from "./editor.js";
@@ -1,89 +1,31 @@
1
1
  /**
2
2
  * Basic draw editor in order to generate an Ink annotation.
3
3
  */
4
- export class InkEditor extends AnnotationEditor {
5
- static _defaultColor: null;
6
- static _defaultOpacity: number;
7
- static _defaultThickness: number;
4
+ export class InkEditor extends DrawingEditor {
8
5
  static _type: string;
9
6
  static _editorType: number;
7
+ static _defaultDrawingOptions: null;
10
8
  /** @inheritdoc */
11
9
  static initialize(l10n: any, uiManager: any): void;
12
10
  /** @inheritdoc */
13
- static updateDefaultParams(type: any, value: any): void;
11
+ static getDefaultDrawingOptions(options: any): any;
14
12
  /** @inheritdoc */
15
- static get defaultPropertiesToUpdate(): any[][];
16
- /**
17
- * Convert into a Path2D.
18
- * @param {Array<Array<number>>} bezier
19
- * @returns {Path2D}
20
- */
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;
13
+ static get typesMap(): any;
24
14
  /** @inheritdoc */
25
- static deserialize(data: any, parent: any, uiManager: any): AnnotationEditor | null;
26
- constructor(params: any);
27
- color: any;
28
- thickness: any;
29
- opacity: any;
30
- paths: any[];
31
- bezierPath2D: any[];
32
- allRawPaths: any[];
33
- currentPath: any[];
34
- scaleFactor: number;
35
- translationX: number;
36
- translationY: number;
15
+ static createDrawerInstance(x: any, y: any, parentWidth: any, parentHeight: any, rotation: any): InkDrawOutliner;
37
16
  /** @inheritdoc */
38
- updateParams(type: any, value: any): void;
17
+ static deserializeDraw(pageX: any, pageY: any, pageWidth: any, pageHeight: any, innerMargin: any, data: any): InkDrawOutline;
39
18
  /** @inheritdoc */
40
- get propertiesToUpdate(): any[][];
41
- canvas: HTMLCanvasElement | null | undefined;
42
- onScaleChanging(): void;
43
- /**
44
- * onpointerdown callback for the canvas we're drawing on.
45
- * @param {PointerEvent} event
46
- */
47
- canvasPointerdown(event: PointerEvent): void;
48
- /**
49
- * onpointermove callback for the canvas we're drawing on.
50
- * @param {PointerEvent} event
51
- */
52
- canvasPointermove(event: PointerEvent): void;
53
- /**
54
- * onpointerup callback for the canvas we're drawing on.
55
- * @param {PointerEvent} event
56
- */
57
- canvasPointerup(event: PointerEvent): void;
58
- /**
59
- * onpointerleave callback for the canvas we're drawing on.
60
- * @param {PointerEvent} event
61
- */
62
- canvasPointerleave(event: PointerEvent): void;
63
- ctx: CanvasRenderingContext2D | null | undefined;
64
- /**
65
- * When the dimensions of the div change the inner canvas must
66
- * renew its dimensions, hence it must redraw its own contents.
67
- * @param {number} width - the new width of the div
68
- * @param {number} height - the new height of the div
69
- * @returns
70
- */
71
- setDimensions(width: number, height: number): void;
72
- /** @inheritdoc */
73
- serialize(): {
74
- annotationType: number;
75
- color: number[];
19
+ createDrawingOptions({ color, thickness, opacity }: {
20
+ color: any;
76
21
  thickness: any;
77
22
  opacity: any;
78
- paths: {
79
- bezier: any;
80
- points: any;
81
- }[];
82
- pageIndex: number;
83
- rect: any[];
84
- rotation: number;
85
- structTreeParentId: any;
86
- } | null;
23
+ }): void;
24
+ _drawingOptions: any;
25
+ /** @inheritdoc */
26
+ serialize(isForCopying?: boolean): Object | null;
87
27
  #private;
88
28
  }
89
- import { AnnotationEditor } from "./editor.js";
29
+ import { DrawingEditor } from "./draw.js";
30
+ import { InkDrawOutliner } from "./drawers/inkdraw.js";
31
+ import { InkDrawOutline } from "./drawers/inkdraw.js";
@@ -12,21 +12,38 @@ export class StampEditor extends AnnotationEditor {
12
12
  static isHandlingMimeForPasting(mime: any): any;
13
13
  /** @inheritdoc */
14
14
  static paste(item: any, parent: any): void;
15
+ static computeTelemetryFinalData(data: any): {
16
+ hasAltText: any;
17
+ hasNoAltText: any;
18
+ };
15
19
  /** @inheritdoc */
16
- static deserialize(data: any, parent: any, uiManager: any): AnnotationEditor | null;
20
+ static deserialize(data: any, parent: any, uiManager: any): Promise<AnnotationEditor | null>;
17
21
  constructor(params: any);
18
22
  /** @inheritdoc */
23
+ get telemetryFinalData(): {
24
+ type: string;
25
+ hasAltText: boolean;
26
+ };
27
+ mlGuessAltText(imageData?: null, updateAltTextData?: boolean): Promise<any>;
28
+ /** @inheritdoc */
29
+ onceAdded(focus: any): void;
30
+ onScaleChanging(): void;
31
+ copyCanvas(maxDataDimension: any, maxPreviewDimension: any, createImageData?: boolean): {
32
+ canvas: HTMLCanvasElement | null;
33
+ width: any;
34
+ height: any;
35
+ imageData: {
36
+ width: any;
37
+ height: any;
38
+ data: Uint8ClampedArray<ArrayBufferLike>;
39
+ } | null;
40
+ };
41
+ /** @inheritdoc */
19
42
  getImageForAltText(): null;
20
43
  /** @inheritdoc */
21
- serialize(isForCopying?: boolean, context?: null): {
22
- annotationType: number;
23
- bitmapId: null;
24
- pageIndex: number;
25
- rect: any[];
26
- rotation: number;
27
- isSvg: boolean;
28
- structTreeParentId: any;
29
- } | null;
44
+ serialize(isForCopying?: boolean, context?: null): Object | null;
45
+ /** @inheritdoc */
46
+ renderAnnotationElement(annotation: any): null;
30
47
  #private;
31
48
  }
32
49
  import { AnnotationEditor } from "./editor.js";
@@ -1,10 +1,12 @@
1
1
  export class EditorToolbar {
2
+ static "__#3@#l10nRemove": null;
2
3
  static "__#3@#pointerDown"(e: any): void;
3
4
  constructor(editor: any);
4
5
  render(): HTMLDivElement;
6
+ get div(): null;
5
7
  hide(): void;
6
8
  show(): void;
7
- addAltTextButton(button: any): void;
9
+ addAltText(altText: any): Promise<void>;
8
10
  addColorPicker(colorPicker: any): void;
9
11
  remove(): void;
10
12
  #private;
@@ -12,22 +12,38 @@ export class AnnotationEditorUIManager {
12
12
  static TRANSLATE_SMALL: number;
13
13
  static TRANSLATE_BIG: number;
14
14
  static get _keyboardManager(): any;
15
- constructor(container: any, viewer: any, altTextManager: any, eventBus: any, pdfDocument: any, pageColors: any, highlightColors: any, enableHighlightFloatingButton: any, mlManager: any);
15
+ constructor(container: any, viewer: any, altTextManager: any, eventBus: any, pdfDocument: any, pageColors: any, highlightColors: any, enableHighlightFloatingButton: any, enableUpdatedAddImage: any, enableNewAltTextWhenAddingImage: any, mlManager: any, editorUndoBar: any, supportsPinchToZoom: any);
16
+ _editorUndoBar: null;
17
+ _signal: AbortSignal;
16
18
  _eventBus: any;
17
19
  viewParameters: {
18
20
  realScale: number;
19
21
  rotation: number;
20
22
  };
21
23
  isShiftKeyDown: boolean;
24
+ _supportsPinchToZoom: boolean;
22
25
  destroy(): void;
23
- mlGuess(data: any): Promise<any>;
24
- get hasMLManager(): boolean;
26
+ combinedSignal(ac: any): AbortSignal;
27
+ get mlManager(): null;
28
+ get useNewAltTextFlow(): boolean;
29
+ get useNewAltTextWhenAddingImage(): boolean;
25
30
  get hcmFilter(): any;
26
31
  get direction(): any;
27
32
  get highlightColors(): any;
28
33
  get highlightColorNames(): any;
34
+ /**
35
+ * Set the current drawing session.
36
+ * @param {AnnotationEditorLayer} layer
37
+ */
38
+ setCurrentDrawingSession(layer: AnnotationEditorLayer): void;
29
39
  setMainHighlightColorPicker(colorPicker: any): void;
30
- editAltText(editor: any): void;
40
+ editAltText(editor: any, firstTime?: boolean): void;
41
+ switchToMode(mode: any, callback: any): void;
42
+ setPreference(name: any, value: any): void;
43
+ onSetPreference({ name, value }: {
44
+ name: any;
45
+ value: any;
46
+ }): void;
31
47
  onPageChanging({ pageNumber }: {
32
48
  pageNumber: any;
33
49
  }): void;
@@ -52,6 +68,12 @@ export class AnnotationEditorUIManager {
52
68
  focus(): void;
53
69
  addEditListeners(): void;
54
70
  removeEditListeners(): void;
71
+ dragOver(event: any): void;
72
+ /**
73
+ * Drop callback.
74
+ * @param {DragEvent} event
75
+ */
76
+ drop(event: DragEvent): void;
55
77
  /**
56
78
  * Copy callback.
57
79
  * @param {ClipboardEvent} event
@@ -66,7 +88,7 @@ export class AnnotationEditorUIManager {
66
88
  * Paste callback.
67
89
  * @param {ClipboardEvent} event
68
90
  */
69
- paste(event: ClipboardEvent): void;
91
+ paste(event: ClipboardEvent): Promise<void>;
70
92
  /**
71
93
  * Keydown callback.
72
94
  * @param {KeyboardEvent} event
@@ -118,7 +140,7 @@ export class AnnotationEditorUIManager {
118
140
  * @param {boolean} [isFromKeyboard] - true if the mode change is due to a
119
141
  * keyboard action.
120
142
  */
121
- updateMode(mode: number, editId?: string | null, isFromKeyboard?: boolean | undefined): void;
143
+ updateMode(mode: number, editId?: string | null, isFromKeyboard?: boolean): Promise<void>;
122
144
  addNewEditorFromKeyboard(): void;
123
145
  /**
124
146
  * Update the toolbar if it's required to reflect the tool currently used.
@@ -182,6 +204,7 @@ export class AnnotationEditorUIManager {
182
204
  * @param {AnnotationEditor} editor
183
205
  */
184
206
  updateUI(editor: AnnotationEditor): void;
207
+ updateUIForDefaultProperties(editorType: any): void;
185
208
  /**
186
209
  * Add or remove an editor the current selection.
187
210
  * @param {AnnotationEditor} editor
@@ -218,6 +241,7 @@ export class AnnotationEditorUIManager {
218
241
  * @param {Object} params
219
242
  */
220
243
  addCommands(params: Object): void;
244
+ cleanUndoStack(type: any): void;
221
245
  /**
222
246
  * Delete the current editor or all.
223
247
  */
@@ -260,7 +284,7 @@ export class AnnotationEditorUIManager {
260
284
  * @param {AnnotationEditor} editor
261
285
  * @returns
262
286
  */
263
- isActive(editor: AnnotationEditor): boolean;
287
+ isActive(editor: AnnotationEditor): editor is never;
264
288
  /**
265
289
  * Get the current active editor.
266
290
  * @returns {AnnotationEditor|null}
@@ -359,6 +383,7 @@ export class CommandManager {
359
383
  * @returns {boolean}
360
384
  */
361
385
  hasSomethingToRedo(): boolean;
386
+ cleanType(type: any): void;
362
387
  destroy(): void;
363
388
  #private;
364
389
  }
@@ -1,9 +1,10 @@
1
1
  /** @implements {IPDFStream} */
2
2
  export class PDFFetchStream implements IPDFStream {
3
3
  constructor(source: any);
4
+ _responseOrigin: null;
4
5
  source: any;
5
6
  isHttp: boolean;
6
- httpHeaders: any;
7
+ headers: Headers;
7
8
  _fullRequestReader: PDFFetchStreamReader | null;
8
9
  _rangeRequestReaders: any[];
9
10
  get _progressiveDataLength(): number;
@@ -15,7 +16,7 @@ export class PDFFetchStream implements IPDFStream {
15
16
  declare class PDFFetchStreamReader implements IPDFStreamReader {
16
17
  constructor(stream: any);
17
18
  _stream: any;
18
- _reader: ReadableStreamDefaultReader<Uint8Array> | null;
19
+ _reader: ReadableStreamDefaultReader<Uint8Array<ArrayBufferLike>> | null;
19
20
  _loaded: number;
20
21
  _filename: string | null;
21
22
  _withCredentials: any;
@@ -26,7 +27,6 @@ declare class PDFFetchStreamReader implements IPDFStreamReader {
26
27
  _abortController: AbortController;
27
28
  _isStreamingSupported: boolean;
28
29
  _isRangeSupported: boolean;
29
- _headers: Headers;
30
30
  onProgress: any;
31
31
  get headersReady(): any;
32
32
  get filename(): string | null;
@@ -34,10 +34,7 @@ declare class PDFFetchStreamReader implements IPDFStreamReader {
34
34
  get isRangeSupported(): boolean;
35
35
  get isStreamingSupported(): boolean;
36
36
  read(): Promise<{
37
- value: Uint8Array | undefined;
38
- done: true;
39
- } | {
40
- value: ArrayBufferLike;
37
+ value: any;
41
38
  done: boolean;
42
39
  }>;
43
40
  cancel(reason: any): void;
@@ -46,20 +43,16 @@ declare class PDFFetchStreamReader implements IPDFStreamReader {
46
43
  declare class PDFFetchStreamRangeReader implements IPDFStreamRangeReader {
47
44
  constructor(stream: any, begin: any, end: any);
48
45
  _stream: any;
49
- _reader: ReadableStreamDefaultReader<Uint8Array> | null;
46
+ _reader: ReadableStreamDefaultReader<Uint8Array<ArrayBufferLike>> | null;
50
47
  _loaded: number;
51
48
  _withCredentials: any;
52
49
  _readCapability: any;
53
50
  _isStreamingSupported: boolean;
54
51
  _abortController: AbortController;
55
- _headers: Headers;
56
52
  onProgress: any;
57
53
  get isStreamingSupported(): boolean;
58
54
  read(): Promise<{
59
- value: Uint8Array | undefined;
60
- done: true;
61
- } | {
62
- value: ArrayBufferLike;
55
+ value: any;
63
56
  done: boolean;
64
57
  }>;
65
58
  cancel(reason: any): void;
@@ -0,0 +1,29 @@
1
+ export class BaseFilterFactory {
2
+ addFilter(maps: any): string;
3
+ addHCMFilter(fgColor: any, bgColor: any): string;
4
+ addAlphaFilter(map: any): string;
5
+ addLuminosityFilter(map: any): string;
6
+ addHighlightHCMFilter(filterName: any, fgColor: any, bgColor: any, newFgColor: any, newBgColor: any): string;
7
+ destroy(keepHCM?: boolean): void;
8
+ }
9
+ /**
10
+ * FilterFactory aims to create some SVG filters we can use when drawing an
11
+ * image (or whatever) on a canvas.
12
+ * Filters aren't applied with ctx.putImageData because it just overwrites the
13
+ * underlying pixels.
14
+ * With these filters, it's possible for example to apply some transfer maps on
15
+ * an image without the need to apply them on the pixel arrays: the renderer
16
+ * does the magic for us.
17
+ */
18
+ export class DOMFilterFactory extends BaseFilterFactory {
19
+ constructor({ docId, ownerDocument }: {
20
+ docId: any;
21
+ ownerDocument?: Document | undefined;
22
+ });
23
+ addFilter(maps: any): any;
24
+ addHCMFilter(fgColor: any, bgColor: any): any;
25
+ addAlphaFilter(map: any): any;
26
+ addLuminosityFilter(map: any): any;
27
+ addHighlightHCMFilter(filterName: any, fgColor: any, bgColor: any, newFgColor: any, newBgColor: any): any;
28
+ #private;
29
+ }