unpdf 1.2.2 → 1.3.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 (44) hide show
  1. package/README.md +1 -1
  2. package/dist/index.cjs +45 -3
  3. package/dist/index.d.cts +5 -2
  4. package/dist/index.d.mts +5 -2
  5. package/dist/index.d.ts +5 -2
  6. package/dist/index.mjs +45 -3
  7. package/dist/pdfjs.mjs +1 -1
  8. package/dist/types/src/display/annotation_layer.d.ts +5 -0
  9. package/dist/types/src/display/api.d.ts +41 -19
  10. package/dist/types/src/display/canvas.d.ts +82 -80
  11. package/dist/types/src/display/canvas_dependency_tracker.d.ts +144 -0
  12. package/dist/types/src/display/display_utils.d.ts +1 -1
  13. package/dist/types/src/display/draw_layer.d.ts +2 -2
  14. package/dist/types/src/display/editor/alt_text.d.ts +1 -1
  15. package/dist/types/src/display/editor/annotation_editor_layer.d.ts +1 -1
  16. package/dist/types/src/display/editor/color_picker.d.ts +2 -2
  17. package/dist/types/src/display/editor/draw.d.ts +7 -7
  18. package/dist/types/src/display/editor/drawers/freedraw.d.ts +3 -3
  19. package/dist/types/src/display/editor/drawers/signaturedraw.d.ts +13 -13
  20. package/dist/types/src/display/editor/editor.d.ts +7 -1
  21. package/dist/types/src/display/editor/freetext.d.ts +4 -2
  22. package/dist/types/src/display/editor/highlight.d.ts +3 -3
  23. package/dist/types/src/display/editor/stamp.d.ts +1 -1
  24. package/dist/types/src/display/editor/toolbar.d.ts +3 -3
  25. package/dist/types/src/display/editor/tools.d.ts +2 -1
  26. package/dist/types/src/display/fetch_stream.d.ts +2 -2
  27. package/dist/types/src/display/text_layer.d.ts +9 -9
  28. package/dist/types/src/display/worker_options.d.ts +2 -2
  29. package/dist/types/src/shared/util.d.ts +7 -3
  30. package/dist/types/web/annotation_layer_builder.d.ts +4 -1
  31. package/dist/types/web/app_options.d.ts +1 -1
  32. package/dist/types/web/autolinker.d.ts +2 -2
  33. package/dist/types/web/base_pdf_page_view.d.ts +2 -0
  34. package/dist/types/web/genericl10n.d.ts +5 -5
  35. package/dist/types/web/interfaces.d.ts +7 -0
  36. package/dist/types/web/l10n.d.ts +2 -2
  37. package/dist/types/web/pdf_link_service.d.ts +7 -0
  38. package/dist/types/web/pdf_page_detail_view.d.ts +1 -0
  39. package/dist/types/web/pdf_page_view.d.ts +9 -0
  40. package/dist/types/web/pdf_thumbnail_view.d.ts +1 -1
  41. package/dist/types/web/pdf_viewer.d.ts +13 -0
  42. package/dist/types/web/text_accessibility.d.ts +1 -1
  43. package/dist/types/web/text_layer_builder.d.ts +4 -4
  44. package/package.json +8 -8
@@ -73,7 +73,7 @@ export class AnnotationEditor {
73
73
  * @param {AnnotationEditorLayer} parent
74
74
  */
75
75
  static paste(item: DataTransferItem, parent: AnnotationEditorLayer): void;
76
- static "__#44@#rotatePoint"(x: any, y: any, angle: any): any[];
76
+ static #rotatePoint(x: any, y: any, angle: any): any[];
77
77
  static _round(x: any): number;
78
78
  /**
79
79
  * Deserialize the editor.
@@ -324,6 +324,12 @@ export class AnnotationEditor {
324
324
  */
325
325
  getRect(tx: number, ty: number, rotation?: number): any[];
326
326
  getRectInCurrentCoords(rect: any, pageHeight: any): any[];
327
+ /**
328
+ * Get the rect in page coordinates without any translation.
329
+ * It's used when serializing the editor.
330
+ * @returns {Array<number>}
331
+ */
332
+ getPDFRect(): Array<number>;
327
333
  /**
328
334
  * Executed once this editor has been rendered.
329
335
  * @param {boolean} focus - true if the editor should be focused.
@@ -16,8 +16,8 @@ export class FreeTextEditor extends AnnotationEditor {
16
16
  static updateDefaultParams(type: any, value: any): void;
17
17
  /** @inheritdoc */
18
18
  static get defaultPropertiesToUpdate(): any[][];
19
- static "__#20@#getNodeContent"(node: any): any;
20
- static "__#20@#deserializeContent"(content: any): any;
19
+ static #getNodeContent(node: any): any;
20
+ static #deserializeContent(content: any): any;
21
21
  /** @inheritdoc */
22
22
  static deserialize(data: any, parent: any, uiManager: any): Promise<AnnotationEditor | null>;
23
23
  constructor(params: any);
@@ -53,6 +53,8 @@ export class FreeTextEditor extends AnnotationEditor {
53
53
  overlayDiv: HTMLDivElement | undefined;
54
54
  editorDivPaste(event: any): void;
55
55
  /** @inheritdoc */
56
+ getPDFRect(): any[];
57
+ /** @inheritdoc */
56
58
  serialize(isForCopying?: boolean): Object | null;
57
59
  /** @inheritdoc */
58
60
  renderAnnotationElement(annotation: any): HTMLElement | null;
@@ -19,14 +19,14 @@ export class HighlightEditor extends AnnotationEditor {
19
19
  /** @inheritdoc */
20
20
  static updateDefaultParams(type: any, value: any): void;
21
21
  static get defaultPropertiesToUpdate(): (number | null)[][];
22
- static "__#25@#rotateBbox"([x, y, width, height]: [any, any, any, any], angle: any): any[];
22
+ static #rotateBbox([x, y, width, height]: [any, any, any, any], angle: any): any[];
23
23
  static startHighlighting(parent: any, isLTR: any, { target: textLayer, x, y }: {
24
24
  target: any;
25
25
  x: any;
26
26
  y: any;
27
27
  }): void;
28
- static "__#25@#highlightMove"(parent: any, event: any): void;
29
- static "__#25@#endHighlight"(parent: any, event: any): void;
28
+ static #highlightMove(parent: any, event: any): void;
29
+ static #endHighlight(parent: any, event: any): void;
30
30
  /** @inheritdoc */
31
31
  static deserialize(data: any, parent: any, uiManager: any): Promise<AnnotationEditor | null>;
32
32
  constructor(params: any);
@@ -37,7 +37,7 @@ export class StampEditor extends AnnotationEditor {
37
37
  imageData: {
38
38
  width: any;
39
39
  height: any;
40
- data: Uint8ClampedArray<ArrayBufferLike>;
40
+ data: ImageDataArray;
41
41
  } | null;
42
42
  };
43
43
  /** @inheritdoc */
@@ -1,6 +1,6 @@
1
1
  export class EditorToolbar {
2
- static "__#3@#l10nRemove": null;
3
- static "__#3@#pointerDown"(e: any): void;
2
+ static #l10nRemove: null;
3
+ static #pointerDown(e: any): void;
4
4
  constructor(editor: any);
5
5
  render(): HTMLDivElement;
6
6
  get div(): null;
@@ -16,7 +16,7 @@ export class EditorToolbar {
16
16
  remove(): void;
17
17
  #private;
18
18
  }
19
- export class HighlightToolbar {
19
+ export class FloatingToolbar {
20
20
  constructor(uiManager: any);
21
21
  show(parent: any, boxes: any, isLTR: any): void;
22
22
  hide(): void;
@@ -65,7 +65,8 @@ export class AnnotationEditorUIManager {
65
65
  onRotationChanging({ pagesRotation }: {
66
66
  pagesRotation: any;
67
67
  }): void;
68
- highlightSelection(methodOfCreation?: string): void;
68
+ highlightSelection(methodOfCreation?: string, comment?: boolean): void;
69
+ commentSelection(methodOfCreation?: string): void;
69
70
  /**
70
71
  * Add an editor in the annotation storage.
71
72
  * @param {AnnotationEditor} editor
@@ -16,7 +16,7 @@ export class PDFFetchStream implements IPDFStream {
16
16
  declare class PDFFetchStreamReader implements IPDFStreamReader {
17
17
  constructor(stream: any);
18
18
  _stream: any;
19
- _reader: ReadableStreamDefaultReader<Uint8Array<ArrayBufferLike>> | null;
19
+ _reader: ReadableStreamDefaultReader<Uint8Array<ArrayBuffer>> | null;
20
20
  _loaded: number;
21
21
  _filename: string | null;
22
22
  _withCredentials: any;
@@ -43,7 +43,7 @@ declare class PDFFetchStreamReader implements IPDFStreamReader {
43
43
  declare class PDFFetchStreamRangeReader implements IPDFStreamRangeReader {
44
44
  constructor(stream: any, begin: any, end: any);
45
45
  _stream: any;
46
- _reader: ReadableStreamDefaultReader<Uint8Array<ArrayBufferLike>> | null;
46
+ _reader: ReadableStreamDefaultReader<Uint8Array<ArrayBuffer>> | null;
47
47
  _loaded: number;
48
48
  _withCredentials: any;
49
49
  _readCapability: any;
@@ -31,24 +31,24 @@ export type TextLayerUpdateParameters = {
31
31
  onBefore?: Function | undefined;
32
32
  };
33
33
  export class TextLayer {
34
- static "__#58@#ascentCache": Map<any, any>;
35
- static "__#58@#canvasContexts": Map<any, any>;
36
- static "__#58@#canvasCtxFonts": WeakMap<object, any>;
37
- static "__#58@#minFontSize": null;
38
- static "__#58@#pendingTextLayers": Set<any>;
34
+ static #ascentCache: Map<any, any>;
35
+ static #canvasContexts: Map<any, any>;
36
+ static #canvasCtxFonts: WeakMap<object, any>;
37
+ static #minFontSize: null;
38
+ static #pendingTextLayers: Set<any>;
39
39
  static get fontFamilyMap(): any;
40
40
  /**
41
41
  * Clean-up global textLayer data.
42
42
  * @returns {undefined}
43
43
  */
44
44
  static cleanup(): undefined;
45
- static "__#58@#getCtx"(lang?: null): any;
46
- static "__#58@#ensureCtxFont"(ctx: any, size: any, family: any): void;
45
+ static #getCtx(lang?: null): any;
46
+ static #ensureCtxFont(ctx: any, size: any, family: any): void;
47
47
  /**
48
48
  * Compute the minimum font size enforced by the browser.
49
49
  */
50
- static "__#58@#ensureMinFontSizeComputed"(): void;
51
- static "__#58@#getAscent"(fontFamily: any, style: any, lang: any): any;
50
+ static #ensureMinFontSizeComputed(): void;
51
+ static #getAscent(fontFamily: any, style: any, lang: any): any;
52
52
  /**
53
53
  * @param {TextLayerParameters} options
54
54
  */
@@ -1,6 +1,6 @@
1
1
  export class GlobalWorkerOptions {
2
- static "__#53@#port": null;
3
- static "__#53@#src": string;
2
+ static #port: null;
3
+ static #src: string;
4
4
  /**
5
5
  * @param {Worker | null} workerPort - Defines global port for worker process.
6
6
  * Overrides the `workerSrc` option.
@@ -53,6 +53,7 @@ export namespace AnnotationEditorType {
53
53
  let HIGHLIGHT: number;
54
54
  let STAMP: number;
55
55
  let INK: number;
56
+ let POPUP: number;
56
57
  let SIGNATURE: number;
57
58
  let COMMENT: number;
58
59
  }
@@ -123,7 +124,8 @@ export namespace AnnotationType {
123
124
  export let CARET: number;
124
125
  let INK_1: number;
125
126
  export { INK_1 as INK };
126
- export let POPUP: number;
127
+ let POPUP_1: number;
128
+ export { POPUP_1 as POPUP };
127
129
  export let FILEATTACHMENT: number;
128
130
  export let SOUND: number;
129
131
  export let MOVIE: number;
@@ -386,8 +388,10 @@ export function updateUrlHash(url: URL | string, hash: string, allowRel?: boolea
386
388
  export function utf8StringToString(str: any): string;
387
389
  export class Util {
388
390
  static makeHexColor(r: any, g: any, b: any): string;
391
+ static domMatrixToTransform(dm: any): any[];
389
392
  static scaleMinMax(transform: any, minMax: any): void;
390
393
  static transform(m1: any, m2: any): any[];
394
+ static multiplyByDOMMatrix(m: any, md: any): any[];
391
395
  static applyTransform(p: any, m: any, pos?: number): void;
392
396
  static applyTransformToBezier(p: any, transform: any, pos?: number): void;
393
397
  static applyInverseTransform(p: any, m: any): void;
@@ -398,8 +402,8 @@ export class Util {
398
402
  static intersect(rect1: any, rect2: any): number[] | null;
399
403
  static pointBoundingBox(x: any, y: any, minMax: any): void;
400
404
  static rectBoundingBox(x0: any, y0: any, x1: any, y1: any, minMax: any): void;
401
- static "__#1@#getExtremumOnCurve"(x0: any, x1: any, x2: any, x3: any, y0: any, y1: any, y2: any, y3: any, t: any, minMax: any): void;
402
- 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;
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;
403
407
  static bezierBoundingBox(x0: any, y0: any, x1: any, y1: any, x2: any, y2: any, x3: any, y3: any, minMax: any): void;
404
408
  }
405
409
  export namespace VerbosityLevel {
@@ -17,6 +17,7 @@ export type AnnotationLayerBuilderOptions = {
17
17
  renderForms: boolean;
18
18
  linkService: IPDFLinkService;
19
19
  downloadManager?: import("./interfaces").IDownloadManager | undefined;
20
+ enableComment?: boolean | undefined;
20
21
  enableScripting?: boolean | undefined;
21
22
  hasJSActionsPromise?: Promise<boolean> | undefined;
22
23
  fieldObjectsPromise?: Promise<{
@@ -49,6 +50,7 @@ export type InjectLinkAnnotationsOptions = {
49
50
  * @property {boolean} renderForms
50
51
  * @property {IPDFLinkService} linkService
51
52
  * @property {IDownloadManager} [downloadManager]
53
+ * @property {boolean} [enableComment]
52
54
  * @property {boolean} [enableScripting]
53
55
  * @property {Promise<boolean>} [hasJSActionsPromise]
54
56
  * @property {Promise<Object<string, Array<Object>> | null>}
@@ -74,13 +76,14 @@ export class AnnotationLayerBuilder {
74
76
  /**
75
77
  * @param {AnnotationLayerBuilderOptions} options
76
78
  */
77
- constructor({ pdfPage, linkService, downloadManager, annotationStorage, imageResourcesPath, renderForms, enableScripting, hasJSActionsPromise, fieldObjectsPromise, annotationCanvasMap, accessibilityManager, annotationEditorUIManager, onAppend, }: AnnotationLayerBuilderOptions);
79
+ constructor({ pdfPage, linkService, downloadManager, annotationStorage, imageResourcesPath, renderForms, enableComment, enableScripting, hasJSActionsPromise, fieldObjectsPromise, annotationCanvasMap, accessibilityManager, annotationEditorUIManager, onAppend, }: AnnotationLayerBuilderOptions);
78
80
  pdfPage: import("../src/display/api").PDFPageProxy;
79
81
  linkService: import("./interfaces").IPDFLinkService;
80
82
  downloadManager: import("./interfaces").IDownloadManager | undefined;
81
83
  imageResourcesPath: string;
82
84
  renderForms: boolean;
83
85
  annotationStorage: import("../src/display/annotation_storage").AnnotationStorage;
86
+ enableComment: boolean;
84
87
  enableScripting: boolean;
85
88
  _hasJSActionsPromise: Promise<boolean>;
86
89
  _fieldObjectsPromise: Promise<{
@@ -1,6 +1,6 @@
1
1
  export class AppOptions {
2
2
  static eventBus: any;
3
- static "__#75@#opts": Map<any, any>;
3
+ static #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,6 @@
1
1
  export class Autolinker {
2
- static "__#76@#index": number;
3
- static "__#76@#regex": any;
2
+ static #index: number;
3
+ static #regex: any;
4
4
  static findLinks(text: any): {
5
5
  url: string;
6
6
  index: any;
@@ -3,9 +3,11 @@ export class BasePDFPageView {
3
3
  canvas: null;
4
4
  /** @type {null | HTMLDivElement} */
5
5
  div: null | HTMLDivElement;
6
+ enableOptimizedPartialRendering: boolean;
6
7
  eventBus: null;
7
8
  id: null;
8
9
  pageColors: null;
10
+ recordedGroups: null;
9
11
  renderingQueue: null;
10
12
  renderTask: null;
11
13
  resume: null;
@@ -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 "__#72@#generateBundles"(defaultLang: string, baseLang: string): AsyncGenerator<any, void, unknown>;
13
- static "__#72@#createBundle"(lang: any, baseURL: any, paths: any): Promise<any>;
14
- static "__#72@#getPaths"(): Promise<{
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<{
15
15
  baseURL: any;
16
16
  paths: any;
17
17
  }>;
18
- static "__#72@#generateBundlesFallback"(lang: any): AsyncGenerator<any, void, unknown>;
19
- static "__#72@#createBundleFallback"(lang: any): Promise<any>;
18
+ static #generateBundlesFallback(lang: any): AsyncGenerator<any, void, unknown>;
19
+ static #createBundleFallback(lang: any): Promise<any>;
20
20
  constructor(lang: any);
21
21
  }
22
22
  import { L10n } from "./l10n.js";
@@ -109,6 +109,13 @@ export class IPDFLinkService {
109
109
  * @param {number|string} val - The page number, or page label.
110
110
  */
111
111
  goToPage(val: number | string): void;
112
+ /**
113
+ * Scrolls to a specific location in the PDF document.
114
+ * @param {number} pageNumber - The page number to scroll to.
115
+ * @param {number} x - The x-coordinate to scroll to in page coordinates.
116
+ * @param {number} y - The y-coordinate to scroll to in page coordinates.
117
+ */
118
+ goToXY(pageNumber: number, x: number, y: number): void;
112
119
  /**
113
120
  * @param {HTMLAnchorElement} link
114
121
  * @param {string} url
@@ -7,8 +7,8 @@ export const GenericL10n: null;
7
7
  * @implements {IL10n}
8
8
  */
9
9
  export class L10n implements IL10n {
10
- static "__#71@#fixupLangCode"(langCode: any): any;
11
- static "__#71@#isRTL"(lang: any): boolean;
10
+ static #fixupLangCode(langCode: any): any;
11
+ static #isRTL(lang: any): boolean;
12
12
  constructor({ lang, isRTL }: {
13
13
  lang: any;
14
14
  isRTL: any;
@@ -100,6 +100,13 @@ export class PDFLinkService implements IPDFLinkService {
100
100
  * @param {number|string} val - The page number, or page label.
101
101
  */
102
102
  goToPage(val: number | string): void;
103
+ /**
104
+ * Scrolls to a specific location in the PDF document.
105
+ * @param {number} pageNumber - The page number to scroll to.
106
+ * @param {number} x - The x-coordinate to scroll to in page coordinates.
107
+ * @param {number} y - The y-coordinate to scroll to in page coordinates.
108
+ */
109
+ goToXY(pageNumber: number, x: number, y: number): void;
103
110
  /**
104
111
  * Adds various attributes (href, title, target, rel) to hyperlinks.
105
112
  * @param {HTMLAnchorElement} link
@@ -26,6 +26,7 @@ export class PDFPageDetailView extends BasePDFPageView implements IRenderableVie
26
26
  visibleArea?: null | undefined;
27
27
  underlyingViewUpdated?: boolean | undefined;
28
28
  }): void;
29
+ _getRenderingContext(canvas: any, transform: any): any;
29
30
  draw(): Promise<void>;
30
31
  #private;
31
32
  }
@@ -80,6 +80,14 @@ export type PDFPageViewOptions = {
80
80
  * The default value is `true`.
81
81
  */
82
82
  enableDetailCanvas?: boolean | undefined;
83
+ /**
84
+ * - When enabled, PDF
85
+ * rendering will keep track of which areas of the page each PDF operation
86
+ * affects. Then, when rendering a partial page (if `enableDetailCanvas` is
87
+ * enabled), it will only run through the operations that affect that portion.
88
+ * The default value is `false`.
89
+ */
90
+ enableOptimizedPartialRendering?: boolean | undefined;
83
91
  /**
84
92
  * - Overwrites background and foreground colors
85
93
  * with user defined ones in order to improve readability in high contrast
@@ -208,6 +216,7 @@ export class PDFPageView extends BasePDFPageView implements IRenderableView {
208
216
  annotationCanvasMap: any;
209
217
  pageColors: null;
210
218
  isEditing: boolean;
219
+ recordOperations: boolean;
211
220
  };
212
221
  draw(): Promise<void>;
213
222
  /**
@@ -126,7 +126,7 @@ export class PDFThumbnailView implements IRenderableView {
126
126
  * mode.
127
127
  */
128
128
  export class TempImageFactory {
129
- static "__#85@#tempCanvas": null;
129
+ static #tempCanvas: null;
130
130
  static getCanvas(width: any, height: any): (HTMLCanvasElement | CanvasRenderingContext2D | null)[];
131
131
  static destroyCanvas(): void;
132
132
  }
@@ -110,6 +110,13 @@ export type PDFViewerOptions = {
110
110
  * The default value is `true`.
111
111
  */
112
112
  enableDetailCanvas?: boolean | undefined;
113
+ /**
114
+ * - When enabled, PDF
115
+ * rendering will keep track of which areas of the page each PDF operation
116
+ * affects. Then, when rendering a partial page (if `enableDetailCanvas` is
117
+ * enabled), it will only run through the operations that affect that portion.
118
+ */
119
+ enableOptimizedPartialRendering?: boolean | undefined;
113
120
  /**
114
121
  * - Localization service.
115
122
  */
@@ -197,6 +204,10 @@ export namespace PagesCountLimit {
197
204
  * `maxCanvasDim`, it will draw a second canvas on top of the CSS-zoomed one,
198
205
  * that only renders the part of the page that is close to the viewport.
199
206
  * The default value is `true`.
207
+ * @property {boolean} [enableOptimizedPartialRendering] - When enabled, PDF
208
+ * rendering will keep track of which areas of the page each PDF operation
209
+ * affects. Then, when rendering a partial page (if `enableDetailCanvas` is
210
+ * enabled), it will only run through the operations that affect that portion.
200
211
  * @property {IL10n} [l10n] - Localization service.
201
212
  * @property {boolean} [enablePermissions] - Enables PDF document permissions,
202
213
  * when they exist. The default value is `false`.
@@ -249,6 +260,7 @@ export class PDFViewer {
249
260
  maxCanvasDim: number | undefined;
250
261
  capCanvasAreaFactor: number | undefined;
251
262
  enableDetailCanvas: boolean;
263
+ enableOptimizedPartialRendering: boolean;
252
264
  l10n: import("./interfaces").IL10n | GenericL10n | undefined;
253
265
  pageColors: Object | null;
254
266
  defaultRenderingQueue: boolean;
@@ -261,6 +273,7 @@ export class PDFViewer {
261
273
  _eventHandler: (evt: any) => void;
262
274
  };
263
275
  presentationModeState: number;
276
+ get printingAllowed(): boolean;
264
277
  get pagesCount(): number;
265
278
  getPageView(index: any): any;
266
279
  getCachedPageViews(): Set<any>;
@@ -14,7 +14,7 @@ export class TextAccessibilityManager {
14
14
  * @param {HTMLElement} e2
15
15
  * @returns {number}
16
16
  */
17
- static "__#8@#compareElementPositions"(e1: HTMLElement, e2: HTMLElement): number;
17
+ static #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.
@@ -37,10 +37,10 @@ export type TextLayerBuilderRenderOptions = {
37
37
  * contain text that matches the PDF text they are overlaying.
38
38
  */
39
39
  export class TextLayerBuilder {
40
- static "__#81@#textLayers": Map<any, any>;
41
- static "__#81@#selectionChangeAbortController": null;
42
- static "__#81@#removeGlobalSelectionListener"(textLayerDiv: any): void;
43
- static "__#81@#enableGlobalSelectionListener"(): void;
40
+ static #textLayers: Map<any, any>;
41
+ static #selectionChangeAbortController: null;
42
+ static #removeGlobalSelectionListener(textLayerDiv: any): void;
43
+ static #enableGlobalSelectionListener(): void;
44
44
  /**
45
45
  * @param {TextLayerBuilderOptions} options
46
46
  */
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "unpdf",
3
3
  "type": "module",
4
- "version": "1.2.2",
5
- "packageManager": "pnpm@10.15.0",
4
+ "version": "1.3.0",
5
+ "packageManager": "pnpm@10.17.0",
6
6
  "description": "PDF extraction and rendering across all JavaScript runtimes",
7
7
  "author": "Johann Schopplich <hello@johannschopplich.com>",
8
8
  "license": "MIT",
@@ -70,20 +70,20 @@
70
70
  }
71
71
  },
72
72
  "devDependencies": {
73
- "@antfu/eslint-config": "^5.2.1",
74
- "@napi-rs/canvas": "^0.1.77",
73
+ "@antfu/eslint-config": "^5.3.0",
74
+ "@napi-rs/canvas": "^0.1.80",
75
75
  "@rollup/plugin-alias": "^5.1.1",
76
76
  "@rollup/plugin-inject": "^5.0.5",
77
77
  "@rollup/plugin-node-resolve": "^16.0.1",
78
78
  "@rollup/plugin-replace": "^6.0.2",
79
79
  "@rollup/plugin-terser": "^0.4.4",
80
80
  "@rollup/plugin-typescript": "^12.1.4",
81
- "@types/node": "^24.3.0",
81
+ "@types/node": "^24.5.2",
82
82
  "bumpp": "^10.2.3",
83
- "eslint": "^9.33.0",
83
+ "eslint": "^9.35.0",
84
84
  "fast-glob": "^3.3.3",
85
- "pdfjs-dist": "~5.4.54",
86
- "rollup": "^4.46.4",
85
+ "pdfjs-dist": "~5.4.149",
86
+ "rollup": "^4.51.0",
87
87
  "tslib": "^2.8.1",
88
88
  "typescript": "^5.9.2",
89
89
  "unbuild": "^3.6.1",