pdfjs-serverless 1.0.1 → 1.2.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 (86) hide show
  1. package/README.md +14 -44
  2. package/dist/index.d.mts +1 -1
  3. package/dist/index.mjs +1 -1
  4. package/dist/types/src/display/annotation_layer.d.ts +49 -16
  5. package/dist/types/src/display/annotation_storage.d.ts +10 -8
  6. package/dist/types/src/display/api.d.ts +134 -126
  7. package/dist/types/src/display/api_utils.d.ts +13 -0
  8. package/dist/types/src/display/binary_data_factory.d.ts +26 -0
  9. package/dist/types/src/display/canvas.d.ts +97 -92
  10. package/dist/types/src/display/canvas_dependency_tracker.d.ts +216 -0
  11. package/dist/types/src/display/canvas_factory.d.ts +3 -1
  12. package/dist/types/src/display/display_utils.d.ts +27 -3
  13. package/dist/types/src/display/draw_layer.d.ts +2 -6
  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 +16 -19
  16. package/dist/types/src/display/editor/color_picker.d.ts +20 -1
  17. package/dist/types/src/display/editor/comment.d.ts +59 -0
  18. package/dist/types/src/display/editor/draw.d.ts +4 -8
  19. package/dist/types/src/display/editor/drawers/freedraw.d.ts +4 -3
  20. package/dist/types/src/display/editor/drawers/highlight.d.ts +2 -1
  21. package/dist/types/src/display/editor/drawers/signaturedraw.d.ts +13 -13
  22. package/dist/types/src/display/editor/editor.d.ts +119 -15
  23. package/dist/types/src/display/editor/freetext.d.ts +11 -7
  24. package/dist/types/src/display/editor/highlight.d.ts +8 -3
  25. package/dist/types/src/display/editor/ink.d.ts +5 -0
  26. package/dist/types/src/display/editor/signature.d.ts +2 -5
  27. package/dist/types/src/display/editor/stamp.d.ts +3 -1
  28. package/dist/types/src/display/editor/toolbar.d.ts +8 -3
  29. package/dist/types/src/display/editor/tools.d.ts +72 -6
  30. package/dist/types/src/display/fetch_stream.d.ts +3 -56
  31. package/dist/types/src/display/font_loader.d.ts +28 -1
  32. package/dist/types/src/display/network.d.ts +14 -80
  33. package/dist/types/src/display/network_stream.d.ts +2 -0
  34. package/dist/types/src/display/network_utils.d.ts +3 -3
  35. package/dist/types/src/display/node_stream.d.ts +2 -52
  36. package/dist/types/src/display/node_utils.d.ts +5 -19
  37. package/dist/types/src/display/obj_bin_transform_display.d.ts +67 -0
  38. package/dist/types/src/display/pages_mapper.d.ts +72 -0
  39. package/dist/types/src/display/pattern_helper.d.ts +9 -4
  40. package/dist/types/src/display/pdf_objects.d.ts +40 -0
  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 +11 -2
  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/scripting_utils.d.ts +2 -0
  51. package/dist/types/src/shared/util.d.ts +21 -8
  52. package/dist/types/web/annotation_editor_layer_builder.d.ts +7 -8
  53. package/dist/types/web/annotation_layer_builder.d.ts +18 -23
  54. package/dist/types/web/app_options.d.ts +1 -1
  55. package/dist/types/web/autolinker.d.ts +3 -2
  56. package/dist/types/web/base_download_manager.d.ts +24 -0
  57. package/dist/types/web/base_pdf_page_view.d.ts +7 -6
  58. package/dist/types/web/comment_manager.d.ts +20 -0
  59. package/dist/types/web/download_manager.d.ts +3 -12
  60. package/dist/types/web/draw_layer_builder.d.ts +0 -12
  61. package/dist/types/web/event_utils.d.ts +1 -1
  62. package/dist/types/web/genericl10n.d.ts +6 -10
  63. package/dist/types/web/l10n.d.ts +3 -6
  64. package/dist/types/web/menu.d.ts +11 -0
  65. package/dist/types/web/pdf_find_controller.d.ts +10 -12
  66. package/dist/types/web/pdf_history.d.ts +3 -3
  67. package/dist/types/web/pdf_link_service.d.ts +10 -7
  68. package/dist/types/web/pdf_page_detail_view.d.ts +2 -7
  69. package/dist/types/web/pdf_page_view.d.ts +39 -17
  70. package/dist/types/web/pdf_rendering_queue.d.ts +10 -14
  71. package/dist/types/web/pdf_thumbnail_view.d.ts +18 -50
  72. package/dist/types/web/pdf_thumbnail_viewer.d.ts +57 -13
  73. package/dist/types/web/pdf_viewer.component.d.ts +1 -1
  74. package/dist/types/web/pdf_viewer.d.ts +95 -29
  75. package/dist/types/web/renderable_view.d.ts +33 -0
  76. package/dist/types/web/sidebar.d.ts +65 -0
  77. package/dist/types/web/struct_tree_layer_builder.d.ts +1 -1
  78. package/dist/types/web/text_accessibility.d.ts +1 -1
  79. package/dist/types/web/text_layer_builder.d.ts +11 -6
  80. package/dist/types/web/ui_utils.d.ts +3 -11
  81. package/dist/types/web/xfa_layer_builder.d.ts +4 -4
  82. package/package.json +18 -15
  83. package/dist/types/src/display/cmap_reader_factory.d.ts +0 -25
  84. package/dist/types/src/display/standard_fontdata_factory.d.ts +0 -20
  85. package/dist/types/src/display/wasm_factory.d.ts +0 -20
  86. package/dist/types/web/interfaces.d.ts +0 -167
@@ -1,167 +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
- * @param {HTMLAnchorElement} link
114
- * @param {string} url
115
- * @param {boolean} [newWindow]
116
- */
117
- addLinkAttributes(link: HTMLAnchorElement, url: string, newWindow?: boolean): void;
118
- /**
119
- * @param dest - The PDF destination object.
120
- * @returns {string} The hyperlink to the PDF object.
121
- */
122
- getDestinationHash(dest: any): string;
123
- /**
124
- * @param hash - The PDF parameters/hash.
125
- * @returns {string} The hyperlink to the PDF object.
126
- */
127
- getAnchorUrl(hash: any): string;
128
- /**
129
- * @param {string} hash
130
- */
131
- setHash(hash: string): void;
132
- /**
133
- * @param {string} action
134
- */
135
- executeNamedAction(action: string): void;
136
- /**
137
- * @param {Object} action
138
- */
139
- executeSetOCGState(action: Object): void;
140
- }
141
- /**
142
- * @interface
143
- */
144
- export class IPDFPrintServiceFactory {
145
- static initGlobals(): void;
146
- static get supportsPrinting(): boolean;
147
- static createPrintService(): void;
148
- }
149
- /**
150
- * @interface
151
- */
152
- export class IRenderableView {
153
- /** @type {function | null} */
154
- resume: Function | null;
155
- /**
156
- * @type {string} - Unique ID for rendering queue.
157
- */
158
- get renderingId(): string;
159
- /**
160
- * @type {RenderingStates}
161
- */
162
- get renderingState(): RenderingStates;
163
- /**
164
- * @returns {Promise} Resolved on draw completion.
165
- */
166
- draw(): Promise<any>;
167
- }