unpdf 0.10.0 → 0.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (61) hide show
  1. package/README.md +9 -7
  2. package/dist/index.cjs +15 -19
  3. package/dist/index.d.cts +32 -13
  4. package/dist/index.d.mts +32 -13
  5. package/dist/index.d.ts +32 -13
  6. package/dist/index.mjs +15 -19
  7. package/dist/pdfjs.d.mts +1 -0
  8. package/dist/pdfjs.d.ts +1 -0
  9. package/dist/pdfjs.mjs +1 -1
  10. package/dist/types/src/display/annotation_layer.d.ts +10 -3
  11. package/dist/types/src/display/annotation_storage.d.ts +1 -0
  12. package/dist/types/src/display/api.d.ts +54 -26
  13. package/dist/types/src/display/base_factory.d.ts +3 -1
  14. package/dist/types/src/display/canvas.d.ts +2 -0
  15. package/dist/types/src/display/display_utils.d.ts +7 -5
  16. package/dist/types/src/display/draw_layer.d.ts +38 -0
  17. package/dist/types/src/display/editor/alt_text.d.ts +22 -0
  18. package/dist/types/src/display/editor/annotation_editor_layer.d.ts +24 -2
  19. package/dist/types/src/display/editor/color_picker.d.ts +19 -0
  20. package/dist/types/src/display/editor/editor.d.ts +78 -16
  21. package/dist/types/src/display/editor/freetext.d.ts +6 -1
  22. package/dist/types/src/display/editor/highlight.d.ts +88 -0
  23. package/dist/types/src/display/editor/ink.d.ts +4 -4
  24. package/dist/types/src/display/editor/outliner.d.ts +70 -0
  25. package/dist/types/src/display/editor/stamp.d.ts +1 -1
  26. package/dist/types/src/display/editor/toolbar.d.ts +17 -0
  27. package/dist/types/src/display/editor/tools.d.ts +39 -4
  28. package/dist/types/src/display/fetch_stream.d.ts +3 -4
  29. package/dist/types/src/display/font_loader.d.ts +1 -5
  30. package/dist/types/src/display/network.d.ts +2 -3
  31. package/dist/types/src/display/node_stream.d.ts +4 -5
  32. package/dist/types/src/display/node_utils.d.ts +6 -5
  33. package/dist/types/src/display/optional_content_config.d.ts +6 -1
  34. package/dist/types/src/display/text_layer.d.ts +40 -108
  35. package/dist/types/src/display/transport_stream.d.ts +3 -7
  36. package/dist/types/src/display/worker_options.d.ts +20 -22
  37. package/dist/types/src/pdf.d.ts +6 -3
  38. package/dist/types/src/shared/util.d.ts +24 -23
  39. package/dist/types/web/annotation_editor_layer_builder.d.ts +10 -13
  40. package/dist/types/web/annotation_layer_builder.d.ts +7 -4
  41. package/dist/types/web/app_options.d.ts +1 -2
  42. package/dist/types/web/draw_layer_builder.d.ts +23 -0
  43. package/dist/types/web/genericl10n.d.ts +5 -3
  44. package/dist/types/web/interfaces.d.ts +11 -8
  45. package/dist/types/web/l10n.d.ts +5 -2
  46. package/dist/types/web/pdf_find_controller.d.ts +1 -2
  47. package/dist/types/web/pdf_history.d.ts +1 -53
  48. package/dist/types/web/pdf_link_service.d.ts +6 -109
  49. package/dist/types/web/pdf_page_view.d.ts +5 -16
  50. package/dist/types/web/pdf_scripting_manager.d.ts +6 -10
  51. package/dist/types/web/pdf_single_page_viewer.d.ts +2 -2
  52. package/dist/types/web/pdf_thumbnail_view.d.ts +1 -13
  53. package/dist/types/web/pdf_thumbnail_viewer.d.ts +1 -17
  54. package/dist/types/web/pdf_viewer.component.d.ts +1 -2
  55. package/dist/types/web/pdf_viewer.d.ts +90 -42
  56. package/dist/types/web/text_accessibility.d.ts +1 -1
  57. package/dist/types/web/text_highlighter.d.ts +1 -1
  58. package/dist/types/web/text_layer_builder.d.ts +17 -29
  59. package/dist/types/web/ui_utils.d.ts +1 -1
  60. package/package.json +21 -30
  61. package/dist/types/web/l10n_utils.d.ts +0 -9
@@ -1,9 +1,14 @@
1
1
  export class OptionalContentConfig {
2
- constructor(data: any);
2
+ constructor(data: any, renderingIntent?: number);
3
+ renderingIntent: number;
3
4
  name: any;
4
5
  creator: any;
5
6
  isVisible(group: any): any;
6
7
  setVisibility(id: any, visible?: boolean): void;
8
+ setOCGState({ state, preserveRB }: {
9
+ state: any;
10
+ preserveRB: any;
11
+ }): void;
7
12
  get hasInitialVisibility(): boolean;
8
13
  getOrder(): any;
9
14
  getGroups(): any;
@@ -1,9 +1,6 @@
1
1
  export type PageViewport = import("./display_utils").PageViewport;
2
2
  export type TextContent = import("./api").TextContent;
3
- /**
4
- * Text layer render parameters.
5
- */
6
- export type TextLayerRenderParameters = {
3
+ export type TextLayerParameters = {
7
4
  /**
8
5
  * - Text content to
9
6
  * render, i.e. the value returned by the page's `streamTextContent` or
@@ -20,132 +17,67 @@ export type TextLayerRenderParameters = {
20
17
  * the text runs.
21
18
  */
22
19
  viewport: PageViewport;
23
- /**
24
- * - HTML elements that correspond to
25
- * the text items of the textContent input.
26
- * This is output and shall initially be set to an empty array.
27
- */
28
- textDivs?: HTMLElement[] | undefined;
29
- /**
30
- * - Some properties
31
- * weakly mapped to the HTML elements used to render the text.
32
- */
33
- textDivProperties?: WeakMap<HTMLElement, Object> | undefined;
34
- /**
35
- * - Strings that correspond to
36
- * the `str` property of the text items of the textContent input.
37
- * This is output and shall initially be set to an empty array.
38
- */
39
- textContentItemsStr?: string[] | undefined;
40
- /**
41
- * true if we can use
42
- * OffscreenCanvas to measure string widths.
43
- */
44
- isOffscreenCanvasSupported?: boolean | undefined;
45
20
  };
46
- /**
47
- * Text layer update parameters.
48
- */
49
21
  export type TextLayerUpdateParameters = {
50
- /**
51
- * - The DOM node that will contain the text
52
- * runs.
53
- */
54
- container: HTMLElement;
55
22
  /**
56
23
  * - The target viewport to properly layout
57
24
  * the text runs.
58
25
  */
59
26
  viewport: PageViewport;
60
27
  /**
61
- * - HTML elements that correspond to
62
- * the text items of the textContent input.
63
- * This is output and shall initially be set to an empty array.
64
- */
65
- textDivs?: HTMLElement[] | undefined;
66
- /**
67
- * - Some properties
68
- * weakly mapped to the HTML elements used to render the text.
28
+ * - Callback invoked before the textLayer is
29
+ * updated in the DOM.
69
30
  */
70
- textDivProperties?: WeakMap<HTMLElement, Object> | undefined;
31
+ onBefore?: Function | undefined;
32
+ };
33
+ export function renderTextLayer(...args: any[]): {
34
+ promise: Promise<any>;
35
+ textDivs: HTMLElement[];
36
+ textContentItemsStr: string[];
37
+ } | undefined;
38
+ export class TextLayer {
39
+ static "__#44@#ascentCache": Map<any, any>;
40
+ static "__#44@#canvasContexts": Map<any, any>;
41
+ static "__#44@#pendingTextLayers": Set<any>;
71
42
  /**
72
- * true if we can use
73
- * OffscreenCanvas to measure string widths.
43
+ * Clean-up global textLayer data.
44
+ * @returns {undefined}
74
45
  */
75
- isOffscreenCanvasSupported?: boolean | undefined;
46
+ static cleanup(): undefined;
47
+ static "__#44@#getCtx"(lang?: null): any;
48
+ static "__#44@#getAscent"(fontFamily: any, lang: any): any;
76
49
  /**
77
- * true if the text layer must be rotated.
50
+ * @param {TextLayerParameters} options
78
51
  */
79
- mustRotate?: boolean | undefined;
52
+ constructor({ textContentSource, container, viewport }: TextLayerParameters);
80
53
  /**
81
- * true if the text layer contents must be
82
- * rescaled.
54
+ * Render the textLayer.
55
+ * @returns {Promise}
83
56
  */
84
- mustRescale?: boolean | undefined;
85
- };
86
- /**
87
- * @param {TextLayerRenderParameters} params
88
- * @returns {TextLayerRenderTask}
89
- */
90
- export function renderTextLayer(params: TextLayerRenderParameters): TextLayerRenderTask;
91
- export class TextLayerRenderTask {
92
- constructor({ textContentSource, container, viewport, textDivs, textDivProperties, textContentItemsStr, isOffscreenCanvasSupported, }: {
93
- textContentSource: any;
94
- container: any;
95
- viewport: any;
96
- textDivs: any;
97
- textDivProperties: any;
98
- textContentItemsStr: any;
99
- isOffscreenCanvasSupported: any;
100
- });
101
- _textContentSource: any;
102
- _isReadableStream: boolean;
103
- _container: any;
104
- _rootContainer: any;
105
- _textDivs: any;
106
- _textContentItemsStr: any;
107
- _isOffscreenCanvasSupported: any;
108
- _fontInspectorEnabled: boolean;
109
- _reader: any;
110
- _textDivProperties: any;
111
- _canceled: boolean;
112
- _capability: PromiseCapability;
113
- _layoutTextParams: {
114
- prevFontSize: null;
115
- prevFontFamily: null;
116
- div: null;
117
- scale: number;
118
- properties: null;
119
- ctx: CanvasRenderingContext2D | OffscreenCanvasRenderingContext2D | null;
120
- };
121
- _transform: any[];
122
- _pageWidth: any;
123
- _pageHeight: any;
57
+ render(): Promise<any>;
124
58
  /**
125
- * Promise for textLayer rendering task completion.
126
- * @type {Promise<void>}
59
+ * Update a previously rendered textLayer, if necessary.
60
+ * @param {TextLayerUpdateParameters} options
61
+ * @returns {undefined}
127
62
  */
128
- get promise(): Promise<void>;
63
+ update({ viewport, onBefore }: TextLayerUpdateParameters): undefined;
129
64
  /**
130
65
  * Cancel rendering of the textLayer.
66
+ * @returns {undefined}
131
67
  */
132
- cancel(): void;
133
- /**
134
- * @private
135
- */
136
- private _processItems;
68
+ cancel(): undefined;
137
69
  /**
138
- * @private
70
+ * @type {Array<HTMLElement>} HTML elements that correspond to the text items
71
+ * of the textContent input.
72
+ * This is output and will initially be set to an empty array.
139
73
  */
140
- private _layoutText;
74
+ get textDivs(): HTMLElement[];
141
75
  /**
142
- * @private
76
+ * @type {Array<string>} Strings that correspond to the `str` property of
77
+ * the text items of the textContent input.
78
+ * This is output and will initially be set to an empty array
143
79
  */
144
- private _render;
80
+ get textContentItemsStr(): string[];
81
+ #private;
145
82
  }
146
- /**
147
- * @param {TextLayerUpdateParameters} params
148
- * @returns {undefined}
149
- */
150
- export function updateTextLayer({ container, viewport, textDivs, textDivProperties, isOffscreenCanvasSupported, mustRotate, mustRescale, }: TextLayerUpdateParameters): undefined;
151
- import { PromiseCapability } from "../shared/util.js";
83
+ export function updateTextLayer(): void;
@@ -3,16 +3,12 @@ export type IPDFStreamReader = import("../interfaces").IPDFStreamReader;
3
3
  export type IPDFStreamRangeReader = import("../interfaces").IPDFStreamRangeReader;
4
4
  /** @implements {IPDFStream} */
5
5
  export class PDFDataTransportStream implements IPDFStream {
6
- constructor({ length, initialData, progressiveDone, contentDispositionFilename, disableRange, disableStream, }: {
7
- length: any;
8
- initialData: any;
9
- progressiveDone?: boolean | undefined;
10
- contentDispositionFilename?: null | undefined;
6
+ constructor(pdfDataRangeTransport: any, { disableRange, disableStream }: {
11
7
  disableRange?: boolean | undefined;
12
8
  disableStream?: boolean | undefined;
13
- }, pdfDataRangeTransport: any);
9
+ });
14
10
  _queuedChunks: ArrayBuffer[];
15
- _progressiveDone: boolean;
11
+ _progressiveDone: any;
16
12
  _contentDispositionFilename: any;
17
13
  _pdfDataRangeTransport: any;
18
14
  _isStreamingSupported: boolean;
@@ -1,27 +1,25 @@
1
- export type GlobalWorkerOptionsType = {
1
+ export class GlobalWorkerOptions {
2
+ static "__#39@#port": null;
3
+ static "__#39@#src": string;
2
4
  /**
3
- * - Defines global port for worker
4
- * process. Overrides the `workerSrc` option.
5
+ * @param {Worker | null} workerPort - Defines global port for worker process.
6
+ * Overrides the `workerSrc` option.
5
7
  */
6
- workerPort: Worker | null;
8
+ static set workerPort(val: Worker | null);
7
9
  /**
8
- * - A string containing the path and filename
9
- * of the worker file.
10
+ * @type {Worker | null}
11
+ */
12
+ static get workerPort(): Worker | null;
13
+ /**
14
+ * @param {string} workerSrc - A string containing the path and filename of
15
+ * the worker file.
10
16
  *
11
- * NOTE: The `workerSrc` option should always be set, in order to prevent any
12
- * issues when using the PDF.js library.
17
+ * NOTE: The `workerSrc` option should always be set, in order to prevent
18
+ * any issues when using the PDF.js library.
19
+ */
20
+ static set workerSrc(val: string);
21
+ /**
22
+ * @type {string}
13
23
  */
14
- workerSrc: string;
15
- };
16
- /**
17
- * @typedef {Object} GlobalWorkerOptionsType
18
- * @property {Worker | null} workerPort - Defines global port for worker
19
- * process. Overrides the `workerSrc` option.
20
- * @property {string} workerSrc - A string containing the path and filename
21
- * of the worker file.
22
- *
23
- * NOTE: The `workerSrc` option should always be set, in order to prevent any
24
- * issues when using the PDF.js library.
25
- */
26
- /** @type {GlobalWorkerOptionsType} */
27
- export const GlobalWorkerOptions: GlobalWorkerOptionsType;
24
+ static get workerSrc(): string;
25
+ }
@@ -4,7 +4,6 @@ export type PDFDocumentProxy = import("./display/api").PDFDocumentProxy;
4
4
  export type PDFPageProxy = import("./display/api").PDFPageProxy;
5
5
  export type RenderTask = import("./display/api").RenderTask;
6
6
  export type PageViewport = import("./display/display_utils").PageViewport;
7
- export type TextLayerRenderTask = import("./display/text_layer").TextLayerRenderTask;
8
7
  import { AbortException } from "./shared/util.js";
9
8
  import { AnnotationEditorLayer } from "./display/editor/annotation_editor_layer.js";
10
9
  import { AnnotationEditorParamsType } from "./shared/util.js";
@@ -14,9 +13,12 @@ import { AnnotationLayer } from "./display/annotation_layer.js";
14
13
  import { AnnotationMode } from "./shared/util.js";
15
14
  import { build } from "./display/api.js";
16
15
  import { CMapCompressionType } from "./shared/util.js";
16
+ import { ColorPicker } from "./display/editor/color_picker.js";
17
17
  import { createValidAbsoluteUrl } from "./shared/util.js";
18
18
  import { DOMSVGFactory } from "./display/display_utils.js";
19
+ import { DrawLayer } from "./display/draw_layer.js";
19
20
  import { FeatureTest } from "./shared/util.js";
21
+ import { fetchData } from "./display/display_utils.js";
20
22
  import { getDocument } from "./display/api.js";
21
23
  import { getFilenameFromUrl } from "./display/display_utils.js";
22
24
  import { getPdfFilenameFromUrl } from "./display/display_utils.js";
@@ -30,21 +32,22 @@ import { MissingPDFException } from "./shared/util.js";
30
32
  import { noContextMenu } from "./display/display_utils.js";
31
33
  import { normalizeUnicode } from "./shared/util.js";
32
34
  import { OPS } from "./shared/util.js";
35
+ import { Outliner } from "./display/editor/outliner.js";
33
36
  import { PasswordResponses } from "./shared/util.js";
34
37
  import { PDFDataRangeTransport } from "./display/api.js";
35
38
  import { PDFDateString } from "./display/display_utils.js";
36
39
  import { PDFWorker } from "./display/api.js";
37
40
  import { PermissionFlag } from "./shared/util.js";
38
41
  import { PixelsPerInch } from "./display/display_utils.js";
39
- import { PromiseCapability } from "./shared/util.js";
40
42
  import { RenderingCancelledException } from "./display/display_utils.js";
41
43
  import { renderTextLayer } from "./display/text_layer.js";
42
44
  import { setLayerDimensions } from "./display/display_utils.js";
43
45
  import { shadow } from "./shared/util.js";
46
+ import { TextLayer } from "./display/text_layer.js";
44
47
  import { UnexpectedResponseException } from "./shared/util.js";
45
48
  import { updateTextLayer } from "./display/text_layer.js";
46
49
  import { Util } from "./shared/util.js";
47
50
  import { VerbosityLevel } from "./shared/util.js";
48
51
  import { version } from "./display/api.js";
49
52
  import { XfaLayer } from "./display/xfa_layer.js";
50
- export { AbortException, AnnotationEditorLayer, AnnotationEditorParamsType, AnnotationEditorType, AnnotationEditorUIManager, AnnotationLayer, AnnotationMode, build, CMapCompressionType, createValidAbsoluteUrl, DOMSVGFactory, FeatureTest, getDocument, getFilenameFromUrl, getPdfFilenameFromUrl, getXfaPageViewport, GlobalWorkerOptions, ImageKind, InvalidPDFException, isDataScheme, isPdfFile, MissingPDFException, noContextMenu, normalizeUnicode, OPS, PasswordResponses, PDFDataRangeTransport, PDFDateString, PDFWorker, PermissionFlag, PixelsPerInch, PromiseCapability, RenderingCancelledException, renderTextLayer, setLayerDimensions, shadow, UnexpectedResponseException, updateTextLayer, Util, VerbosityLevel, version, XfaLayer };
53
+ export { AbortException, AnnotationEditorLayer, AnnotationEditorParamsType, AnnotationEditorType, AnnotationEditorUIManager, AnnotationLayer, AnnotationMode, build, CMapCompressionType, ColorPicker, createValidAbsoluteUrl, DOMSVGFactory, DrawLayer, FeatureTest, fetchData, getDocument, getFilenameFromUrl, getPdfFilenameFromUrl, getXfaPageViewport, GlobalWorkerOptions, ImageKind, InvalidPDFException, isDataScheme, isPdfFile, MissingPDFException, noContextMenu, normalizeUnicode, OPS, Outliner, PasswordResponses, PDFDataRangeTransport, PDFDateString, PDFWorker, PermissionFlag, PixelsPerInch, RenderingCancelledException, renderTextLayer, setLayerDimensions, shadow, TextLayer, UnexpectedResponseException, updateTextLayer, Util, VerbosityLevel, version, XfaLayer };
@@ -38,12 +38,18 @@ export namespace AnnotationEditorParamsType {
38
38
  let INK_COLOR: number;
39
39
  let INK_THICKNESS: number;
40
40
  let INK_OPACITY: number;
41
+ let HIGHLIGHT_COLOR: number;
42
+ let HIGHLIGHT_DEFAULT_COLOR: number;
43
+ let HIGHLIGHT_THICKNESS: number;
44
+ let HIGHLIGHT_FREE: number;
45
+ let HIGHLIGHT_SHOW_ALL: number;
41
46
  }
42
47
  export const AnnotationEditorPrefix: "pdfjs_internal_editor_";
43
48
  export namespace AnnotationEditorType {
44
49
  let DISABLE: number;
45
50
  let NONE: number;
46
51
  let FREETEXT: number;
52
+ let HIGHLIGHT: number;
47
53
  let STAMP: number;
48
54
  let INK: number;
49
55
  }
@@ -103,7 +109,8 @@ export namespace AnnotationType {
103
109
  export let CIRCLE: number;
104
110
  export let POLYGON: number;
105
111
  export let POLYLINE: number;
106
- export let HIGHLIGHT: number;
112
+ let HIGHLIGHT_1: number;
113
+ export { HIGHLIGHT_1 as HIGHLIGHT };
107
114
  let UNDERLINE_1: number;
108
115
  export { UNDERLINE_1 as UNDERLINE };
109
116
  export let SQUIGGLY: number;
@@ -161,6 +168,17 @@ export class FeatureTest {
161
168
  static get isCSSRoundSupported(): any;
162
169
  }
163
170
  export const FONT_IDENTITY_MATRIX: number[];
171
+ export namespace FontRenderOps {
172
+ let BEZIER_CURVE_TO: number;
173
+ let MOVE_TO: number;
174
+ let LINE_TO: number;
175
+ let QUADRATIC_CURVE_TO: number;
176
+ let RESTORE: number;
177
+ let SAVE: number;
178
+ let SCALE: number;
179
+ let TRANSFORM: number;
180
+ let TRANSLATE: number;
181
+ }
164
182
  declare const FormatError_base: any;
165
183
  /**
166
184
  * Error caused during parsing PDF data.
@@ -184,7 +202,6 @@ export class InvalidPDFException extends InvalidPDFException_base {
184
202
  [x: string]: any;
185
203
  constructor(msg: any);
186
204
  }
187
- export function isArrayBuffer(v: any): boolean;
188
205
  export function isArrayEqual(arr1: any, arr2: any): boolean;
189
206
  export const isNodeJS: any;
190
207
  export const LINE_DESCENT_FACTOR: 0.35;
@@ -314,31 +331,13 @@ export namespace PermissionFlag {
314
331
  export let ASSEMBLE: number;
315
332
  export let PRINT_HIGH_QUALITY: number;
316
333
  }
317
- export class PromiseCapability {
318
- /**
319
- * @type {Promise<any>} The Promise object.
320
- */
321
- promise: Promise<any>;
322
- /**
323
- * @type {function} Fulfills the Promise.
324
- */
325
- resolve: Function;
326
- /**
327
- * @type {function} Rejects the Promise.
328
- */
329
- reject: Function;
330
- /**
331
- * @type {boolean} If the Promise has been fulfilled/rejected.
332
- */
333
- get settled(): boolean;
334
- #private;
335
- }
336
334
  export namespace RenderingIntentFlag {
337
335
  export let ANY: number;
338
336
  export let DISPLAY: number;
339
337
  let PRINT_2: number;
340
338
  export { PRINT_2 as PRINT };
341
- export let SAVE: number;
339
+ let SAVE_1: number;
340
+ export { SAVE_1 as SAVE };
342
341
  export let ANNOTATIONS_FORMS: number;
343
342
  export let ANNOTATIONS_STORAGE: number;
344
343
  export let ANNOTATIONS_DISABLE: number;
@@ -388,7 +387,9 @@ export class Util {
388
387
  static singularValueDecompose2dScale(m: any): number[];
389
388
  static normalizeRect(rect: any): any;
390
389
  static intersect(rect1: any, rect2: any): number[] | null;
391
- static bezierBoundingBox(x0: any, y0: any, x1: any, y1: any, x2: any, y2: any, x3: any, y3: any): number[];
390
+ static "__#1@#getExtremumOnCurve"(x0: any, x1: any, x2: any, x3: any, y0: any, y1: any, y2: any, y3: any, t: any, minMax: any): void;
391
+ static "__#1@#getExtremum"(x0: any, x1: any, x2: any, x3: any, y0: any, y1: any, y2: any, y3: any, a: any, b: any, c: any, minMax: any): void;
392
+ static bezierBoundingBox(x0: any, y0: any, x1: any, y1: any, x2: any, y2: any, x3: any, y3: any, minMax: any): any;
392
393
  }
393
394
  export namespace VerbosityLevel {
394
395
  let ERRORS: number;
@@ -5,38 +5,34 @@ export type TextAccessibilityManager = import("./text_accessibility.js").TextAcc
5
5
  export type IL10n = import("./interfaces").IL10n;
6
6
  export type AnnotationLayer = import("../src/display/annotation_layer.js").AnnotationLayer;
7
7
  export type AnnotationEditorLayerBuilderOptions = {
8
- uiManager?: import("../src/display/editor/tools.js").AnnotationEditorUIManager | undefined;
9
- pageDiv: HTMLDivElement;
8
+ uiManager?: import("../src/pdf").AnnotationEditorUIManager | undefined;
10
9
  pdfPage: PDFPageProxy;
11
10
  l10n?: import("./interfaces").IL10n | undefined;
12
11
  accessibilityManager?: import("./text_accessibility.js").TextAccessibilityManager | undefined;
13
- annotationLayer?: import("../src/display/annotation_layer.js").AnnotationLayer | undefined;
12
+ annotationLayer?: import("../src/pdf").AnnotationLayer | undefined;
13
+ textLayer?: any;
14
+ drawLayer?: any;
15
+ onAppend?: Function | undefined;
14
16
  };
15
17
  /**
16
18
  * @typedef {Object} AnnotationEditorLayerBuilderOptions
17
19
  * @property {AnnotationEditorUIManager} [uiManager]
18
- * @property {HTMLDivElement} pageDiv
19
20
  * @property {PDFPageProxy} pdfPage
20
21
  * @property {IL10n} [l10n]
21
22
  * @property {TextAccessibilityManager} [accessibilityManager]
22
23
  * @property {AnnotationLayer} [annotationLayer]
24
+ * @property {TextLayer} [textLayer]
25
+ * @property {DrawLayer} [drawLayer]
26
+ * @property {function} [onAppend]
23
27
  */
24
28
  export class AnnotationEditorLayerBuilder {
25
29
  /**
26
30
  * @param {AnnotationEditorLayerBuilderOptions} options
27
31
  */
28
32
  constructor(options: AnnotationEditorLayerBuilderOptions);
29
- pageDiv: HTMLDivElement;
30
33
  pdfPage: import("../src/display/api").PDFPageProxy;
31
34
  accessibilityManager: import("./text_accessibility.js").TextAccessibilityManager | undefined;
32
- l10n: {
33
- getLanguage(): any;
34
- getDirection(): any;
35
- get(ids: any, args: null | undefined, fallback: any): Promise<any>;
36
- translate(element: any): Promise<any>;
37
- pause(): any;
38
- resume(): any;
39
- };
35
+ l10n: import("./interfaces").IL10n | GenericL10n | undefined;
40
36
  annotationEditorLayer: AnnotationEditorLayer | null;
41
37
  div: HTMLDivElement | null;
42
38
  _cancelled: boolean;
@@ -50,4 +46,5 @@ export class AnnotationEditorLayerBuilder {
50
46
  show(): void;
51
47
  #private;
52
48
  }
49
+ import { GenericL10n } from "./genericl10n";
53
50
  import { AnnotationEditorLayer } from "../src/pdf";
@@ -4,8 +4,8 @@ export type AnnotationStorage = import("../src/display/annotation_storage").Anno
4
4
  export type IDownloadManager = import("./interfaces").IDownloadManager;
5
5
  export type IPDFLinkService = import("./interfaces").IPDFLinkService;
6
6
  export type TextAccessibilityManager = import("./text_accessibility.js").TextAccessibilityManager;
7
+ export type AnnotationEditorUIManager = import("../src/display/editor/tools.js").AnnotationEditorUIManager;
7
8
  export type AnnotationLayerBuilderOptions = {
8
- pageDiv: HTMLDivElement;
9
9
  pdfPage: PDFPageProxy;
10
10
  annotationStorage?: import("../src/display/annotation_storage").AnnotationStorage | undefined;
11
11
  /**
@@ -23,10 +23,11 @@ export type AnnotationLayerBuilderOptions = {
23
23
  } | null> | undefined;
24
24
  annotationCanvasMap?: Map<string, HTMLCanvasElement> | undefined;
25
25
  accessibilityManager?: import("./text_accessibility.js").TextAccessibilityManager | undefined;
26
+ annotationEditorUIManager?: import("../src/pdf").AnnotationEditorUIManager | undefined;
27
+ onAppend?: Function | undefined;
26
28
  };
27
29
  /**
28
30
  * @typedef {Object} AnnotationLayerBuilderOptions
29
- * @property {HTMLDivElement} pageDiv
30
31
  * @property {PDFPageProxy} pdfPage
31
32
  * @property {AnnotationStorage} [annotationStorage]
32
33
  * @property {string} [imageResourcesPath] - Path for image resources, mainly
@@ -40,13 +41,14 @@ export type AnnotationLayerBuilderOptions = {
40
41
  * [fieldObjectsPromise]
41
42
  * @property {Map<string, HTMLCanvasElement>} [annotationCanvasMap]
42
43
  * @property {TextAccessibilityManager} [accessibilityManager]
44
+ * @property {AnnotationEditorUIManager} [annotationEditorUIManager]
45
+ * @property {function} [onAppend]
43
46
  */
44
47
  export class AnnotationLayerBuilder {
45
48
  /**
46
49
  * @param {AnnotationLayerBuilderOptions} options
47
50
  */
48
- constructor({ pageDiv, pdfPage, linkService, downloadManager, annotationStorage, imageResourcesPath, renderForms, enableScripting, hasJSActionsPromise, fieldObjectsPromise, annotationCanvasMap, accessibilityManager, }: AnnotationLayerBuilderOptions);
49
- pageDiv: HTMLDivElement;
51
+ constructor({ pdfPage, linkService, downloadManager, annotationStorage, imageResourcesPath, renderForms, enableScripting, hasJSActionsPromise, fieldObjectsPromise, annotationCanvasMap, accessibilityManager, annotationEditorUIManager, onAppend, }: AnnotationLayerBuilderOptions);
50
52
  pdfPage: import("../src/display/api").PDFPageProxy;
51
53
  linkService: import("./interfaces").IPDFLinkService;
52
54
  downloadManager: import("./interfaces").IDownloadManager | undefined;
@@ -60,6 +62,7 @@ export class AnnotationLayerBuilder {
60
62
  } | null>;
61
63
  _annotationCanvasMap: Map<string, HTMLCanvasElement>;
62
64
  _accessibilityManager: import("./text_accessibility.js").TextAccessibilityManager;
65
+ _annotationEditorUIManager: import("../src/pdf").AnnotationEditorUIManager;
63
66
  annotationLayer: AnnotationLayer | null;
64
67
  div: HTMLDivElement | null;
65
68
  _cancelled: boolean;
@@ -1,11 +1,10 @@
1
1
  export class AppOptions {
2
2
  static get(name: any): any;
3
- static getAll(kind?: null): any;
3
+ static getAll(kind?: null, defaultOnly?: boolean): any;
4
4
  static set(name: any, value: any): void;
5
5
  static setAll(options: any, init?: boolean): void;
6
6
  static remove(name: any): void;
7
7
  }
8
- export const compatibilityParams: any;
9
8
  export namespace OptionKind {
10
9
  let BROWSER: number;
11
10
  let VIEWER: number;
@@ -0,0 +1,23 @@
1
+ export type DrawLayerBuilderOptions = {
2
+ pageIndex: number;
3
+ };
4
+ /**
5
+ * @typedef {Object} DrawLayerBuilderOptions
6
+ * @property {number} pageIndex
7
+ */
8
+ export class DrawLayerBuilder {
9
+ /**
10
+ * @param {DrawLayerBuilderOptions} options
11
+ */
12
+ constructor(options: DrawLayerBuilderOptions);
13
+ pageIndex: number;
14
+ /**
15
+ * @param {string} intent (default value is 'display')
16
+ */
17
+ render(intent?: string): Promise<void>;
18
+ cancel(): void;
19
+ _cancelled: boolean | undefined;
20
+ setParent(parent: any): void;
21
+ getDrawLayer(): null;
22
+ #private;
23
+ }
@@ -9,12 +9,14 @@ export class GenericL10n extends L10n implements IL10n {
9
9
  * translations.
10
10
  * @param {String} baseLang - The base language to use for translations.
11
11
  */
12
- static "__#47@#generateBundles"(defaultLang: string, baseLang: string): AsyncGenerator<any, void, unknown>;
13
- static "__#47@#createBundle"(lang: any, baseURL: any, paths: any): Promise<any>;
14
- static "__#47@#getPaths"(): Promise<{
12
+ static "__#59@#generateBundles"(defaultLang: string, baseLang: string): AsyncGenerator<any, void, unknown>;
13
+ static "__#59@#createBundle"(lang: any, baseURL: any, paths: any): Promise<any>;
14
+ static "__#59@#getPaths"(): Promise<{
15
15
  baseURL: any;
16
16
  paths: any;
17
17
  }>;
18
+ static "__#59@#generateBundlesFallback"(lang: any): AsyncGenerator<any, void, unknown>;
19
+ static "__#59@#createBundleFallback"(lang: any): Promise<any>;
18
20
  constructor(lang: any);
19
21
  }
20
22
  import { L10n } from "./l10n.js";
@@ -83,7 +83,7 @@ export class IPDFLinkService {
83
83
  /**
84
84
  * @param {number} value
85
85
  */
86
- set page(arg: number);
86
+ set page(value: number);
87
87
  /**
88
88
  * @type {number}
89
89
  */
@@ -91,7 +91,7 @@ export class IPDFLinkService {
91
91
  /**
92
92
  * @param {number} value
93
93
  */
94
- set rotation(arg: number);
94
+ set rotation(value: number);
95
95
  /**
96
96
  * @type {number}
97
97
  */
@@ -103,7 +103,7 @@ export class IPDFLinkService {
103
103
  /**
104
104
  * @param {boolean} value
105
105
  */
106
- set externalLinkEnabled(arg: boolean);
106
+ set externalLinkEnabled(value: boolean);
107
107
  /**
108
108
  * @type {boolean}
109
109
  */
@@ -144,11 +144,14 @@ export class IPDFLinkService {
144
144
  * @param {Object} action
145
145
  */
146
146
  executeSetOCGState(action: Object): void;
147
- /**
148
- * @param {number} pageNum - page number.
149
- * @param {Object} pageRef - reference to the page.
150
- */
151
- cachePageRef(pageNum: number, pageRef: Object): void;
147
+ }
148
+ /**
149
+ * @interface
150
+ */
151
+ export class IPDFPrintServiceFactory {
152
+ static initGlobals(): void;
153
+ static get supportsPrinting(): boolean;
154
+ static createPrintService(): void;
152
155
  }
153
156
  /**
154
157
  * @interface
@@ -1,11 +1,14 @@
1
1
  export type IL10n = import("./interfaces").IL10n;
2
+ export const GenericL10n: null;
2
3
  /** @typedef {import("./interfaces").IL10n} IL10n */
3
4
  /**
5
+ * NOTE: The L10n-implementations should use lowercase language-codes
6
+ * internally.
4
7
  * @implements {IL10n}
5
8
  */
6
9
  export class L10n implements IL10n {
7
- static "__#46@#fixupLangCode"(langCode: any): any;
8
- static "__#46@#isRTL"(lang: any): boolean;
10
+ static "__#58@#fixupLangCode"(langCode: any): any;
11
+ static "__#58@#isRTL"(lang: any): boolean;
9
12
  constructor({ lang, isRTL }: {
10
13
  lang: any;
11
14
  isRTL: any;
@@ -102,8 +102,7 @@ export class PDFFindController {
102
102
  _pagesToSearch: number | null | undefined;
103
103
  _pendingFindMatches: Set<any> | undefined;
104
104
  _resumePageIdx: any;
105
- _firstPageCapability: PromiseCapability | undefined;
105
+ _firstPageCapability: any;
106
106
  _rawQuery: any;
107
107
  #private;
108
108
  }
109
- import { PromiseCapability } from "../src/pdf";