pdfjs-serverless 0.6.0 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. package/dist/index.d.mts +1 -0
  2. package/dist/index.d.ts +1 -0
  3. package/dist/index.mjs +1 -1
  4. package/dist/types/src/display/annotation_layer.d.ts +11 -1
  5. package/dist/types/src/display/api.d.ts +79 -35
  6. package/dist/types/src/display/canvas.d.ts +2 -1
  7. package/dist/types/src/display/canvas_factory.d.ts +27 -0
  8. package/dist/types/src/display/cmap_reader_factory.d.ts +25 -0
  9. package/dist/types/src/display/display_utils.d.ts +29 -60
  10. package/dist/types/src/display/draw_layer.d.ts +6 -19
  11. package/dist/types/src/display/editor/alt_text.d.ts +3 -2
  12. package/dist/types/src/display/editor/annotation_editor_layer.d.ts +13 -9
  13. package/dist/types/src/display/editor/color_picker.d.ts +1 -0
  14. package/dist/types/src/display/editor/draw.d.ts +120 -0
  15. package/dist/types/src/display/editor/drawers/freedraw.d.ts +31 -0
  16. package/dist/types/src/display/editor/drawers/highlight.d.ts +36 -0
  17. package/dist/types/src/display/editor/drawers/inkdraw.d.ts +128 -0
  18. package/dist/types/src/display/editor/drawers/outline.d.ts +19 -0
  19. package/dist/types/src/display/editor/editor.d.ts +51 -12
  20. package/dist/types/src/display/editor/freetext.d.ts +5 -16
  21. package/dist/types/src/display/editor/highlight.d.ts +7 -25
  22. package/dist/types/src/display/editor/ink.d.ts +15 -74
  23. package/dist/types/src/display/editor/stamp.d.ts +13 -17
  24. package/dist/types/src/display/editor/toolbar.d.ts +3 -2
  25. package/dist/types/src/display/editor/tools.d.ts +13 -3
  26. package/dist/types/src/display/fetch_stream.d.ts +6 -13
  27. package/dist/types/src/display/filter_factory.d.ts +29 -0
  28. package/dist/types/src/display/font_loader.d.ts +3 -1
  29. package/dist/types/src/display/network.d.ts +10 -6
  30. package/dist/types/src/display/network_utils.d.ts +5 -3
  31. package/dist/types/src/display/node_stream.d.ts +6 -22
  32. package/dist/types/src/display/node_utils.d.ts +8 -11
  33. package/dist/types/src/display/optional_content_config.d.ts +1 -1
  34. package/dist/types/src/display/standard_fontdata_factory.d.ts +20 -0
  35. package/dist/types/src/display/svg_factory.d.ts +14 -0
  36. package/dist/types/src/display/text_layer.d.ts +12 -9
  37. package/dist/types/src/display/touch_manager.d.ts +14 -0
  38. package/dist/types/src/display/transport_stream.d.ts +1 -1
  39. package/dist/types/src/display/worker_options.d.ts +2 -2
  40. package/dist/types/src/interfaces.d.ts +4 -0
  41. package/dist/types/src/pdf.d.ts +5 -3
  42. package/dist/types/src/shared/message_handler.d.ts +10 -4
  43. package/dist/types/src/shared/util.d.ts +9 -20
  44. package/dist/types/web/annotation_editor_layer_builder.d.ts +5 -2
  45. package/dist/types/web/annotation_layer_builder.d.ts +2 -1
  46. package/dist/types/web/app_options.d.ts +1 -1
  47. package/dist/types/web/event_utils.d.ts +2 -2
  48. package/dist/types/web/genericl10n.d.ts +5 -5
  49. package/dist/types/web/interfaces.d.ts +5 -5
  50. package/dist/types/web/l10n.d.ts +2 -2
  51. package/dist/types/web/pdf_link_service.d.ts +2 -2
  52. package/dist/types/web/pdf_page_view.d.ts +5 -11
  53. package/dist/types/web/pdf_rendering_queue.d.ts +1 -1
  54. package/dist/types/web/pdf_thumbnail_view.d.ts +1 -1
  55. package/dist/types/web/pdf_viewer.d.ts +13 -16
  56. package/dist/types/web/struct_tree_layer_builder.d.ts +4 -2
  57. package/dist/types/web/text_accessibility.d.ts +1 -1
  58. package/dist/types/web/text_layer_builder.d.ts +5 -5
  59. package/dist/types/web/ui_utils.d.ts +3 -19
  60. package/package.json +15 -15
  61. package/dist/types/src/display/base_factory.d.ts +0 -60
  62. package/dist/types/src/display/editor/outliner.d.ts +0 -70
@@ -7,7 +7,7 @@ export class PDFDataTransportStream implements IPDFStream {
7
7
  disableRange?: boolean | undefined;
8
8
  disableStream?: boolean | undefined;
9
9
  });
10
- _queuedChunks: ArrayBuffer[];
10
+ _queuedChunks: any[];
11
11
  _progressiveDone: any;
12
12
  _contentDispositionFilename: any;
13
13
  _pdfDataRangeTransport: any;
@@ -1,6 +1,6 @@
1
1
  export class GlobalWorkerOptions {
2
- static "__#40@#port": null;
3
- static "__#40@#src": string;
2
+ static "__#49@#port": null;
3
+ static "__#49@#src": string;
4
4
  /**
5
5
  * @param {Worker | null} workerPort - Defines global port for worker process.
6
6
  * Overrides the `workerSrc` option.
@@ -12,6 +12,10 @@ export class IPDFStream {
12
12
  getFullReader(): IPDFStreamReader;
13
13
  /**
14
14
  * Gets a reader for the range of the PDF data.
15
+ *
16
+ * NOTE: Currently this method is only expected to be invoked *after*
17
+ * the `IPDFStreamReader.prototype.headersReady` promise has resolved.
18
+ *
15
19
  * @param {number} begin - the start offset of the data.
16
20
  * @param {number} end - the end offset of the data.
17
21
  * @returns {IPDFStreamRangeReader}
@@ -12,10 +12,9 @@ import { AnnotationEditorUIManager } from "./display/editor/tools.js";
12
12
  import { AnnotationLayer } from "./display/annotation_layer.js";
13
13
  import { AnnotationMode } from "./shared/util.js";
14
14
  import { build } from "./display/api.js";
15
- import { CMapCompressionType } from "./shared/util.js";
16
15
  import { ColorPicker } from "./display/editor/color_picker.js";
17
16
  import { createValidAbsoluteUrl } from "./shared/util.js";
18
- import { DOMSVGFactory } from "./display/display_utils.js";
17
+ import { DOMSVGFactory } from "./display/svg_factory.js";
19
18
  import { DrawLayer } from "./display/draw_layer.js";
20
19
  import { FeatureTest } from "./shared/util.js";
21
20
  import { fetchData } from "./display/display_utils.js";
@@ -32,6 +31,7 @@ import { MissingPDFException } from "./shared/util.js";
32
31
  import { noContextMenu } from "./display/display_utils.js";
33
32
  import { normalizeUnicode } from "./shared/util.js";
34
33
  import { OPS } from "./shared/util.js";
34
+ import { OutputScale } from "./display/display_utils.js";
35
35
  import { PasswordResponses } from "./shared/util.js";
36
36
  import { PDFDataRangeTransport } from "./display/api.js";
37
37
  import { PDFDateString } from "./display/display_utils.js";
@@ -41,10 +41,12 @@ import { PixelsPerInch } from "./display/display_utils.js";
41
41
  import { RenderingCancelledException } from "./display/display_utils.js";
42
42
  import { setLayerDimensions } from "./display/display_utils.js";
43
43
  import { shadow } from "./shared/util.js";
44
+ import { stopEvent } from "./display/display_utils.js";
44
45
  import { TextLayer } from "./display/text_layer.js";
46
+ import { TouchManager } from "./display/touch_manager.js";
45
47
  import { UnexpectedResponseException } from "./shared/util.js";
46
48
  import { Util } from "./shared/util.js";
47
49
  import { VerbosityLevel } from "./shared/util.js";
48
50
  import { version } from "./display/api.js";
49
51
  import { XfaLayer } from "./display/xfa_layer.js";
50
- 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, PasswordResponses, PDFDataRangeTransport, PDFDateString, PDFWorker, PermissionFlag, PixelsPerInch, RenderingCancelledException, setLayerDimensions, shadow, TextLayer, UnexpectedResponseException, Util, VerbosityLevel, version, XfaLayer };
52
+ export { AbortException, AnnotationEditorLayer, AnnotationEditorParamsType, AnnotationEditorType, AnnotationEditorUIManager, AnnotationLayer, AnnotationMode, build, ColorPicker, createValidAbsoluteUrl, DOMSVGFactory, DrawLayer, FeatureTest, fetchData, getDocument, getFilenameFromUrl, getPdfFilenameFromUrl, getXfaPageViewport, GlobalWorkerOptions, ImageKind, InvalidPDFException, isDataScheme, isPdfFile, MissingPDFException, noContextMenu, normalizeUnicode, OPS, OutputScale, PasswordResponses, PDFDataRangeTransport, PDFDateString, PDFWorker, PermissionFlag, PixelsPerInch, RenderingCancelledException, setLayerDimensions, shadow, stopEvent, TextLayer, TouchManager, UnexpectedResponseException, Util, VerbosityLevel, version, XfaLayer };
@@ -9,7 +9,6 @@ export class MessageHandler {
9
9
  streamControllers: any;
10
10
  callbackCapabilities: any;
11
11
  actionHandler: any;
12
- _onComObjOnMessage: (event: any) => void;
13
12
  on(actionName: any, handler: any): void;
14
13
  /**
15
14
  * Sends a message to the comObj to invoke the action with the supplied data.
@@ -17,7 +16,7 @@ export class MessageHandler {
17
16
  * @param {JSON} data - JSON data to send.
18
17
  * @param {Array} [transfers] - List of transfers/ArrayBuffers.
19
18
  */
20
- send(actionName: string, data: JSON, transfers?: any[] | undefined): void;
19
+ send(actionName: string, data: JSON, transfers?: any[]): void;
21
20
  /**
22
21
  * Sends a message to the comObj to invoke the action with the supplied data.
23
22
  * Expects that the other side will callback with the response.
@@ -26,7 +25,7 @@ export class MessageHandler {
26
25
  * @param {Array} [transfers] - List of transfers/ArrayBuffers.
27
26
  * @returns {Promise} Promise to be resolved with response data.
28
27
  */
29
- sendWithPromise(actionName: string, data: JSON, transfers?: any[] | undefined): Promise<any>;
28
+ sendWithPromise(actionName: string, data: JSON, transfers?: any[]): Promise<any>;
30
29
  /**
31
30
  * Sends a message to the comObj to invoke the action with the supplied data.
32
31
  * Expect that the other side will callback to signal 'start_complete'.
@@ -37,7 +36,14 @@ export class MessageHandler {
37
36
  * @param {Array} [transfers] - List of transfers/ArrayBuffers.
38
37
  * @returns {ReadableStream} ReadableStream to read data in chunks.
39
38
  */
40
- sendWithStream(actionName: string, data: JSON, queueingStrategy: Object, transfers?: any[] | undefined): ReadableStream;
39
+ sendWithStream(actionName: string, data: JSON, queueingStrategy: Object, transfers?: any[]): ReadableStream;
41
40
  destroy(): void;
42
41
  #private;
43
42
  }
43
+ export function wrapReason(ex: any): PasswordException | UnknownErrorException | InvalidPDFException | MissingPDFException | UnexpectedResponseException | AbortException;
44
+ import { PasswordException } from "./util.js";
45
+ import { UnknownErrorException } from "./util.js";
46
+ import { InvalidPDFException } from "./util.js";
47
+ import { MissingPDFException } from "./util.js";
48
+ import { UnexpectedResponseException } from "./util.js";
49
+ import { AbortException } from "./util.js";
@@ -43,6 +43,7 @@ export namespace AnnotationEditorParamsType {
43
43
  let HIGHLIGHT_THICKNESS: number;
44
44
  let HIGHLIGHT_FREE: number;
45
45
  let HIGHLIGHT_SHOW_ALL: number;
46
+ let DRAW_STEP: number;
46
47
  }
47
48
  export const AnnotationEditorPrefix: "pdfjs_internal_editor_";
48
49
  export namespace AnnotationEditorType {
@@ -139,11 +140,6 @@ export function assert(cond: any, msg: any): void;
139
140
  export const BaseException: any;
140
141
  export const BASELINE_FACTOR: number;
141
142
  export function bytesToString(bytes: any): string;
142
- export namespace CMapCompressionType {
143
- let NONE_1: number;
144
- export { NONE_1 as NONE };
145
- export let BINARY: number;
146
- }
147
143
  /**
148
144
  * Attempts to create a valid absolute URL.
149
145
  *
@@ -152,7 +148,7 @@ export namespace CMapCompressionType {
152
148
  * @param {Object} [options]
153
149
  * @returns Either a valid {URL}, or `null` otherwise.
154
150
  */
155
- export function createValidAbsoluteUrl(url: URL | string, baseUrl?: string | URL | undefined, options?: Object | undefined): URL | null;
151
+ export function createValidAbsoluteUrl(url: URL | string, baseUrl?: URL | string, options?: Object): URL | null;
156
152
  export namespace DocumentActionEventType {
157
153
  let WC: string;
158
154
  let WS: string;
@@ -164,21 +160,11 @@ export class FeatureTest {
164
160
  static get isLittleEndian(): any;
165
161
  static get isEvalSupported(): any;
166
162
  static get isOffscreenCanvasSupported(): any;
163
+ static get isImageDecoderSupported(): any;
167
164
  static get platform(): any;
168
165
  static get isCSSRoundSupported(): any;
169
166
  }
170
167
  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
- }
182
168
  declare const FormatError_base: any;
183
169
  /**
184
170
  * Error caused during parsing PDF data.
@@ -187,9 +173,11 @@ export class FormatError extends FormatError_base {
187
173
  [x: string]: any;
188
174
  constructor(msg: any);
189
175
  }
176
+ export function fromBase64Util(str: any): any;
190
177
  export function getModificationDate(date?: Date): string;
191
178
  export function getUuid(): string;
192
179
  export function getVerbosityLevel(): number;
180
+ export const hexNumbers: string[];
193
181
  export const IDENTITY_MATRIX: number[];
194
182
  export namespace ImageKind {
195
183
  let GRAYSCALE_1BPP: number;
@@ -338,8 +326,7 @@ export namespace RenderingIntentFlag {
338
326
  export let DISPLAY: number;
339
327
  let PRINT_2: number;
340
328
  export { PRINT_2 as PRINT };
341
- let SAVE_1: number;
342
- export { SAVE_1 as SAVE };
329
+ export let SAVE: number;
343
330
  export let ANNOTATIONS_FORMS: number;
344
331
  export let ANNOTATIONS_STORAGE: number;
345
332
  export let ANNOTATIONS_DISABLE: number;
@@ -349,7 +336,7 @@ export namespace RenderingIntentFlag {
349
336
  export function setVerbosityLevel(level: any): void;
350
337
  export function shadow(obj: any, prop: any, value: any, nonSerializable?: boolean): any;
351
338
  export function string32(value: any): string;
352
- export function stringToBytes(str: any): Uint8Array;
339
+ export function stringToBytes(str: any): Uint8Array<any>;
353
340
  export function stringToPDFString(str: any): string;
354
341
  export function stringToUTF8String(str: any): string;
355
342
  export namespace TextRenderingMode {
@@ -365,6 +352,8 @@ export namespace TextRenderingMode {
365
352
  export let FILL_STROKE_MASK: number;
366
353
  export let ADD_TO_PATH_FLAG: number;
367
354
  }
355
+ export function toBase64Util(arr: any): any;
356
+ export function toHexUtil(arr: any): any;
368
357
  declare const UnexpectedResponseException_base: any;
369
358
  export class UnexpectedResponseException extends UnexpectedResponseException_base {
370
359
  [x: string]: any;
@@ -4,14 +4,16 @@ export type AnnotationEditorUIManager = import("../src/display/editor/tools.js")
4
4
  export type TextAccessibilityManager = import("./text_accessibility.js").TextAccessibilityManager;
5
5
  export type IL10n = import("./interfaces").IL10n;
6
6
  export type AnnotationLayer = import("../src/display/annotation_layer.js").AnnotationLayer;
7
+ export type StructTreeLayerBuilder = any;
7
8
  export type AnnotationEditorLayerBuilderOptions = {
8
9
  uiManager?: import("../src/pdf").AnnotationEditorUIManager | undefined;
9
10
  pdfPage: PDFPageProxy;
10
11
  l10n?: import("./interfaces").IL10n | undefined;
12
+ structTreeLayer?: StructTreeLayerBuilder;
11
13
  accessibilityManager?: import("./text_accessibility.js").TextAccessibilityManager | undefined;
12
14
  annotationLayer?: import("../src/pdf").AnnotationLayer | undefined;
13
- textLayer?: any;
14
- drawLayer?: any;
15
+ textLayer?: TextLayer;
16
+ drawLayer?: DrawLayer;
15
17
  onAppend?: Function | undefined;
16
18
  };
17
19
  /**
@@ -19,6 +21,7 @@ export type AnnotationEditorLayerBuilderOptions = {
19
21
  * @property {AnnotationEditorUIManager} [uiManager]
20
22
  * @property {PDFPageProxy} pdfPage
21
23
  * @property {IL10n} [l10n]
24
+ * @property {StructTreeLayerBuilder} [structTreeLayer]
22
25
  * @property {TextAccessibilityManager} [accessibilityManager]
23
26
  * @property {AnnotationLayer} [annotationLayer]
24
27
  * @property {TextLayer} [textLayer]
@@ -69,11 +69,12 @@ export class AnnotationLayerBuilder {
69
69
  _eventBus: any;
70
70
  /**
71
71
  * @param {PageViewport} viewport
72
+ * @param {Object} options
72
73
  * @param {string} intent (default value is 'display')
73
74
  * @returns {Promise<void>} A promise that is resolved when rendering of the
74
75
  * annotations is complete.
75
76
  */
76
- render(viewport: PageViewport, intent?: string): Promise<void>;
77
+ render(viewport: PageViewport, options: Object, intent?: string): Promise<void>;
77
78
  cancel(): void;
78
79
  hide(): void;
79
80
  hasEditableAnnotations(): boolean;
@@ -1,6 +1,6 @@
1
1
  export class AppOptions {
2
2
  static eventBus: any;
3
- static "__#64@#opts": Map<any, any>;
3
+ static "__#72@#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;
@@ -24,13 +24,13 @@ export class EventBus {
24
24
  * @param {function} listener
25
25
  * @param {Object} [options]
26
26
  */
27
- on(eventName: string, listener: Function, options?: Object | undefined): void;
27
+ on(eventName: string, listener: Function, options?: Object): void;
28
28
  /**
29
29
  * @param {string} eventName
30
30
  * @param {function} listener
31
31
  * @param {Object} [options]
32
32
  */
33
- off(eventName: string, listener: Function, options?: Object | undefined): void;
33
+ off(eventName: string, listener: Function, options?: Object): void;
34
34
  /**
35
35
  * @param {string} eventName
36
36
  * @param {Object} data
@@ -9,14 +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 "__#61@#generateBundles"(defaultLang: string, baseLang: string): AsyncGenerator<any, void, unknown>;
13
- static "__#61@#createBundle"(lang: any, baseURL: any, paths: any): Promise<any>;
14
- static "__#61@#getPaths"(): Promise<{
12
+ static "__#69@#generateBundles"(defaultLang: string, baseLang: string): AsyncGenerator<any, void, unknown>;
13
+ static "__#69@#createBundle"(lang: any, baseURL: any, paths: any): Promise<any>;
14
+ static "__#69@#getPaths"(): Promise<{
15
15
  baseURL: any;
16
16
  paths: any;
17
17
  }>;
18
- static "__#61@#generateBundlesFallback"(lang: any): AsyncGenerator<any, void, unknown>;
19
- static "__#61@#createBundleFallback"(lang: any): Promise<any>;
18
+ static "__#69@#generateBundlesFallback"(lang: any): AsyncGenerator<any, void, unknown>;
19
+ static "__#69@#createBundleFallback"(lang: any): Promise<any>;
20
20
  constructor(lang: any);
21
21
  }
22
22
  import { L10n } from "./l10n.js";
@@ -10,14 +10,14 @@ export class IDownloadManager {
10
10
  * @param {string} filename
11
11
  * @param {string} [contentType]
12
12
  */
13
- downloadData(data: Uint8Array, filename: string, contentType?: string | undefined): void;
13
+ downloadData(data: Uint8Array, filename: string, contentType?: string): void;
14
14
  /**
15
15
  * @param {Uint8Array} data
16
16
  * @param {string} filename
17
17
  * @param {string | null} [dest]
18
18
  * @returns {boolean} Indicating if the data was opened.
19
19
  */
20
- openOrDownloadData(data: Uint8Array, filename: string, dest?: string | null | undefined): boolean;
20
+ openOrDownloadData(data: Uint8Array, filename: string, dest?: string | null): boolean;
21
21
  /**
22
22
  * @param {Uint8Array} data
23
23
  * @param {string} url
@@ -46,7 +46,7 @@ export class IL10n {
46
46
  * @param {string} [fallback]
47
47
  * @returns {Promise<string>}
48
48
  */
49
- get(ids: any[] | string, args?: Object | null | undefined, fallback?: string | undefined): Promise<string>;
49
+ get(ids: any[] | string, args?: Object | null, fallback?: string): Promise<string>;
50
50
  /**
51
51
  * Translates HTML element.
52
52
  * @param {HTMLElement} element
@@ -114,7 +114,7 @@ export class IPDFLinkService {
114
114
  * @param {string} url
115
115
  * @param {boolean} [newWindow]
116
116
  */
117
- addLinkAttributes(link: HTMLAnchorElement, url: string, newWindow?: boolean | undefined): void;
117
+ addLinkAttributes(link: HTMLAnchorElement, url: string, newWindow?: boolean): void;
118
118
  /**
119
119
  * @param dest - The PDF destination object.
120
120
  * @returns {string} The hyperlink to the PDF object.
@@ -159,7 +159,7 @@ export class IRenderableView {
159
159
  /**
160
160
  * @type {RenderingStates}
161
161
  */
162
- get renderingState(): any;
162
+ get renderingState(): RenderingStates;
163
163
  /**
164
164
  * @returns {Promise} Resolved on draw completion.
165
165
  */
@@ -7,8 +7,8 @@ export const GenericL10n: null;
7
7
  * @implements {IL10n}
8
8
  */
9
9
  export class L10n implements IL10n {
10
- static "__#60@#fixupLangCode"(langCode: any): any;
11
- static "__#60@#isRTL"(lang: any): boolean;
10
+ static "__#68@#fixupLangCode"(langCode: any): any;
11
+ static "__#68@#isRTL"(lang: any): boolean;
12
12
  constructor({ lang, isRTL }: {
13
13
  lang: any;
14
14
  isRTL: any;
@@ -48,7 +48,7 @@ export namespace LinkTarget {
48
48
  * @implements {IPDFLinkService}
49
49
  */
50
50
  export class PDFLinkService implements IPDFLinkService {
51
- static "__#57@#isValidExplicitDest"(dest: any): boolean;
51
+ static "__#65@#isValidExplicitDest"(dest: any): boolean;
52
52
  /**
53
53
  * @param {PDFLinkServiceOptions} options
54
54
  */
@@ -107,7 +107,7 @@ export class PDFLinkService implements IPDFLinkService {
107
107
  * @param {string} url
108
108
  * @param {boolean} [newWindow]
109
109
  */
110
- addLinkAttributes(link: HTMLAnchorElement, url: string, newWindow?: boolean | undefined): void;
110
+ addLinkAttributes(link: HTMLAnchorElement, url: string, newWindow?: boolean): void;
111
111
  /**
112
112
  * @param {string|Array} dest - The PDF destination object.
113
113
  * @returns {string} The hyperlink to the PDF object.
@@ -112,7 +112,6 @@ export class PDFPageView implements IRenderableView {
112
112
  annotationLayer: AnnotationLayerBuilder | null;
113
113
  annotationEditorLayer: any;
114
114
  textLayer: TextLayerBuilder | null;
115
- zoomLayer: ParentNode | null;
116
115
  xfaLayer: XfaLayerBuilder | null;
117
116
  structTreeLayer: any;
118
117
  drawLayer: any;
@@ -123,16 +122,13 @@ export class PDFPageView implements IRenderableView {
123
122
  destroy(): void;
124
123
  hasEditableAnnotations(): boolean;
125
124
  get _textHighlighter(): any;
126
- /**
127
- * @private
128
- */
129
- private _resetZoomLayer;
130
- reset({ keepZoomLayer, keepAnnotationLayer, keepAnnotationEditorLayer, keepXfaLayer, keepTextLayer, }?: {
131
- keepZoomLayer?: boolean | undefined;
125
+ canvas: HTMLCanvasElement | null | undefined;
126
+ reset({ keepAnnotationLayer, keepAnnotationEditorLayer, keepXfaLayer, keepTextLayer, keepCanvasWrapper, }?: {
132
127
  keepAnnotationLayer?: boolean | undefined;
133
128
  keepAnnotationEditorLayer?: boolean | undefined;
134
129
  keepXfaLayer?: boolean | undefined;
135
130
  keepTextLayer?: boolean | undefined;
131
+ keepCanvasWrapper?: boolean | undefined;
136
132
  }): void;
137
133
  toggleEditingMode(isEditing: any): void;
138
134
  /**
@@ -174,8 +170,7 @@ export class PDFPageView implements IRenderableView {
174
170
  keepTextLayer?: boolean | undefined;
175
171
  cancelExtraDelay?: number | undefined;
176
172
  }): void;
177
- cssTransform({ target, redrawAnnotationLayer, redrawAnnotationEditorLayer, redrawXfaLayer, redrawTextLayer, hideTextLayer, }: {
178
- target: any;
173
+ cssTransform({ redrawAnnotationLayer, redrawAnnotationEditorLayer, redrawXfaLayer, redrawTextLayer, hideTextLayer, }: {
179
174
  redrawAnnotationLayer?: boolean | undefined;
180
175
  redrawAnnotationEditorLayer?: boolean | undefined;
181
176
  redrawXfaLayer?: boolean | undefined;
@@ -186,7 +181,6 @@ export class PDFPageView implements IRenderableView {
186
181
  get height(): number;
187
182
  getPagePoint(x: any, y: any): any[];
188
183
  draw(): Promise<any>;
189
- canvas: HTMLCanvasElement | undefined;
190
184
  outputScale: OutputScale | undefined;
191
185
  /**
192
186
  * @param {string|null} label
@@ -203,4 +197,4 @@ import { GenericL10n } from "./genericl10n";
203
197
  import { AnnotationLayerBuilder } from "./annotation_layer_builder.js";
204
198
  import { TextLayerBuilder } from "./text_layer_builder.js";
205
199
  import { XfaLayerBuilder } from "./xfa_layer_builder.js";
206
- import { OutputScale } from "./ui_utils.js";
200
+ import { OutputScale } from "../src/pdf";
@@ -36,7 +36,7 @@ export class PDFRenderingQueue {
36
36
  * @param {boolean} scrolledDown
37
37
  * @param {boolean} [preRenderExtra]
38
38
  */
39
- getHighestPriority(visible: Object, views: any[], scrolledDown: boolean, preRenderExtra?: boolean | undefined): any;
39
+ getHighestPriority(visible: Object, views: any[], scrolledDown: boolean, preRenderExtra?: boolean): any;
40
40
  /**
41
41
  * @param {IRenderableView} view
42
42
  * @returns {boolean}
@@ -114,7 +114,7 @@ export class PDFThumbnailView implements IRenderableView {
114
114
  * rendering. The default value is `false`.
115
115
  */
116
116
  export class TempImageFactory {
117
- static "__#72@#tempCanvas": null;
117
+ static "__#79@#tempCanvas": null;
118
118
  static getCanvas(width: any, height: any): (HTMLCanvasElement | CanvasRenderingContext2D | null)[];
119
119
  static destroyCanvas(): void;
120
120
  }
@@ -110,6 +110,11 @@ export type PDFViewerOptions = {
110
110
  * rendering. The default value is `false`.
111
111
  */
112
112
  enableHWA?: boolean | undefined;
113
+ /**
114
+ * - Enable zooming on pinch gesture.
115
+ * The default value is `true`.
116
+ */
117
+ supportsPinchToZoom?: boolean | undefined;
113
118
  };
114
119
  export namespace PagesCountLimit {
115
120
  let FORCE_SCROLL_MODE_PAGE: number;
@@ -159,6 +164,8 @@ export namespace PagesCountLimit {
159
164
  * mode.
160
165
  * @property {boolean} [enableHWA] - Enables hardware acceleration for
161
166
  * rendering. The default value is `false`.
167
+ * @property {boolean} [supportsPinchToZoom] - Enable zooming on pinch gesture.
168
+ * The default value is `true`.
162
169
  */
163
170
  export class PDFPageViewBuffer {
164
171
  constructor(size: any);
@@ -172,7 +179,7 @@ export class PDFPageViewBuffer {
172
179
  */
173
180
  resize(newSize: any, idsToKeep?: null): void;
174
181
  has(view: any): boolean;
175
- [Symbol.iterator](): IterableIterator<any>;
182
+ [Symbol.iterator](): SetIterator<any>;
176
183
  #private;
177
184
  }
178
185
  /**
@@ -375,11 +382,11 @@ export class PDFViewer {
375
382
  * @param {Promise<OptionalContentConfig>} promise - A promise that is
376
383
  * resolved with an {@link OptionalContentConfig} instance.
377
384
  */
378
- set optionalContentConfigPromise(promise: Promise<import("../src/display/optional_content_config").OptionalContentConfig>);
385
+ set optionalContentConfigPromise(promise: Promise<OptionalContentConfig>);
379
386
  /**
380
387
  * @type {Promise<OptionalContentConfig | null>}
381
388
  */
382
- get optionalContentConfigPromise(): Promise<import("../src/display/optional_content_config").OptionalContentConfig | null>;
389
+ get optionalContentConfigPromise(): Promise<OptionalContentConfig | null>;
383
390
  /**
384
391
  * @param {number} mode - The direction in which the document pages should be
385
392
  * laid out within the scrolling container.
@@ -437,7 +444,7 @@ export class PDFViewer {
437
444
  * transformation origin.
438
445
  */
439
446
  origin?: any[] | undefined;
440
- } | undefined): void;
447
+ }): void;
441
448
  /**
442
449
  * Increase the current zoom level one, or more, times.
443
450
  * @param {ChangeScaleOptions} [options]
@@ -451,7 +458,7 @@ export class PDFViewer {
451
458
  * transformation origin.
452
459
  */
453
460
  origin?: any[] | undefined;
454
- } | undefined): void;
461
+ }): void;
455
462
  /**
456
463
  * Decrease the current zoom level one, or more, times.
457
464
  * @param {ChangeScaleOptions} [options]
@@ -465,7 +472,7 @@ export class PDFViewer {
465
472
  * transformation origin.
466
473
  */
467
474
  origin?: any[] | undefined;
468
- } | undefined): void;
475
+ }): void;
469
476
  get containerTopLeft(): number[];
470
477
  /**
471
478
  * @typedef {Object} AnnotationEditorModeOptions
@@ -493,24 +500,14 @@ export class PDFViewer {
493
500
  isFromKeyboard?: boolean | undefined;
494
501
  });
495
502
  get annotationEditorMode(): {
496
- /**
497
- * - The editor mode (none, FreeText, ink, ...).
498
- */
499
503
  /**
500
504
  * - The editor mode (none, FreeText, ink, ...).
501
505
  */
502
506
  mode: number;
503
- /**
504
- * - ID of the existing annotation to edit.
505
- */
506
507
  /**
507
508
  * - ID of the existing annotation to edit.
508
509
  */
509
510
  editId?: string | null | undefined;
510
- /**
511
- * - True if the mode change is due to a
512
- * keyboard action.
513
- */
514
511
  /**
515
512
  * - True if the mode change is due to a
516
513
  * keyboard action.
@@ -1,7 +1,9 @@
1
1
  export class StructTreeLayerBuilder {
2
- get renderingDone(): boolean;
3
- render(structTree: any): HTMLSpanElement | null;
2
+ constructor(pdfPage: any, rawDims: any);
3
+ render(): Promise<any>;
4
+ getAriaAttributes(annotationId: any): Promise<any>;
4
5
  hide(): void;
5
6
  show(): void;
7
+ addElementsToTextLayer(): void;
6
8
  #private;
7
9
  }
@@ -14,7 +14,7 @@ export class TextAccessibilityManager {
14
14
  * @param {HTMLElement} e2
15
15
  * @returns {number}
16
16
  */
17
- static "__#7@#compareElementPositions"(e1: HTMLElement, e2: HTMLElement): number;
17
+ static "__#6@#compareElementPositions"(e1: HTMLElement, e2: HTMLElement): number;
18
18
  setTextMapping(textDivs: any): void;
19
19
  /**
20
20
  * Function called when the text layer has finished rendering.
@@ -26,10 +26,10 @@ export type TextLayerBuilderOptions = {
26
26
  * contain text that matches the PDF text they are overlaying.
27
27
  */
28
28
  export class TextLayerBuilder {
29
- static "__#68@#textLayers": Map<any, any>;
30
- static "__#68@#selectionChangeAbortController": null;
31
- static "__#68@#removeGlobalSelectionListener"(textLayerDiv: any): void;
32
- static "__#68@#enableGlobalSelectionListener"(): void;
29
+ static "__#75@#textLayers": Map<any, any>;
30
+ static "__#75@#selectionChangeAbortController": null;
31
+ static "__#75@#removeGlobalSelectionListener"(textLayerDiv: any): void;
32
+ static "__#75@#enableGlobalSelectionListener"(): void;
33
33
  constructor({ pdfPage, highlighter, accessibilityManager, enablePermissions, onAppend, }: {
34
34
  pdfPage: any;
35
35
  highlighter?: null | undefined;
@@ -46,7 +46,7 @@ export class TextLayerBuilder {
46
46
  * @param {PageViewport} viewport
47
47
  * @param {Object} [textContentParams]
48
48
  */
49
- render(viewport: PageViewport, textContentParams?: Object | undefined): Promise<void>;
49
+ render(viewport: PageViewport, textContentParams?: Object): Promise<void>;
50
50
  hide(): void;
51
51
  show(): void;
52
52
  /**
@@ -92,6 +92,7 @@ export function backtrackBeforeAllVisibleElements(index: number, views: any[], t
92
92
  * or |items.length| if no such element exists.
93
93
  */
94
94
  export function binarySearchFirstItem(items: any, condition: any, start?: number): number;
95
+ export const calcRound: ((x: number) => number) | ((x: any) => any);
95
96
  export namespace CursorTool {
96
97
  let SELECT: number;
97
98
  let HAND: number;
@@ -176,23 +177,6 @@ export const MAX_SCALE: 10;
176
177
  export const MIN_SCALE: 0.1;
177
178
  export function normalizeWheelEventDelta(evt: any): number;
178
179
  export function normalizeWheelEventDirection(evt: any): number;
179
- /**
180
- * Scale factors for the canvas, necessary with HiDPI displays.
181
- */
182
- export class OutputScale {
183
- /**
184
- * @type {number} Horizontal scale.
185
- */
186
- sx: number;
187
- /**
188
- * @type {number} Vertical scale.
189
- */
190
- sy: number;
191
- /**
192
- * @type {boolean} Returns `true` when scaling is required, `false` otherwise.
193
- */
194
- get scaled(): boolean;
195
- }
196
180
  /**
197
181
  * Helper function to parse query string (e.g. ?param1=value&param2=...).
198
182
  * @param {string} query
@@ -219,7 +203,7 @@ export class ProgressBar {
219
203
  * @param {string} str
220
204
  * @param {boolean} [replaceInvisible]
221
205
  */
222
- export function removeNullCharacters(str: string, replaceInvisible?: boolean | undefined): string;
206
+ export function removeNullCharacters(str: string, replaceInvisible?: boolean): string;
223
207
  export namespace RenderingStates {
224
208
  let INITIAL: number;
225
209
  let RUNNING: number;
@@ -241,7 +225,7 @@ export const SCROLLBAR_PADDING: 40;
241
225
  export function scrollIntoView(element: HTMLElement, spot?: {
242
226
  left?: number | undefined;
243
227
  top?: number | undefined;
244
- } | undefined, scrollMatches?: boolean | undefined): void;
228
+ }, scrollMatches?: boolean): void;
245
229
  export namespace ScrollMode {
246
230
  let UNKNOWN_1: number;
247
231
  export { UNKNOWN_1 as UNKNOWN };