unpdf 1.3.2 → 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 (84) 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 +42 -17
  7. package/dist/types/src/display/annotation_storage.d.ts +10 -8
  8. package/dist/types/src/display/api.d.ts +93 -63
  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 +99 -27
  13. package/dist/types/src/display/canvas_factory.d.ts +3 -1
  14. package/dist/types/src/display/display_utils.d.ts +25 -2
  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 +11 -14
  18. package/dist/types/src/display/editor/color_picker.d.ts +2 -2
  19. package/dist/types/src/display/editor/comment.d.ts +32 -5
  20. package/dist/types/src/display/editor/draw.d.ts +3 -7
  21. package/dist/types/src/display/editor/drawers/freedraw.d.ts +4 -3
  22. package/dist/types/src/display/editor/drawers/highlight.d.ts +2 -1
  23. package/dist/types/src/display/editor/drawers/signaturedraw.d.ts +13 -13
  24. package/dist/types/src/display/editor/editor.d.ts +81 -26
  25. package/dist/types/src/display/editor/freetext.d.ts +3 -3
  26. package/dist/types/src/display/editor/highlight.d.ts +6 -4
  27. package/dist/types/src/display/editor/ink.d.ts +2 -1
  28. package/dist/types/src/display/editor/signature.d.ts +0 -5
  29. package/dist/types/src/display/editor/toolbar.d.ts +5 -3
  30. package/dist/types/src/display/editor/tools.d.ts +58 -4
  31. package/dist/types/src/display/fetch_stream.d.ts +3 -56
  32. package/dist/types/src/display/font_loader.d.ts +28 -1
  33. package/dist/types/src/display/network.d.ts +14 -80
  34. package/dist/types/src/display/network_stream.d.ts +2 -0
  35. package/dist/types/src/display/network_utils.d.ts +3 -3
  36. package/dist/types/src/display/node_stream.d.ts +2 -52
  37. package/dist/types/src/display/node_utils.d.ts +5 -19
  38. package/dist/types/src/display/obj_bin_transform_display.d.ts +67 -0
  39. package/dist/types/src/display/pages_mapper.d.ts +72 -0
  40. package/dist/types/src/display/pattern_helper.d.ts +9 -4
  41. package/dist/types/src/display/text_layer.d.ts +16 -10
  42. package/dist/types/src/display/text_layer_images.d.ts +10 -0
  43. package/dist/types/src/display/transport_stream.d.ts +8 -64
  44. package/dist/types/src/display/webgpu_mesh.d.ts +3 -0
  45. package/dist/types/src/display/worker_options.d.ts +2 -2
  46. package/dist/types/src/display/xfa_layer.d.ts +3 -3
  47. package/dist/types/src/pdf.d.ts +9 -1
  48. package/dist/types/src/{interfaces.d.ts → shared/base_pdf_stream.d.ts} +26 -27
  49. package/dist/types/src/shared/obj_bin_transform_utils.d.ts +26 -0
  50. package/dist/types/src/shared/util.d.ts +14 -5
  51. package/dist/types/web/annotation_editor_layer_builder.d.ts +7 -8
  52. package/dist/types/web/annotation_layer_builder.d.ts +15 -23
  53. package/dist/types/web/app_options.d.ts +1 -1
  54. package/dist/types/web/autolinker.d.ts +3 -2
  55. package/dist/types/web/base_download_manager.d.ts +24 -0
  56. package/dist/types/web/base_pdf_page_view.d.ts +6 -6
  57. package/dist/types/web/comment_manager.d.ts +20 -0
  58. package/dist/types/web/download_manager.d.ts +3 -12
  59. package/dist/types/web/draw_layer_builder.d.ts +0 -12
  60. package/dist/types/web/genericl10n.d.ts +6 -10
  61. package/dist/types/web/l10n.d.ts +3 -6
  62. package/dist/types/web/menu.d.ts +11 -0
  63. package/dist/types/web/pdf_find_controller.d.ts +9 -11
  64. package/dist/types/web/pdf_history.d.ts +3 -3
  65. package/dist/types/web/pdf_link_service.d.ts +4 -8
  66. package/dist/types/web/pdf_page_detail_view.d.ts +1 -7
  67. package/dist/types/web/pdf_page_view.d.ts +23 -12
  68. package/dist/types/web/pdf_rendering_queue.d.ts +10 -14
  69. package/dist/types/web/pdf_thumbnail_view.d.ts +18 -42
  70. package/dist/types/web/pdf_thumbnail_viewer.d.ts +57 -13
  71. package/dist/types/web/pdf_viewer.component.d.ts +1 -1
  72. package/dist/types/web/pdf_viewer.d.ts +40 -28
  73. package/dist/types/web/renderable_view.d.ts +33 -0
  74. package/dist/types/web/sidebar.d.ts +65 -0
  75. package/dist/types/web/struct_tree_layer_builder.d.ts +1 -1
  76. package/dist/types/web/text_accessibility.d.ts +1 -1
  77. package/dist/types/web/text_layer_builder.d.ts +11 -6
  78. package/dist/types/web/ui_utils.d.ts +3 -11
  79. package/dist/types/web/xfa_layer_builder.d.ts +4 -4
  80. package/package.json +25 -20
  81. package/dist/types/src/display/cmap_reader_factory.d.ts +0 -25
  82. package/dist/types/src/display/standard_fontdata_factory.d.ts +0 -20
  83. package/dist/types/src/display/wasm_factory.d.ts +0 -20
  84. package/dist/types/web/interfaces.d.ts +0 -174
@@ -0,0 +1,65 @@
1
+ /**
2
+ * Viewer control to display a sidebar with resizer functionality.
3
+ */
4
+ export class Sidebar {
5
+ /**
6
+ * @typedef {Object} SidebarElements
7
+ * @property {HTMLElement} sidebar - The sidebar element.
8
+ * @property {HTMLElement} resizer - The sidebar resizer element.
9
+ * @property {HTMLElement} toggleButton - The button used to toggle the
10
+ * sidebar.
11
+ */
12
+ /**
13
+ * Create a sidebar with resizer functionality.
14
+ * @param {SidebarElements} sidebarElements
15
+ * @param {boolean} ltr
16
+ * @param {boolean} isResizerOnTheLeft
17
+ */
18
+ constructor({ sidebar, resizer, toggleButton }: {
19
+ /**
20
+ * - The sidebar element.
21
+ */
22
+ sidebar: HTMLElement;
23
+ /**
24
+ * - The sidebar resizer element.
25
+ */
26
+ resizer: HTMLElement;
27
+ /**
28
+ * - The button used to toggle the
29
+ * sidebar.
30
+ */
31
+ toggleButton: HTMLElement;
32
+ }, ltr: boolean, isResizerOnTheLeft: boolean, globalAbortSignal: any);
33
+ _sidebar: HTMLElement;
34
+ _isOpen: boolean;
35
+ /**
36
+ * Set the width of the sidebar in pixels.
37
+ * @param {number} newWidth
38
+ */
39
+ set width(newWidth: number);
40
+ /**
41
+ * Get the current width of the sidebar in pixels.
42
+ * @returns {number}
43
+ */
44
+ get width(): number;
45
+ /**
46
+ * Callback to be executed when the user starts resizing the sidebar.
47
+ */
48
+ onStartResizing(): void;
49
+ /**
50
+ * Callback to be executed when the user stops resizing the sidebar.
51
+ */
52
+ onStopResizing(): void;
53
+ /**
54
+ * Callback to be executed when the sidebar is being resized.
55
+ * @param {number} newWidth - The new width of the sidebar in pixels.
56
+ */
57
+ onResizing(_newWidth: any): void;
58
+ /**
59
+ * Toggle the sidebar's visibility.
60
+ * @param {boolean} [visibility] - The visibility state to set.
61
+ */
62
+ toggle(visibility?: boolean): void;
63
+ destroy(): void;
64
+ #private;
65
+ }
@@ -20,6 +20,6 @@ export class StructTreeLayerBuilder {
20
20
  getAriaAttributes(annotationId: any): Promise<any>;
21
21
  hide(): void;
22
22
  show(): void;
23
- addElementsToTextLayer(): void;
23
+ updateTextLayer(): void;
24
24
  #private;
25
25
  }
@@ -14,7 +14,7 @@ export class TextAccessibilityManager {
14
14
  * @param {HTMLElement} e2
15
15
  * @returns {number}
16
16
  */
17
- static #compareElementPositions(e1: HTMLElement, e2: HTMLElement): number;
17
+ static "__#private@#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.
@@ -1,5 +1,6 @@
1
1
  export type PDFPageProxy = import("../src/display/api").PDFPageProxy;
2
2
  export type PageViewport = import("../src/display/display_utils").PageViewport;
3
+ export type TextLayerImages = import("../src/display/text_layer_images.js").TextLayerImages;
3
4
  export type TextHighlighter = import("./text_highlighter").TextHighlighter;
4
5
  export type TextAccessibilityManager = import("./text_accessibility.js").TextAccessibilityManager;
5
6
  export type TextLayerBuilderOptions = {
@@ -12,9 +13,11 @@ export type TextLayerBuilderOptions = {
12
13
  accessibilityManager?: import("./text_accessibility.js").TextAccessibilityManager | undefined;
13
14
  enablePermissions?: boolean | undefined;
14
15
  onAppend?: Function | undefined;
16
+ abortSignal?: AbortSignal | undefined;
15
17
  };
16
18
  export type TextLayerBuilderRenderOptions = {
17
19
  viewport: PageViewport;
20
+ images: TextLayerImages;
18
21
  textContentParams?: Object | undefined;
19
22
  };
20
23
  /**
@@ -25,10 +28,12 @@ export type TextLayerBuilderRenderOptions = {
25
28
  * @property {TextAccessibilityManager} [accessibilityManager]
26
29
  * @property {boolean} [enablePermissions]
27
30
  * @property {function} [onAppend]
31
+ * @property {AbortSignal} [abortSignal]
28
32
  */
29
33
  /**
30
34
  * @typedef {Object} TextLayerBuilderRenderOptions
31
35
  * @property {PageViewport} viewport
36
+ * @property {TextLayerImages} images
32
37
  * @property {Object} [textContentParams]
33
38
  */
34
39
  /**
@@ -37,14 +42,14 @@ export type TextLayerBuilderRenderOptions = {
37
42
  * contain text that matches the PDF text they are overlaying.
38
43
  */
39
44
  export class TextLayerBuilder {
40
- static #textLayers: Map<any, any>;
41
- static #selectionChangeAbortController: null;
42
- static #removeGlobalSelectionListener(textLayerDiv: any): void;
43
- static #enableGlobalSelectionListener(): void;
45
+ static "__#private@#textLayers": Map<any, any>;
46
+ static "__#private@#selectionChangeAbortController": null;
47
+ static "__#private@#removeGlobalSelectionListener"(textLayerDiv: any): void;
48
+ static "__#private@#enableGlobalSelectionListener"(globalAbortSignal: any): void;
44
49
  /**
45
50
  * @param {TextLayerBuilderOptions} options
46
51
  */
47
- constructor({ pdfPage, highlighter, accessibilityManager, enablePermissions, onAppend, }: TextLayerBuilderOptions);
52
+ constructor({ pdfPage, highlighter, accessibilityManager, enablePermissions, onAppend, abortSignal, }: TextLayerBuilderOptions);
48
53
  pdfPage: import("../src/display/api").PDFPageProxy;
49
54
  highlighter: import("./text_highlighter").TextHighlighter;
50
55
  accessibilityManager: import("./text_accessibility.js").TextAccessibilityManager;
@@ -54,7 +59,7 @@ export class TextLayerBuilder {
54
59
  * @param {TextLayerBuilderRenderOptions} options
55
60
  * @returns {Promise<void>}
56
61
  */
57
- render({ viewport, textContentParams }: TextLayerBuilderRenderOptions): Promise<void>;
62
+ render({ viewport, images, textContentParams }: TextLayerBuilderRenderOptions): Promise<void>;
58
63
  hide(): void;
59
64
  show(): void;
60
65
  /**
@@ -173,7 +173,7 @@ export function isValidRotation(angle: any): boolean;
173
173
  export function isValidScrollMode(mode: any): boolean;
174
174
  export function isValidSpreadMode(mode: any): boolean;
175
175
  export const MAX_AUTO_SCALE: 1.25;
176
- export const MAX_SCALE: 10;
176
+ export const MAX_SCALE: 25;
177
177
  export const MIN_SCALE: 0.1;
178
178
  export function normalizeWheelEventDelta(evt: any): number;
179
179
  export function normalizeWheelEventDirection(evt: any): number;
@@ -204,12 +204,6 @@ export class ProgressBar {
204
204
  * @param {boolean} [replaceInvisible]
205
205
  */
206
206
  export function removeNullCharacters(str: string, replaceInvisible?: boolean): string;
207
- export namespace RenderingStates {
208
- let INITIAL: number;
209
- let RUNNING: number;
210
- let PAUSED: number;
211
- let FINISHED: number;
212
- }
213
207
  export const SCROLLBAR_PADDING: 40;
214
208
  /**
215
209
  * Scrolls specified element into view of its parent.
@@ -218,14 +212,11 @@ export const SCROLLBAR_PADDING: 40;
218
212
  * specifying the offset from the top left edge.
219
213
  * @param {number} [spot.left]
220
214
  * @param {number} [spot.top]
221
- * @param {boolean} [scrollMatches] - When scrolling search results into view,
222
- * ignore elements that either: Contains marked content identifiers,
223
- * or have the CSS-rule `overflow: hidden;` set. The default value is `false`.
224
215
  */
225
216
  export function scrollIntoView(element: HTMLElement, spot?: {
226
217
  left?: number | undefined;
227
218
  top?: number | undefined;
228
- }, scrollMatches?: boolean): void;
219
+ }): void;
229
220
  export namespace ScrollMode {
230
221
  let UNKNOWN_1: number;
231
222
  export { UNKNOWN_1 as UNKNOWN };
@@ -258,6 +249,7 @@ export namespace TextLayerMode {
258
249
  }
259
250
  export function toggleCheckedBtn(button: any, toggle: any, view?: null): void;
260
251
  export function toggleExpandedBtn(button: any, toggle: any, view?: null): void;
252
+ export function toggleSelectedBtn(button: any, toggle: any, view?: null): void;
261
253
  export const UNKNOWN_SCALE: 0;
262
254
  export const VERTICAL_PADDING: 5;
263
255
  /**
@@ -1,11 +1,11 @@
1
1
  export type PDFPageProxy = import("../src/display/api").PDFPageProxy;
2
2
  export type AnnotationStorage = import("../src/display/annotation_storage").AnnotationStorage;
3
3
  export type PageViewport = import("../src/display/display_utils").PageViewport;
4
- export type IPDFLinkService = import("./interfaces").IPDFLinkService;
4
+ export type PDFLinkService = import("./pdf_link_service.js").PDFLinkService;
5
5
  export type XfaLayerBuilderOptions = {
6
6
  pdfPage: PDFPageProxy;
7
7
  annotationStorage?: import("../src/display/annotation_storage").AnnotationStorage | undefined;
8
- linkService: IPDFLinkService;
8
+ linkService: PDFLinkService;
9
9
  xfaHtml?: Object | undefined;
10
10
  };
11
11
  export type XfaLayerBuilderRenderOptions = {
@@ -19,7 +19,7 @@ export type XfaLayerBuilderRenderOptions = {
19
19
  * @typedef {Object} XfaLayerBuilderOptions
20
20
  * @property {PDFPageProxy} pdfPage
21
21
  * @property {AnnotationStorage} [annotationStorage]
22
- * @property {IPDFLinkService} linkService
22
+ * @property {PDFLinkService} linkService
23
23
  * @property {Object} [xfaHtml]
24
24
  */
25
25
  /**
@@ -34,7 +34,7 @@ export class XfaLayerBuilder {
34
34
  constructor({ pdfPage, annotationStorage, linkService, xfaHtml, }: XfaLayerBuilderOptions);
35
35
  pdfPage: import("../src/display/api").PDFPageProxy;
36
36
  annotationStorage: import("../src/display/annotation_storage").AnnotationStorage;
37
- linkService: import("./interfaces").IPDFLinkService;
37
+ linkService: import("./pdf_link_service.js").PDFLinkService;
38
38
  xfaHtml: Object;
39
39
  div: HTMLDivElement | null;
40
40
  _cancelled: boolean;
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "unpdf",
3
3
  "type": "module",
4
- "version": "1.3.2",
5
- "packageManager": "pnpm@10.17.0",
4
+ "version": "1.5.0",
5
+ "packageManager": "pnpm@10.33.0",
6
6
  "description": "PDF extraction and rendering across all JavaScript runtimes",
7
7
  "author": "Johann Schopplich <hello@johannschopplich.com>",
8
8
  "license": "MIT",
@@ -15,10 +15,17 @@
15
15
  "url": "https://github.com/unjs/unpdf/issues"
16
16
  },
17
17
  "keywords": [
18
+ "cloudflare",
19
+ "edge",
20
+ "extract",
18
21
  "parse",
19
- "pdfjs-dist",
20
22
  "pdf",
21
- "serverless"
23
+ "pdf.js",
24
+ "pdfjs-dist",
25
+ "rendering",
26
+ "serverless",
27
+ "text-extraction",
28
+ "workers"
22
29
  ],
23
30
  "sideEffects": false,
24
31
  "exports": {
@@ -70,23 +77,21 @@
70
77
  }
71
78
  },
72
79
  "devDependencies": {
73
- "@antfu/eslint-config": "^5.3.0",
74
- "@napi-rs/canvas": "^0.1.80",
75
- "@rollup/plugin-alias": "^5.1.1",
76
- "@rollup/plugin-inject": "^5.0.5",
77
- "@rollup/plugin-node-resolve": "^16.0.1",
78
- "@rollup/plugin-replace": "^6.0.2",
79
- "@rollup/plugin-terser": "^0.4.4",
80
- "@rollup/plugin-typescript": "^12.1.4",
81
- "@types/node": "^24.5.2",
82
- "bumpp": "^10.2.3",
83
- "eslint": "^9.35.0",
84
- "fast-glob": "^3.3.3",
85
- "pdfjs-dist": "~5.4.149",
86
- "rollup": "^4.51.0",
80
+ "@antfu/eslint-config": "^8.2.0",
81
+ "@napi-rs/canvas": "^0.1.97",
82
+ "@rollup/plugin-node-resolve": "^16.0.3",
83
+ "@rollup/plugin-replace": "^6.0.3",
84
+ "@rollup/plugin-typescript": "^12.3.0",
85
+ "@types/node": "^24.12.2",
86
+ "bumpp": "^11.0.1",
87
+ "eslint": "^10.2.0",
88
+ "pdfjs-dist": "~5.6.205",
89
+ "rollup": "^4.60.1",
90
+ "rollup-plugin-esbuild": "^6.2.1",
91
+ "tinyglobby": "^0.2.16",
87
92
  "tslib": "^2.8.1",
88
- "typescript": "^5.9.2",
93
+ "typescript": "^6.0.2",
89
94
  "unbuild": "^3.6.1",
90
- "vitest": "^3.2.4"
95
+ "vitest": "^4.1.4"
91
96
  }
92
97
  }
@@ -1,25 +0,0 @@
1
- export class BaseCMapReaderFactory {
2
- constructor({ baseUrl, isCompressed }: {
3
- baseUrl?: null | undefined;
4
- isCompressed?: boolean | undefined;
5
- });
6
- baseUrl: any;
7
- isCompressed: boolean;
8
- fetch({ name }: {
9
- name: any;
10
- }): Promise<{
11
- cMapData: Uint8Array<ArrayBufferLike>;
12
- isCompressed: boolean;
13
- }>;
14
- /**
15
- * @ignore
16
- * @returns {Promise<Uint8Array>}
17
- */
18
- _fetch(url: any): Promise<Uint8Array>;
19
- }
20
- export class DOMCMapReaderFactory extends BaseCMapReaderFactory {
21
- /**
22
- * @ignore
23
- */
24
- _fetch(url: any): Promise<Uint8Array<any>>;
25
- }
@@ -1,20 +0,0 @@
1
- export class BaseStandardFontDataFactory {
2
- constructor({ baseUrl }: {
3
- baseUrl?: null | undefined;
4
- });
5
- baseUrl: any;
6
- fetch({ filename }: {
7
- filename: any;
8
- }): Promise<Uint8Array<ArrayBufferLike>>;
9
- /**
10
- * @ignore
11
- * @returns {Promise<Uint8Array>}
12
- */
13
- _fetch(url: any): Promise<Uint8Array>;
14
- }
15
- export class DOMStandardFontDataFactory extends BaseStandardFontDataFactory {
16
- /**
17
- * @ignore
18
- */
19
- _fetch(url: any): Promise<Uint8Array<any>>;
20
- }
@@ -1,20 +0,0 @@
1
- export class BaseWasmFactory {
2
- constructor({ baseUrl }: {
3
- baseUrl?: null | undefined;
4
- });
5
- baseUrl: any;
6
- fetch({ filename }: {
7
- filename: any;
8
- }): Promise<Uint8Array<ArrayBufferLike>>;
9
- /**
10
- * @ignore
11
- * @returns {Promise<Uint8Array>}
12
- */
13
- _fetch(url: any): Promise<Uint8Array>;
14
- }
15
- export class DOMWasmFactory extends BaseWasmFactory {
16
- /**
17
- * @ignore
18
- */
19
- _fetch(url: any): Promise<Uint8Array<any>>;
20
- }
@@ -1,174 +0,0 @@
1
- export type PDFPageProxy = import("../src/display/api").PDFPageProxy;
2
- export type PageViewport = import("../src/display/display_utils").PageViewport;
3
- export type RenderingStates = any;
4
- /**
5
- * @interface
6
- */
7
- export class IDownloadManager {
8
- /**
9
- * @param {Uint8Array} data
10
- * @param {string} filename
11
- * @param {string} [contentType]
12
- */
13
- downloadData(data: Uint8Array, filename: string, contentType?: string): void;
14
- /**
15
- * @param {Uint8Array} data
16
- * @param {string} filename
17
- * @param {string | null} [dest]
18
- * @returns {boolean} Indicating if the data was opened.
19
- */
20
- openOrDownloadData(data: Uint8Array, filename: string, dest?: string | null): boolean;
21
- /**
22
- * @param {Uint8Array} data
23
- * @param {string} url
24
- * @param {string} filename
25
- */
26
- download(data: Uint8Array, url: string, filename: string): void;
27
- }
28
- /**
29
- * @interface
30
- */
31
- export class IL10n {
32
- /**
33
- * @returns {string} - The current locale.
34
- */
35
- getLanguage(): string;
36
- /**
37
- * @returns {string} - 'rtl' or 'ltr'.
38
- */
39
- getDirection(): string;
40
- /**
41
- * Translates text identified by the key and adds/formats data using the args
42
- * property bag. If the key was not found, translation falls back to the
43
- * fallback text.
44
- * @param {Array | string} ids
45
- * @param {Object | null} [args]
46
- * @param {string} [fallback]
47
- * @returns {Promise<string>}
48
- */
49
- get(ids: any[] | string, args?: Object | null, fallback?: string): Promise<string>;
50
- /**
51
- * Translates HTML element.
52
- * @param {HTMLElement} element
53
- * @returns {Promise<void>}
54
- */
55
- translate(element: HTMLElement): Promise<void>;
56
- /**
57
- * Pause the localization.
58
- */
59
- pause(): void;
60
- /**
61
- * Resume the localization.
62
- */
63
- resume(): void;
64
- }
65
- /** @typedef {import("../src/display/api").PDFPageProxy} PDFPageProxy */
66
- /** @typedef {import("../src/display/display_utils").PageViewport} PageViewport */
67
- /** @typedef {import("./ui_utils").RenderingStates} RenderingStates */
68
- /**
69
- * @interface
70
- */
71
- export class IPDFLinkService {
72
- /**
73
- * @type {number}
74
- */
75
- get pagesCount(): number;
76
- /**
77
- * @param {number} value
78
- */
79
- set page(value: number);
80
- /**
81
- * @type {number}
82
- */
83
- get page(): number;
84
- /**
85
- * @param {number} value
86
- */
87
- set rotation(value: number);
88
- /**
89
- * @type {number}
90
- */
91
- get rotation(): number;
92
- /**
93
- * @type {boolean}
94
- */
95
- get isInPresentationMode(): boolean;
96
- /**
97
- * @param {boolean} value
98
- */
99
- set externalLinkEnabled(value: boolean);
100
- /**
101
- * @type {boolean}
102
- */
103
- get externalLinkEnabled(): boolean;
104
- /**
105
- * @param {string|Array} dest - The named, or explicit, PDF destination.
106
- */
107
- goToDestination(dest: string | any[]): Promise<void>;
108
- /**
109
- * @param {number|string} val - The page number, or page label.
110
- */
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;
119
- /**
120
- * @param {HTMLAnchorElement} link
121
- * @param {string} url
122
- * @param {boolean} [newWindow]
123
- */
124
- addLinkAttributes(link: HTMLAnchorElement, url: string, newWindow?: boolean): void;
125
- /**
126
- * @param dest - The PDF destination object.
127
- * @returns {string} The hyperlink to the PDF object.
128
- */
129
- getDestinationHash(dest: any): string;
130
- /**
131
- * @param hash - The PDF parameters/hash.
132
- * @returns {string} The hyperlink to the PDF object.
133
- */
134
- getAnchorUrl(hash: any): string;
135
- /**
136
- * @param {string} hash
137
- */
138
- setHash(hash: string): void;
139
- /**
140
- * @param {string} action
141
- */
142
- executeNamedAction(action: string): void;
143
- /**
144
- * @param {Object} action
145
- */
146
- executeSetOCGState(action: Object): void;
147
- }
148
- /**
149
- * @interface
150
- */
151
- export class IPDFPrintServiceFactory {
152
- static initGlobals(): void;
153
- static get supportsPrinting(): boolean;
154
- static createPrintService(): void;
155
- }
156
- /**
157
- * @interface
158
- */
159
- export class IRenderableView {
160
- /** @type {function | null} */
161
- resume: Function | null;
162
- /**
163
- * @type {string} - Unique ID for rendering queue.
164
- */
165
- get renderingId(): string;
166
- /**
167
- * @type {RenderingStates}
168
- */
169
- get renderingState(): RenderingStates;
170
- /**
171
- * @returns {Promise} Resolved on draw completion.
172
- */
173
- draw(): Promise<any>;
174
- }