@chialab/pdfjs-lib 1.0.0-alpha.29 → 1.0.0-alpha.30

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 (40) hide show
  1. package/dist/browser/{chunk-W35PJZ6L.js → chunk-R7G44NYV.js} +521 -3
  2. package/dist/browser/index.js +2329 -969
  3. package/dist/browser/openjpeg-Q27OVS4T.js +9 -0
  4. package/dist/browser/worker.js +594 -609
  5. package/dist/index.d.ts +1 -1
  6. package/dist/lib/TextLayer.d.ts +4 -0
  7. package/dist/node/{NodeUtils-ZPPZPJWD.js → NodeUtils-PVXQMWFJ.js} +2 -2
  8. package/dist/node/{chunk-GWGW2EKY.js → chunk-4Y7OZIIX.js} +520 -2
  9. package/dist/node/{chunk-D4U3W2CD.js → chunk-O74KGUUC.js} +451 -1
  10. package/dist/node/{chunk-FHASHZBJ.js → chunk-T2JWSGAF.js} +2 -2
  11. package/dist/node/index.js +1896 -972
  12. package/dist/node/openjpeg-QFJSFVSJ.js +9 -0
  13. package/dist/node/worker.js +595 -610
  14. package/dist/pdf.js/external/openjpeg/openjpeg.d.ts +1 -1
  15. package/dist/pdf.js/src/core/fonts.d.ts +7 -1
  16. package/dist/pdf.js/src/display/annotation_layer.d.ts +28 -6
  17. package/dist/pdf.js/src/display/annotation_storage.d.ts +2 -0
  18. package/dist/pdf.js/src/display/api.d.ts +13 -7
  19. package/dist/pdf.js/src/display/canvas.d.ts +1 -1
  20. package/dist/pdf.js/src/display/canvas_dependency_tracker.d.ts +36 -20
  21. package/dist/pdf.js/src/display/display_utils.d.ts +22 -0
  22. package/dist/pdf.js/src/display/editor/annotation_editor_layer.d.ts +4 -2
  23. package/dist/pdf.js/src/display/editor/comment.d.ts +20 -5
  24. package/dist/pdf.js/src/display/editor/drawers/freedraw.d.ts +1 -0
  25. package/dist/pdf.js/src/display/editor/drawers/highlight.d.ts +2 -1
  26. package/dist/pdf.js/src/display/editor/editor.d.ts +67 -15
  27. package/dist/pdf.js/src/display/editor/freetext.d.ts +1 -1
  28. package/dist/pdf.js/src/display/editor/highlight.d.ts +3 -1
  29. package/dist/pdf.js/src/display/editor/ink.d.ts +2 -1
  30. package/dist/pdf.js/src/display/editor/signature.d.ts +0 -5
  31. package/dist/pdf.js/src/display/editor/toolbar.d.ts +3 -1
  32. package/dist/pdf.js/src/display/editor/tools.d.ts +21 -3
  33. package/dist/pdf.js/src/display/font_loader.d.ts +27 -1
  34. package/dist/pdf.js/src/display/pattern_helper.d.ts +2 -2
  35. package/dist/pdf.js/src/pdf.d.ts +5 -1
  36. package/dist/pdf.js/src/shared/obj-bin-transform.d.ts +64 -0
  37. package/dist/pdf.js/web/comment_manager.d.ts +20 -0
  38. package/package.json +1 -1
  39. package/dist/browser/openjpeg-QLA762TL.js +0 -9
  40. package/dist/node/openjpeg-TRZ4ANDN.js +0 -9
@@ -1,2 +1,2 @@
1
1
  export default OpenJPEG;
2
- declare function OpenJPEG(moduleArg?: {}): Promise<any>;
2
+ declare function OpenJPEG(moduleArg?: {}): Promise<{}>;
@@ -55,7 +55,13 @@ export class Font {
55
55
  data: Uint8Array<ArrayBuffer> | undefined;
56
56
  seacMap: any;
57
57
  get renderer(): any;
58
- exportData(): any;
58
+ exportData(): {
59
+ data: any;
60
+ extra?: undefined;
61
+ } | {
62
+ data: any;
63
+ extra: any;
64
+ };
59
65
  fallbackToSystemFont(properties: any): void;
60
66
  bold: boolean | undefined;
61
67
  italic: boolean | undefined;
@@ -5,6 +5,7 @@ export type IDownloadManager = import("../../web/interfaces").IDownloadManager;
5
5
  export type IPDFLinkService = import("../../web/interfaces").IPDFLinkService;
6
6
  export type AnnotationEditorUIManager = any;
7
7
  export type StructTreeLayerBuilder = import("../../web/struct_tree_layer_builder.js").StructTreeLayerBuilder;
8
+ export type CommentManager = import("../../web/comment_manager.js").CommentManager;
8
9
  export type AnnotationElementParameters = {
9
10
  data: Object;
10
11
  layer: HTMLDivElement;
@@ -52,6 +53,10 @@ export type AnnotationLayerParameters = {
52
53
  accessibilityManager?: import("../../web/text_accessibility.js").TextAccessibilityManager | undefined;
53
54
  annotationEditorUIManager?: AnnotationEditorUIManager;
54
55
  structTreeLayer?: import("../../web/struct_tree_layer_builder.js").StructTreeLayerBuilder | undefined;
56
+ /**
57
+ * - The comment manager instance.
58
+ */
59
+ commentManager?: import("../../web/comment_manager.js").CommentManager | undefined;
55
60
  };
56
61
  /**
57
62
  * @typedef {Object} AnnotationLayerParameters
@@ -73,6 +78,7 @@ export type AnnotationLayerParameters = {
73
78
  * @property {TextAccessibilityManager} [accessibilityManager]
74
79
  * @property {AnnotationEditorUIManager} [annotationEditorUIManager]
75
80
  * @property {StructTreeLayerBuilder} [structTreeLayer]
81
+ * @property {CommentManager} [commentManager] - The comment manager instance.
76
82
  */
77
83
  /**
78
84
  * Manage the layer containing all the annotations.
@@ -82,7 +88,7 @@ export class AnnotationLayer {
82
88
  * @private
83
89
  */
84
90
  private static get _defaultBorderStyle();
85
- constructor({ div, accessibilityManager, annotationCanvasMap, annotationEditorUIManager, page, viewport, structTreeLayer, }: {
91
+ constructor({ div, accessibilityManager, annotationCanvasMap, annotationEditorUIManager, page, viewport, structTreeLayer, commentManager, linkService, annotationStorage, }: {
86
92
  div: any;
87
93
  accessibilityManager: any;
88
94
  annotationCanvasMap: any;
@@ -90,12 +96,16 @@ export class AnnotationLayer {
90
96
  page: any;
91
97
  viewport: any;
92
98
  structTreeLayer: any;
99
+ commentManager: any;
100
+ linkService: any;
101
+ annotationStorage: any;
93
102
  });
94
103
  div: any;
95
104
  page: any;
96
105
  viewport: any;
97
106
  zIndex: number;
98
107
  _annotationEditorUIManager: any;
108
+ _commentManager: any;
99
109
  popupShow: any[] | undefined;
100
110
  hasEditableAnnotations(): boolean;
101
111
  /**
@@ -112,7 +122,7 @@ export class AnnotationLayer {
112
122
  * @param {IPDFLinkService} linkService
113
123
  * @memberof AnnotationLayer
114
124
  */
115
- addLinkAnnotations(annotations: Array<Object>, linkService: IPDFLinkService): Promise<void>;
125
+ addLinkAnnotations(annotations: Array<Object>): Promise<void>;
116
126
  /**
117
127
  * Update the annotation elements on existing annotation layer.
118
128
  *
@@ -122,6 +132,7 @@ export class AnnotationLayer {
122
132
  update({ viewport }: AnnotationLayerParameters): void;
123
133
  getEditableAnnotations(): any[];
124
134
  getEditableAnnotation(id: any): any;
135
+ addFakeAnnotation(editor: any): EditorAnnotationElement;
125
136
  #private;
126
137
  }
127
138
  export class FreeTextAnnotationElement extends AnnotationElement {
@@ -151,6 +162,13 @@ export class StampAnnotationElement extends AnnotationElement {
151
162
  render(): HTMLElement | undefined;
152
163
  }
153
164
  import { AnnotationStorage } from "./annotation_storage.js";
165
+ declare class EditorAnnotationElement extends AnnotationElement {
166
+ constructor(parameters: any);
167
+ editor: any;
168
+ render(): HTMLElement | undefined;
169
+ createOrUpdatePopup(): void;
170
+ remove(): void;
171
+ }
154
172
  declare class AnnotationElement {
155
173
  static _hasPopupData({ contentsObj, richText }: {
156
174
  contentsObj: any;
@@ -177,13 +195,16 @@ declare class AnnotationElement {
177
195
  parent: any;
178
196
  container: HTMLElement | undefined;
179
197
  get _isEditable(): any;
180
- get hasPopupData(): boolean;
198
+ get hasPopupData(): any;
199
+ get commentData(): any;
181
200
  get hasCommentButton(): any;
182
- get commentButtonPosition(): any[] | null;
183
- get commentButtonColor(): string | null;
201
+ get commentButtonPosition(): any;
184
202
  _normalizePoint(point: any): any;
185
- updateEdited(params: any): void;
203
+ set commentText(text: any);
204
+ get commentText(): any;
205
+ removePopup(): void;
186
206
  popup: any;
207
+ updateEdited(params: any): void;
187
208
  resetEdited(): void;
188
209
  /**
189
210
  * Create an empty container for the annotation's HTML element.
@@ -217,6 +238,7 @@ declare class AnnotationElement {
217
238
  */
218
239
  private _createPopup;
219
240
  get hasPopupElement(): boolean;
241
+ get extraPopupElement(): null;
220
242
  /**
221
243
  * Render the annotation's HTML element(s).
222
244
  *
@@ -56,6 +56,8 @@ export class AnnotationStorage {
56
56
  };
57
57
  get editorStats(): any;
58
58
  resetModifiedIds(): void;
59
+ updateEditor(annotationId: any, data: any): boolean;
60
+ getEditor(annotationId: any): any;
59
61
  /**
60
62
  * @returns {{ids: Set<string>, hash: string}}
61
63
  */
@@ -498,11 +498,12 @@ export type RenderParameters = {
498
498
  */
499
499
  recordOperations?: boolean | undefined;
500
500
  /**
501
- * - If provided, only run
502
- * the PDF operations that are included in this set.
501
+ * - If provided, only
502
+ * run for which this function returns `true`.
503
503
  */
504
- filteredOperationIndexes?: Set<number> | undefined;
504
+ operationsFilter?: OperationsFilter | undefined;
505
505
  };
506
+ export type OperationsFilter = (index: number) => boolean;
506
507
  /**
507
508
  * Page getOperatorList parameters.
508
509
  */
@@ -1284,8 +1285,13 @@ export class PDFDocumentProxy {
1284
1285
  * @property {boolean} [isEditing] - Render the page in editing mode.
1285
1286
  * @property {boolean} [recordOperations] - Record the dependencies and bounding
1286
1287
  * boxes of all PDF operations that render onto the canvas.
1287
- * @property {Set<number>} [filteredOperationIndexes] - If provided, only run
1288
- * the PDF operations that are included in this set.
1288
+ * @property {OperationsFilter} [operationsFilter] - If provided, only
1289
+ * run for which this function returns `true`.
1290
+ */
1291
+ /**
1292
+ * @callback OperationsFilter
1293
+ * @param {number} index - The index of the operation.
1294
+ * @returns {boolean} If false, the operation is ignored.
1289
1295
  */
1290
1296
  /**
1291
1297
  * Page getOperatorList parameters.
@@ -1348,7 +1354,7 @@ export class PDFPageProxy {
1348
1354
  objs: PDFObjects;
1349
1355
  _intentStates: Map<any, any>;
1350
1356
  destroyed: boolean;
1351
- recordedGroups: any;
1357
+ recordedBBoxes: any;
1352
1358
  /**
1353
1359
  * @type {number} Page number of the page. First page is 1.
1354
1360
  */
@@ -1409,7 +1415,7 @@ export class PDFPageProxy {
1409
1415
  * @returns {RenderTask} An object that contains a promise that is
1410
1416
  * resolved when the page finishes rendering.
1411
1417
  */
1412
- render({ canvasContext, canvas, viewport, intent, annotationMode, transform, background, optionalContentConfigPromise, annotationCanvasMap, pageColors, printAnnotationStorage, isEditing, recordOperations, filteredOperationIndexes, }: RenderParameters): RenderTask;
1418
+ render({ canvasContext, canvas, viewport, intent, annotationMode, transform, background, optionalContentConfigPromise, annotationCanvasMap, pageColors, printAnnotationStorage, isEditing, recordOperations, operationsFilter, }: RenderParameters): RenderTask;
1413
1419
  /**
1414
1420
  * @param {GetOperatorListParameters} params - Page getOperatorList
1415
1421
  * parameters.
@@ -45,7 +45,7 @@ export class CanvasGraphics {
45
45
  }): void;
46
46
  compositeCtx: any;
47
47
  transparentCanvas: any;
48
- executeOperatorList(operatorList: any, executionStartIdx: any, continueCallback: any, stepper: any, filteredOperationIndexes: any): any;
48
+ executeOperatorList(operatorList: any, executionStartIdx: any, continueCallback: any, stepper: any, operationsFilter: any): any;
49
49
  endDrawing(): void;
50
50
  _scaleImage(img: any, inverseTransform: any): {
51
51
  img: any;
@@ -1,10 +1,10 @@
1
- export type SimpleDependency = "lineWidth" | "lineCap" | "lineJoin" | "miterLimit" | "dash" | "strokeAlpha" | "fillColor" | "fillAlpha" | "globalCompositeOperation" | "path" | "filter";
1
+ export type SimpleDependency = "lineWidth" | "lineCap" | "lineJoin" | "miterLimit" | "dash" | "strokeAlpha" | "fillColor" | "fillAlpha" | "globalCompositeOperation" | "path" | "filter" | "font" | "fontObj";
2
2
  export type IncrementalDependency = "transform" | "moveText" | "sameLineText";
3
3
  export type InternalIncrementalDependency = IncrementalDependency | typeof FORCED_DEPENDENCY_LABEL;
4
4
  /**
5
5
  * @typedef {"lineWidth" | "lineCap" | "lineJoin" | "miterLimit" | "dash" |
6
6
  * "strokeAlpha" | "fillColor" | "fillAlpha" | "globalCompositeOperation" |
7
- * "path" | "filter"} SimpleDependency
7
+ * "path" | "filter" | "font" | "fontObj"} SimpleDependency
8
8
  */
9
9
  /**
10
10
  * @typedef {"transform" | "moveText" | "sameLineText"} IncrementalDependency
@@ -14,7 +14,8 @@ export type InternalIncrementalDependency = IncrementalDependency | typeof FORCE
14
14
  * typeof FORCED_DEPENDENCY_LABEL} InternalIncrementalDependency
15
15
  */
16
16
  export class CanvasDependencyTracker {
17
- constructor(canvas: any);
17
+ constructor(canvas: any, operationsCount: any, recordDebugMetadata?: boolean);
18
+ growOperationsCount(operationsCount: any): void;
18
19
  save(opIdx: any): this;
19
20
  restore(opIdx: any): this;
20
21
  /**
@@ -22,7 +23,7 @@ export class CanvasDependencyTracker {
22
23
  */
23
24
  recordOpenMarker(idx: number): this;
24
25
  getOpenMarker(): any;
25
- recordCloseMarker(idx: any): this;
26
+ recordCloseMarker(opIdx: any): this;
26
27
  beginMarkedContent(opIdx: any): this;
27
28
  endMarkedContent(opIdx: any): this;
28
29
  pushBaseTransform(ctx: any): this;
@@ -43,35 +44,34 @@ export class CanvasDependencyTracker {
43
44
  */
44
45
  resetIncrementalData(name: IncrementalDependency, idx: number): this;
45
46
  recordNamedData(name: any, idx: any): this;
47
+ /**
48
+ * @param {SimpleDependency} name
49
+ * @param {string} depName
50
+ * @param {number} fallbackIdx
51
+ */
52
+ recordSimpleDataFromNamed(name: SimpleDependency, depName: string, fallbackIdx: number): void;
46
53
  recordFutureForcedDependency(name: any, idx: any): this;
47
54
  inheritSimpleDataAsFutureForcedDependencies(names: any): this;
48
55
  inheritPendingDependenciesAsFutureForcedDependencies(): this;
49
56
  resetBBox(idx: any): this;
50
- get hasPendingBBox(): boolean;
51
57
  recordClipBox(idx: any, ctx: any, minX: any, maxX: any, minY: any, maxY: any): this;
52
58
  recordBBox(idx: any, ctx: any, minX: any, maxX: any, minY: any, maxY: any): this;
53
59
  recordCharacterBBox(idx: any, ctx: any, font: any, scale: number | undefined, x: number | undefined, y: number | undefined, getMeasure: any): this;
54
60
  recordFullPageBBox(idx: any): this;
55
61
  getSimpleIndex(dependencyName: any): any;
56
62
  recordDependencies(idx: any, dependencyNames: any): this;
57
- copyDependenciesFromIncrementalOperation(idx: any, name: any): this;
58
63
  recordNamedDependency(idx: any, name: any): this;
59
64
  /**
60
65
  * @param {number} idx
61
66
  */
62
- recordOperation(idx: number, preserveBbox?: boolean): this;
63
- bboxToClipBoxDropOperation(idx: any): this;
67
+ recordOperation(idx: number, preserve?: boolean): this;
68
+ recordShowTextOperation(idx: any, preserve?: boolean): this;
69
+ bboxToClipBoxDropOperation(idx: any, preserve?: boolean): this;
64
70
  _takePendingDependencies(): Set<any>;
65
71
  _extractOperation(idx: any): any;
66
72
  _pushPendingDependencies(dependencies: any): void;
67
- take(): {
68
- minX: number;
69
- maxX: number;
70
- minY: number;
71
- maxY: number;
72
- dependencies: any[];
73
- idx: any;
74
- }[];
73
+ take(): BBoxReader;
74
+ takeDebugMetadata(): Map<any, any> | undefined;
75
75
  #private;
76
76
  }
77
77
  /**
@@ -82,7 +82,8 @@ export class CanvasDependencyTracker {
82
82
  * @implements {CanvasDependencyTracker}
83
83
  */
84
84
  export class CanvasNestedDependencyTracker implements CanvasDependencyTracker {
85
- constructor(dependencyTracker: any, opIdx: any);
85
+ constructor(dependencyTracker: any, opIdx: any, ignoreBBoxes: any);
86
+ growOperationsCount(): void;
86
87
  save(opIdx: any): this;
87
88
  restore(opIdx: any): this;
88
89
  recordOpenMarker(idx: any): this;
@@ -108,27 +109,32 @@ export class CanvasNestedDependencyTracker implements CanvasDependencyTracker {
108
109
  */
109
110
  resetIncrementalData(name: IncrementalDependency, idx: number): this;
110
111
  recordNamedData(name: any, idx: any): this;
112
+ /**
113
+ * @param {SimpleDependency} name
114
+ * @param {string} depName
115
+ * @param {number} fallbackIdx
116
+ */
117
+ recordSimpleDataFromNamed(name: SimpleDependency, depName: string, fallbackIdx: number): this;
111
118
  recordFutureForcedDependency(name: any, idx: any): this;
112
119
  inheritSimpleDataAsFutureForcedDependencies(names: any): this;
113
120
  inheritPendingDependenciesAsFutureForcedDependencies(): this;
114
121
  resetBBox(idx: any): this;
115
- get hasPendingBBox(): boolean;
116
122
  recordClipBox(idx: any, ctx: any, minX: any, maxX: any, minY: any, maxY: any): this;
117
123
  recordBBox(idx: any, ctx: any, minX: any, maxX: any, minY: any, maxY: any): this;
118
124
  recordCharacterBBox(idx: any, ctx: any, font: any, scale: any, x: any, y: any, getMeasure: any): this;
119
125
  recordFullPageBBox(idx: any): this;
120
126
  getSimpleIndex(dependencyName: any): any;
121
127
  recordDependencies(idx: any, dependencyNames: any): this;
122
- copyDependenciesFromIncrementalOperation(idx: any, name: any): this;
123
128
  recordNamedDependency(idx: any, name: any): this;
124
129
  /**
125
130
  * @param {number} idx
126
131
  * @param {SimpleDependency[]} dependencyNames
127
132
  */
128
133
  recordOperation(idx: number): this;
134
+ recordShowTextOperation(idx: any): this;
129
135
  bboxToClipBoxDropOperation(idx: any): this;
130
- recordNestedDependencies(): void;
131
136
  take(): void;
137
+ takeDebugMetadata(): void;
132
138
  #private;
133
139
  }
134
140
  export namespace Dependencies {
@@ -141,4 +147,14 @@ export namespace Dependencies {
141
147
  let transformAndFill: string[];
142
148
  }
143
149
  declare const FORCED_DEPENDENCY_LABEL: "__forcedDependency";
150
+ declare class BBoxReader {
151
+ constructor(bboxes: any, coords: any);
152
+ get length(): any;
153
+ isEmpty(i: any): boolean;
154
+ minX(i: any): number;
155
+ minY(i: any): number;
156
+ maxX(i: any): number;
157
+ maxY(i: any): number;
158
+ #private;
159
+ }
144
160
  export {};
@@ -59,8 +59,25 @@ export type PageViewportCloneParameters = {
59
59
  */
60
60
  dontFlip?: boolean | undefined;
61
61
  };
62
+ export function applyOpacity(r: any, g: any, b: any, opacity: any): any[];
63
+ export class ColorScheme {
64
+ static get isDarkMode(): any;
65
+ }
66
+ export class CSSConstants {
67
+ static get commentForegroundColor(): any;
68
+ }
62
69
  export function deprecated(details: any): void;
63
70
  export function fetchData(url: any, type?: string): Promise<any>;
71
+ /**
72
+ * Find a color that has sufficient contrast against a fixed color.
73
+ * The luminance (in HSL color space) of the base color is adjusted
74
+ * until the contrast ratio between the base color and the fixed color
75
+ * is at least the minimum contrast ratio required by WCAG 2.1.
76
+ * @param {Array<number>} baseColor
77
+ * @param {Array<number>} fixedColor
78
+ * @returns {string}
79
+ */
80
+ export function findContrastColor(baseColor: Array<number>, fixedColor: Array<number>): string;
64
81
  export function getColorValues(colors: any): void;
65
82
  export function getCurrentTransform(ctx: any): any[];
66
83
  export function getCurrentTransformInverse(ctx: any): any[];
@@ -238,6 +255,11 @@ export class RenderingCancelledException extends RenderingCancelledException_bas
238
255
  constructor(msg: any, extraDelay?: number);
239
256
  extraDelay: number;
240
257
  }
258
+ export function renderRichText({ html, dir, className }: {
259
+ html: any;
260
+ dir: any;
261
+ className: any;
262
+ }, container: any): void;
241
263
  /**
242
264
  * @param {HTMLDivElement} div
243
265
  * @param {PageViewport} viewport
@@ -131,6 +131,7 @@ export class AnnotationEditorLayer {
131
131
  * @param {AnnotationEditor} editor
132
132
  */
133
133
  addUndoableEditor(editor: AnnotationEditor): void;
134
+ getEditorByUID(uid: any): any;
134
135
  /**
135
136
  * Get an id for an editor.
136
137
  * @returns {string}
@@ -147,9 +148,9 @@ export class AnnotationEditorLayer {
147
148
  /**
148
149
  * Create a new editor
149
150
  * @param {Object} data
150
- * @returns {AnnotationEditor | null}
151
+ * @returns {Promise<AnnotationEditor | null>}
151
152
  */
152
- deserialize(data: Object): AnnotationEditor | null;
153
+ deserialize(data: Object): Promise<AnnotationEditor | null>;
153
154
  /**
154
155
  * Create and add a new editor.
155
156
  * @param {PointerEvent} event
@@ -158,6 +159,7 @@ export class AnnotationEditorLayer {
158
159
  * @returns {AnnotationEditor}
159
160
  */
160
161
  createAndAddNewEditor(event: PointerEvent, isCentered: boolean, data?: {}): AnnotationEditor;
162
+ get boundingClientRect(): DOMRect;
161
163
  /**
162
164
  * Create and add a new editor.
163
165
  */
@@ -1,13 +1,27 @@
1
1
  export class Comment {
2
2
  constructor(editor: any);
3
- toolbar: any;
4
- render(): HTMLButtonElement | null;
5
- edit(): void;
3
+ renderForToolbar(): any;
4
+ renderForStandalone(): any;
5
+ focusButton(): void;
6
+ onUpdatedColor(): void;
7
+ get commentButtonWidth(): number;
8
+ set commentPopupPositionInLayer(pos: number[] | null);
9
+ get commentPopupPositionInLayer(): number[] | null;
10
+ hasDefaultPopupPosition(): boolean;
11
+ removeStandaloneCommentButton(): void;
12
+ removeToolbarCommentButton(): void;
13
+ setCommentButtonStates({ selected, hasPopup }: {
14
+ selected: any;
15
+ hasPopup: any;
16
+ }): void;
17
+ edit(options: any): void;
6
18
  finish(): void;
7
19
  isDeleted(): boolean;
20
+ isEmpty(): boolean;
8
21
  hasBeenEdited(): boolean;
9
22
  serialize(): {
10
23
  text: null;
24
+ richText: null;
11
25
  date: null;
12
26
  deleted: boolean;
13
27
  };
@@ -16,16 +30,17 @@ export class Comment {
16
30
  */
17
31
  set data(text: {
18
32
  text: null;
33
+ richText: null;
19
34
  date: null;
20
35
  deleted: boolean;
21
36
  });
22
37
  get data(): {
23
38
  text: null;
39
+ richText: null;
24
40
  date: null;
25
41
  deleted: boolean;
26
42
  };
27
- setInitialText(text: any): void;
28
- toggle(enabled?: boolean): void;
43
+ setInitialText(text: any, richText?: null): void;
29
44
  shown(): void;
30
45
  destroy(): void;
31
46
  #private;
@@ -1,5 +1,6 @@
1
1
  export class FreeDrawOutline extends Outline {
2
2
  constructor(outline: any, points: any, box: any, scaleFactor: any, innerMargin: any, isLTR: any);
3
+ firstPoint: number[];
3
4
  lastPoint: number[];
4
5
  serialize([blX, blY, trX, trY]: [any, any, any, any], rotation: any): {
5
6
  outline: any[];
@@ -19,7 +19,8 @@ export class HighlightOutliner {
19
19
  }
20
20
  import { FreeDrawOutliner } from "./freedraw.js";
21
21
  declare class HighlightOutline extends Outline {
22
- constructor(outlines: any, box: any, lastPoint: any);
22
+ constructor(outlines: any, box: any, firstPoint: any, lastPoint: any);
23
+ firstPoint: any;
23
24
  lastPoint: any;
24
25
  /**
25
26
  * Serialize the outlines into the PDF page coordinate system.
@@ -109,6 +109,8 @@ export class AnnotationEditor {
109
109
  annotationElementId: any;
110
110
  _willKeepAspectRatio: boolean;
111
111
  _structTreeParentId: any;
112
+ creationDate: any;
113
+ modificationDate: any;
112
114
  rotation: number;
113
115
  pageRotation: number;
114
116
  pageDimensions: any[];
@@ -126,6 +128,7 @@ export class AnnotationEditor {
126
128
  get propertiesToUpdate(): any[];
127
129
  set _isDraggable(value: boolean);
128
130
  get _isDraggable(): boolean;
131
+ get uid(): any;
129
132
  /**
130
133
  * @returns {boolean} true if the editor handles the Enter key itself.
131
134
  */
@@ -234,11 +237,8 @@ export class AnnotationEditor {
234
237
  get parentDimensions(): number[];
235
238
  /**
236
239
  * Set the dimensions of this editor.
237
- * @param {number} width
238
- * @param {number} height
239
240
  */
240
- setDims(width: number, height: number): void;
241
- fixDims(): void;
241
+ setDims(): void;
242
242
  /**
243
243
  * Get the translation used to position this editor when it's created.
244
244
  * @returns {Array<number>}
@@ -266,6 +266,8 @@ export class AnnotationEditor {
266
266
  * @returns {Promise<EditorToolbar|null>}
267
267
  */
268
268
  addEditToolbar(): Promise<EditorToolbar | null>;
269
+ addCommentButtonInToolbar(): void;
270
+ removeCommentButtonFromToolbar(): void;
269
271
  removeEditToolbar(): void;
270
272
  addContainer(container: any): void;
271
273
  getClientDimensions(): DOMRect;
@@ -284,24 +286,46 @@ export class AnnotationEditor {
284
286
  serializeAltText(isForCopying: any): any;
285
287
  hasAltText(): boolean;
286
288
  hasAltTextData(): any;
289
+ focusCommentButton(): void;
287
290
  addCommentButton(): Comment;
288
- get commentColor(): null;
291
+ addStandaloneCommentButton(): void;
292
+ removeStandaloneCommentButton(): void;
293
+ hideStandaloneCommentButton(): void;
289
294
  set comment(text: {
290
295
  text: any;
296
+ richText: any;
291
297
  date: any;
292
298
  deleted: any;
293
- color: null;
299
+ color: any;
300
+ opacity: any;
294
301
  });
295
302
  get comment(): {
296
303
  text: any;
304
+ richText: any;
297
305
  date: any;
298
306
  deleted: any;
299
- color: null;
307
+ color: any;
308
+ opacity: any;
300
309
  };
301
- setCommentData(text: any): void;
310
+ setCommentData({ comment, popupRef, richText }: {
311
+ comment: any;
312
+ popupRef: any;
313
+ richText: any;
314
+ }): void;
302
315
  get hasEditedComment(): any;
303
- editComment(): Promise<void>;
316
+ get hasDeletedComment(): any;
317
+ get hasComment(): boolean;
318
+ editComment(options: any): Promise<void>;
319
+ toggleComment(isSelected: any, visibility?: undefined): void;
320
+ setSelectedCommentButton(selected: any): void;
304
321
  addComment(serialized: any): void;
322
+ updateFromAnnotationLayer({ popup: { contents, deleted } }: {
323
+ popup: {
324
+ contents: any;
325
+ deleted: any;
326
+ };
327
+ }): void;
328
+ get parentBoundingClientRect(): DOMRect;
305
329
  /**
306
330
  * Render this editor in a div.
307
331
  * @returns {HTMLDivElement | null}
@@ -330,6 +354,25 @@ export class AnnotationEditor {
330
354
  * @returns {Array<number>}
331
355
  */
332
356
  getPDFRect(): Array<number>;
357
+ getNonHCMColor(): any;
358
+ /**
359
+ * The color has been changed.
360
+ */
361
+ onUpdatedColor(): void;
362
+ getData(): {
363
+ id: any;
364
+ pageIndex: number;
365
+ rect: number[];
366
+ richText: any;
367
+ contentsObj: {
368
+ str: any;
369
+ };
370
+ creationDate: any;
371
+ modificationDate: any;
372
+ popupRef: boolean;
373
+ color: any;
374
+ opacity: any;
375
+ };
333
376
  /**
334
377
  * Executed once this editor has been rendered.
335
378
  * @param {boolean} focus - true if the editor should be focused.
@@ -418,6 +461,19 @@ export class AnnotationEditor {
418
461
  */
419
462
  makeResizable(): void;
420
463
  get toolbarPosition(): null;
464
+ /**
465
+ * Get the position of the comment button.
466
+ * @returns {Array<number>|null}
467
+ */
468
+ get commentButtonPosition(): Array<number> | null;
469
+ get commentButtonPositionInPage(): number[];
470
+ get commentButtonColor(): any;
471
+ set commentPopupPosition(pos: any);
472
+ get commentPopupPosition(): any;
473
+ hasDefaultPopupPosition(): any;
474
+ get commentButtonWidth(): any;
475
+ get elementBeforePopup(): HTMLDivElement | null;
476
+ setCommentButtonStates(options: any): void;
421
477
  /**
422
478
  * onkeydown callback.
423
479
  * @param {KeyboardEvent} event
@@ -429,6 +485,7 @@ export class AnnotationEditor {
429
485
  * Select this editor.
430
486
  */
431
487
  select(): void;
488
+ focus(): void;
432
489
  /**
433
490
  * Unselect this editor.
434
491
  */
@@ -484,12 +541,6 @@ export class AnnotationEditor {
484
541
  * @type {boolean}
485
542
  */
486
543
  get isEditing(): boolean;
487
- /**
488
- * Set the aspect ratio to use when resizing.
489
- * @param {number} width
490
- * @param {number} height
491
- */
492
- setAspectRatio(width: number, height: number): void;
493
544
  /**
494
545
  * Get the data to report to the telemetry when the editor is added.
495
546
  * @returns {Object}
@@ -508,6 +559,7 @@ export class AnnotationEditor {
508
559
  show(visible?: boolean | undefined): void;
509
560
  enable(): void;
510
561
  disable(): void;
562
+ updateFakeAnnotationElement(annotationLayer: any): void;
511
563
  /**
512
564
  * Render an annotation in the annotation layer.
513
565
  * @param {Object} annotation
@@ -22,6 +22,7 @@ export class FreeTextEditor extends AnnotationEditor {
22
22
  static deserialize(data: any, parent: any, uiManager: any): Promise<AnnotationEditor | null>;
23
23
  constructor(params: any);
24
24
  _colorPicker: null;
25
+ color: any;
25
26
  /** @inheritdoc */
26
27
  updateParams(type: any, value: any): void;
27
28
  /** @inheritdoc */
@@ -29,7 +30,6 @@ export class FreeTextEditor extends AnnotationEditor {
29
30
  /** @inheritdoc */
30
31
  get toolbarButtons(): (string | null)[][];
31
32
  get colorType(): number;
32
- get colorValue(): any;
33
33
  /**
34
34
  * Helper to translate the editor with the keyboard when it's empty.
35
35
  * @param {number} x in page units.
@@ -31,6 +31,7 @@ export class HighlightEditor extends AnnotationEditor {
31
31
  static deserialize(data: any, parent: any, uiManager: any): Promise<AnnotationEditor | null>;
32
32
  constructor(params: any);
33
33
  color: any;
34
+ opacity: any;
34
35
  defaultL10nId: string;
35
36
  /** @inheritdoc */
36
37
  get telemetryInitialData(): {
@@ -45,10 +46,11 @@ export class HighlightEditor extends AnnotationEditor {
45
46
  type: string;
46
47
  color: any;
47
48
  };
48
- get commentColor(): any;
49
49
  /** @inheritdoc */
50
50
  translateInPage(x: any, y: any): void;
51
51
  /** @inheritdoc */
52
+ get commentButtonPosition(): null;
53
+ /** @inheritdoc */
52
54
  updateParams(type: any, value: any): void;
53
55
  /** @inheritdoc */
54
56
  get propertiesToUpdate(): any[][];