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.
- package/README.md +22 -38
- package/dist/index.d.cts +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/pdfjs.mjs +107 -1
- package/dist/types/src/display/annotation_layer.d.ts +42 -17
- package/dist/types/src/display/annotation_storage.d.ts +10 -8
- package/dist/types/src/display/api.d.ts +93 -63
- package/dist/types/src/display/api_utils.d.ts +1 -1
- package/dist/types/src/display/binary_data_factory.d.ts +26 -0
- package/dist/types/src/display/canvas.d.ts +19 -16
- package/dist/types/src/display/canvas_dependency_tracker.d.ts +99 -27
- package/dist/types/src/display/canvas_factory.d.ts +3 -1
- package/dist/types/src/display/display_utils.d.ts +25 -2
- package/dist/types/src/display/draw_layer.d.ts +2 -6
- package/dist/types/src/display/editor/alt_text.d.ts +1 -1
- package/dist/types/src/display/editor/annotation_editor_layer.d.ts +11 -14
- package/dist/types/src/display/editor/color_picker.d.ts +2 -2
- package/dist/types/src/display/editor/comment.d.ts +32 -5
- package/dist/types/src/display/editor/draw.d.ts +3 -7
- package/dist/types/src/display/editor/drawers/freedraw.d.ts +4 -3
- package/dist/types/src/display/editor/drawers/highlight.d.ts +2 -1
- package/dist/types/src/display/editor/drawers/signaturedraw.d.ts +13 -13
- package/dist/types/src/display/editor/editor.d.ts +81 -26
- package/dist/types/src/display/editor/freetext.d.ts +3 -3
- package/dist/types/src/display/editor/highlight.d.ts +6 -4
- package/dist/types/src/display/editor/ink.d.ts +2 -1
- package/dist/types/src/display/editor/signature.d.ts +0 -5
- package/dist/types/src/display/editor/toolbar.d.ts +5 -3
- package/dist/types/src/display/editor/tools.d.ts +58 -4
- package/dist/types/src/display/fetch_stream.d.ts +3 -56
- package/dist/types/src/display/font_loader.d.ts +28 -1
- package/dist/types/src/display/network.d.ts +14 -80
- package/dist/types/src/display/network_stream.d.ts +2 -0
- package/dist/types/src/display/network_utils.d.ts +3 -3
- package/dist/types/src/display/node_stream.d.ts +2 -52
- package/dist/types/src/display/node_utils.d.ts +5 -19
- package/dist/types/src/display/obj_bin_transform_display.d.ts +67 -0
- package/dist/types/src/display/pages_mapper.d.ts +72 -0
- package/dist/types/src/display/pattern_helper.d.ts +9 -4
- package/dist/types/src/display/text_layer.d.ts +16 -10
- package/dist/types/src/display/text_layer_images.d.ts +10 -0
- package/dist/types/src/display/transport_stream.d.ts +8 -64
- package/dist/types/src/display/webgpu_mesh.d.ts +3 -0
- package/dist/types/src/display/worker_options.d.ts +2 -2
- package/dist/types/src/display/xfa_layer.d.ts +3 -3
- package/dist/types/src/pdf.d.ts +9 -1
- package/dist/types/src/{interfaces.d.ts → shared/base_pdf_stream.d.ts} +26 -27
- package/dist/types/src/shared/obj_bin_transform_utils.d.ts +26 -0
- package/dist/types/src/shared/util.d.ts +14 -5
- package/dist/types/web/annotation_editor_layer_builder.d.ts +7 -8
- package/dist/types/web/annotation_layer_builder.d.ts +15 -23
- package/dist/types/web/app_options.d.ts +1 -1
- package/dist/types/web/autolinker.d.ts +3 -2
- package/dist/types/web/base_download_manager.d.ts +24 -0
- package/dist/types/web/base_pdf_page_view.d.ts +6 -6
- package/dist/types/web/comment_manager.d.ts +20 -0
- package/dist/types/web/download_manager.d.ts +3 -12
- package/dist/types/web/draw_layer_builder.d.ts +0 -12
- package/dist/types/web/genericl10n.d.ts +6 -10
- package/dist/types/web/l10n.d.ts +3 -6
- package/dist/types/web/menu.d.ts +11 -0
- package/dist/types/web/pdf_find_controller.d.ts +9 -11
- package/dist/types/web/pdf_history.d.ts +3 -3
- package/dist/types/web/pdf_link_service.d.ts +4 -8
- package/dist/types/web/pdf_page_detail_view.d.ts +1 -7
- package/dist/types/web/pdf_page_view.d.ts +23 -12
- package/dist/types/web/pdf_rendering_queue.d.ts +10 -14
- package/dist/types/web/pdf_thumbnail_view.d.ts +18 -42
- package/dist/types/web/pdf_thumbnail_viewer.d.ts +57 -13
- package/dist/types/web/pdf_viewer.component.d.ts +1 -1
- package/dist/types/web/pdf_viewer.d.ts +40 -28
- package/dist/types/web/renderable_view.d.ts +33 -0
- package/dist/types/web/sidebar.d.ts +65 -0
- package/dist/types/web/struct_tree_layer_builder.d.ts +1 -1
- package/dist/types/web/text_accessibility.d.ts +1 -1
- package/dist/types/web/text_layer_builder.d.ts +11 -6
- package/dist/types/web/ui_utils.d.ts +3 -11
- package/dist/types/web/xfa_layer_builder.d.ts +4 -4
- package/package.json +25 -20
- package/dist/types/src/display/cmap_reader_factory.d.ts +0 -25
- package/dist/types/src/display/standard_fontdata_factory.d.ts +0 -20
- package/dist/types/src/display/wasm_factory.d.ts +0 -20
- 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
|
+
}
|
|
@@ -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:
|
|
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
|
-
}
|
|
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
|
|
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:
|
|
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 {
|
|
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("./
|
|
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.
|
|
5
|
-
"packageManager": "pnpm@10.
|
|
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
|
-
"
|
|
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": "^
|
|
74
|
-
"@napi-rs/canvas": "^0.1.
|
|
75
|
-
"@rollup/plugin-
|
|
76
|
-
"@rollup/plugin-
|
|
77
|
-
"@rollup/plugin-
|
|
78
|
-
"@
|
|
79
|
-
"
|
|
80
|
-
"
|
|
81
|
-
"
|
|
82
|
-
"
|
|
83
|
-
"
|
|
84
|
-
"
|
|
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": "^
|
|
93
|
+
"typescript": "^6.0.2",
|
|
89
94
|
"unbuild": "^3.6.1",
|
|
90
|
-
"vitest": "^
|
|
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
|
-
}
|