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
|
@@ -164,6 +164,7 @@ export namespace DrawOPS {
|
|
|
164
164
|
let moveTo: number;
|
|
165
165
|
let lineTo: number;
|
|
166
166
|
let curveTo: number;
|
|
167
|
+
let quadraticCurveTo: number;
|
|
167
168
|
let closePath: number;
|
|
168
169
|
}
|
|
169
170
|
export class FeatureTest {
|
|
@@ -171,6 +172,8 @@ export class FeatureTest {
|
|
|
171
172
|
static get isEvalSupported(): any;
|
|
172
173
|
static get isOffscreenCanvasSupported(): any;
|
|
173
174
|
static get isImageDecoderSupported(): any;
|
|
175
|
+
static get isFloat16ArraySupported(): any;
|
|
176
|
+
static get isSanitizerSupported(): any;
|
|
174
177
|
static get platform(): any;
|
|
175
178
|
static get isCSSRoundSupported(): any;
|
|
176
179
|
}
|
|
@@ -183,7 +186,6 @@ export class FormatError extends FormatError_base {
|
|
|
183
186
|
[x: string]: any;
|
|
184
187
|
constructor(msg: any);
|
|
185
188
|
}
|
|
186
|
-
export function fromBase64Util(str: any): any;
|
|
187
189
|
export function getModificationDate(date?: Date): string;
|
|
188
190
|
export function getUuid(): string;
|
|
189
191
|
export function getVerbosityLevel(): number;
|
|
@@ -203,7 +205,15 @@ export function isArrayEqual(arr1: any, arr2: any): boolean;
|
|
|
203
205
|
export const isNodeJS: any;
|
|
204
206
|
export const LINE_DESCENT_FACTOR: 0.35;
|
|
205
207
|
export const LINE_FACTOR: 1.35;
|
|
208
|
+
export function makeArr(): never[];
|
|
209
|
+
export function makeMap(): Map<any, any>;
|
|
210
|
+
export function makeObj(): any;
|
|
206
211
|
export function MathClamp(v: any, min: any, max: any): number;
|
|
212
|
+
export namespace MeshFigureType {
|
|
213
|
+
let TRIANGLES: number;
|
|
214
|
+
let LATTICE: number;
|
|
215
|
+
let PATCH: number;
|
|
216
|
+
}
|
|
207
217
|
export function normalizeUnicode(str: any): any;
|
|
208
218
|
export function objectSize(obj: any): number;
|
|
209
219
|
export namespace OPS {
|
|
@@ -354,6 +364,7 @@ export function string32(value: any): string;
|
|
|
354
364
|
export function stringToBytes(str: any): Uint8Array<any>;
|
|
355
365
|
export function stringToPDFString(str: any, keepEscapeSequence?: boolean): string;
|
|
356
366
|
export function stringToUTF8String(str: any): string;
|
|
367
|
+
export function stripPath(str: any): any;
|
|
357
368
|
export namespace TextRenderingMode {
|
|
358
369
|
export let FILL: number;
|
|
359
370
|
export let STROKE: number;
|
|
@@ -367,8 +378,6 @@ export namespace TextRenderingMode {
|
|
|
367
378
|
export let FILL_STROKE_MASK: number;
|
|
368
379
|
export let ADD_TO_PATH_FLAG: number;
|
|
369
380
|
}
|
|
370
|
-
export function toBase64Util(arr: any): any;
|
|
371
|
-
export function toHexUtil(arr: any): any;
|
|
372
381
|
declare const UnknownErrorException_base: any;
|
|
373
382
|
export class UnknownErrorException extends UnknownErrorException_base {
|
|
374
383
|
[x: string]: any;
|
|
@@ -402,8 +411,8 @@ export class Util {
|
|
|
402
411
|
static intersect(rect1: any, rect2: any): number[] | null;
|
|
403
412
|
static pointBoundingBox(x: any, y: any, minMax: any): void;
|
|
404
413
|
static rectBoundingBox(x0: any, y0: any, x1: any, y1: 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;
|
|
414
|
+
static "__#private@#getExtremumOnCurve"(x0: any, x1: any, x2: any, x3: any, y0: any, y1: any, y2: any, y3: any, t: any, minMax: any): void;
|
|
415
|
+
static "__#private@#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;
|
|
407
416
|
static bezierBoundingBox(x0: any, y0: any, x1: any, y1: any, x2: any, y2: any, x3: any, y3: any, minMax: any): void;
|
|
408
417
|
}
|
|
409
418
|
export namespace VerbosityLevel {
|
|
@@ -2,13 +2,12 @@ export type PDFPageProxy = import("../src/display/api").PDFPageProxy;
|
|
|
2
2
|
export type PageViewport = import("../src/display/display_utils").PageViewport;
|
|
3
3
|
export type AnnotationEditorUIManager = import("../src/display/editor/tools.js").AnnotationEditorUIManager;
|
|
4
4
|
export type TextAccessibilityManager = import("./text_accessibility.js").TextAccessibilityManager;
|
|
5
|
-
export type IL10n = import("./interfaces").IL10n;
|
|
6
5
|
export type AnnotationLayer = import("../src/display/annotation_layer.js").AnnotationLayer;
|
|
7
6
|
export type StructTreeLayerBuilder = any;
|
|
8
7
|
export type AnnotationEditorLayerBuilderOptions = {
|
|
9
8
|
uiManager?: import("../src/pdf").AnnotationEditorUIManager | undefined;
|
|
10
|
-
|
|
11
|
-
l10n?:
|
|
9
|
+
pageIndex: number;
|
|
10
|
+
l10n?: L10n;
|
|
12
11
|
structTreeLayer?: StructTreeLayerBuilder;
|
|
13
12
|
accessibilityManager?: import("./text_accessibility.js").TextAccessibilityManager | undefined;
|
|
14
13
|
annotationLayer?: import("../src/pdf").AnnotationLayer | undefined;
|
|
@@ -26,8 +25,8 @@ export type AnnotationEditorLayerBuilderRenderOptions = {
|
|
|
26
25
|
/**
|
|
27
26
|
* @typedef {Object} AnnotationEditorLayerBuilderOptions
|
|
28
27
|
* @property {AnnotationEditorUIManager} [uiManager]
|
|
29
|
-
* @property {
|
|
30
|
-
* @property {
|
|
28
|
+
* @property {number} pageIndex
|
|
29
|
+
* @property {L10n} [l10n]
|
|
31
30
|
* @property {StructTreeLayerBuilder} [structTreeLayer]
|
|
32
31
|
* @property {TextAccessibilityManager} [accessibilityManager]
|
|
33
32
|
* @property {AnnotationLayer} [annotationLayer]
|
|
@@ -45,12 +44,13 @@ export class AnnotationEditorLayerBuilder {
|
|
|
45
44
|
* @param {AnnotationEditorLayerBuilderOptions} options
|
|
46
45
|
*/
|
|
47
46
|
constructor(options: AnnotationEditorLayerBuilderOptions);
|
|
48
|
-
|
|
47
|
+
pageIndex: number;
|
|
49
48
|
accessibilityManager: import("./text_accessibility.js").TextAccessibilityManager | undefined;
|
|
50
|
-
l10n:
|
|
49
|
+
l10n: any;
|
|
51
50
|
annotationEditorLayer: AnnotationEditorLayer | null;
|
|
52
51
|
div: HTMLDivElement | null;
|
|
53
52
|
_cancelled: boolean;
|
|
53
|
+
updatePageIndex(newPageIndex: any): void;
|
|
54
54
|
/**
|
|
55
55
|
* @param {AnnotationEditorLayerBuilderRenderOptions} options
|
|
56
56
|
* @returns {Promise<void>}
|
|
@@ -61,5 +61,4 @@ export class AnnotationEditorLayerBuilder {
|
|
|
61
61
|
show(): void;
|
|
62
62
|
#private;
|
|
63
63
|
}
|
|
64
|
-
import { GenericL10n } from "./genericl10n";
|
|
65
64
|
import { AnnotationEditorLayer } from "../src/pdf";
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
export type PDFPageProxy = import("../src/display/api").PDFPageProxy;
|
|
2
2
|
export type PageViewport = import("../src/display/display_utils").PageViewport;
|
|
3
3
|
export type AnnotationStorage = import("../src/display/annotation_storage").AnnotationStorage;
|
|
4
|
-
export type IDownloadManager = import("./interfaces").IDownloadManager;
|
|
5
|
-
export type IPDFLinkService = import("./interfaces").IPDFLinkService;
|
|
6
4
|
export type StructTreeLayerBuilder = import("./struct_tree_layer_builder.js").StructTreeLayerBuilder;
|
|
7
5
|
export type TextAccessibilityManager = import("./text_accessibility.js").TextAccessibilityManager;
|
|
8
6
|
export type AnnotationEditorUIManager = import("../src/display/editor/tools.js").AnnotationEditorUIManager;
|
|
7
|
+
export type CommentManager = import("./comment_manager.js").CommentManager;
|
|
8
|
+
export type PDFLinkService = import("./pdf_link_service.js").PDFLinkService;
|
|
9
|
+
export type BaseDownloadManager = import("./base_download_manager.js").BaseDownloadManager;
|
|
9
10
|
export type AnnotationLayerBuilderOptions = {
|
|
10
11
|
pdfPage: PDFPageProxy;
|
|
11
12
|
annotationStorage?: import("../src/display/annotation_storage").AnnotationStorage | undefined;
|
|
@@ -15,8 +16,8 @@ export type AnnotationLayerBuilderOptions = {
|
|
|
15
16
|
*/
|
|
16
17
|
imageResourcesPath?: string | undefined;
|
|
17
18
|
renderForms: boolean;
|
|
18
|
-
linkService:
|
|
19
|
-
downloadManager?: import("./
|
|
19
|
+
linkService: PDFLinkService;
|
|
20
|
+
downloadManager?: import("./base_download_manager.js").BaseDownloadManager | undefined;
|
|
20
21
|
enableComment?: boolean | undefined;
|
|
21
22
|
enableScripting?: boolean | undefined;
|
|
22
23
|
hasJSActionsPromise?: Promise<boolean> | undefined;
|
|
@@ -27,6 +28,7 @@ export type AnnotationLayerBuilderOptions = {
|
|
|
27
28
|
accessibilityManager?: import("./text_accessibility.js").TextAccessibilityManager | undefined;
|
|
28
29
|
annotationEditorUIManager?: import("../src/pdf").AnnotationEditorUIManager | undefined;
|
|
29
30
|
onAppend?: Function | undefined;
|
|
31
|
+
commentManager?: import("./comment_manager.js").CommentManager | undefined;
|
|
30
32
|
};
|
|
31
33
|
export type AnnotationLayerBuilderRenderOptions = {
|
|
32
34
|
viewport: PageViewport;
|
|
@@ -36,11 +38,6 @@ export type AnnotationLayerBuilderRenderOptions = {
|
|
|
36
38
|
intent?: string | undefined;
|
|
37
39
|
structTreeLayer?: import("./struct_tree_layer_builder.js").StructTreeLayerBuilder | undefined;
|
|
38
40
|
};
|
|
39
|
-
export type InjectLinkAnnotationsOptions = {
|
|
40
|
-
inferredLinks: Array<Object>;
|
|
41
|
-
viewport: PageViewport;
|
|
42
|
-
structTreeLayer?: import("./struct_tree_layer_builder.js").StructTreeLayerBuilder | undefined;
|
|
43
|
-
};
|
|
44
41
|
/**
|
|
45
42
|
* @typedef {Object} AnnotationLayerBuilderOptions
|
|
46
43
|
* @property {PDFPageProxy} pdfPage
|
|
@@ -48,8 +45,8 @@ export type InjectLinkAnnotationsOptions = {
|
|
|
48
45
|
* @property {string} [imageResourcesPath] - Path for image resources, mainly
|
|
49
46
|
* for annotation icons. Include trailing slash.
|
|
50
47
|
* @property {boolean} renderForms
|
|
51
|
-
* @property {
|
|
52
|
-
* @property {
|
|
48
|
+
* @property {PDFLinkService} linkService
|
|
49
|
+
* @property {BaseDownloadManager} [downloadManager]
|
|
53
50
|
* @property {boolean} [enableComment]
|
|
54
51
|
* @property {boolean} [enableScripting]
|
|
55
52
|
* @property {Promise<boolean>} [hasJSActionsPromise]
|
|
@@ -59,6 +56,7 @@ export type InjectLinkAnnotationsOptions = {
|
|
|
59
56
|
* @property {TextAccessibilityManager} [accessibilityManager]
|
|
60
57
|
* @property {AnnotationEditorUIManager} [annotationEditorUIManager]
|
|
61
58
|
* @property {function} [onAppend]
|
|
59
|
+
* @property {CommentManager} [commentManager]
|
|
62
60
|
*/
|
|
63
61
|
/**
|
|
64
62
|
* @typedef {Object} AnnotationLayerBuilderRenderOptions
|
|
@@ -66,20 +64,14 @@ export type InjectLinkAnnotationsOptions = {
|
|
|
66
64
|
* @property {string} [intent] - The default value is "display".
|
|
67
65
|
* @property {StructTreeLayerBuilder} [structTreeLayer]
|
|
68
66
|
*/
|
|
69
|
-
/**
|
|
70
|
-
* @typedef {Object} InjectLinkAnnotationsOptions
|
|
71
|
-
* @property {Array<Object>} inferredLinks
|
|
72
|
-
* @property {PageViewport} viewport
|
|
73
|
-
* @property {StructTreeLayerBuilder} [structTreeLayer]
|
|
74
|
-
*/
|
|
75
67
|
export class AnnotationLayerBuilder {
|
|
76
68
|
/**
|
|
77
69
|
* @param {AnnotationLayerBuilderOptions} options
|
|
78
70
|
*/
|
|
79
|
-
constructor({ pdfPage, linkService, downloadManager, annotationStorage, imageResourcesPath, renderForms, enableComment, enableScripting, hasJSActionsPromise, fieldObjectsPromise, annotationCanvasMap, accessibilityManager, annotationEditorUIManager, onAppend, }: AnnotationLayerBuilderOptions);
|
|
71
|
+
constructor({ pdfPage, linkService, downloadManager, annotationStorage, imageResourcesPath, renderForms, enableComment, commentManager, enableScripting, hasJSActionsPromise, fieldObjectsPromise, annotationCanvasMap, accessibilityManager, annotationEditorUIManager, onAppend, }: AnnotationLayerBuilderOptions);
|
|
80
72
|
pdfPage: import("../src/display/api").PDFPageProxy;
|
|
81
|
-
linkService: import("./
|
|
82
|
-
downloadManager: import("./
|
|
73
|
+
linkService: import("./pdf_link_service.js").PDFLinkService;
|
|
74
|
+
downloadManager: import("./base_download_manager.js").BaseDownloadManager | undefined;
|
|
83
75
|
imageResourcesPath: string;
|
|
84
76
|
renderForms: boolean;
|
|
85
77
|
annotationStorage: import("../src/display/annotation_storage").AnnotationStorage;
|
|
@@ -95,7 +87,7 @@ export class AnnotationLayerBuilder {
|
|
|
95
87
|
annotationLayer: AnnotationLayer | null;
|
|
96
88
|
div: HTMLDivElement | null;
|
|
97
89
|
_cancelled: boolean;
|
|
98
|
-
_eventBus:
|
|
90
|
+
_eventBus: import("./event_utils.js").EventBus;
|
|
99
91
|
/**
|
|
100
92
|
* @param {AnnotationLayerBuilderRenderOptions} options
|
|
101
93
|
* @returns {Promise<void>} A promise that is resolved when rendering of the
|
|
@@ -106,11 +98,11 @@ export class AnnotationLayerBuilder {
|
|
|
106
98
|
hide(internal?: boolean): void;
|
|
107
99
|
hasEditableAnnotations(): boolean;
|
|
108
100
|
/**
|
|
109
|
-
* @param {
|
|
101
|
+
* @param {Array<Object>} inferredLinks
|
|
110
102
|
* @returns {Promise<void>} A promise that is resolved when the inferred links
|
|
111
103
|
* are added to the annotation layer.
|
|
112
104
|
*/
|
|
113
|
-
injectLinkAnnotations(
|
|
105
|
+
injectLinkAnnotations(inferredLinks: Array<Object>): Promise<void>;
|
|
114
106
|
#private;
|
|
115
107
|
}
|
|
116
108
|
import { AnnotationLayer } from "../src/pdf";
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export class BaseDownloadManager {
|
|
2
|
+
_triggerDownload(blobUrl: any, originalUrl: any, filename: any, isAttachment?: boolean): void;
|
|
3
|
+
_getOpenDataUrl(blobUrl: any, filename: any, dest?: null): void;
|
|
4
|
+
/**
|
|
5
|
+
* @param {Uint8Array} data
|
|
6
|
+
* @param {string} filename
|
|
7
|
+
* @param {string} [contentType]
|
|
8
|
+
*/
|
|
9
|
+
downloadData(data: Uint8Array, filename: string, contentType?: string): void;
|
|
10
|
+
/**
|
|
11
|
+
* @param {Uint8Array} data
|
|
12
|
+
* @param {string} filename
|
|
13
|
+
* @param {string | null} [dest]
|
|
14
|
+
* @returns {boolean} Indicating if the data was opened.
|
|
15
|
+
*/
|
|
16
|
+
openOrDownloadData(data: Uint8Array, filename: string, dest?: string | null): boolean;
|
|
17
|
+
/**
|
|
18
|
+
* @param {Uint8Array} data
|
|
19
|
+
* @param {string} url
|
|
20
|
+
* @param {string} filename
|
|
21
|
+
*/
|
|
22
|
+
download(data: Uint8Array, url: string, filename: string): void;
|
|
23
|
+
#private;
|
|
24
|
+
}
|
|
@@ -1,18 +1,17 @@
|
|
|
1
|
-
export class BasePDFPageView {
|
|
1
|
+
export class BasePDFPageView extends RenderableView {
|
|
2
2
|
constructor(options: any);
|
|
3
3
|
canvas: null;
|
|
4
4
|
/** @type {null | HTMLDivElement} */
|
|
5
5
|
div: null | HTMLDivElement;
|
|
6
6
|
enableOptimizedPartialRendering: boolean;
|
|
7
|
+
imagesRightClickMinSize: number;
|
|
7
8
|
eventBus: null;
|
|
8
9
|
id: null;
|
|
10
|
+
imageCoordinates: null;
|
|
9
11
|
pageColors: null;
|
|
10
|
-
|
|
12
|
+
recordedBBoxes: null;
|
|
11
13
|
renderingQueue: null;
|
|
12
|
-
|
|
13
|
-
resume: null;
|
|
14
|
-
set renderingState(state: number);
|
|
15
|
-
get renderingState(): number;
|
|
14
|
+
minDurationToUpdateCanvas: any;
|
|
16
15
|
_createCanvas(onShow: any, hideUntilComplete?: boolean): {
|
|
17
16
|
canvas: HTMLCanvasElement;
|
|
18
17
|
prevCanvas: null;
|
|
@@ -26,3 +25,4 @@ export class BasePDFPageView {
|
|
|
26
25
|
dispatchPageRendered(cssTransform: any, isDetailView: any): void;
|
|
27
26
|
#private;
|
|
28
27
|
}
|
|
28
|
+
import { RenderableView } from "./renderable_view.js";
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export class CommentManager {
|
|
2
|
+
static "__#private@#hasForcedColors": null;
|
|
3
|
+
static _makeCommentColor(color: any, opacity: any): string | null;
|
|
4
|
+
constructor(commentDialog: any, sidebar: any, eventBus: any, linkService: any, overlayManager: any, ltr: any, hasForcedColors: any, globalAbortSignal: any);
|
|
5
|
+
dialogElement: any;
|
|
6
|
+
setSidebarUiManager(uiManager: any): void;
|
|
7
|
+
showSidebar(annotations: any): void;
|
|
8
|
+
hideSidebar(): void;
|
|
9
|
+
removeComments(ids: any): void;
|
|
10
|
+
selectComment(id: any): void;
|
|
11
|
+
addComment(annotation: any): void;
|
|
12
|
+
updateComment(annotation: any): void;
|
|
13
|
+
toggleCommentPopup(editor: any, isSelected: any, visibility: any, isEditable: any): void;
|
|
14
|
+
destroyPopup(): void;
|
|
15
|
+
updatePopupColor(editor: any): void;
|
|
16
|
+
showDialog(uiManager: any, editor: any, posX: any, posY: any, options: any): Promise<void>;
|
|
17
|
+
makeCommentColor(color: any, opacity: any): string | null;
|
|
18
|
+
destroy(): void;
|
|
19
|
+
#private;
|
|
20
|
+
}
|
|
@@ -1,13 +1,4 @@
|
|
|
1
|
-
export
|
|
2
|
-
|
|
3
|
-
* @implements {IDownloadManager}
|
|
4
|
-
*/
|
|
5
|
-
export class DownloadManager implements IDownloadManager {
|
|
6
|
-
downloadData(data: any, filename: any, contentType: any): void;
|
|
7
|
-
/**
|
|
8
|
-
* @returns {boolean} Indicating if the data was opened.
|
|
9
|
-
*/
|
|
10
|
-
openOrDownloadData(data: any, filename: any, dest?: null): boolean;
|
|
11
|
-
download(data: any, url: any, filename: any): void;
|
|
12
|
-
#private;
|
|
1
|
+
export class DownloadManager extends BaseDownloadManager {
|
|
2
|
+
_getOpenDataUrl(blobUrl: any, filename: any, dest?: null): string;
|
|
13
3
|
}
|
|
4
|
+
import { BaseDownloadManager } from "./base_download_manager.js";
|
|
@@ -1,26 +1,14 @@
|
|
|
1
|
-
export type DrawLayerBuilderOptions = {
|
|
2
|
-
pageIndex: number;
|
|
3
|
-
};
|
|
4
1
|
export type DrawLayerBuilderRenderOptions = {
|
|
5
2
|
/**
|
|
6
3
|
* - The default value is "display".
|
|
7
4
|
*/
|
|
8
5
|
intent?: string | undefined;
|
|
9
6
|
};
|
|
10
|
-
/**
|
|
11
|
-
* @typedef {Object} DrawLayerBuilderOptions
|
|
12
|
-
* @property {number} pageIndex
|
|
13
|
-
*/
|
|
14
7
|
/**
|
|
15
8
|
* @typedef {Object} DrawLayerBuilderRenderOptions
|
|
16
9
|
* @property {string} [intent] - The default value is "display".
|
|
17
10
|
*/
|
|
18
11
|
export class DrawLayerBuilder {
|
|
19
|
-
/**
|
|
20
|
-
* @param {DrawLayerBuilderOptions} options
|
|
21
|
-
*/
|
|
22
|
-
constructor(options: DrawLayerBuilderOptions);
|
|
23
|
-
pageIndex: number;
|
|
24
12
|
/**
|
|
25
13
|
* @param {DrawLayerBuilderRenderOptions} options
|
|
26
14
|
* @returns {Promise<void>}
|
|
@@ -1,22 +1,18 @@
|
|
|
1
|
-
export
|
|
2
|
-
/**
|
|
3
|
-
* @implements {IL10n}
|
|
4
|
-
*/
|
|
5
|
-
export class GenericL10n extends L10n implements IL10n {
|
|
1
|
+
export class GenericL10n extends L10n {
|
|
6
2
|
/**
|
|
7
3
|
* Generate the bundles for Fluent.
|
|
8
4
|
* @param {String} defaultLang - The fallback language to use for
|
|
9
5
|
* translations.
|
|
10
6
|
* @param {String} baseLang - The base language to use for translations.
|
|
11
7
|
*/
|
|
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<{
|
|
8
|
+
static "__#private@#generateBundles"(defaultLang: string, baseLang: string): AsyncGenerator<any, void, unknown>;
|
|
9
|
+
static "__#private@#createBundle"(lang: any, baseURL: any, paths: any): Promise<any>;
|
|
10
|
+
static "__#private@#getPaths"(): Promise<{
|
|
15
11
|
baseURL: any;
|
|
16
12
|
paths: any;
|
|
17
13
|
}>;
|
|
18
|
-
static #generateBundlesFallback(lang: any): AsyncGenerator<any, void, unknown>;
|
|
19
|
-
static #createBundleFallback(lang: any): Promise<any>;
|
|
14
|
+
static "__#private@#generateBundlesFallback"(lang: any): AsyncGenerator<any, void, unknown>;
|
|
15
|
+
static "__#private@#createBundleFallback"(lang: any): Promise<any>;
|
|
20
16
|
constructor(lang: any);
|
|
21
17
|
}
|
|
22
18
|
import { L10n } from "./l10n.js";
|
package/dist/types/web/l10n.d.ts
CHANGED
|
@@ -1,14 +1,11 @@
|
|
|
1
|
-
export type IL10n = import("./interfaces").IL10n;
|
|
2
1
|
export const GenericL10n: null;
|
|
3
|
-
/** @typedef {import("./interfaces").IL10n} IL10n */
|
|
4
2
|
/**
|
|
5
3
|
* NOTE: The L10n-implementations should use lowercase language-codes
|
|
6
4
|
* internally.
|
|
7
|
-
* @implements {IL10n}
|
|
8
5
|
*/
|
|
9
|
-
export class L10n
|
|
10
|
-
static #fixupLangCode(langCode: any): any;
|
|
11
|
-
static #isRTL(lang: any): boolean;
|
|
6
|
+
export class L10n {
|
|
7
|
+
static "__#private@#fixupLangCode"(langCode: any): any;
|
|
8
|
+
static "__#private@#isRTL"(lang: any): boolean;
|
|
12
9
|
constructor({ lang, isRTL }: {
|
|
13
10
|
lang: any;
|
|
14
11
|
isRTL: any;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export class Menu {
|
|
2
|
+
/**
|
|
3
|
+
* Create a menu for the given button.
|
|
4
|
+
* @param {HTMLElement} menuContainer
|
|
5
|
+
* @param {HTMLElement} triggeringButton
|
|
6
|
+
* @param {Array<HTMLElement>|null} menuItems
|
|
7
|
+
*/
|
|
8
|
+
constructor(menuContainer: HTMLElement, triggeringButton: HTMLElement, menuItems: Array<HTMLElement> | null);
|
|
9
|
+
destroy(): void;
|
|
10
|
+
#private;
|
|
11
|
+
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
export type PDFDocumentProxy = import("../src/display/api").PDFDocumentProxy;
|
|
2
2
|
export type EventBus = import("./event_utils").EventBus;
|
|
3
|
-
export type
|
|
3
|
+
export type PDFLinkService = import("./pdf_link_service.js").PDFLinkService;
|
|
4
4
|
export type PDFFindControllerOptions = {
|
|
5
5
|
/**
|
|
6
6
|
* - The navigation/linking service.
|
|
7
7
|
*/
|
|
8
|
-
linkService:
|
|
8
|
+
linkService: PDFLinkService;
|
|
9
9
|
/**
|
|
10
10
|
* - The application event bus.
|
|
11
11
|
*/
|
|
@@ -27,7 +27,7 @@ export function getOriginalIndex(diffs: any, pos: any, len: any): any[];
|
|
|
27
27
|
export function normalize(text: any, options?: {}): any[];
|
|
28
28
|
/**
|
|
29
29
|
* @typedef {Object} PDFFindControllerOptions
|
|
30
|
-
* @property {
|
|
30
|
+
* @property {PDFLinkService} linkService - The navigation/linking service.
|
|
31
31
|
* @property {EventBus} eventBus - The application event bus.
|
|
32
32
|
* @property {boolean} [updateMatchesCountOnProgress] - True if the matches
|
|
33
33
|
* count must be updated on progress or only when the last page is reached.
|
|
@@ -41,7 +41,7 @@ export class PDFFindController {
|
|
|
41
41
|
* @param {PDFFindControllerOptions} options
|
|
42
42
|
*/
|
|
43
43
|
constructor({ linkService, eventBus, updateMatchesCountOnProgress }: PDFFindControllerOptions);
|
|
44
|
-
_linkService: import("./
|
|
44
|
+
_linkService: import("./pdf_link_service.js").PDFLinkService;
|
|
45
45
|
_eventBus: import("./event_utils").EventBus;
|
|
46
46
|
/**
|
|
47
47
|
* Callback used to check if a `pageNumber` is currently visible.
|
|
@@ -70,7 +70,6 @@ export class PDFFindController {
|
|
|
70
70
|
/**
|
|
71
71
|
* @typedef {Object} PDFFindControllerScrollMatchIntoViewParams
|
|
72
72
|
* @property {HTMLElement} element
|
|
73
|
-
* @property {number} selectedLeft
|
|
74
73
|
* @property {number} pageIndex
|
|
75
74
|
* @property {number} matchIndex
|
|
76
75
|
*/
|
|
@@ -78,9 +77,8 @@ export class PDFFindController {
|
|
|
78
77
|
* Scroll the current match into view.
|
|
79
78
|
* @param {PDFFindControllerScrollMatchIntoViewParams}
|
|
80
79
|
*/
|
|
81
|
-
scrollMatchIntoView({ element,
|
|
80
|
+
scrollMatchIntoView({ element, pageIndex, matchIndex }: {
|
|
82
81
|
element: HTMLElement;
|
|
83
|
-
selectedLeft: number;
|
|
84
82
|
pageIndex: number;
|
|
85
83
|
matchIndex: number;
|
|
86
84
|
}): void;
|
|
@@ -96,10 +94,10 @@ export class PDFFindController {
|
|
|
96
94
|
matchIdx: null;
|
|
97
95
|
wrapped: boolean;
|
|
98
96
|
} | undefined;
|
|
99
|
-
_extractTextPromises: any
|
|
100
|
-
_pageContents: any
|
|
101
|
-
_pageDiffs: any
|
|
102
|
-
_hasDiacritics: any
|
|
97
|
+
_extractTextPromises: any;
|
|
98
|
+
_pageContents: any;
|
|
99
|
+
_pageDiffs: any;
|
|
100
|
+
_hasDiacritics: any;
|
|
103
101
|
_matchesCountTotal: number | undefined;
|
|
104
102
|
_pagesToSearch: number | null | undefined;
|
|
105
103
|
_pendingFindMatches: Set<any> | undefined;
|
|
@@ -2,7 +2,7 @@ export type PDFHistoryOptions = {
|
|
|
2
2
|
/**
|
|
3
3
|
* - The navigation/linking service.
|
|
4
4
|
*/
|
|
5
|
-
linkService:
|
|
5
|
+
linkService: PDFLinkService;
|
|
6
6
|
/**
|
|
7
7
|
* - The application event bus.
|
|
8
8
|
*/
|
|
@@ -39,7 +39,7 @@ export type PushParameters = {
|
|
|
39
39
|
pageNumber: number;
|
|
40
40
|
};
|
|
41
41
|
export type EventBus = import("./event_utils").EventBus;
|
|
42
|
-
export type
|
|
42
|
+
export type PDFLinkService = import("./pdf_link_service.js").PDFLinkService;
|
|
43
43
|
export function isDestArraysEqual(firstDest: any, secondDest: any): boolean;
|
|
44
44
|
export function isDestHashesEqual(destHash: any, pushHash: any): boolean;
|
|
45
45
|
export class PDFHistory {
|
|
@@ -47,7 +47,7 @@ export class PDFHistory {
|
|
|
47
47
|
* @param {PDFHistoryOptions} options
|
|
48
48
|
*/
|
|
49
49
|
constructor({ linkService, eventBus }: PDFHistoryOptions);
|
|
50
|
-
linkService: import("./
|
|
50
|
+
linkService: import("./pdf_link_service.js").PDFLinkService;
|
|
51
51
|
eventBus: import("./event_utils.js").EventBus;
|
|
52
52
|
_initialized: boolean;
|
|
53
53
|
_fingerprint: string;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
export type EventBus = import("./event_utils").EventBus;
|
|
2
|
-
export type IPDFLinkService = import("./interfaces").IPDFLinkService;
|
|
3
2
|
export type PDFLinkServiceOptions = {
|
|
4
3
|
/**
|
|
5
4
|
* - The application event bus.
|
|
@@ -45,9 +44,8 @@ export namespace LinkTarget {
|
|
|
45
44
|
/**
|
|
46
45
|
* Performs navigation functions inside PDF, such as opening specified page,
|
|
47
46
|
* or destination.
|
|
48
|
-
* @implements {IPDFLinkService}
|
|
49
47
|
*/
|
|
50
|
-
export class PDFLinkService
|
|
48
|
+
export class PDFLinkService {
|
|
51
49
|
/**
|
|
52
50
|
* @param {PDFLinkServiceOptions} options
|
|
53
51
|
*/
|
|
@@ -105,8 +103,9 @@ export class PDFLinkService implements IPDFLinkService {
|
|
|
105
103
|
* @param {number} pageNumber - The page number to scroll to.
|
|
106
104
|
* @param {number} x - The x-coordinate to scroll to in page coordinates.
|
|
107
105
|
* @param {number} y - The y-coordinate to scroll to in page coordinates.
|
|
106
|
+
* @param {Object} [options]
|
|
108
107
|
*/
|
|
109
|
-
goToXY(pageNumber: number, x: number, y: number): void;
|
|
108
|
+
goToXY(pageNumber: number, x: number, y: number, options?: Object): void;
|
|
110
109
|
/**
|
|
111
110
|
* Adds various attributes (href, title, target, rel) to hyperlinks.
|
|
112
111
|
* @param {HTMLAnchorElement} link
|
|
@@ -139,8 +138,5 @@ export class PDFLinkService implements IPDFLinkService {
|
|
|
139
138
|
*/
|
|
140
139
|
executeSetOCGState(action: Object): Promise<void>;
|
|
141
140
|
}
|
|
142
|
-
|
|
143
|
-
* @implements {IPDFLinkService}
|
|
144
|
-
*/
|
|
145
|
-
export class SimpleLinkService extends PDFLinkService implements IPDFLinkService {
|
|
141
|
+
export class SimpleLinkService extends PDFLinkService {
|
|
146
142
|
}
|
|
@@ -1,9 +1,4 @@
|
|
|
1
|
-
export
|
|
2
|
-
/** @typedef {import("./interfaces").IRenderableView} IRenderableView */
|
|
3
|
-
/**
|
|
4
|
-
* @implements {IRenderableView}
|
|
5
|
-
*/
|
|
6
|
-
export class PDFPageDetailView extends BasePDFPageView implements IRenderableView {
|
|
1
|
+
export class PDFPageDetailView extends BasePDFPageView {
|
|
7
2
|
constructor({ pageView }: {
|
|
8
3
|
pageView: any;
|
|
9
4
|
});
|
|
@@ -15,7 +10,6 @@ export class PDFPageDetailView extends BasePDFPageView implements IRenderableVie
|
|
|
15
10
|
*/
|
|
16
11
|
renderingCancelled: boolean;
|
|
17
12
|
pageView: any;
|
|
18
|
-
renderingId: string;
|
|
19
13
|
div: any;
|
|
20
14
|
setPdfPage(pdfPage: any): void;
|
|
21
15
|
get pdfPage(): any;
|