unpdf 1.4.0 → 1.5.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 (81) hide show
  1. package/README.md +22 -38
  2. package/dist/index.d.cts +1 -1
  3. package/dist/index.d.mts +1 -1
  4. package/dist/index.d.ts +1 -1
  5. package/dist/pdfjs.mjs +107 -1
  6. package/dist/types/src/display/annotation_layer.d.ts +14 -11
  7. package/dist/types/src/display/annotation_storage.d.ts +8 -8
  8. package/dist/types/src/display/api.d.ts +81 -57
  9. package/dist/types/src/display/api_utils.d.ts +1 -1
  10. package/dist/types/src/display/binary_data_factory.d.ts +26 -0
  11. package/dist/types/src/display/canvas.d.ts +19 -16
  12. package/dist/types/src/display/canvas_dependency_tracker.d.ts +66 -10
  13. package/dist/types/src/display/canvas_factory.d.ts +3 -1
  14. package/dist/types/src/display/display_utils.d.ts +4 -3
  15. package/dist/types/src/display/draw_layer.d.ts +2 -6
  16. package/dist/types/src/display/editor/alt_text.d.ts +1 -1
  17. package/dist/types/src/display/editor/annotation_editor_layer.d.ts +7 -12
  18. package/dist/types/src/display/editor/color_picker.d.ts +2 -2
  19. package/dist/types/src/display/editor/comment.d.ts +12 -0
  20. package/dist/types/src/display/editor/draw.d.ts +3 -7
  21. package/dist/types/src/display/editor/drawers/freedraw.d.ts +3 -3
  22. package/dist/types/src/display/editor/drawers/signaturedraw.d.ts +13 -13
  23. package/dist/types/src/display/editor/editor.d.ts +16 -13
  24. package/dist/types/src/display/editor/freetext.d.ts +2 -2
  25. package/dist/types/src/display/editor/highlight.d.ts +3 -3
  26. package/dist/types/src/display/editor/toolbar.d.ts +2 -2
  27. package/dist/types/src/display/editor/tools.d.ts +37 -1
  28. package/dist/types/src/display/fetch_stream.d.ts +3 -56
  29. package/dist/types/src/display/font_loader.d.ts +2 -1
  30. package/dist/types/src/display/network.d.ts +14 -80
  31. package/dist/types/src/display/network_stream.d.ts +2 -0
  32. package/dist/types/src/display/network_utils.d.ts +3 -3
  33. package/dist/types/src/display/node_stream.d.ts +2 -52
  34. package/dist/types/src/display/node_utils.d.ts +5 -19
  35. package/dist/types/src/{shared/obj-bin-transform.d.ts → display/obj_bin_transform_display.d.ts} +21 -18
  36. package/dist/types/src/display/pages_mapper.d.ts +72 -0
  37. package/dist/types/src/display/pattern_helper.d.ts +7 -2
  38. package/dist/types/src/display/text_layer.d.ts +16 -10
  39. package/dist/types/src/display/text_layer_images.d.ts +10 -0
  40. package/dist/types/src/display/transport_stream.d.ts +8 -64
  41. package/dist/types/src/display/webgpu_mesh.d.ts +3 -0
  42. package/dist/types/src/display/worker_options.d.ts +2 -2
  43. package/dist/types/src/display/xfa_layer.d.ts +3 -3
  44. package/dist/types/src/pdf.d.ts +5 -1
  45. package/dist/types/src/{interfaces.d.ts → shared/base_pdf_stream.d.ts} +26 -27
  46. package/dist/types/src/shared/obj_bin_transform_utils.d.ts +26 -0
  47. package/dist/types/src/shared/util.d.ts +14 -5
  48. package/dist/types/web/annotation_editor_layer_builder.d.ts +7 -8
  49. package/dist/types/web/annotation_layer_builder.d.ts +9 -9
  50. package/dist/types/web/app_options.d.ts +1 -1
  51. package/dist/types/web/autolinker.d.ts +3 -2
  52. package/dist/types/web/base_download_manager.d.ts +24 -0
  53. package/dist/types/web/base_pdf_page_view.d.ts +5 -5
  54. package/dist/types/web/comment_manager.d.ts +2 -2
  55. package/dist/types/web/download_manager.d.ts +3 -12
  56. package/dist/types/web/draw_layer_builder.d.ts +0 -12
  57. package/dist/types/web/genericl10n.d.ts +6 -10
  58. package/dist/types/web/l10n.d.ts +3 -6
  59. package/dist/types/web/menu.d.ts +11 -0
  60. package/dist/types/web/pdf_find_controller.d.ts +9 -11
  61. package/dist/types/web/pdf_history.d.ts +3 -3
  62. package/dist/types/web/pdf_link_service.d.ts +2 -7
  63. package/dist/types/web/pdf_page_detail_view.d.ts +1 -7
  64. package/dist/types/web/pdf_page_view.d.ts +17 -11
  65. package/dist/types/web/pdf_rendering_queue.d.ts +10 -14
  66. package/dist/types/web/pdf_thumbnail_view.d.ts +18 -42
  67. package/dist/types/web/pdf_thumbnail_viewer.d.ts +57 -13
  68. package/dist/types/web/pdf_viewer.component.d.ts +1 -1
  69. package/dist/types/web/pdf_viewer.d.ts +30 -27
  70. package/dist/types/web/renderable_view.d.ts +33 -0
  71. package/dist/types/web/sidebar.d.ts +65 -0
  72. package/dist/types/web/struct_tree_layer_builder.d.ts +1 -1
  73. package/dist/types/web/text_accessibility.d.ts +1 -1
  74. package/dist/types/web/text_layer_builder.d.ts +11 -6
  75. package/dist/types/web/ui_utils.d.ts +3 -11
  76. package/dist/types/web/xfa_layer_builder.d.ts +4 -4
  77. package/package.json +22 -17
  78. package/dist/types/src/display/cmap_reader_factory.d.ts +0 -25
  79. package/dist/types/src/display/standard_fontdata_factory.d.ts +0 -20
  80. package/dist/types/src/display/wasm_factory.d.ts +0 -20
  81. package/dist/types/web/interfaces.d.ts +0 -174
@@ -1,50 +1,42 @@
1
1
  /**
2
2
  * Interface that represents PDF data transport. If possible, it allows
3
3
  * progressively load entire or fragment of the PDF binary data.
4
- *
5
- * @interface
6
4
  */
7
- export class IPDFStream {
5
+ export class BasePDFStream {
6
+ constructor(source: any, PDFStreamReader: any, PDFStreamRangeReader: any);
7
+ _fullReader: null;
8
+ _rangeReaders: Set<any>;
9
+ _source: null;
10
+ get _progressiveDataLength(): any;
8
11
  /**
9
12
  * Gets a reader for the entire PDF data.
10
- * @returns {IPDFStreamReader}
13
+ * @returns {BasePDFStreamReader}
11
14
  */
12
- getFullReader(): IPDFStreamReader;
15
+ getFullReader(): BasePDFStreamReader;
13
16
  /**
14
17
  * Gets a reader for the range of the PDF data.
15
18
  *
16
19
  * NOTE: Currently this method is only expected to be invoked *after*
17
- * the `IPDFStreamReader.prototype.headersReady` promise has resolved.
20
+ * the `BasePDFStreamReader.prototype.headersReady` promise has resolved.
18
21
  *
19
22
  * @param {number} begin - the start offset of the data.
20
23
  * @param {number} end - the end offset of the data.
21
- * @returns {IPDFStreamRangeReader}
24
+ * @returns {BasePDFStreamRangeReader}
22
25
  */
23
- getRangeReader(begin: number, end: number): IPDFStreamRangeReader;
26
+ getRangeReader(begin: number, end: number): BasePDFStreamRangeReader;
24
27
  /**
25
28
  * Cancels all opened reader and closes all their opened requests.
26
29
  * @param {Object} reason - the reason for cancelling
27
30
  */
28
31
  cancelAllRequests(reason: Object): void;
32
+ #private;
29
33
  }
30
34
  /**
31
35
  * Interface for a PDF binary data fragment reader.
32
- *
33
- * @interface
34
36
  */
35
- export class IPDFStreamRangeReader {
36
- /**
37
- * Sets or gets the progress callback. The callback can be useful when the
38
- * isStreamingSupported property of the object is defined as false.
39
- * The callback is called with one parameter: an object with the loaded
40
- * property.
41
- */
42
- onProgress: any;
43
- /**
44
- * Gets ability of the stream to progressively load binary data.
45
- * @type {boolean}
46
- */
47
- get isStreamingSupported(): boolean;
37
+ export class BasePDFStreamRangeReader {
38
+ constructor(stream: any, begin: any, end: any);
39
+ _stream: null;
48
40
  /**
49
41
  * Requests a chunk of the binary data. The method returns the promise, which
50
42
  * is resolved into object with properties "value" and "done". If the done
@@ -62,17 +54,24 @@ export class IPDFStreamRangeReader {
62
54
  }
63
55
  /**
64
56
  * Interface for a PDF binary data reader.
65
- *
66
- * @interface
67
57
  */
68
- export class IPDFStreamReader {
58
+ export class BasePDFStreamReader {
59
+ constructor(stream: any);
69
60
  /**
70
61
  * Sets or gets the progress callback. The callback can be useful when the
71
62
  * isStreamingSupported property of the object is defined as false.
72
63
  * The callback is called with one parameter: an object with the loaded and
73
64
  * total properties.
74
65
  */
75
- onProgress: any;
66
+ onProgress: null;
67
+ _contentLength: number;
68
+ _filename: null;
69
+ _headersCapability: any;
70
+ _isRangeSupported: boolean;
71
+ _isStreamingSupported: boolean;
72
+ _loaded: number;
73
+ _stream: null;
74
+ _callOnProgress(): void;
76
75
  /**
77
76
  * Gets a promise that is resolved when the headers and other metadata of
78
77
  * the PDF data stream are available.
@@ -0,0 +1,26 @@
1
+ export class CSS_FONT_INFO {
2
+ static strings: string[];
3
+ }
4
+ export class FONT_INFO {
5
+ static bools: string[];
6
+ static numbers: string[];
7
+ static strings: string[];
8
+ static OFFSET_NUMBERS: number;
9
+ static OFFSET_BBOX: number;
10
+ static OFFSET_FONT_MATRIX: number;
11
+ static OFFSET_DEFAULT_VMETRICS: number;
12
+ static OFFSET_STRINGS: number;
13
+ }
14
+ export class PATTERN_INFO {
15
+ static KIND: number;
16
+ static HAS_BBOX: number;
17
+ static HAS_BACKGROUND: number;
18
+ static SHADING_TYPE: number;
19
+ static N_COORD: number;
20
+ static N_COLOR: number;
21
+ static N_STOP: number;
22
+ static N_FIGURES: number;
23
+ }
24
+ export class SYSTEM_FONT_INFO {
25
+ static strings: string[];
26
+ }
@@ -164,6 +164,7 @@ export namespace DrawOPS {
164
164
  let moveTo: number;
165
165
  let lineTo: number;
166
166
  let curveTo: number;
167
+ let quadraticCurveTo: number;
167
168
  let closePath: number;
168
169
  }
169
170
  export class FeatureTest {
@@ -171,6 +172,8 @@ export class FeatureTest {
171
172
  static get isEvalSupported(): any;
172
173
  static get isOffscreenCanvasSupported(): any;
173
174
  static get isImageDecoderSupported(): any;
175
+ static get isFloat16ArraySupported(): any;
176
+ static get isSanitizerSupported(): any;
174
177
  static get platform(): any;
175
178
  static get isCSSRoundSupported(): any;
176
179
  }
@@ -183,7 +186,6 @@ export class FormatError extends FormatError_base {
183
186
  [x: string]: any;
184
187
  constructor(msg: any);
185
188
  }
186
- export function fromBase64Util(str: any): any;
187
189
  export function getModificationDate(date?: Date): string;
188
190
  export function getUuid(): string;
189
191
  export function getVerbosityLevel(): number;
@@ -203,7 +205,15 @@ export function isArrayEqual(arr1: any, arr2: any): boolean;
203
205
  export const isNodeJS: any;
204
206
  export const LINE_DESCENT_FACTOR: 0.35;
205
207
  export const LINE_FACTOR: 1.35;
208
+ export function makeArr(): never[];
209
+ export function makeMap(): Map<any, any>;
210
+ export function makeObj(): any;
206
211
  export function MathClamp(v: any, min: any, max: any): number;
212
+ export namespace MeshFigureType {
213
+ let TRIANGLES: number;
214
+ let LATTICE: number;
215
+ let PATCH: number;
216
+ }
207
217
  export function normalizeUnicode(str: any): any;
208
218
  export function objectSize(obj: any): number;
209
219
  export namespace OPS {
@@ -354,6 +364,7 @@ export function string32(value: any): string;
354
364
  export function stringToBytes(str: any): Uint8Array<any>;
355
365
  export function stringToPDFString(str: any, keepEscapeSequence?: boolean): string;
356
366
  export function stringToUTF8String(str: any): string;
367
+ export function stripPath(str: any): any;
357
368
  export namespace TextRenderingMode {
358
369
  export let FILL: number;
359
370
  export let STROKE: number;
@@ -367,8 +378,6 @@ export namespace TextRenderingMode {
367
378
  export let FILL_STROKE_MASK: number;
368
379
  export let ADD_TO_PATH_FLAG: number;
369
380
  }
370
- export function toBase64Util(arr: any): any;
371
- export function toHexUtil(arr: any): any;
372
381
  declare const UnknownErrorException_base: any;
373
382
  export class UnknownErrorException extends UnknownErrorException_base {
374
383
  [x: string]: any;
@@ -402,8 +411,8 @@ export class Util {
402
411
  static intersect(rect1: any, rect2: any): number[] | null;
403
412
  static pointBoundingBox(x: any, y: any, minMax: any): void;
404
413
  static rectBoundingBox(x0: any, y0: any, x1: any, y1: any, minMax: any): void;
405
- static #getExtremumOnCurve(x0: any, x1: any, x2: any, x3: any, y0: any, y1: any, y2: any, y3: any, t: any, minMax: any): void;
406
- static #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;
414
+ static "__#private@#getExtremumOnCurve"(x0: any, x1: any, x2: any, x3: any, y0: any, y1: any, y2: any, y3: any, t: any, minMax: any): void;
415
+ static "__#private@#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;
407
416
  static bezierBoundingBox(x0: any, y0: any, x1: any, y1: any, x2: any, y2: any, x3: any, y3: any, minMax: any): void;
408
417
  }
409
418
  export namespace VerbosityLevel {
@@ -2,13 +2,12 @@ export type PDFPageProxy = import("../src/display/api").PDFPageProxy;
2
2
  export type PageViewport = import("../src/display/display_utils").PageViewport;
3
3
  export type AnnotationEditorUIManager = import("../src/display/editor/tools.js").AnnotationEditorUIManager;
4
4
  export type TextAccessibilityManager = import("./text_accessibility.js").TextAccessibilityManager;
5
- export type IL10n = import("./interfaces").IL10n;
6
5
  export type AnnotationLayer = import("../src/display/annotation_layer.js").AnnotationLayer;
7
6
  export type StructTreeLayerBuilder = any;
8
7
  export type AnnotationEditorLayerBuilderOptions = {
9
8
  uiManager?: import("../src/pdf").AnnotationEditorUIManager | undefined;
10
- pdfPage: PDFPageProxy;
11
- l10n?: import("./interfaces").IL10n | undefined;
9
+ pageIndex: number;
10
+ l10n?: L10n;
12
11
  structTreeLayer?: StructTreeLayerBuilder;
13
12
  accessibilityManager?: import("./text_accessibility.js").TextAccessibilityManager | undefined;
14
13
  annotationLayer?: import("../src/pdf").AnnotationLayer | undefined;
@@ -26,8 +25,8 @@ export type AnnotationEditorLayerBuilderRenderOptions = {
26
25
  /**
27
26
  * @typedef {Object} AnnotationEditorLayerBuilderOptions
28
27
  * @property {AnnotationEditorUIManager} [uiManager]
29
- * @property {PDFPageProxy} pdfPage
30
- * @property {IL10n} [l10n]
28
+ * @property {number} pageIndex
29
+ * @property {L10n} [l10n]
31
30
  * @property {StructTreeLayerBuilder} [structTreeLayer]
32
31
  * @property {TextAccessibilityManager} [accessibilityManager]
33
32
  * @property {AnnotationLayer} [annotationLayer]
@@ -45,12 +44,13 @@ export class AnnotationEditorLayerBuilder {
45
44
  * @param {AnnotationEditorLayerBuilderOptions} options
46
45
  */
47
46
  constructor(options: AnnotationEditorLayerBuilderOptions);
48
- pdfPage: import("../src/display/api").PDFPageProxy;
47
+ pageIndex: number;
49
48
  accessibilityManager: import("./text_accessibility.js").TextAccessibilityManager | undefined;
50
- l10n: import("./interfaces").IL10n | GenericL10n | undefined;
49
+ l10n: any;
51
50
  annotationEditorLayer: AnnotationEditorLayer | null;
52
51
  div: HTMLDivElement | null;
53
52
  _cancelled: boolean;
53
+ updatePageIndex(newPageIndex: any): void;
54
54
  /**
55
55
  * @param {AnnotationEditorLayerBuilderRenderOptions} options
56
56
  * @returns {Promise<void>}
@@ -61,5 +61,4 @@ export class AnnotationEditorLayerBuilder {
61
61
  show(): void;
62
62
  #private;
63
63
  }
64
- import { GenericL10n } from "./genericl10n";
65
64
  import { AnnotationEditorLayer } from "../src/pdf";
@@ -1,12 +1,12 @@
1
1
  export type PDFPageProxy = import("../src/display/api").PDFPageProxy;
2
2
  export type PageViewport = import("../src/display/display_utils").PageViewport;
3
3
  export type AnnotationStorage = import("../src/display/annotation_storage").AnnotationStorage;
4
- export type IDownloadManager = import("./interfaces").IDownloadManager;
5
- export type IPDFLinkService = import("./interfaces").IPDFLinkService;
6
4
  export type StructTreeLayerBuilder = import("./struct_tree_layer_builder.js").StructTreeLayerBuilder;
7
5
  export type TextAccessibilityManager = import("./text_accessibility.js").TextAccessibilityManager;
8
6
  export type AnnotationEditorUIManager = import("../src/display/editor/tools.js").AnnotationEditorUIManager;
9
7
  export type CommentManager = import("./comment_manager.js").CommentManager;
8
+ export type PDFLinkService = import("./pdf_link_service.js").PDFLinkService;
9
+ export type BaseDownloadManager = import("./base_download_manager.js").BaseDownloadManager;
10
10
  export type AnnotationLayerBuilderOptions = {
11
11
  pdfPage: PDFPageProxy;
12
12
  annotationStorage?: import("../src/display/annotation_storage").AnnotationStorage | undefined;
@@ -16,8 +16,8 @@ export type AnnotationLayerBuilderOptions = {
16
16
  */
17
17
  imageResourcesPath?: string | undefined;
18
18
  renderForms: boolean;
19
- linkService: IPDFLinkService;
20
- downloadManager?: import("./interfaces").IDownloadManager | undefined;
19
+ linkService: PDFLinkService;
20
+ downloadManager?: import("./base_download_manager.js").BaseDownloadManager | undefined;
21
21
  enableComment?: boolean | undefined;
22
22
  enableScripting?: boolean | undefined;
23
23
  hasJSActionsPromise?: Promise<boolean> | undefined;
@@ -45,8 +45,8 @@ export type AnnotationLayerBuilderRenderOptions = {
45
45
  * @property {string} [imageResourcesPath] - Path for image resources, mainly
46
46
  * for annotation icons. Include trailing slash.
47
47
  * @property {boolean} renderForms
48
- * @property {IPDFLinkService} linkService
49
- * @property {IDownloadManager} [downloadManager]
48
+ * @property {PDFLinkService} linkService
49
+ * @property {BaseDownloadManager} [downloadManager]
50
50
  * @property {boolean} [enableComment]
51
51
  * @property {boolean} [enableScripting]
52
52
  * @property {Promise<boolean>} [hasJSActionsPromise]
@@ -70,8 +70,8 @@ export class AnnotationLayerBuilder {
70
70
  */
71
71
  constructor({ pdfPage, linkService, downloadManager, annotationStorage, imageResourcesPath, renderForms, enableComment, commentManager, enableScripting, hasJSActionsPromise, fieldObjectsPromise, annotationCanvasMap, accessibilityManager, annotationEditorUIManager, onAppend, }: AnnotationLayerBuilderOptions);
72
72
  pdfPage: import("../src/display/api").PDFPageProxy;
73
- linkService: import("./interfaces").IPDFLinkService;
74
- downloadManager: import("./interfaces").IDownloadManager | undefined;
73
+ linkService: import("./pdf_link_service.js").PDFLinkService;
74
+ downloadManager: import("./base_download_manager.js").BaseDownloadManager | undefined;
75
75
  imageResourcesPath: string;
76
76
  renderForms: boolean;
77
77
  annotationStorage: import("../src/display/annotation_storage").AnnotationStorage;
@@ -87,7 +87,7 @@ export class AnnotationLayerBuilder {
87
87
  annotationLayer: AnnotationLayer | null;
88
88
  div: HTMLDivElement | null;
89
89
  _cancelled: boolean;
90
- _eventBus: any;
90
+ _eventBus: import("./event_utils.js").EventBus;
91
91
  /**
92
92
  * @param {AnnotationLayerBuilderRenderOptions} options
93
93
  * @returns {Promise<void>} A promise that is resolved when rendering of the
@@ -1,6 +1,6 @@
1
1
  export class AppOptions {
2
2
  static eventBus: any;
3
- static #opts: Map<any, any>;
3
+ static "__#private@#opts": Map<any, any>;
4
4
  static get(name: any): any;
5
5
  static getAll(kind?: null, defaultOnly?: boolean): any;
6
6
  static set(name: any, value: any): void;
@@ -1,6 +1,7 @@
1
1
  export class Autolinker {
2
- static #index: number;
3
- static #regex: any;
2
+ static "__#private@#index": number;
3
+ static "__#private@#regex": any;
4
+ static "__#private@#numericTLDRegex": any;
4
5
  static findLinks(text: any): {
5
6
  url: string;
6
7
  index: any;
@@ -0,0 +1,24 @@
1
+ export class BaseDownloadManager {
2
+ _triggerDownload(blobUrl: any, originalUrl: any, filename: any, isAttachment?: boolean): void;
3
+ _getOpenDataUrl(blobUrl: any, filename: any, dest?: null): void;
4
+ /**
5
+ * @param {Uint8Array} data
6
+ * @param {string} filename
7
+ * @param {string} [contentType]
8
+ */
9
+ downloadData(data: Uint8Array, filename: string, contentType?: string): void;
10
+ /**
11
+ * @param {Uint8Array} data
12
+ * @param {string} filename
13
+ * @param {string | null} [dest]
14
+ * @returns {boolean} Indicating if the data was opened.
15
+ */
16
+ openOrDownloadData(data: Uint8Array, filename: string, dest?: string | null): boolean;
17
+ /**
18
+ * @param {Uint8Array} data
19
+ * @param {string} url
20
+ * @param {string} filename
21
+ */
22
+ download(data: Uint8Array, url: string, filename: string): void;
23
+ #private;
24
+ }
@@ -1,18 +1,17 @@
1
- export class BasePDFPageView {
1
+ export class BasePDFPageView extends RenderableView {
2
2
  constructor(options: any);
3
3
  canvas: null;
4
4
  /** @type {null | HTMLDivElement} */
5
5
  div: null | HTMLDivElement;
6
6
  enableOptimizedPartialRendering: boolean;
7
+ imagesRightClickMinSize: number;
7
8
  eventBus: null;
8
9
  id: null;
10
+ imageCoordinates: null;
9
11
  pageColors: null;
10
12
  recordedBBoxes: null;
11
13
  renderingQueue: null;
12
- renderTask: null;
13
- resume: null;
14
- set renderingState(state: number);
15
- get renderingState(): number;
14
+ minDurationToUpdateCanvas: any;
16
15
  _createCanvas(onShow: any, hideUntilComplete?: boolean): {
17
16
  canvas: HTMLCanvasElement;
18
17
  prevCanvas: null;
@@ -26,3 +25,4 @@ export class BasePDFPageView {
26
25
  dispatchPageRendered(cssTransform: any, isDetailView: any): void;
27
26
  #private;
28
27
  }
28
+ import { RenderableView } from "./renderable_view.js";
@@ -1,7 +1,7 @@
1
1
  export class CommentManager {
2
- static #hasForcedColors: null;
2
+ static "__#private@#hasForcedColors": null;
3
3
  static _makeCommentColor(color: any, opacity: any): string | null;
4
- constructor(commentDialog: any, sidebar: any, eventBus: any, linkService: any, overlayManager: any, ltr: any, hasForcedColors: any);
4
+ constructor(commentDialog: any, sidebar: any, eventBus: any, linkService: any, overlayManager: any, ltr: any, hasForcedColors: any, globalAbortSignal: any);
5
5
  dialogElement: any;
6
6
  setSidebarUiManager(uiManager: any): void;
7
7
  showSidebar(annotations: any): void;
@@ -1,13 +1,4 @@
1
- export type IDownloadManager = import("./interfaces").IDownloadManager;
2
- /**
3
- * @implements {IDownloadManager}
4
- */
5
- export class DownloadManager implements IDownloadManager {
6
- downloadData(data: any, filename: any, contentType: any): void;
7
- /**
8
- * @returns {boolean} Indicating if the data was opened.
9
- */
10
- openOrDownloadData(data: any, filename: any, dest?: null): boolean;
11
- download(data: any, url: any, filename: any): void;
12
- #private;
1
+ export class DownloadManager extends BaseDownloadManager {
2
+ _getOpenDataUrl(blobUrl: any, filename: any, dest?: null): string;
13
3
  }
4
+ import { BaseDownloadManager } from "./base_download_manager.js";
@@ -1,26 +1,14 @@
1
- export type DrawLayerBuilderOptions = {
2
- pageIndex: number;
3
- };
4
1
  export type DrawLayerBuilderRenderOptions = {
5
2
  /**
6
3
  * - The default value is "display".
7
4
  */
8
5
  intent?: string | undefined;
9
6
  };
10
- /**
11
- * @typedef {Object} DrawLayerBuilderOptions
12
- * @property {number} pageIndex
13
- */
14
7
  /**
15
8
  * @typedef {Object} DrawLayerBuilderRenderOptions
16
9
  * @property {string} [intent] - The default value is "display".
17
10
  */
18
11
  export class DrawLayerBuilder {
19
- /**
20
- * @param {DrawLayerBuilderOptions} options
21
- */
22
- constructor(options: DrawLayerBuilderOptions);
23
- pageIndex: number;
24
12
  /**
25
13
  * @param {DrawLayerBuilderRenderOptions} options
26
14
  * @returns {Promise<void>}
@@ -1,22 +1,18 @@
1
- export type IL10n = import("./interfaces").IL10n;
2
- /**
3
- * @implements {IL10n}
4
- */
5
- export class GenericL10n extends L10n implements IL10n {
1
+ export class GenericL10n extends L10n {
6
2
  /**
7
3
  * Generate the bundles for Fluent.
8
4
  * @param {String} defaultLang - The fallback language to use for
9
5
  * translations.
10
6
  * @param {String} baseLang - The base language to use for translations.
11
7
  */
12
- static #generateBundles(defaultLang: string, baseLang: string): AsyncGenerator<any, void, unknown>;
13
- static #createBundle(lang: any, baseURL: any, paths: any): Promise<any>;
14
- static #getPaths(): Promise<{
8
+ static "__#private@#generateBundles"(defaultLang: string, baseLang: string): AsyncGenerator<any, void, unknown>;
9
+ static "__#private@#createBundle"(lang: any, baseURL: any, paths: any): Promise<any>;
10
+ static "__#private@#getPaths"(): Promise<{
15
11
  baseURL: any;
16
12
  paths: any;
17
13
  }>;
18
- static #generateBundlesFallback(lang: any): AsyncGenerator<any, void, unknown>;
19
- static #createBundleFallback(lang: any): Promise<any>;
14
+ static "__#private@#generateBundlesFallback"(lang: any): AsyncGenerator<any, void, unknown>;
15
+ static "__#private@#createBundleFallback"(lang: any): Promise<any>;
20
16
  constructor(lang: any);
21
17
  }
22
18
  import { L10n } from "./l10n.js";
@@ -1,14 +1,11 @@
1
- export type IL10n = import("./interfaces").IL10n;
2
1
  export const GenericL10n: null;
3
- /** @typedef {import("./interfaces").IL10n} IL10n */
4
2
  /**
5
3
  * NOTE: The L10n-implementations should use lowercase language-codes
6
4
  * internally.
7
- * @implements {IL10n}
8
5
  */
9
- export class L10n implements IL10n {
10
- static #fixupLangCode(langCode: any): any;
11
- static #isRTL(lang: any): boolean;
6
+ export class L10n {
7
+ static "__#private@#fixupLangCode"(langCode: any): any;
8
+ static "__#private@#isRTL"(lang: any): boolean;
12
9
  constructor({ lang, isRTL }: {
13
10
  lang: any;
14
11
  isRTL: any;
@@ -0,0 +1,11 @@
1
+ export class Menu {
2
+ /**
3
+ * Create a menu for the given button.
4
+ * @param {HTMLElement} menuContainer
5
+ * @param {HTMLElement} triggeringButton
6
+ * @param {Array<HTMLElement>|null} menuItems
7
+ */
8
+ constructor(menuContainer: HTMLElement, triggeringButton: HTMLElement, menuItems: Array<HTMLElement> | null);
9
+ destroy(): void;
10
+ #private;
11
+ }
@@ -1,11 +1,11 @@
1
1
  export type PDFDocumentProxy = import("../src/display/api").PDFDocumentProxy;
2
2
  export type EventBus = import("./event_utils").EventBus;
3
- export type IPDFLinkService = import("./interfaces").IPDFLinkService;
3
+ export type PDFLinkService = import("./pdf_link_service.js").PDFLinkService;
4
4
  export type PDFFindControllerOptions = {
5
5
  /**
6
6
  * - The navigation/linking service.
7
7
  */
8
- linkService: IPDFLinkService;
8
+ linkService: PDFLinkService;
9
9
  /**
10
10
  * - The application event bus.
11
11
  */
@@ -27,7 +27,7 @@ export function getOriginalIndex(diffs: any, pos: any, len: any): any[];
27
27
  export function normalize(text: any, options?: {}): any[];
28
28
  /**
29
29
  * @typedef {Object} PDFFindControllerOptions
30
- * @property {IPDFLinkService} linkService - The navigation/linking service.
30
+ * @property {PDFLinkService} linkService - The navigation/linking service.
31
31
  * @property {EventBus} eventBus - The application event bus.
32
32
  * @property {boolean} [updateMatchesCountOnProgress] - True if the matches
33
33
  * count must be updated on progress or only when the last page is reached.
@@ -41,7 +41,7 @@ export class PDFFindController {
41
41
  * @param {PDFFindControllerOptions} options
42
42
  */
43
43
  constructor({ linkService, eventBus, updateMatchesCountOnProgress }: PDFFindControllerOptions);
44
- _linkService: import("./interfaces").IPDFLinkService;
44
+ _linkService: import("./pdf_link_service.js").PDFLinkService;
45
45
  _eventBus: import("./event_utils").EventBus;
46
46
  /**
47
47
  * Callback used to check if a `pageNumber` is currently visible.
@@ -70,7 +70,6 @@ export class PDFFindController {
70
70
  /**
71
71
  * @typedef {Object} PDFFindControllerScrollMatchIntoViewParams
72
72
  * @property {HTMLElement} element
73
- * @property {number} selectedLeft
74
73
  * @property {number} pageIndex
75
74
  * @property {number} matchIndex
76
75
  */
@@ -78,9 +77,8 @@ export class PDFFindController {
78
77
  * Scroll the current match into view.
79
78
  * @param {PDFFindControllerScrollMatchIntoViewParams}
80
79
  */
81
- scrollMatchIntoView({ element, selectedLeft, pageIndex, matchIndex, }: {
80
+ scrollMatchIntoView({ element, pageIndex, matchIndex }: {
82
81
  element: HTMLElement;
83
- selectedLeft: number;
84
82
  pageIndex: number;
85
83
  matchIndex: number;
86
84
  }): void;
@@ -96,10 +94,10 @@ export class PDFFindController {
96
94
  matchIdx: null;
97
95
  wrapped: boolean;
98
96
  } | undefined;
99
- _extractTextPromises: any[] | undefined;
100
- _pageContents: any[] | undefined;
101
- _pageDiffs: any[] | undefined;
102
- _hasDiacritics: any[] | undefined;
97
+ _extractTextPromises: any;
98
+ _pageContents: any;
99
+ _pageDiffs: any;
100
+ _hasDiacritics: any;
103
101
  _matchesCountTotal: number | undefined;
104
102
  _pagesToSearch: number | null | undefined;
105
103
  _pendingFindMatches: Set<any> | undefined;
@@ -2,7 +2,7 @@ export type PDFHistoryOptions = {
2
2
  /**
3
3
  * - The navigation/linking service.
4
4
  */
5
- linkService: IPDFLinkService;
5
+ linkService: PDFLinkService;
6
6
  /**
7
7
  * - The application event bus.
8
8
  */
@@ -39,7 +39,7 @@ export type PushParameters = {
39
39
  pageNumber: number;
40
40
  };
41
41
  export type EventBus = import("./event_utils").EventBus;
42
- export type IPDFLinkService = import("./interfaces").IPDFLinkService;
42
+ export type PDFLinkService = import("./pdf_link_service.js").PDFLinkService;
43
43
  export function isDestArraysEqual(firstDest: any, secondDest: any): boolean;
44
44
  export function isDestHashesEqual(destHash: any, pushHash: any): boolean;
45
45
  export class PDFHistory {
@@ -47,7 +47,7 @@ export class PDFHistory {
47
47
  * @param {PDFHistoryOptions} options
48
48
  */
49
49
  constructor({ linkService, eventBus }: PDFHistoryOptions);
50
- linkService: import("./interfaces").IPDFLinkService;
50
+ linkService: import("./pdf_link_service.js").PDFLinkService;
51
51
  eventBus: import("./event_utils.js").EventBus;
52
52
  _initialized: boolean;
53
53
  _fingerprint: string;
@@ -1,5 +1,4 @@
1
1
  export type EventBus = import("./event_utils").EventBus;
2
- export type IPDFLinkService = import("./interfaces").IPDFLinkService;
3
2
  export type PDFLinkServiceOptions = {
4
3
  /**
5
4
  * - The application event bus.
@@ -45,9 +44,8 @@ export namespace LinkTarget {
45
44
  /**
46
45
  * Performs navigation functions inside PDF, such as opening specified page,
47
46
  * or destination.
48
- * @implements {IPDFLinkService}
49
47
  */
50
- export class PDFLinkService implements IPDFLinkService {
48
+ export class PDFLinkService {
51
49
  /**
52
50
  * @param {PDFLinkServiceOptions} options
53
51
  */
@@ -140,8 +138,5 @@ export class PDFLinkService implements IPDFLinkService {
140
138
  */
141
139
  executeSetOCGState(action: Object): Promise<void>;
142
140
  }
143
- /**
144
- * @implements {IPDFLinkService}
145
- */
146
- export class SimpleLinkService extends PDFLinkService implements IPDFLinkService {
141
+ export class SimpleLinkService extends PDFLinkService {
147
142
  }
@@ -1,9 +1,4 @@
1
- export type IRenderableView = import("./interfaces").IRenderableView;
2
- /** @typedef {import("./interfaces").IRenderableView} IRenderableView */
3
- /**
4
- * @implements {IRenderableView}
5
- */
6
- export class PDFPageDetailView extends BasePDFPageView implements IRenderableView {
1
+ export class PDFPageDetailView extends BasePDFPageView {
7
2
  constructor({ pageView }: {
8
3
  pageView: any;
9
4
  });
@@ -15,7 +10,6 @@ export class PDFPageDetailView extends BasePDFPageView implements IRenderableVie
15
10
  */
16
11
  renderingCancelled: boolean;
17
12
  pageView: any;
18
- renderingId: string;
19
13
  div: any;
20
14
  setPdfPage(pdfPage: any): void;
21
15
  get pdfPage(): any;