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.
- package/README.md +14 -44
- package/dist/index.d.mts +1 -1
- package/dist/index.mjs +1 -1
- package/dist/types/src/display/annotation_layer.d.ts +49 -16
- package/dist/types/src/display/annotation_storage.d.ts +10 -8
- package/dist/types/src/display/api.d.ts +134 -126
- package/dist/types/src/display/api_utils.d.ts +13 -0
- package/dist/types/src/display/binary_data_factory.d.ts +26 -0
- package/dist/types/src/display/canvas.d.ts +97 -92
- package/dist/types/src/display/canvas_dependency_tracker.d.ts +216 -0
- package/dist/types/src/display/canvas_factory.d.ts +3 -1
- package/dist/types/src/display/display_utils.d.ts +27 -3
- 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 +16 -19
- package/dist/types/src/display/editor/color_picker.d.ts +20 -1
- package/dist/types/src/display/editor/comment.d.ts +59 -0
- package/dist/types/src/display/editor/draw.d.ts +4 -8
- 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 +119 -15
- package/dist/types/src/display/editor/freetext.d.ts +11 -7
- package/dist/types/src/display/editor/highlight.d.ts +8 -3
- package/dist/types/src/display/editor/ink.d.ts +5 -0
- package/dist/types/src/display/editor/signature.d.ts +2 -5
- package/dist/types/src/display/editor/stamp.d.ts +3 -1
- package/dist/types/src/display/editor/toolbar.d.ts +8 -3
- package/dist/types/src/display/editor/tools.d.ts +72 -6
- 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/pdf_objects.d.ts +40 -0
- 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 +11 -2
- 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/scripting_utils.d.ts +2 -0
- package/dist/types/src/shared/util.d.ts +21 -8
- package/dist/types/web/annotation_editor_layer_builder.d.ts +7 -8
- package/dist/types/web/annotation_layer_builder.d.ts +18 -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 +7 -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/event_utils.d.ts +1 -1
- 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 +10 -12
- package/dist/types/web/pdf_history.d.ts +3 -3
- package/dist/types/web/pdf_link_service.d.ts +10 -7
- package/dist/types/web/pdf_page_detail_view.d.ts +2 -7
- package/dist/types/web/pdf_page_view.d.ts +39 -17
- package/dist/types/web/pdf_rendering_queue.d.ts +10 -14
- package/dist/types/web/pdf_thumbnail_view.d.ts +18 -50
- 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 +95 -29
- 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 +18 -15
- 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 -167
|
@@ -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,9 @@ 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;
|
|
21
|
+
enableComment?: boolean | undefined;
|
|
20
22
|
enableScripting?: boolean | undefined;
|
|
21
23
|
hasJSActionsPromise?: Promise<boolean> | undefined;
|
|
22
24
|
fieldObjectsPromise?: Promise<{
|
|
@@ -26,6 +28,7 @@ export type AnnotationLayerBuilderOptions = {
|
|
|
26
28
|
accessibilityManager?: import("./text_accessibility.js").TextAccessibilityManager | undefined;
|
|
27
29
|
annotationEditorUIManager?: import("../src/pdf").AnnotationEditorUIManager | undefined;
|
|
28
30
|
onAppend?: Function | undefined;
|
|
31
|
+
commentManager?: import("./comment_manager.js").CommentManager | undefined;
|
|
29
32
|
};
|
|
30
33
|
export type AnnotationLayerBuilderRenderOptions = {
|
|
31
34
|
viewport: PageViewport;
|
|
@@ -35,11 +38,6 @@ export type AnnotationLayerBuilderRenderOptions = {
|
|
|
35
38
|
intent?: string | undefined;
|
|
36
39
|
structTreeLayer?: import("./struct_tree_layer_builder.js").StructTreeLayerBuilder | undefined;
|
|
37
40
|
};
|
|
38
|
-
export type InjectLinkAnnotationsOptions = {
|
|
39
|
-
inferredLinks: Array<Object>;
|
|
40
|
-
viewport: PageViewport;
|
|
41
|
-
structTreeLayer?: import("./struct_tree_layer_builder.js").StructTreeLayerBuilder | undefined;
|
|
42
|
-
};
|
|
43
41
|
/**
|
|
44
42
|
* @typedef {Object} AnnotationLayerBuilderOptions
|
|
45
43
|
* @property {PDFPageProxy} pdfPage
|
|
@@ -47,8 +45,9 @@ export type InjectLinkAnnotationsOptions = {
|
|
|
47
45
|
* @property {string} [imageResourcesPath] - Path for image resources, mainly
|
|
48
46
|
* for annotation icons. Include trailing slash.
|
|
49
47
|
* @property {boolean} renderForms
|
|
50
|
-
* @property {
|
|
51
|
-
* @property {
|
|
48
|
+
* @property {PDFLinkService} linkService
|
|
49
|
+
* @property {BaseDownloadManager} [downloadManager]
|
|
50
|
+
* @property {boolean} [enableComment]
|
|
52
51
|
* @property {boolean} [enableScripting]
|
|
53
52
|
* @property {Promise<boolean>} [hasJSActionsPromise]
|
|
54
53
|
* @property {Promise<Object<string, Array<Object>> | null>}
|
|
@@ -57,6 +56,7 @@ export type InjectLinkAnnotationsOptions = {
|
|
|
57
56
|
* @property {TextAccessibilityManager} [accessibilityManager]
|
|
58
57
|
* @property {AnnotationEditorUIManager} [annotationEditorUIManager]
|
|
59
58
|
* @property {function} [onAppend]
|
|
59
|
+
* @property {CommentManager} [commentManager]
|
|
60
60
|
*/
|
|
61
61
|
/**
|
|
62
62
|
* @typedef {Object} AnnotationLayerBuilderRenderOptions
|
|
@@ -64,23 +64,18 @@ export type InjectLinkAnnotationsOptions = {
|
|
|
64
64
|
* @property {string} [intent] - The default value is "display".
|
|
65
65
|
* @property {StructTreeLayerBuilder} [structTreeLayer]
|
|
66
66
|
*/
|
|
67
|
-
/**
|
|
68
|
-
* @typedef {Object} InjectLinkAnnotationsOptions
|
|
69
|
-
* @property {Array<Object>} inferredLinks
|
|
70
|
-
* @property {PageViewport} viewport
|
|
71
|
-
* @property {StructTreeLayerBuilder} [structTreeLayer]
|
|
72
|
-
*/
|
|
73
67
|
export class AnnotationLayerBuilder {
|
|
74
68
|
/**
|
|
75
69
|
* @param {AnnotationLayerBuilderOptions} options
|
|
76
70
|
*/
|
|
77
|
-
constructor({ pdfPage, linkService, downloadManager, annotationStorage, imageResourcesPath, renderForms, 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);
|
|
78
72
|
pdfPage: import("../src/display/api").PDFPageProxy;
|
|
79
|
-
linkService: import("./
|
|
80
|
-
downloadManager: import("./
|
|
73
|
+
linkService: import("./pdf_link_service.js").PDFLinkService;
|
|
74
|
+
downloadManager: import("./base_download_manager.js").BaseDownloadManager | undefined;
|
|
81
75
|
imageResourcesPath: string;
|
|
82
76
|
renderForms: boolean;
|
|
83
77
|
annotationStorage: import("../src/display/annotation_storage").AnnotationStorage;
|
|
78
|
+
enableComment: boolean;
|
|
84
79
|
enableScripting: boolean;
|
|
85
80
|
_hasJSActionsPromise: Promise<boolean>;
|
|
86
81
|
_fieldObjectsPromise: Promise<{
|
|
@@ -92,7 +87,7 @@ export class AnnotationLayerBuilder {
|
|
|
92
87
|
annotationLayer: AnnotationLayer | null;
|
|
93
88
|
div: HTMLDivElement | null;
|
|
94
89
|
_cancelled: boolean;
|
|
95
|
-
_eventBus:
|
|
90
|
+
_eventBus: import("./event_utils.js").EventBus;
|
|
96
91
|
/**
|
|
97
92
|
* @param {AnnotationLayerBuilderRenderOptions} options
|
|
98
93
|
* @returns {Promise<void>} A promise that is resolved when rendering of the
|
|
@@ -103,11 +98,11 @@ export class AnnotationLayerBuilder {
|
|
|
103
98
|
hide(internal?: boolean): void;
|
|
104
99
|
hasEditableAnnotations(): boolean;
|
|
105
100
|
/**
|
|
106
|
-
* @param {
|
|
101
|
+
* @param {Array<Object>} inferredLinks
|
|
107
102
|
* @returns {Promise<void>} A promise that is resolved when the inferred links
|
|
108
103
|
* are added to the annotation layer.
|
|
109
104
|
*/
|
|
110
|
-
injectLinkAnnotations(
|
|
105
|
+
injectLinkAnnotations(inferredLinks: Array<Object>): Promise<void>;
|
|
111
106
|
#private;
|
|
112
107
|
}
|
|
113
108
|
import { AnnotationLayer } from "../src/pdf";
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export class Autolinker {
|
|
2
|
-
static "__#
|
|
3
|
-
static "__#
|
|
2
|
+
static "__#private@#index": number;
|
|
3
|
+
static "__#private@#regex": any;
|
|
4
|
+
static "__#private@#numericTLDRegex": any;
|
|
4
5
|
static findLinks(text: any): {
|
|
5
6
|
url: string;
|
|
6
7
|
index: any;
|
|
@@ -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,20 +1,20 @@
|
|
|
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
|
+
enableOptimizedPartialRendering: boolean;
|
|
7
|
+
imagesRightClickMinSize: number;
|
|
6
8
|
eventBus: null;
|
|
7
9
|
id: null;
|
|
10
|
+
imageCoordinates: null;
|
|
8
11
|
pageColors: null;
|
|
12
|
+
recordedBBoxes: null;
|
|
9
13
|
renderingQueue: null;
|
|
10
|
-
|
|
11
|
-
resume: null;
|
|
12
|
-
set renderingState(state: number);
|
|
13
|
-
get renderingState(): number;
|
|
14
|
+
minDurationToUpdateCanvas: any;
|
|
14
15
|
_createCanvas(onShow: any, hideUntilComplete?: boolean): {
|
|
15
16
|
canvas: HTMLCanvasElement;
|
|
16
17
|
prevCanvas: null;
|
|
17
|
-
ctx: CanvasRenderingContext2D | null;
|
|
18
18
|
};
|
|
19
19
|
_resetCanvas(): void;
|
|
20
20
|
_drawCanvas(options: any, onCancel: any, onFinish: any): Promise<void>;
|
|
@@ -25,3 +25,4 @@ export class BasePDFPageView {
|
|
|
25
25
|
dispatchPageRendered(cssTransform: any, isDetailView: any): void;
|
|
26
26
|
#private;
|
|
27
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>}
|
|
@@ -47,7 +47,7 @@ export class EventBus {
|
|
|
47
47
|
#private;
|
|
48
48
|
}
|
|
49
49
|
/**
|
|
50
|
-
* NOTE: Only used in the Firefox
|
|
50
|
+
* NOTE: Only used in the Firefox built-in pdf viewer.
|
|
51
51
|
*/
|
|
52
52
|
export class FirefoxEventBus extends EventBus {
|
|
53
53
|
constructor(globalEventNames: any, externalServices: any, isInAutomation: any);
|
|
@@ -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 "__#
|
|
13
|
-
static "__#
|
|
14
|
-
static "__#
|
|
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 "__#
|
|
19
|
-
static "__#
|
|
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 "__#
|
|
11
|
-
static "__#
|
|
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
|
*/
|
|
@@ -24,10 +24,10 @@ export namespace FindState {
|
|
|
24
24
|
let PENDING: number;
|
|
25
25
|
}
|
|
26
26
|
export function getOriginalIndex(diffs: any, pos: any, len: any): any[];
|
|
27
|
-
export function normalize(text: any): any[];
|
|
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
|
*/
|
|
@@ -100,6 +98,14 @@ export class PDFLinkService implements IPDFLinkService {
|
|
|
100
98
|
* @param {number|string} val - The page number, or page label.
|
|
101
99
|
*/
|
|
102
100
|
goToPage(val: number | string): void;
|
|
101
|
+
/**
|
|
102
|
+
* Scrolls to a specific location in the PDF document.
|
|
103
|
+
* @param {number} pageNumber - The page number to scroll to.
|
|
104
|
+
* @param {number} x - The x-coordinate to scroll to in page coordinates.
|
|
105
|
+
* @param {number} y - The y-coordinate to scroll to in page coordinates.
|
|
106
|
+
* @param {Object} [options]
|
|
107
|
+
*/
|
|
108
|
+
goToXY(pageNumber: number, x: number, y: number, options?: Object): void;
|
|
103
109
|
/**
|
|
104
110
|
* Adds various attributes (href, title, target, rel) to hyperlinks.
|
|
105
111
|
* @param {HTMLAnchorElement} link
|
|
@@ -132,8 +138,5 @@ export class PDFLinkService implements IPDFLinkService {
|
|
|
132
138
|
*/
|
|
133
139
|
executeSetOCGState(action: Object): Promise<void>;
|
|
134
140
|
}
|
|
135
|
-
|
|
136
|
-
* @implements {IPDFLinkService}
|
|
137
|
-
*/
|
|
138
|
-
export class SimpleLinkService extends PDFLinkService implements IPDFLinkService {
|
|
141
|
+
export class SimpleLinkService extends PDFLinkService {
|
|
139
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;
|
|
@@ -26,6 +20,7 @@ export class PDFPageDetailView extends BasePDFPageView implements IRenderableVie
|
|
|
26
20
|
visibleArea?: null | undefined;
|
|
27
21
|
underlyingViewUpdated?: boolean | undefined;
|
|
28
22
|
}): void;
|
|
23
|
+
_getRenderingContext(canvas: any, transform: any): any;
|
|
29
24
|
draw(): Promise<void>;
|
|
30
25
|
#private;
|
|
31
26
|
}
|