unpdf 0.11.0 → 0.12.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 (43) hide show
  1. package/README.md +4 -2
  2. package/dist/index.cjs +9 -3
  3. package/dist/index.mjs +9 -3
  4. package/dist/pdfjs.mjs +1 -1
  5. package/dist/types/src/display/annotation_layer.d.ts +3 -3
  6. package/dist/types/src/display/annotation_storage.d.ts +9 -0
  7. package/dist/types/src/display/api.d.ts +48 -26
  8. package/dist/types/src/display/base_factory.d.ts +4 -0
  9. package/dist/types/src/display/canvas.d.ts +2 -0
  10. package/dist/types/src/display/display_utils.d.ts +2 -1
  11. package/dist/types/src/display/draw_layer.d.ts +1 -1
  12. package/dist/types/src/display/editor/alt_text.d.ts +14 -3
  13. package/dist/types/src/display/editor/annotation_editor_layer.d.ts +3 -1
  14. package/dist/types/src/display/editor/editor.d.ts +11 -2
  15. package/dist/types/src/display/editor/freetext.d.ts +2 -2
  16. package/dist/types/src/display/editor/highlight.d.ts +4 -4
  17. package/dist/types/src/display/editor/ink.d.ts +4 -3
  18. package/dist/types/src/display/editor/outliner.d.ts +3 -3
  19. package/dist/types/src/display/editor/stamp.d.ts +21 -0
  20. package/dist/types/src/display/editor/toolbar.d.ts +3 -2
  21. package/dist/types/src/display/editor/tools.d.ts +20 -5
  22. package/dist/types/src/display/node_stream.d.ts +1 -1
  23. package/dist/types/src/display/text_layer.d.ts +10 -11
  24. package/dist/types/src/display/worker_options.d.ts +2 -2
  25. package/dist/types/src/pdf.d.ts +1 -4
  26. package/dist/types/src/shared/util.d.ts +3 -0
  27. package/dist/types/web/annotation_layer_builder.d.ts +1 -0
  28. package/dist/types/web/app_options.d.ts +4 -2
  29. package/dist/types/web/download_manager.d.ts +1 -2
  30. package/dist/types/web/event_utils.d.ts +8 -6
  31. package/dist/types/web/genericl10n.d.ts +5 -5
  32. package/dist/types/web/interfaces.d.ts +2 -9
  33. package/dist/types/web/l10n.d.ts +6 -2
  34. package/dist/types/web/pdf_find_controller.d.ts +24 -0
  35. package/dist/types/web/pdf_link_service.d.ts +1 -1
  36. package/dist/types/web/pdf_page_view.d.ts +12 -6
  37. package/dist/types/web/pdf_thumbnail_view.d.ts +11 -3
  38. package/dist/types/web/pdf_thumbnail_viewer.d.ts +16 -1
  39. package/dist/types/web/pdf_viewer.d.ts +22 -6
  40. package/dist/types/web/text_accessibility.d.ts +1 -1
  41. package/dist/types/web/text_layer_builder.d.ts +4 -4
  42. package/dist/types/web/ui_utils.d.ts +7 -2
  43. package/package.json +21 -21
@@ -49,7 +49,7 @@ export type AnnotationLayerParameters = {
49
49
  } | null | undefined;
50
50
  annotationCanvasMap?: Map<string, HTMLCanvasElement> | undefined;
51
51
  accessibilityManager?: import("../../web/text_accessibility.js").TextAccessibilityManager | undefined;
52
- annotationEditorUIManager?: any;
52
+ annotationEditorUIManager?: AnnotationEditorUIManager;
53
53
  };
54
54
  /**
55
55
  * @typedef {Object} AnnotationLayerParameters
@@ -89,6 +89,7 @@ export class AnnotationLayer {
89
89
  zIndex: number;
90
90
  _annotationEditorUIManager: any;
91
91
  popupShow: any[] | undefined;
92
+ hasEditableAnnotations(): boolean;
92
93
  /**
93
94
  * Render a new annotation layer with all annotation elements.
94
95
  *
@@ -113,7 +114,6 @@ export class FreeTextAnnotationElement extends AnnotationElement {
113
114
  textPosition: any;
114
115
  annotationEditorType: number;
115
116
  render(): HTMLElement | undefined;
116
- get _isEditable(): any;
117
117
  }
118
118
  export class InkAnnotationElement extends AnnotationElement {
119
119
  constructor(parameters: any);
@@ -154,6 +154,7 @@ declare class AnnotationElement {
154
154
  _fieldObjects: any;
155
155
  parent: any;
156
156
  container: HTMLElement | undefined;
157
+ get _isEditable(): any;
157
158
  get hasPopupData(): boolean;
158
159
  updateEdited(params: any): void;
159
160
  resetEdited(): void;
@@ -210,7 +211,6 @@ declare class AnnotationElement {
210
211
  */
211
212
  public getElementsToTriggerPopup(): Array<HTMLElement> | HTMLElement;
212
213
  addHighlightArea(): void;
213
- get _isEditable(): boolean;
214
214
  _editOnDoubleClick(): void;
215
215
  #private;
216
216
  }
@@ -63,6 +63,14 @@ export class AnnotationStorage {
63
63
  transfer: any[];
64
64
  };
65
65
  get editorStats(): any;
66
+ resetModifiedIds(): void;
67
+ /**
68
+ * @returns {{ids: Set<string>, hash: string}}
69
+ */
70
+ get modifiedIds(): {
71
+ ids: Set<string>;
72
+ hash: string;
73
+ };
66
74
  #private;
67
75
  }
68
76
  /**
@@ -81,6 +89,7 @@ export class PrintAnnotationStorage extends AnnotationStorage {
81
89
  hash: any;
82
90
  transfer: any;
83
91
  };
92
+ get modifiedIds(): any;
84
93
  #private;
85
94
  }
86
95
  export const SerializableEmpty: Readonly<{
@@ -48,7 +48,7 @@ export type DocumentInitParameters = {
48
48
  range?: PDFDataRangeTransport | undefined;
49
49
  /**
50
50
  * - Specify maximum number of bytes fetched
51
- * per range request. The default value is {@link DEFAULT_RANGE_CHUNK_SIZE }.
51
+ * per range request. The default value is {@link DEFAULT_RANGE_CHUNK_SIZE}.
52
52
  */
53
53
  rangeChunkSize?: number | undefined;
54
54
  /**
@@ -58,7 +58,7 @@ export type DocumentInitParameters = {
58
58
  worker?: PDFWorker | undefined;
59
59
  /**
60
60
  * - Controls the logging level; the constants
61
- * from {@link VerbosityLevel } should be used.
61
+ * from {@link VerbosityLevel} should be used.
62
62
  */
63
63
  verbosity?: number | undefined;
64
64
  /**
@@ -207,6 +207,11 @@ export type DocumentInitParameters = {
207
207
  * to create SVG filters when rendering some images on the main canvas.
208
208
  */
209
209
  filterFactory?: Object | undefined;
210
+ /**
211
+ * - Enables hardware acceleration for
212
+ * rendering. The default value is `false`.
213
+ */
214
+ enableHWA?: boolean | undefined;
210
215
  };
211
216
  export type OnProgressParameters = {
212
217
  /**
@@ -268,12 +273,12 @@ export type getTextContentParameters = {
268
273
  export type TextContent = {
269
274
  /**
270
275
  * - Array of
271
- * {@link TextItem } and {@link TextMarkedContent } objects. TextMarkedContent
276
+ * {@link TextItem} and {@link TextMarkedContent} objects. TextMarkedContent
272
277
  * items are included when includeMarkedContent is true.
273
278
  */
274
279
  items: Array<TextItem | TextMarkedContent>;
275
280
  /**
276
- * - {@link TextStyle } objects,
281
+ * - {@link TextStyle} objects,
277
282
  * indexed by font name.
278
283
  */
279
284
  styles: {
@@ -387,7 +392,7 @@ export type RenderParameters = {
387
392
  /**
388
393
  * Controls which annotations are rendered
389
394
  * onto the canvas, for annotations with appearance-data; the values from
390
- * {@link AnnotationMode } should be used. The following values are supported:
395
+ * {@link AnnotationMode} should be used. The following values are supported:
391
396
  * - `AnnotationMode.DISABLE`, which disables all annotations.
392
397
  * - `AnnotationMode.ENABLE`, which includes all possible annotations (thus
393
398
  * it also depends on the `intent`-option, see above).
@@ -395,7 +400,7 @@ export type RenderParameters = {
395
400
  * interactive form elements (those will be rendered in the display layer).
396
401
  * - `AnnotationMode.ENABLE_STORAGE`, which includes all possible annotations
397
402
  * (as above) but where interactive form elements are updated with data
398
- * from the {@link AnnotationStorage }-instance; useful e.g. for printing.
403
+ * from the {@link AnnotationStorage}-instance; useful e.g. for printing.
399
404
  * The default value is `AnnotationMode.ENABLE`.
400
405
  */
401
406
  annotationMode?: number | undefined;
@@ -424,7 +429,7 @@ export type RenderParameters = {
424
429
  pageColors?: Object | undefined;
425
430
  /**
426
431
  * -
427
- * A promise that should resolve with an {@link OptionalContentConfig }created from `PDFDocumentProxy.getOptionalContentConfig`. If `null`,
432
+ * A promise that should resolve with an {@link OptionalContentConfig}created from `PDFDocumentProxy.getOptionalContentConfig`. If `null`,
428
433
  * the configuration will be fetched automatically with the default visibility
429
434
  * states set.
430
435
  */
@@ -435,6 +440,10 @@ export type RenderParameters = {
435
440
  */
436
441
  annotationCanvasMap?: Map<string, HTMLCanvasElement> | undefined;
437
442
  printAnnotationStorage?: PrintAnnotationStorage | undefined;
443
+ /**
444
+ * - Render the page in editing mode.
445
+ */
446
+ isEditing?: boolean | undefined;
438
447
  };
439
448
  /**
440
449
  * Page getOperatorList parameters.
@@ -448,7 +457,7 @@ export type GetOperatorListParameters = {
448
457
  /**
449
458
  * Controls which annotations are included
450
459
  * in the operatorList, for annotations with appearance-data; the values from
451
- * {@link AnnotationMode } should be used. The following values are supported:
460
+ * {@link AnnotationMode} should be used. The following values are supported:
452
461
  * - `AnnotationMode.DISABLE`, which disables all annotations.
453
462
  * - `AnnotationMode.ENABLE`, which includes all possible annotations (thus
454
463
  * it also depends on the `intent`-option, see above).
@@ -456,11 +465,15 @@ export type GetOperatorListParameters = {
456
465
  * interactive form elements (those will be rendered in the display layer).
457
466
  * - `AnnotationMode.ENABLE_STORAGE`, which includes all possible annotations
458
467
  * (as above) but where interactive form elements are updated with data
459
- * from the {@link AnnotationStorage }-instance; useful e.g. for printing.
468
+ * from the {@link AnnotationStorage}-instance; useful e.g. for printing.
460
469
  * The default value is `AnnotationMode.ENABLE`.
461
470
  */
462
471
  annotationMode?: number | undefined;
463
472
  printAnnotationStorage?: PrintAnnotationStorage | undefined;
473
+ /**
474
+ * - Render the page in editing mode.
475
+ */
476
+ isEditing?: boolean | undefined;
464
477
  };
465
478
  /**
466
479
  * Structure tree node. The root node will have a role "Root".
@@ -468,7 +481,7 @@ export type GetOperatorListParameters = {
468
481
  export type StructTreeNode = {
469
482
  /**
470
483
  * - Array of
471
- * {@link StructTreeNode } and {@link StructTreeContent } objects.
484
+ * {@link StructTreeNode} and {@link StructTreeContent} objects.
472
485
  */
473
486
  children: Array<StructTreeNode | StructTreeContent>;
474
487
  /**
@@ -516,13 +529,13 @@ export type PDFWorkerParameters = {
516
529
  port?: Worker | undefined;
517
530
  /**
518
531
  * - Controls the logging level;
519
- * the constants from {@link VerbosityLevel } should be used.
532
+ * the constants from {@link VerbosityLevel} should be used.
520
533
  */
521
534
  verbosity?: number | undefined;
522
535
  };
523
536
  /** @type {string} */
524
537
  export const build: string;
525
- export const DefaultCanvasFactory: typeof DOMCanvasFactory | typeof NodeCanvasFactory;
538
+ export const DefaultCanvasFactory: typeof NodeCanvasFactory;
526
539
  export const DefaultCMapReaderFactory: typeof NodeCMapReaderFactory;
527
540
  export const DefaultFilterFactory: typeof DOMFilterFactory | typeof NodeFilterFactory;
528
541
  export const DefaultStandardFontDataFactory: typeof NodeStandardFontDataFactory;
@@ -643,6 +656,8 @@ export const DefaultStandardFontDataFactory: typeof NodeStandardFontDataFactory;
643
656
  * when creating canvases. The default value is {new DOMCanvasFactory()}.
644
657
  * @property {Object} [filterFactory] - A factory instance that will be used
645
658
  * to create SVG filters when rendering some images on the main canvas.
659
+ * @property {boolean} [enableHWA] - Enables hardware acceleration for
660
+ * rendering. The default value is `false`.
646
661
  */
647
662
  /**
648
663
  * This is the main entry point for loading a PDF and interacting with it.
@@ -656,7 +671,7 @@ export const DefaultStandardFontDataFactory: typeof NodeStandardFontDataFactory;
656
671
  * already populated with data, or a parameter object.
657
672
  * @returns {PDFDocumentLoadingTask}
658
673
  */
659
- export function getDocument(src: string | URL | TypedArray | ArrayBuffer | DocumentInitParameters): PDFDocumentLoadingTask;
674
+ export function getDocument(src?: string | URL | TypedArray | ArrayBuffer | DocumentInitParameters): PDFDocumentLoadingTask;
660
675
  export class LoopbackPort {
661
676
  postMessage(obj: any, transfer: any): void;
662
677
  addEventListener(name: any, listener: any): void;
@@ -738,7 +753,7 @@ export class PDFDataRangeTransport {
738
753
  * after which individual pages can be rendered.
739
754
  */
740
755
  export class PDFDocumentLoadingTask {
741
- static "__#45@#docId": number;
756
+ static "__#46@#docId": number;
742
757
  _capability: any;
743
758
  _transport: any;
744
759
  _worker: any;
@@ -902,7 +917,7 @@ export class PDFDocumentProxy {
902
917
  * @returns {Promise<Array<OutlineNode>>} A promise that is resolved with an
903
918
  * {Array} that is a tree outline (if it has one) of the PDF file.
904
919
  */
905
- getOutline(): Promise<{
920
+ getOutline(): Promise<Array<{
906
921
  title: string;
907
922
  bold: boolean;
908
923
  italic: boolean;
@@ -916,8 +931,8 @@ export class PDFDocumentProxy {
916
931
  unsafeUrl: string | undefined;
917
932
  newWindow: boolean | undefined;
918
933
  count: number | undefined;
919
- items: any[];
920
- }[]>;
934
+ items: Array<any>;
935
+ }>>;
921
936
  /**
922
937
  * @typedef {Object} GetOptionalContentConfigParameters
923
938
  * @property {string} [intent] - Determines the optional content groups that
@@ -1165,6 +1180,7 @@ export class PDFDocumentProxy {
1165
1180
  * @property {Map<string, HTMLCanvasElement>} [annotationCanvasMap] - Map some
1166
1181
  * annotation ids with canvases used to render them.
1167
1182
  * @property {PrintAnnotationStorage} [printAnnotationStorage]
1183
+ * @property {boolean} [isEditing] - Render the page in editing mode.
1168
1184
  */
1169
1185
  /**
1170
1186
  * Page getOperatorList parameters.
@@ -1185,6 +1201,7 @@ export class PDFDocumentProxy {
1185
1201
  * from the {@link AnnotationStorage}-instance; useful e.g. for printing.
1186
1202
  * The default value is `AnnotationMode.ENABLE`.
1187
1203
  * @property {PrintAnnotationStorage} [printAnnotationStorage]
1204
+ * @property {boolean} [isEditing] - Render the page in editing mode.
1188
1205
  */
1189
1206
  /**
1190
1207
  * Structure tree node. The root node will have a role "Root".
@@ -1287,14 +1304,14 @@ export class PDFPageProxy {
1287
1304
  * @returns {RenderTask} An object that contains a promise that is
1288
1305
  * resolved when the page finishes rendering.
1289
1306
  */
1290
- render({ canvasContext, viewport, intent, annotationMode, transform, background, optionalContentConfigPromise, annotationCanvasMap, pageColors, printAnnotationStorage, }: RenderParameters): RenderTask;
1307
+ render({ canvasContext, viewport, intent, annotationMode, transform, background, optionalContentConfigPromise, annotationCanvasMap, pageColors, printAnnotationStorage, isEditing, }: RenderParameters): RenderTask;
1291
1308
  /**
1292
1309
  * @param {GetOperatorListParameters} params - Page getOperatorList
1293
1310
  * parameters.
1294
1311
  * @returns {Promise<PDFOperatorList>} A promise resolved with an
1295
1312
  * {@link PDFOperatorList} object that represents the page's operator list.
1296
1313
  */
1297
- getOperatorList({ intent, annotationMode, printAnnotationStorage, }?: GetOperatorListParameters): Promise<PDFOperatorList>;
1314
+ getOperatorList({ intent, annotationMode, printAnnotationStorage, isEditing, }?: GetOperatorListParameters): Promise<PDFOperatorList>;
1298
1315
  /**
1299
1316
  * NOTE: All occurrences of whitespace will be replaced by
1300
1317
  * standard spaces (0x20).
@@ -1354,6 +1371,13 @@ export class PDFPageProxy {
1354
1371
  get stats(): StatTimer | null;
1355
1372
  #private;
1356
1373
  }
1374
+ /**
1375
+ * @typedef {Object} PDFWorkerParameters
1376
+ * @property {string} [name] - The name of the worker.
1377
+ * @property {Worker} [port] - The `workerPort` object.
1378
+ * @property {number} [verbosity] - Controls the logging level;
1379
+ * the constants from {@link VerbosityLevel} should be used.
1380
+ */
1357
1381
  /**
1358
1382
  * PDF.js web worker abstraction that controls the instantiation of PDF
1359
1383
  * documents. Message handlers are used to pass information from the main
@@ -1363,7 +1387,9 @@ export class PDFPageProxy {
1363
1387
  * @param {PDFWorkerParameters} params - The worker initialization parameters.
1364
1388
  */
1365
1389
  export class PDFWorker {
1366
- static "__#48@#workerPorts": any;
1390
+ static "__#49@#fakeWorkerId": number;
1391
+ static "__#49@#isWorkerDisabled": boolean;
1392
+ static "__#49@#workerPorts": any;
1367
1393
  /**
1368
1394
  * @param {PDFWorkerParameters} params - The worker initialization parameters.
1369
1395
  */
@@ -1373,7 +1399,7 @@ export class PDFWorker {
1373
1399
  * @type {string}
1374
1400
  */
1375
1401
  static get workerSrc(): string;
1376
- static get "__#48@#mainThreadWorkerMessageHandler"(): any;
1402
+ static get "__#49@#mainThreadWorkerMessageHandler"(): any;
1377
1403
  static get _setupFakeWorkerGlobal(): any;
1378
1404
  constructor({ name, port, verbosity, }?: {
1379
1405
  name?: null | undefined;
@@ -1409,10 +1435,7 @@ export class PDFWorker {
1409
1435
  * Destroys the worker instance.
1410
1436
  */
1411
1437
  destroy(): void;
1412
- }
1413
- export namespace PDFWorkerUtil {
1414
- let isWorkerDisabled: boolean;
1415
- let fakeWorkerId: number;
1438
+ #private;
1416
1439
  }
1417
1440
  /**
1418
1441
  * Allows controlling of the rendering tasks.
@@ -1451,7 +1474,6 @@ export const version: string;
1451
1474
  import { PageViewport } from "./display_utils.js";
1452
1475
  import { OptionalContentConfig } from "./optional_content_config.js";
1453
1476
  import { PrintAnnotationStorage } from "./annotation_storage.js";
1454
- import { DOMCanvasFactory } from "./display_utils.js";
1455
1477
  import { NodeCanvasFactory } from "./node_utils";
1456
1478
  import { NodeCMapReaderFactory } from "./node_utils";
1457
1479
  import { DOMFilterFactory } from "./display_utils.js";
@@ -1,4 +1,7 @@
1
1
  export class BaseCanvasFactory {
2
+ constructor({ enableHWA }?: {
3
+ enableHWA?: boolean | undefined;
4
+ });
2
5
  create(width: any, height: any): {
3
6
  canvas: void;
4
7
  context: any;
@@ -9,6 +12,7 @@ export class BaseCanvasFactory {
9
12
  * @ignore
10
13
  */
11
14
  _createCanvas(width: any, height: any): void;
15
+ #private;
12
16
  }
13
17
  export class BaseCMapReaderFactory {
14
18
  constructor({ baseUrl, isCompressed }: {
@@ -120,7 +120,9 @@ export class CanvasGraphics {
120
120
  setStrokeColorN(...args: any[]): void;
121
121
  setFillColorN(...args: any[]): void;
122
122
  setStrokeRGBColor(r: any, g: any, b: any): void;
123
+ setStrokeTransparent(): void;
123
124
  setFillRGBColor(r: any, g: any, b: any): void;
125
+ setFillTransparent(): void;
124
126
  _getPattern(objId: any, matrix?: null): any;
125
127
  shadingFill(objId: any): void;
126
128
  beginInlineImage(): void;
@@ -57,8 +57,9 @@ export type PageViewportCloneParameters = {
57
57
  };
58
58
  export function deprecated(details: any): void;
59
59
  export class DOMCanvasFactory extends BaseCanvasFactory {
60
- constructor({ ownerDocument }?: {
60
+ constructor({ ownerDocument, enableHWA }?: {
61
61
  ownerDocument?: Document | undefined;
62
+ enableHWA?: boolean | undefined;
62
63
  });
63
64
  _document: Document;
64
65
  /**
@@ -5,7 +5,7 @@
5
5
  */
6
6
  export class DrawLayer {
7
7
  static get _svgFactory(): any;
8
- static "__#26@#setBox"(element: any, { x, y, width, height }?: {
8
+ static "__#27@#setBox"(element: any, { x, y, width, height }?: {
9
9
  x?: number | undefined;
10
10
  y?: number | undefined;
11
11
  width?: number | undefined;
@@ -5,18 +5,29 @@ export class AltText {
5
5
  render(): Promise<HTMLButtonElement>;
6
6
  finish(): void;
7
7
  isEmpty(): boolean;
8
+ hasData(): boolean;
9
+ get guessedText(): null;
10
+ setGuessedText(guessedText: any): Promise<void>;
11
+ toggleAltTextBadge(visibility?: boolean): void;
12
+ serialize(isForCopying: any): {
13
+ altText: null;
14
+ decorative: boolean;
15
+ guessedText: null;
16
+ textWithDisclaimer: null;
17
+ };
8
18
  /**
9
19
  * Set the alt text data.
10
20
  */
11
- set data({ altText, decorative }: {
12
- altText: string;
21
+ set data({ altText, decorative, guessedText, textWithDisclaimer, cancel, }: {
22
+ altText: null;
13
23
  decorative: boolean;
14
24
  });
15
25
  get data(): {
16
- altText: string;
26
+ altText: null;
17
27
  decorative: boolean;
18
28
  };
19
29
  toggle(enabled?: boolean): void;
30
+ shown(): void;
20
31
  destroy(): void;
21
32
  #private;
22
33
  }
@@ -43,7 +43,7 @@ export type RenderEditorLayerOptions = {
43
43
  */
44
44
  export class AnnotationEditorLayer {
45
45
  static _initialized: boolean;
46
- static "__#27@#editorTypes": Map<number, typeof FreeTextEditor | typeof HighlightEditor | typeof InkEditor | typeof StampEditor>;
46
+ static "__#28@#editorTypes": Map<number, typeof FreeTextEditor | typeof HighlightEditor | typeof InkEditor | typeof StampEditor>;
47
47
  /**
48
48
  * @param {AnnotationEditorLayerOptions} options
49
49
  */
@@ -76,6 +76,7 @@ export class AnnotationEditorLayer {
76
76
  * @param {Object} params
77
77
  */
78
78
  addCommands(params: Object): void;
79
+ toggleDrawing(enabled?: boolean): void;
79
80
  togglePointerEvents(enabled?: boolean): void;
80
81
  toggleAnnotationLayerPointerEvents(enabled?: boolean): void;
81
82
  /**
@@ -131,6 +132,7 @@ export class AnnotationEditorLayer {
131
132
  * @returns {string}
132
133
  */
133
134
  getNextId(): string;
135
+ combinedSignal(ac: any): AbortSignal;
134
136
  canCreateNewEmptyEditor(): boolean | undefined;
135
137
  /**
136
138
  * Paste some content into a new editor.
@@ -33,6 +33,8 @@ export type AnnotationEditorParameters = {
33
33
  * Base class for editors.
34
34
  */
35
35
  export class AnnotationEditor {
36
+ static _l10nPromise: null;
37
+ static _l10nResizer: null;
36
38
  static _borderLineWidth: number;
37
39
  static _colorManager: ColorManager;
38
40
  static _zIndex: number;
@@ -70,7 +72,7 @@ export class AnnotationEditor {
70
72
  * @param {AnnotationEditorLayer} parent
71
73
  */
72
74
  static paste(item: DataTransferItem, parent: AnnotationEditorLayer): void;
73
- static "__#34@#rotatePoint"(x: any, y: any, angle: any): any[];
75
+ static "__#35@#rotatePoint"(x: any, y: any, angle: any): any[];
74
76
  /**
75
77
  * Deserialize the editor.
76
78
  * The result of the deserialization is a new editor.
@@ -87,11 +89,11 @@ export class AnnotationEditor {
87
89
  * @param {AnnotationEditorParameters} parameters
88
90
  */
89
91
  constructor(parameters: AnnotationEditorParameters);
92
+ _editToolbar: null;
90
93
  _initialOptions: any;
91
94
  _isVisible: boolean;
92
95
  _uiManager: null;
93
96
  _focusEventsAllowed: boolean;
94
- _l10nPromise: null;
95
97
  parent: import("./annotation_editor_layer.js").AnnotationEditorLayer;
96
98
  id: string;
97
99
  width: any;
@@ -221,6 +223,9 @@ export class AnnotationEditor {
221
223
  * @returns {Array<number>}
222
224
  */
223
225
  getInitialTranslation(): Array<number>;
226
+ /**
227
+ * Called when the alt text dialog is closed.
228
+ */
224
229
  altTextFinish(): void;
225
230
  /**
226
231
  * Add a toolbar for this editor.
@@ -235,7 +240,11 @@ export class AnnotationEditor {
235
240
  */
236
241
  set altTextData(data: any);
237
242
  get altTextData(): any;
243
+ get guessedAltText(): any;
244
+ setGuessedAltText(text: any): Promise<void>;
245
+ serializeAltText(isForCopying: any): any;
238
246
  hasAltText(): boolean;
247
+ hasAltTextData(): any;
239
248
  /**
240
249
  * Render this editor in a div.
241
250
  * @returns {HTMLDivElement | null}
@@ -16,8 +16,8 @@ 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
22
  static deserialize(data: any, parent: any, uiManager: any): AnnotationEditor | null;
23
23
  constructor(params: any);
@@ -20,7 +20,7 @@ export class HighlightEditor extends AnnotationEditor {
20
20
  /** @inheritdoc */
21
21
  static updateDefaultParams(type: any, value: any): void;
22
22
  static get defaultPropertiesToUpdate(): (number | null)[][];
23
- static "__#23@#rotateBbox"({ x, y, width, height }: {
23
+ static "__#24@#rotateBbox"({ x, y, width, height }: {
24
24
  x: any;
25
25
  y: any;
26
26
  width: any;
@@ -36,8 +36,8 @@ export class HighlightEditor extends AnnotationEditor {
36
36
  x: any;
37
37
  y: any;
38
38
  }): void;
39
- static "__#23@#highlightMove"(parent: any, event: any): void;
40
- static "__#23@#endHighlight"(parent: any, event: any): void;
39
+ static "__#24@#highlightMove"(parent: any, event: any): void;
40
+ static "__#24@#endHighlight"(parent: any, event: any): void;
41
41
  /** @inheritdoc */
42
42
  static deserialize(data: any, parent: any, uiManager: any): AnnotationEditor | null;
43
43
  constructor(params: any);
@@ -76,7 +76,7 @@ export class HighlightEditor extends AnnotationEditor {
76
76
  color: number[];
77
77
  opacity: any;
78
78
  thickness: any;
79
- quadPoints: any[] | null;
79
+ quadPoints: Float32Array | null;
80
80
  outlines: any;
81
81
  pageIndex: number;
82
82
  rect: any[];
@@ -18,9 +18,9 @@ export class InkEditor extends AnnotationEditor {
18
18
  * @param {Array<Array<number>>} bezier
19
19
  * @returns {Path2D}
20
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;
21
+ static "__#25@#buildPath2D"(bezier: Array<Array<number>>): Path2D;
22
+ static "__#25@#toPDFCoordinates"(points: any, rect: any, rotation: any): any;
23
+ static "__#25@#fromPDFCoordinates"(points: any, rect: any, rotation: any): any;
24
24
  /** @inheritdoc */
25
25
  static deserialize(data: any, parent: any, uiManager: any): AnnotationEditor | null;
26
26
  constructor(params: any);
@@ -40,6 +40,7 @@ export class InkEditor extends AnnotationEditor {
40
40
  get propertiesToUpdate(): any[][];
41
41
  canvas: HTMLCanvasElement | null | undefined;
42
42
  onScaleChanging(): void;
43
+ pointerdownAC: any;
43
44
  /**
44
45
  * onpointerdown callback for the canvas we're drawing on.
45
46
  * @param {PointerEvent} event
@@ -1,7 +1,7 @@
1
1
  export class FreeOutliner {
2
- static "__#20@#MIN_DIST": number;
3
- static "__#20@#MIN_DIFF": number;
4
- static "__#20@#MIN": number;
2
+ static "__#21@#MIN_DIST": number;
3
+ static "__#21@#MIN_DIFF": number;
4
+ static "__#21@#MIN": number;
5
5
  constructor({ x, y }: {
6
6
  x: any;
7
7
  y: any;
@@ -12,10 +12,31 @@ 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
20
  static deserialize(data: any, parent: any, uiManager: any): 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
+ copyCanvas(maxDimension: any, createImageData?: boolean): {
29
+ canvas: HTMLCanvasElement;
30
+ imageData: {
31
+ width: any;
32
+ height: any;
33
+ data: Uint8ClampedArray;
34
+ };
35
+ } | {
36
+ canvas: HTMLCanvasElement;
37
+ imageData: null;
38
+ };
39
+ /** @inheritdoc */
19
40
  getImageForAltText(): null;
20
41
  /** @inheritdoc */
21
42
  serialize(isForCopying?: boolean, context?: null): {
@@ -1,10 +1,11 @@
1
1
  export class EditorToolbar {
2
- static "__#3@#pointerDown"(e: any): void;
2
+ static "__#4@#l10nRemove": null;
3
+ static "__#4@#pointerDown"(e: any): void;
3
4
  constructor(editor: any);
4
5
  render(): HTMLDivElement;
5
6
  hide(): void;
6
7
  show(): void;
7
- addAltTextButton(button: any): void;
8
+ addAltText(altText: any): Promise<void>;
8
9
  addColorPicker(colorPicker: any): void;
9
10
  remove(): void;
10
11
  #private;
@@ -12,7 +12,8 @@ export class AnnotationEditorUIManager {
12
12
  static TRANSLATE_SMALL: number;
13
13
  static TRANSLATE_BIG: number;
14
14
  static get _keyboardManager(): any;
15
- constructor(container: any, viewer: any, altTextManager: any, eventBus: any, pdfDocument: any, pageColors: any, highlightColors: any, enableHighlightFloatingButton: any, 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);
16
+ _signal: AbortSignal;
16
17
  _eventBus: any;
17
18
  viewParameters: {
18
19
  realScale: number;
@@ -20,14 +21,22 @@ export class AnnotationEditorUIManager {
20
21
  };
21
22
  isShiftKeyDown: boolean;
22
23
  destroy(): void;
23
- mlGuess(data: any): Promise<any>;
24
- get hasMLManager(): boolean;
24
+ combinedSignal(ac: any): AbortSignal;
25
+ get mlManager(): null;
26
+ get useNewAltTextFlow(): boolean;
27
+ get useNewAltTextWhenAddingImage(): boolean;
25
28
  get hcmFilter(): any;
26
29
  get direction(): any;
27
30
  get highlightColors(): any;
28
31
  get highlightColorNames(): any;
29
32
  setMainHighlightColorPicker(colorPicker: any): void;
30
- editAltText(editor: any): void;
33
+ editAltText(editor: any, firstTime?: boolean): void;
34
+ switchToMode(mode: any, callback: any): void;
35
+ setPreference(name: any, value: any): void;
36
+ onSetPreference({ name, value }: {
37
+ name: any;
38
+ value: any;
39
+ }): void;
31
40
  onPageChanging({ pageNumber }: {
32
41
  pageNumber: any;
33
42
  }): void;
@@ -52,6 +61,12 @@ export class AnnotationEditorUIManager {
52
61
  focus(): void;
53
62
  addEditListeners(): void;
54
63
  removeEditListeners(): void;
64
+ dragOver(event: any): void;
65
+ /**
66
+ * Drop callback.
67
+ * @param {DragEvent} event
68
+ */
69
+ drop(event: DragEvent): void;
55
70
  /**
56
71
  * Copy callback.
57
72
  * @param {ClipboardEvent} event
@@ -260,7 +275,7 @@ export class AnnotationEditorUIManager {
260
275
  * @param {AnnotationEditor} editor
261
276
  * @returns
262
277
  */
263
- isActive(editor: AnnotationEditor): boolean;
278
+ isActive(editor: AnnotationEditor): editor is never;
264
279
  /**
265
280
  * Get the current active editor.
266
281
  * @returns {AnnotationEditor|null}