pdfjs-serverless 1.3.0 → 2.0.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 +52 -38
- package/dist/image-decoders.d.mts +1 -0
- package/dist/image-decoders.mjs +1 -0
- package/dist/index.d.mts +3 -3
- package/dist/index.mjs +41 -40
- package/dist/licenses/LICENSE_JBIG2 +196 -0
- package/dist/licenses/LICENSE_OPENJPEG +39 -0
- package/dist/licenses/LICENSE_PDFJS +177 -0
- package/dist/licenses/LICENSE_PDFJS_JBIG2 +13 -0
- package/dist/licenses/LICENSE_PDFJS_OPENJPEG +22 -0
- package/dist/pdfjs-decoders-workerd.mjs +1 -0
- package/dist/pdfjs-decoders.mjs +1 -0
- package/dist/pdfjs-jbig2.mjs +1 -0
- package/dist/pdfjs-jbig2_nowasm_fallback.mjs +1 -0
- package/dist/pdfjs-loader.mjs +1 -0
- package/dist/pdfjs-openjpeg.mjs +1 -0
- package/dist/pdfjs-openjpeg_nowasm_fallback.mjs +2 -0
- package/dist/pdfjs-rolldown-runtime.mjs +1 -0
- package/dist/types/external/qcms/qcms.d.ts +11 -7
- package/dist/types/external/qcms/qcms_utils.d.ts +1 -6
- package/dist/types/src/core/base_stream.d.ts +8 -1
- package/dist/types/src/core/catalog.d.ts +12 -12
- package/dist/types/src/core/colorspace.d.ts +6 -15
- package/dist/types/src/core/core_utils.d.ts +18 -14
- package/dist/types/src/core/crypto.d.ts +0 -1
- package/dist/types/src/core/file_spec.d.ts +4 -9
- package/dist/types/src/core/icc_colorspace.d.ts +0 -1
- package/dist/types/src/core/image_resizer.d.ts +24 -0
- package/dist/types/src/core/image_utils.d.ts +4 -4
- package/dist/types/src/core/jpeg_stream.d.ts +1 -1
- package/dist/types/src/core/jpg.d.ts +9 -13
- package/dist/types/src/core/parser.d.ts +0 -2
- package/dist/types/src/core/pattern.d.ts +0 -2
- package/dist/types/src/core/primitives.d.ts +30 -16
- package/dist/types/src/core/sasl_prep.d.ts +1 -0
- package/dist/types/src/core/sound.d.ts +39 -0
- package/dist/types/src/core/string_utils.d.ts +1 -1
- package/dist/types/src/core/struct_tree.d.ts +3 -3
- package/dist/types/src/core/xml_parser.d.ts +1 -2
- package/dist/types/src/core/xref.d.ts +2 -15
- package/dist/types/src/display/annotation_layer.d.ts +11 -22
- package/dist/types/src/display/annotation_storage.d.ts +7 -7
- package/dist/types/src/display/api.d.ts +155 -108
- package/dist/types/src/display/canvas.d.ts +2 -1
- package/dist/types/src/display/canvas_dependency_tracker.d.ts +8 -3
- package/dist/types/src/display/content_disposition.d.ts +0 -1
- package/dist/types/src/display/display_utils.d.ts +2 -2
- package/dist/types/src/display/draw_layer.d.ts +2 -6
- package/dist/types/src/display/editor/annotation_editor_layer.d.ts +18 -19
- package/dist/types/src/display/editor/color_picker.d.ts +1 -1
- package/dist/types/src/display/editor/comment.d.ts +1 -1
- package/dist/types/src/display/editor/draw.d.ts +78 -27
- package/dist/types/src/display/editor/drawers/freedraw.d.ts +11 -9
- package/dist/types/src/display/editor/drawers/highlight.d.ts +99 -15
- package/dist/types/src/display/editor/drawers/inkdraw.d.ts +7 -2
- package/dist/types/src/display/editor/drawers/outline.d.ts +65 -2
- package/dist/types/src/display/editor/editor.d.ts +24 -22
- package/dist/types/src/display/editor/freetext.d.ts +1 -1
- package/dist/types/src/display/editor/highlight.d.ts +44 -35
- package/dist/types/src/display/editor/ink.d.ts +7 -2
- package/dist/types/src/display/editor/stamp.d.ts +1 -1
- package/dist/types/src/display/editor/tools.d.ts +21 -19
- package/dist/types/src/display/filter_factory.d.ts +1 -3
- package/dist/types/src/display/font_loader.d.ts +1 -15
- package/dist/types/src/display/network_utils.d.ts +1 -0
- package/dist/types/src/display/obj_bin_transform_display.d.ts +25 -38
- package/dist/types/src/display/page_viewport.d.ts +5 -5
- package/dist/types/src/display/pages_mapper.d.ts +10 -4
- package/dist/types/src/display/pattern_helper.d.ts +4 -3
- package/dist/types/src/display/pdf_objects.d.ts +1 -3
- package/dist/types/src/display/text_layer.d.ts +6 -4
- package/dist/types/src/display/touch_manager.d.ts +46 -9
- package/dist/types/src/display/worker_options.d.ts +2 -2
- package/dist/types/src/display/xfa_layer.d.ts +9 -14
- package/dist/types/src/display/xfa_text.d.ts +4 -7
- package/dist/types/src/pdf.d.ts +8 -7
- package/dist/types/src/shared/base_pdf_stream.d.ts +6 -7
- package/dist/types/src/shared/css_utils.d.ts +8 -0
- package/dist/types/src/shared/message_handler.d.ts +2 -11
- package/dist/types/src/shared/obj_bin_transform_utils.d.ts +4 -3
- package/dist/types/src/shared/util.d.ts +4 -6
- package/dist/types/web/annotation_editor_layer_builder.d.ts +10 -8
- package/dist/types/web/annotation_layer_builder.d.ts +17 -21
- package/dist/types/web/draw_layer_builder.d.ts +7 -9
- package/dist/types/web/event_utils.d.ts +12 -13
- package/dist/types/web/genericl10n.d.ts +2 -2
- package/dist/types/web/l10n.d.ts +1 -1
- package/dist/types/web/pdf_find_controller.d.ts +9 -10
- package/dist/types/web/pdf_find_utils.d.ts +8 -14
- package/dist/types/web/pdf_history.d.ts +2 -2
- package/dist/types/web/pdf_link_service.d.ts +7 -9
- package/dist/types/web/pdf_page_view.d.ts +15 -15
- package/dist/types/web/pdf_rendering_queue.d.ts +7 -8
- package/dist/types/web/pdf_scripting_manager.d.ts +5 -5
- package/dist/types/web/pdf_thumbnail_view.d.ts +11 -11
- package/dist/types/web/pdf_thumbnail_viewer.d.ts +21 -22
- package/dist/types/web/pdf_viewer.d.ts +49 -29
- package/dist/types/web/renderable_view.d.ts +3 -3
- package/dist/types/web/sidebar.d.ts +3 -3
- package/dist/types/web/struct_tree_layer_builder.d.ts +21 -7
- package/dist/types/web/text_accessibility.d.ts +4 -2
- package/dist/types/web/text_highlighter.d.ts +7 -8
- package/dist/types/web/text_layer_builder.d.ts +11 -11
- package/dist/types/web/ui_utils.d.ts +8 -13
- package/dist/types/web/xfa_layer_builder.d.ts +13 -13
- package/package.json +27 -16
|
@@ -3,7 +3,7 @@ export type WaitOnEventOrTimeoutParameters = {
|
|
|
3
3
|
* - The event target, can for example be:
|
|
4
4
|
* `window`, `document`, a DOM element, or an {EventBus} instance.
|
|
5
5
|
*/
|
|
6
|
-
target:
|
|
6
|
+
target: object;
|
|
7
7
|
/**
|
|
8
8
|
* - The name of the event.
|
|
9
9
|
*/
|
|
@@ -21,21 +21,21 @@ export type WaitOnEventOrTimeoutParameters = {
|
|
|
21
21
|
export class EventBus {
|
|
22
22
|
/**
|
|
23
23
|
* @param {string} eventName
|
|
24
|
-
* @param {
|
|
25
|
-
* @param {
|
|
24
|
+
* @param {Function} listener
|
|
25
|
+
* @param {object} [options]
|
|
26
26
|
*/
|
|
27
|
-
on(eventName: string, listener: Function, options?:
|
|
27
|
+
on(eventName: string, listener: Function, options?: object): void;
|
|
28
28
|
/**
|
|
29
29
|
* @param {string} eventName
|
|
30
|
-
* @param {
|
|
31
|
-
* @param {
|
|
30
|
+
* @param {Function} listener
|
|
31
|
+
* @param {object} [options]
|
|
32
32
|
*/
|
|
33
|
-
off(eventName: string, listener: Function, options?:
|
|
33
|
+
off(eventName: string, listener: Function, options?: object): void;
|
|
34
34
|
/**
|
|
35
35
|
* @param {string} eventName
|
|
36
|
-
* @param {
|
|
36
|
+
* @param {object} data
|
|
37
37
|
*/
|
|
38
|
-
dispatch(eventName: string, data:
|
|
38
|
+
dispatch(eventName: string, data: object): void;
|
|
39
39
|
#private;
|
|
40
40
|
}
|
|
41
41
|
/**
|
|
@@ -47,8 +47,8 @@ export class FirefoxEventBus extends EventBus {
|
|
|
47
47
|
#private;
|
|
48
48
|
}
|
|
49
49
|
/**
|
|
50
|
-
* @typedef {
|
|
51
|
-
* @property {
|
|
50
|
+
* @typedef {object} WaitOnEventOrTimeoutParameters
|
|
51
|
+
* @property {object} target - The event target, can for example be:
|
|
52
52
|
* `window`, `document`, a DOM element, or an {EventBus} instance.
|
|
53
53
|
* @property {string} name - The name of the event.
|
|
54
54
|
* @property {number} delay - The delay, in milliseconds, after which the
|
|
@@ -58,8 +58,7 @@ export class FirefoxEventBus extends EventBus {
|
|
|
58
58
|
* Allows waiting for an event or a timeout, whichever occurs first.
|
|
59
59
|
* Can be used to ensure that an action always occurs, even when an event
|
|
60
60
|
* arrives late or not at all.
|
|
61
|
-
*
|
|
62
|
-
* @param {WaitOnEventOrTimeoutParameters}
|
|
61
|
+
* @param {WaitOnEventOrTimeoutParameters} params
|
|
63
62
|
* @returns {Promise} A promise that is resolved with a {WaitOnType} value.
|
|
64
63
|
*/
|
|
65
64
|
export function waitOnEventOrTimeout({ target, name, delay }: WaitOnEventOrTimeoutParameters): Promise<any>;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
export class GenericL10n extends L10n {
|
|
2
2
|
/**
|
|
3
3
|
* Generate the bundles for Fluent.
|
|
4
|
-
* @param {
|
|
4
|
+
* @param {string} defaultLang - The fallback language to use for
|
|
5
5
|
* translations.
|
|
6
|
-
* @param {
|
|
6
|
+
* @param {string} baseLang - The base language to use for translations.
|
|
7
7
|
*/
|
|
8
8
|
static #generateBundles(defaultLang: string, baseLang: string): AsyncGenerator<any, void, unknown>;
|
|
9
9
|
static #createBundle(lang: any, baseURL: any, paths: any): Promise<any>;
|
package/dist/types/web/l10n.d.ts
CHANGED
|
@@ -16,7 +16,7 @@ export class L10n {
|
|
|
16
16
|
/** @inheritdoc */
|
|
17
17
|
getDirection(): string;
|
|
18
18
|
/** @inheritdoc */
|
|
19
|
-
get(ids: any, args
|
|
19
|
+
get(ids: any, args?: null): Promise<any>;
|
|
20
20
|
/** @inheritdoc */
|
|
21
21
|
translate(element: any): Promise<void>;
|
|
22
22
|
/** @inheritdoc */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export type PDFDocumentProxy = import("../src/display/api").PDFDocumentProxy;
|
|
2
|
-
export type EventBus = import("./event_utils").EventBus;
|
|
1
|
+
export type PDFDocumentProxy = import("../src/display/api.js").PDFDocumentProxy;
|
|
2
|
+
export type EventBus = import("./event_utils.js").EventBus;
|
|
3
3
|
export type PDFLinkService = import("./pdf_link_service.js").PDFLinkService;
|
|
4
4
|
export type PDFFindControllerOptions = {
|
|
5
5
|
/**
|
|
@@ -33,7 +33,7 @@ export namespace FindState {
|
|
|
33
33
|
export function getOriginalIndex(diffs: any, pos: any, len: any): any[];
|
|
34
34
|
export function normalize(text: any, options?: {}): any[];
|
|
35
35
|
/**
|
|
36
|
-
* @typedef {
|
|
36
|
+
* @typedef {object} PDFFindControllerOptions
|
|
37
37
|
* @property {PDFLinkService} linkService - The navigation/linking service.
|
|
38
38
|
* @property {EventBus} eventBus - The application event bus.
|
|
39
39
|
* @property {number} [delay] - The number of milliseconds to delay execution of
|
|
@@ -53,10 +53,10 @@ export class PDFFindController {
|
|
|
53
53
|
*/
|
|
54
54
|
constructor({ linkService, eventBus, delay, updateMatchesCountOnProgress, }: PDFFindControllerOptions);
|
|
55
55
|
_linkService: import("./pdf_link_service.js").PDFLinkService;
|
|
56
|
-
_eventBus: import("./event_utils").EventBus;
|
|
56
|
+
_eventBus: import("./event_utils.js").EventBus;
|
|
57
57
|
/**
|
|
58
58
|
* Callback used to check if a `pageNumber` is currently visible.
|
|
59
|
-
* @type {
|
|
59
|
+
* @type {Function}
|
|
60
60
|
*/
|
|
61
61
|
onIsPageVisible: Function;
|
|
62
62
|
get highlightMatches(): boolean | undefined;
|
|
@@ -70,23 +70,22 @@ export class PDFFindController {
|
|
|
70
70
|
/**
|
|
71
71
|
* Set a reference to the PDF document in order to search it.
|
|
72
72
|
* Note that searching is not possible if this method is not called.
|
|
73
|
-
*
|
|
74
73
|
* @param {PDFDocumentProxy} pdfDocument - The PDF document to search.
|
|
75
74
|
*/
|
|
76
75
|
setDocument(pdfDocument: PDFDocumentProxy): void;
|
|
77
|
-
_pdfDocument: import("../src/display/api").PDFDocumentProxy | null | undefined;
|
|
76
|
+
_pdfDocument: import("../src/display/api.js").PDFDocumentProxy | null | undefined;
|
|
78
77
|
_dirtyMatch: boolean | undefined;
|
|
79
78
|
_findTimeout: any;
|
|
80
79
|
_highlightMatches: boolean | undefined;
|
|
81
80
|
/**
|
|
82
|
-
* @typedef {
|
|
81
|
+
* @typedef {object} PDFFindControllerScrollMatchIntoViewParams
|
|
83
82
|
* @property {HTMLElement} element
|
|
84
83
|
* @property {number} pageIndex
|
|
85
84
|
* @property {number} matchIndex
|
|
86
85
|
*/
|
|
87
86
|
/**
|
|
88
87
|
* Scroll the current match into view.
|
|
89
|
-
* @param {PDFFindControllerScrollMatchIntoViewParams}
|
|
88
|
+
* @param {PDFFindControllerScrollMatchIntoViewParams} params
|
|
90
89
|
*/
|
|
91
90
|
scrollMatchIntoView({ element, pageIndex, matchIndex }: {
|
|
92
91
|
element: HTMLElement;
|
|
@@ -116,7 +115,7 @@ export class PDFFindController {
|
|
|
116
115
|
_firstPageCapability: any;
|
|
117
116
|
_rawQuery: any;
|
|
118
117
|
/**
|
|
119
|
-
* @typedef {
|
|
118
|
+
* @typedef {object} FindMatch
|
|
120
119
|
* @property {number} index - The start of the matched text in the page's
|
|
121
120
|
* string contents.
|
|
122
121
|
* @property {number} length - The length of the matched text.
|
|
@@ -1,16 +1,10 @@
|
|
|
1
|
-
export
|
|
2
|
-
let SPACE: number;
|
|
3
|
-
let ALPHA_LETTER: number;
|
|
4
|
-
let PUNCT: number;
|
|
5
|
-
let HAN_LETTER: number;
|
|
6
|
-
let KATAKANA_LETTER: number;
|
|
7
|
-
let HIRAGANA_LETTER: number;
|
|
8
|
-
let HALFWIDTH_KATAKANA_LETTER: number;
|
|
9
|
-
let THAI_LETTER: number;
|
|
10
|
-
}
|
|
1
|
+
export function getNormalizeWithNFKC(): any;
|
|
11
2
|
/**
|
|
12
|
-
*
|
|
13
|
-
*
|
|
3
|
+
* Determine if the match spanning `[startIdx, startIdx + length)` in `content`
|
|
4
|
+
* is a whole word, i.e. there's a word break on each side of it. Each boundary
|
|
5
|
+
* is tested on its two adjacent characters in isolation rather than on the
|
|
6
|
+
* whole string, so a contraction such as "can't" doesn't prevent "can" from
|
|
7
|
+
* being an entire word, matching Firefox's find:
|
|
8
|
+
* https://searchfox.org/firefox-main/source/toolkit/components/find/nsFind.cpp
|
|
14
9
|
*/
|
|
15
|
-
export function
|
|
16
|
-
export function getNormalizeWithNFKC(): any;
|
|
10
|
+
export function isEntireWord(content: any, startIdx: any, length: any): boolean;
|
|
@@ -38,7 +38,7 @@ export type PushParameters = {
|
|
|
38
38
|
*/
|
|
39
39
|
pageNumber: number;
|
|
40
40
|
};
|
|
41
|
-
export type EventBus = import("./event_utils").EventBus;
|
|
41
|
+
export type EventBus = import("./event_utils.js").EventBus;
|
|
42
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;
|
|
@@ -82,7 +82,7 @@ export class PDFHistory {
|
|
|
82
82
|
_updateViewareaTimeout: any;
|
|
83
83
|
/**
|
|
84
84
|
* Push an internal destination to the browser history.
|
|
85
|
-
* @param {PushParameters}
|
|
85
|
+
* @param {PushParameters} params
|
|
86
86
|
*/
|
|
87
87
|
push({ namedDest, explicitDest, pageNumber }: PushParameters): void;
|
|
88
88
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type EventBus = import("./event_utils").EventBus;
|
|
1
|
+
export type EventBus = import("./event_utils.js").EventBus;
|
|
2
2
|
export type PDFLinkServiceOptions = {
|
|
3
3
|
/**
|
|
4
4
|
* - The application event bus.
|
|
@@ -30,7 +30,7 @@ export namespace LinkTarget {
|
|
|
30
30
|
let TOP: number;
|
|
31
31
|
}
|
|
32
32
|
/**
|
|
33
|
-
* @typedef {
|
|
33
|
+
* @typedef {object} PDFLinkServiceOptions
|
|
34
34
|
* @property {EventBus} eventBus - The application event bus.
|
|
35
35
|
* @property {number} [externalLinkTarget] - Specifies the `target` attribute
|
|
36
36
|
* for external links. Must use one of the values from {LinkTarget}.
|
|
@@ -51,7 +51,7 @@ export class PDFLinkService {
|
|
|
51
51
|
*/
|
|
52
52
|
constructor({ eventBus, externalLinkTarget, externalLinkRel, ignoreDestinationZoom, }?: PDFLinkServiceOptions);
|
|
53
53
|
externalLinkEnabled: boolean;
|
|
54
|
-
eventBus: import("./event_utils").EventBus;
|
|
54
|
+
eventBus: import("./event_utils.js").EventBus;
|
|
55
55
|
externalLinkTarget: number;
|
|
56
56
|
externalLinkRel: string;
|
|
57
57
|
_ignoreDestinationZoom: boolean;
|
|
@@ -88,13 +88,11 @@ export class PDFLinkService {
|
|
|
88
88
|
get isInPresentationMode(): boolean;
|
|
89
89
|
/**
|
|
90
90
|
* This method will, when available, also update the browser history.
|
|
91
|
-
*
|
|
92
91
|
* @param {string|Array} dest - The named, or explicit, PDF destination.
|
|
93
92
|
*/
|
|
94
93
|
goToDestination(dest: string | any[]): Promise<void>;
|
|
95
94
|
/**
|
|
96
95
|
* This method will, when available, also update the browser history.
|
|
97
|
-
*
|
|
98
96
|
* @param {number|string} val - The page number, or page label.
|
|
99
97
|
*/
|
|
100
98
|
goToPage(val: number | string): void;
|
|
@@ -103,9 +101,9 @@ export class PDFLinkService {
|
|
|
103
101
|
* @param {number} pageNumber - The page number to scroll to.
|
|
104
102
|
* @param {number} x - The x-coordinate to scroll to in page coordinates.
|
|
105
103
|
* @param {number} y - The y-coordinate to scroll to in page coordinates.
|
|
106
|
-
* @param {
|
|
104
|
+
* @param {object} [options]
|
|
107
105
|
*/
|
|
108
|
-
goToXY(pageNumber: number, x: number, y: number, options?:
|
|
106
|
+
goToXY(pageNumber: number, x: number, y: number, options?: object): void;
|
|
109
107
|
/**
|
|
110
108
|
* @param {string} id
|
|
111
109
|
* Unique attachment identifier (required).
|
|
@@ -141,9 +139,9 @@ export class PDFLinkService {
|
|
|
141
139
|
*/
|
|
142
140
|
executeNamedAction(action: string): void;
|
|
143
141
|
/**
|
|
144
|
-
* @param {
|
|
142
|
+
* @param {object} action
|
|
145
143
|
*/
|
|
146
|
-
executeSetOCGState(action:
|
|
144
|
+
executeSetOCGState(action: object): Promise<void>;
|
|
147
145
|
}
|
|
148
146
|
export class SimpleLinkService extends PDFLinkService {
|
|
149
147
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export type PageViewport = import("../src/display/page_viewport").PageViewport;
|
|
2
|
-
export type OptionalContentConfig = import("../src/display/optional_content_config").OptionalContentConfig;
|
|
3
|
-
export type EventBus = import("./event_utils").EventBus;
|
|
4
|
-
export type PDFRenderingQueue = import("./pdf_rendering_queue").PDFRenderingQueue;
|
|
1
|
+
export type PageViewport = import("../src/display/page_viewport.js").PageViewport;
|
|
2
|
+
export type OptionalContentConfig = import("../src/display/optional_content_config.js").OptionalContentConfig;
|
|
3
|
+
export type EventBus = import("./event_utils.js").EventBus;
|
|
4
|
+
export type PDFRenderingQueue = import("./pdf_rendering_queue.js").PDFRenderingQueue;
|
|
5
5
|
export type CommentManager = import("./comment_manager.js").CommentManager;
|
|
6
6
|
export type L10n = import("./l10n.js").L10n;
|
|
7
7
|
export type PDFPageViewOptions = {
|
|
@@ -30,11 +30,11 @@ export type PDFPageViewOptions = {
|
|
|
30
30
|
* A promise that is resolved with an {@link OptionalContentConfig} instance.
|
|
31
31
|
* The default value is `null`.
|
|
32
32
|
*/
|
|
33
|
-
optionalContentConfigPromise?: Promise<import("../src/display/optional_content_config").OptionalContentConfig> | undefined;
|
|
33
|
+
optionalContentConfigPromise?: Promise<import("../src/display/optional_content_config.js").OptionalContentConfig> | undefined;
|
|
34
34
|
/**
|
|
35
35
|
* - The rendering queue object.
|
|
36
36
|
*/
|
|
37
|
-
renderingQueue?: import("./pdf_rendering_queue").PDFRenderingQueue | undefined;
|
|
37
|
+
renderingQueue?: import("./pdf_rendering_queue.js").PDFRenderingQueue | undefined;
|
|
38
38
|
/**
|
|
39
39
|
* - Controls if the text layer used for
|
|
40
40
|
* selection and searching is created. The constants from {TextLayerMode}
|
|
@@ -105,7 +105,7 @@ export type PDFPageViewOptions = {
|
|
|
105
105
|
* with user defined ones in order to improve readability in high contrast
|
|
106
106
|
* mode.
|
|
107
107
|
*/
|
|
108
|
-
pageColors?:
|
|
108
|
+
pageColors?: object | undefined;
|
|
109
109
|
/**
|
|
110
110
|
* - Localization service.
|
|
111
111
|
*/
|
|
@@ -114,7 +114,7 @@ export type PDFPageViewOptions = {
|
|
|
114
114
|
* - The object that is used to lookup
|
|
115
115
|
* the necessary layer-properties.
|
|
116
116
|
*/
|
|
117
|
-
layerProperties?:
|
|
117
|
+
layerProperties?: object | undefined;
|
|
118
118
|
/**
|
|
119
119
|
* - Enable creation of hyperlinks from
|
|
120
120
|
* text that look like URLs. The default value is `true`.
|
|
@@ -136,9 +136,9 @@ export class PDFPageView extends BasePDFPageView {
|
|
|
136
136
|
pageLabel: string | null;
|
|
137
137
|
rotation: number;
|
|
138
138
|
scale: number;
|
|
139
|
-
viewport: import("../src/display/page_viewport").PageViewport;
|
|
139
|
+
viewport: import("../src/display/page_viewport.js").PageViewport;
|
|
140
140
|
pdfPageRotate: number;
|
|
141
|
-
_optionalContentConfigPromise: Promise<import("../src/display/optional_content_config").OptionalContentConfig> | null;
|
|
141
|
+
_optionalContentConfigPromise: Promise<import("../src/display/optional_content_config.js").OptionalContentConfig> | null;
|
|
142
142
|
imageResourcesPath: string;
|
|
143
143
|
enableDetailCanvas: boolean;
|
|
144
144
|
maxCanvasPixels: any;
|
|
@@ -175,7 +175,7 @@ export class PDFPageView extends BasePDFPageView {
|
|
|
175
175
|
toggleEditingMode(isEditing: any): void;
|
|
176
176
|
updateVisibleArea(visibleArea: any): void;
|
|
177
177
|
/**
|
|
178
|
-
* @typedef {
|
|
178
|
+
* @typedef {object} PDFPageViewUpdateParameters
|
|
179
179
|
* @property {number} [scale] The new scale, if specified.
|
|
180
180
|
* @property {number} [rotation] The new rotation, if specified.
|
|
181
181
|
* @property {Promise<OptionalContentConfig>} [optionalContentConfigPromise]
|
|
@@ -199,7 +199,7 @@ export class PDFPageView extends BasePDFPageView {
|
|
|
199
199
|
/**
|
|
200
200
|
* A promise that is resolved with an {@link OptionalContentConfig}instance. The default value is `null`.
|
|
201
201
|
*/
|
|
202
|
-
optionalContentConfigPromise?: Promise<import("../src/display/optional_content_config").OptionalContentConfig> | undefined;
|
|
202
|
+
optionalContentConfigPromise?: Promise<import("../src/display/optional_content_config.js").OptionalContentConfig> | undefined;
|
|
203
203
|
drawingDelay?: number | undefined;
|
|
204
204
|
}): void;
|
|
205
205
|
outputScale: OutputScale | undefined;
|
|
@@ -228,9 +228,9 @@ export class PDFPageView extends BasePDFPageView {
|
|
|
228
228
|
_getRenderingContext(canvas: any, transform: any, recordOperations: any, recordImages: any): {
|
|
229
229
|
canvas: any;
|
|
230
230
|
transform: any;
|
|
231
|
-
viewport: import("../src/display/page_viewport").PageViewport;
|
|
231
|
+
viewport: import("../src/display/page_viewport.js").PageViewport;
|
|
232
232
|
annotationMode: number;
|
|
233
|
-
optionalContentConfigPromise: Promise<import("../src/display/optional_content_config").OptionalContentConfig> | null;
|
|
233
|
+
optionalContentConfigPromise: Promise<import("../src/display/optional_content_config.js").OptionalContentConfig> | null;
|
|
234
234
|
annotationCanvasMap: any;
|
|
235
235
|
pageColors: null;
|
|
236
236
|
isEditing: boolean;
|
|
@@ -253,4 +253,4 @@ import { BasePDFPageView } from "./base_pdf_page_view.js";
|
|
|
253
253
|
import { AnnotationLayerBuilder } from "./annotation_layer_builder.js";
|
|
254
254
|
import { TextLayerBuilder } from "./text_layer_builder.js";
|
|
255
255
|
import { XfaLayerBuilder } from "./xfa_layer_builder.js";
|
|
256
|
-
import { OutputScale } from "../src/pdf";
|
|
256
|
+
import { OutputScale } from "../src/pdf.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export type PDFViewer = import("./pdf_viewer").PDFViewer;
|
|
2
|
-
export type PDFThumbnailViewer = import("./pdf_thumbnail_viewer").PDFThumbnailViewer;
|
|
3
|
-
export type RenderableView = import("./renderable_view").RenderableView;
|
|
1
|
+
export type PDFViewer = import("./pdf_viewer.js").PDFViewer;
|
|
2
|
+
export type PDFThumbnailViewer = import("./pdf_thumbnail_viewer.js").PDFThumbnailViewer;
|
|
3
|
+
export type RenderableView = import("./renderable_view.js").RenderableView;
|
|
4
4
|
/**
|
|
5
5
|
* Controls rendering of the views for pages and thumbnails.
|
|
6
6
|
*/
|
|
@@ -22,17 +22,17 @@ export class PDFRenderingQueue {
|
|
|
22
22
|
*/
|
|
23
23
|
isHighestPriority(view: RenderableView): boolean;
|
|
24
24
|
/**
|
|
25
|
-
* @param {
|
|
25
|
+
* @param {object} currentlyVisiblePages
|
|
26
26
|
*/
|
|
27
|
-
renderHighestPriority(currentlyVisiblePages:
|
|
27
|
+
renderHighestPriority(currentlyVisiblePages: object): void;
|
|
28
28
|
/**
|
|
29
|
-
* @param {
|
|
29
|
+
* @param {object} visible
|
|
30
30
|
* @param {Array} views
|
|
31
31
|
* @param {boolean} scrolledDown
|
|
32
32
|
* @param {boolean} [preRenderExtra]
|
|
33
33
|
* @param {boolean} [ignoreDetailViews]
|
|
34
34
|
*/
|
|
35
|
-
getHighestPriority(visible:
|
|
35
|
+
getHighestPriority(visible: object, views: any[], scrolledDown: boolean, preRenderExtra?: boolean, ignoreDetailViews?: boolean): any;
|
|
36
36
|
/**
|
|
37
37
|
* @param {RenderableView} view
|
|
38
38
|
* @returns {boolean}
|
|
@@ -42,7 +42,6 @@ export class PDFRenderingQueue {
|
|
|
42
42
|
* Render a page or thumbnail view. This calls the appropriate function
|
|
43
43
|
* based on the views state. If the view is already rendered it will return
|
|
44
44
|
* `false`.
|
|
45
|
-
*
|
|
46
45
|
* @param {RenderableView} view
|
|
47
46
|
*/
|
|
48
47
|
renderView(view: RenderableView): boolean;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type EventBus = import("./event_utils").EventBus;
|
|
1
|
+
export type EventBus = import("./event_utils.js").EventBus;
|
|
2
2
|
export type PDFScriptingManagerOptions = {
|
|
3
3
|
/**
|
|
4
4
|
* - The application event bus.
|
|
@@ -14,7 +14,7 @@ export type PDFScriptingManagerOptions = {
|
|
|
14
14
|
* initializing scripting; must contain a `createScripting` method.
|
|
15
15
|
* PLEASE NOTE: Primarily intended for the default viewer use-case.
|
|
16
16
|
*/
|
|
17
|
-
externalServices?:
|
|
17
|
+
externalServices?: object | undefined;
|
|
18
18
|
/**
|
|
19
19
|
* - The function that is used to lookup
|
|
20
20
|
* the necessary document properties.
|
|
@@ -22,14 +22,14 @@ export type PDFScriptingManagerOptions = {
|
|
|
22
22
|
docProperties?: Function | undefined;
|
|
23
23
|
};
|
|
24
24
|
/**
|
|
25
|
-
* @typedef {
|
|
25
|
+
* @typedef {object} PDFScriptingManagerOptions
|
|
26
26
|
* @property {EventBus} eventBus - The application event bus.
|
|
27
27
|
* @property {string} [sandboxBundleSrc] - The path and filename of the
|
|
28
28
|
* scripting bundle.
|
|
29
|
-
* @property {
|
|
29
|
+
* @property {object} [externalServices] - The factory that is used when
|
|
30
30
|
* initializing scripting; must contain a `createScripting` method.
|
|
31
31
|
* PLEASE NOTE: Primarily intended for the default viewer use-case.
|
|
32
|
-
* @property {
|
|
32
|
+
* @property {Function} [docProperties] - The function that is used to lookup
|
|
33
33
|
* the necessary document properties.
|
|
34
34
|
*/
|
|
35
35
|
export class PDFScriptingManager {
|
|
@@ -20,7 +20,7 @@ export type PDFThumbnailViewOptions = {
|
|
|
20
20
|
* A promise that is resolved with an {@link OptionalContentConfig} instance.
|
|
21
21
|
* The default value is `null`.
|
|
22
22
|
*/
|
|
23
|
-
optionalContentConfigPromise?: Promise<import("../src/display/optional_content_config").OptionalContentConfig> | undefined;
|
|
23
|
+
optionalContentConfigPromise?: Promise<import("../src/display/optional_content_config.js").OptionalContentConfig> | undefined;
|
|
24
24
|
/**
|
|
25
25
|
* - The navigation/linking service.
|
|
26
26
|
*/
|
|
@@ -46,12 +46,12 @@ export type PDFThumbnailViewOptions = {
|
|
|
46
46
|
* with user defined ones in order to improve readability in high contrast
|
|
47
47
|
* mode.
|
|
48
48
|
*/
|
|
49
|
-
pageColors?:
|
|
49
|
+
pageColors?: object | undefined;
|
|
50
50
|
};
|
|
51
|
-
export type OptionalContentConfig = import("../src/display/optional_content_config").OptionalContentConfig;
|
|
52
|
-
export type PageViewport = import("../src/display/page_viewport").PageViewport;
|
|
53
|
-
export type EventBus = import("./event_utils").EventBus;
|
|
54
|
-
export type PDFRenderingQueue = import("./pdf_rendering_queue").PDFRenderingQueue;
|
|
51
|
+
export type OptionalContentConfig = import("../src/display/optional_content_config.js").OptionalContentConfig;
|
|
52
|
+
export type PageViewport = import("../src/display/page_viewport.js").PageViewport;
|
|
53
|
+
export type EventBus = import("./event_utils.js").EventBus;
|
|
54
|
+
export type PDFRenderingQueue = import("./pdf_rendering_queue.js").PDFRenderingQueue;
|
|
55
55
|
export class PDFThumbnailView extends RenderableView {
|
|
56
56
|
/**
|
|
57
57
|
* @param {PDFThumbnailViewOptions} options
|
|
@@ -61,15 +61,15 @@ export class PDFThumbnailView extends RenderableView {
|
|
|
61
61
|
pageLabel: string | null;
|
|
62
62
|
pdfPage: any;
|
|
63
63
|
rotation: number;
|
|
64
|
-
viewport: import("../src/display/page_viewport").PageViewport;
|
|
64
|
+
viewport: import("../src/display/page_viewport.js").PageViewport;
|
|
65
65
|
pdfPageRotate: number;
|
|
66
|
-
_optionalContentConfigPromise: Promise<import("../src/display/optional_content_config").OptionalContentConfig> | null;
|
|
66
|
+
_optionalContentConfigPromise: Promise<import("../src/display/optional_content_config.js").OptionalContentConfig> | null;
|
|
67
67
|
maxCanvasPixels: any;
|
|
68
68
|
maxCanvasDim: any;
|
|
69
|
-
pageColors:
|
|
70
|
-
eventBus: import("./event_utils").EventBus;
|
|
69
|
+
pageColors: object | null;
|
|
70
|
+
eventBus: import("./event_utils.js").EventBus;
|
|
71
71
|
linkService: PDFLinkService;
|
|
72
|
-
renderingQueue: import("./pdf_rendering_queue").PDFRenderingQueue;
|
|
72
|
+
renderingQueue: import("./pdf_rendering_queue.js").PDFRenderingQueue;
|
|
73
73
|
placeholder: any;
|
|
74
74
|
div: HTMLDivElement;
|
|
75
75
|
imageContainer: HTMLDivElement;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export type PDFDocumentProxy = import("../src/display/api").PDFDocumentProxy;
|
|
2
|
-
export type PDFPageProxy = import("../src/display/api").PDFPageProxy;
|
|
3
|
-
export type EventBus = import("./event_utils").EventBus;
|
|
4
|
-
export type PDFRenderingQueue = import("./pdf_rendering_queue").PDFRenderingQueue;
|
|
1
|
+
export type PDFDocumentProxy = import("../src/display/api.js").PDFDocumentProxy;
|
|
2
|
+
export type PDFPageProxy = import("../src/display/api.js").PDFPageProxy;
|
|
3
|
+
export type EventBus = import("./event_utils.js").EventBus;
|
|
4
|
+
export type PDFRenderingQueue = import("./pdf_rendering_queue.js").PDFRenderingQueue;
|
|
5
5
|
export type PDFLinkService = import("./pdf_link_service.js").PDFLinkService;
|
|
6
6
|
export type PDFThumbnailViewerOptions = {
|
|
7
7
|
/**
|
|
@@ -38,7 +38,7 @@ export type PDFThumbnailViewerOptions = {
|
|
|
38
38
|
* with user defined ones in order to improve readability in high contrast
|
|
39
39
|
* mode.
|
|
40
40
|
*/
|
|
41
|
-
pageColors?:
|
|
41
|
+
pageColors?: object | undefined;
|
|
42
42
|
/**
|
|
43
43
|
* - The AbortSignal for the window
|
|
44
44
|
* events.
|
|
@@ -63,30 +63,30 @@ export type PDFThumbnailViewerOptions = {
|
|
|
63
63
|
* - The status bar elements to manage the status
|
|
64
64
|
* label and action when editing pages.
|
|
65
65
|
*/
|
|
66
|
-
statusBar?:
|
|
66
|
+
statusBar?: object | undefined;
|
|
67
67
|
/**
|
|
68
68
|
* - The undo bar elements to manage the undo
|
|
69
69
|
* action.
|
|
70
70
|
*/
|
|
71
|
-
undoBar?:
|
|
71
|
+
undoBar?: object | undefined;
|
|
72
72
|
/**
|
|
73
73
|
* - The menu elements to manage saving edited
|
|
74
74
|
* PDF.
|
|
75
75
|
*/
|
|
76
|
-
manageMenu?:
|
|
76
|
+
manageMenu?: object | undefined;
|
|
77
77
|
/**
|
|
78
78
|
* - The waiting bar elements shown during
|
|
79
79
|
* long-running operations.
|
|
80
80
|
*/
|
|
81
|
-
waitingBar?:
|
|
81
|
+
waitingBar?: object | undefined;
|
|
82
82
|
/**
|
|
83
83
|
* - The file picker and button used to
|
|
84
84
|
* add one or more PDF files to merge with the current one.
|
|
85
85
|
*/
|
|
86
|
-
addFileComponent?:
|
|
86
|
+
addFileComponent?: object | undefined;
|
|
87
87
|
};
|
|
88
88
|
/**
|
|
89
|
-
* @typedef {
|
|
89
|
+
* @typedef {object} PDFThumbnailViewerOptions
|
|
90
90
|
* @property {HTMLDivElement} container - The container for the thumbnail
|
|
91
91
|
* elements.
|
|
92
92
|
* @property {EventBus} eventBus - The application event bus.
|
|
@@ -98,7 +98,7 @@ export type PDFThumbnailViewerOptions = {
|
|
|
98
98
|
* @property {number} [maxCanvasDim] - The maximum supported canvas dimension,
|
|
99
99
|
* in either width or height. Use `-1` for no limit.
|
|
100
100
|
* The default value is 32767.
|
|
101
|
-
* @property {
|
|
101
|
+
* @property {object} [pageColors] - Overwrites background and foreground colors
|
|
102
102
|
* with user defined ones in order to improve readability in high contrast
|
|
103
103
|
* mode.
|
|
104
104
|
* @property {AbortSignal} [abortSignal] - The AbortSignal for the window
|
|
@@ -109,15 +109,15 @@ export type PDFThumbnailViewerOptions = {
|
|
|
109
109
|
* The default value is `false`.
|
|
110
110
|
* @property {boolean} [enableSplitMerge] - Enables split and merge features.
|
|
111
111
|
* The default value is `false`.
|
|
112
|
-
* @property {
|
|
112
|
+
* @property {object} [statusBar] - The status bar elements to manage the status
|
|
113
113
|
* label and action when editing pages.
|
|
114
|
-
* @property {
|
|
114
|
+
* @property {object} [undoBar] - The undo bar elements to manage the undo
|
|
115
115
|
* action.
|
|
116
|
-
* @property {
|
|
116
|
+
* @property {object} [manageMenu] - The menu elements to manage saving edited
|
|
117
117
|
* PDF.
|
|
118
|
-
* @property {
|
|
118
|
+
* @property {object} [waitingBar] - The waiting bar elements shown during
|
|
119
119
|
* long-running operations.
|
|
120
|
-
* @property {
|
|
120
|
+
* @property {object} [addFileComponent] - The file picker and button used to
|
|
121
121
|
* add one or more PDF files to merge with the current one.
|
|
122
122
|
*/
|
|
123
123
|
/**
|
|
@@ -140,19 +140,18 @@ export class PDFThumbnailViewer {
|
|
|
140
140
|
constructor({ container, eventBus, linkService, renderingQueue, maxCanvasPixels, maxCanvasDim, pageColors, abortSignal, enableMerge, enableSplitMerge, enableNewBadge, statusBar, undoBar, waitingBar, manageMenu, addFileComponent, }: PDFThumbnailViewerOptions);
|
|
141
141
|
scrollableContainer: HTMLElement | null;
|
|
142
142
|
container: HTMLDivElement;
|
|
143
|
-
eventBus: import("./event_utils").EventBus;
|
|
143
|
+
eventBus: import("./event_utils.js").EventBus;
|
|
144
144
|
linkService: import("./pdf_link_service.js").PDFLinkService;
|
|
145
|
-
renderingQueue: import("./pdf_rendering_queue").PDFRenderingQueue;
|
|
145
|
+
renderingQueue: import("./pdf_rendering_queue.js").PDFRenderingQueue;
|
|
146
146
|
maxCanvasPixels: number | undefined;
|
|
147
147
|
maxCanvasDim: number | undefined;
|
|
148
|
-
pageColors:
|
|
148
|
+
pageColors: object | null;
|
|
149
149
|
_manageMenu: Menu | undefined;
|
|
150
150
|
scroll: {
|
|
151
151
|
right: boolean;
|
|
152
152
|
down: boolean;
|
|
153
153
|
lastX: any;
|
|
154
154
|
lastY: any;
|
|
155
|
-
_eventHandler: (evt: any) => void;
|
|
156
155
|
};
|
|
157
156
|
getThumbnail(index: any): any;
|
|
158
157
|
_currentPageNumber: any;
|
|
@@ -167,7 +166,7 @@ export class PDFThumbnailViewer {
|
|
|
167
166
|
* @param {PDFDocumentProxy} pdfDocument
|
|
168
167
|
*/
|
|
169
168
|
setDocument(pdfDocument: PDFDocumentProxy): void;
|
|
170
|
-
pdfDocument: import("../src/display/api").PDFDocumentProxy | undefined;
|
|
169
|
+
pdfDocument: import("../src/display/api.js").PDFDocumentProxy | undefined;
|
|
171
170
|
/**
|
|
172
171
|
* @param {Array|null} labels
|
|
173
172
|
*/
|