pdfjs-serverless 0.4.2 → 0.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 +1 -1
- package/dist/index.mjs +1 -1
- package/dist/types/src/display/annotation_layer.d.ts +10 -3
- package/dist/types/src/display/annotation_storage.d.ts +1 -0
- package/dist/types/src/display/api.d.ts +49 -22
- package/dist/types/src/display/base_factory.d.ts +3 -1
- package/dist/types/src/display/canvas.d.ts +2 -0
- package/dist/types/src/display/display_utils.d.ts +4 -3
- package/dist/types/src/display/draw_layer.d.ts +12 -14
- package/dist/types/src/display/editor/alt_text.d.ts +1 -0
- package/dist/types/src/display/editor/annotation_editor_layer.d.ts +13 -12
- package/dist/types/src/display/editor/color_picker.d.ts +2 -2
- package/dist/types/src/display/editor/editor.d.ts +50 -2
- package/dist/types/src/display/editor/freetext.d.ts +6 -1
- package/dist/types/src/display/editor/highlight.d.ts +38 -4
- package/dist/types/src/display/editor/ink.d.ts +4 -4
- package/dist/types/src/display/editor/outliner.d.ts +53 -9
- package/dist/types/src/display/editor/stamp.d.ts +1 -1
- package/dist/types/src/display/editor/toolbar.d.ts +7 -1
- package/dist/types/src/display/editor/tools.d.ts +37 -4
- package/dist/types/src/display/fetch_stream.d.ts +3 -4
- package/dist/types/src/display/font_loader.d.ts +1 -5
- package/dist/types/src/display/network.d.ts +2 -3
- package/dist/types/src/display/node_stream.d.ts +4 -5
- package/dist/types/src/display/node_utils.d.ts +6 -5
- package/dist/types/src/display/optional_content_config.d.ts +6 -1
- package/dist/types/src/display/text_layer.d.ts +40 -108
- package/dist/types/src/display/transport_stream.d.ts +3 -7
- package/dist/types/src/display/worker_options.d.ts +20 -22
- package/dist/types/src/pdf.d.ts +2 -3
- package/dist/types/src/shared/util.d.ts +19 -22
- package/dist/types/web/annotation_editor_layer_builder.d.ts +6 -13
- package/dist/types/web/annotation_layer_builder.d.ts +7 -4
- package/dist/types/web/app_options.d.ts +1 -2
- package/dist/types/web/genericl10n.d.ts +5 -3
- package/dist/types/web/interfaces.d.ts +8 -5
- package/dist/types/web/l10n.d.ts +3 -2
- package/dist/types/web/pdf_find_controller.d.ts +1 -2
- package/dist/types/web/pdf_history.d.ts +1 -53
- package/dist/types/web/pdf_link_service.d.ts +4 -107
- package/dist/types/web/pdf_page_view.d.ts +3 -15
- package/dist/types/web/pdf_scripting_manager.d.ts +0 -4
- package/dist/types/web/pdf_thumbnail_view.d.ts +1 -13
- package/dist/types/web/pdf_thumbnail_viewer.d.ts +0 -16
- package/dist/types/web/pdf_viewer.component.d.ts +1 -2
- package/dist/types/web/pdf_viewer.d.ts +38 -29
- package/dist/types/web/text_accessibility.d.ts +1 -1
- package/dist/types/web/text_highlighter.d.ts +1 -1
- package/dist/types/web/text_layer_builder.d.ts +17 -29
- package/package.json +14 -14
- package/dist/types/web/l10n_utils.d.ts +0 -9
|
@@ -3,6 +3,7 @@ export type PageViewport = import("./display_utils").PageViewport;
|
|
|
3
3
|
export type TextAccessibilityManager = import("../../web/text_accessibility.js").TextAccessibilityManager;
|
|
4
4
|
export type IDownloadManager = import("../../web/interfaces").IDownloadManager;
|
|
5
5
|
export type IPDFLinkService = import("../../web/interfaces").IPDFLinkService;
|
|
6
|
+
export type AnnotationEditorUIManager = any;
|
|
6
7
|
export type AnnotationElementParameters = {
|
|
7
8
|
data: Object;
|
|
8
9
|
layer: HTMLDivElement;
|
|
@@ -26,7 +27,7 @@ export type AnnotationLayerParameters = {
|
|
|
26
27
|
annotations: any[];
|
|
27
28
|
page: PDFPageProxy;
|
|
28
29
|
linkService: IPDFLinkService;
|
|
29
|
-
downloadManager
|
|
30
|
+
downloadManager?: import("../../web/interfaces").IDownloadManager | undefined;
|
|
30
31
|
annotationStorage?: AnnotationStorage | undefined;
|
|
31
32
|
/**
|
|
32
33
|
* - Path for image resources, mainly
|
|
@@ -48,6 +49,7 @@ export type AnnotationLayerParameters = {
|
|
|
48
49
|
} | null | undefined;
|
|
49
50
|
annotationCanvasMap?: Map<string, HTMLCanvasElement> | undefined;
|
|
50
51
|
accessibilityManager?: import("../../web/text_accessibility.js").TextAccessibilityManager | undefined;
|
|
52
|
+
annotationEditorUIManager?: any;
|
|
51
53
|
};
|
|
52
54
|
/**
|
|
53
55
|
* @typedef {Object} AnnotationLayerParameters
|
|
@@ -56,7 +58,7 @@ export type AnnotationLayerParameters = {
|
|
|
56
58
|
* @property {Array} annotations
|
|
57
59
|
* @property {PDFPageProxy} page
|
|
58
60
|
* @property {IPDFLinkService} linkService
|
|
59
|
-
* @property {IDownloadManager} downloadManager
|
|
61
|
+
* @property {IDownloadManager} [downloadManager]
|
|
60
62
|
* @property {AnnotationStorage} [annotationStorage]
|
|
61
63
|
* @property {string} [imageResourcesPath] - Path for image resources, mainly
|
|
62
64
|
* for annotation icons. Include trailing slash.
|
|
@@ -67,15 +69,17 @@ export type AnnotationLayerParameters = {
|
|
|
67
69
|
* @property {Object<string, Array<Object>> | null} [fieldObjects]
|
|
68
70
|
* @property {Map<string, HTMLCanvasElement>} [annotationCanvasMap]
|
|
69
71
|
* @property {TextAccessibilityManager} [accessibilityManager]
|
|
72
|
+
* @property {AnnotationEditorUIManager} [annotationEditorUIManager]
|
|
70
73
|
*/
|
|
71
74
|
/**
|
|
72
75
|
* Manage the layer containing all the annotations.
|
|
73
76
|
*/
|
|
74
77
|
export class AnnotationLayer {
|
|
75
|
-
constructor({ div, accessibilityManager, annotationCanvasMap, page, viewport, }: {
|
|
78
|
+
constructor({ div, accessibilityManager, annotationCanvasMap, annotationEditorUIManager, page, viewport, }: {
|
|
76
79
|
div: any;
|
|
77
80
|
accessibilityManager: any;
|
|
78
81
|
annotationCanvasMap: any;
|
|
82
|
+
annotationEditorUIManager: any;
|
|
79
83
|
page: any;
|
|
80
84
|
viewport: any;
|
|
81
85
|
});
|
|
@@ -83,6 +87,7 @@ export class AnnotationLayer {
|
|
|
83
87
|
page: any;
|
|
84
88
|
viewport: any;
|
|
85
89
|
zIndex: number;
|
|
90
|
+
_annotationEditorUIManager: any;
|
|
86
91
|
popupShow: any[] | undefined;
|
|
87
92
|
/**
|
|
88
93
|
* Render a new annotation layer with all annotation elements.
|
|
@@ -150,6 +155,8 @@ declare class AnnotationElement {
|
|
|
150
155
|
parent: any;
|
|
151
156
|
container: HTMLElement | undefined;
|
|
152
157
|
get hasPopupData(): boolean;
|
|
158
|
+
updateEdited(params: any): void;
|
|
159
|
+
resetEdited(): void;
|
|
153
160
|
/**
|
|
154
161
|
* Create an empty container for the annotation's HTML element.
|
|
155
162
|
*
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
export type TypedArray = Int8Array | Uint8Array | Uint8ClampedArray | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array;
|
|
2
|
-
export type BinaryData = TypedArray | ArrayBuffer | Array<number> | string;
|
|
3
2
|
export type RefProxy = {
|
|
4
3
|
num: number;
|
|
5
4
|
gen: number;
|
|
@@ -13,7 +12,8 @@ export type DocumentInitParameters = {
|
|
|
13
12
|
*/
|
|
14
13
|
url?: string | URL | undefined;
|
|
15
14
|
/**
|
|
16
|
-
* -
|
|
15
|
+
* -
|
|
16
|
+
* Binary PDF data.
|
|
17
17
|
* Use TypedArrays (Uint8Array) to improve the memory usage. If PDF data is
|
|
18
18
|
* BASE64-encoded, use `atob()` to convert it to a binary string first.
|
|
19
19
|
*
|
|
@@ -21,7 +21,7 @@ export type DocumentInitParameters = {
|
|
|
21
21
|
* worker-thread. This will help reduce main-thread memory usage, however
|
|
22
22
|
* it will take ownership of the TypedArrays.
|
|
23
23
|
*/
|
|
24
|
-
data?:
|
|
24
|
+
data?: string | number[] | ArrayBuffer | TypedArray | undefined;
|
|
25
25
|
/**
|
|
26
26
|
* - Basic authentication headers.
|
|
27
27
|
*/
|
|
@@ -126,8 +126,8 @@ export type DocumentInitParameters = {
|
|
|
126
126
|
maxImageSize?: number | undefined;
|
|
127
127
|
/**
|
|
128
128
|
* - Determines if we can evaluate strings
|
|
129
|
-
* as JavaScript. Primarily used to improve performance of
|
|
130
|
-
*
|
|
129
|
+
* as JavaScript. Primarily used to improve performance of PDF functions.
|
|
130
|
+
* The default value is `true`.
|
|
131
131
|
*/
|
|
132
132
|
isEvalSupported?: boolean | undefined;
|
|
133
133
|
/**
|
|
@@ -279,6 +279,10 @@ export type TextContent = {
|
|
|
279
279
|
styles: {
|
|
280
280
|
[x: string]: TextStyle;
|
|
281
281
|
};
|
|
282
|
+
/**
|
|
283
|
+
* - The document /Lang attribute.
|
|
284
|
+
*/
|
|
285
|
+
lang: string | null;
|
|
282
286
|
};
|
|
283
287
|
/**
|
|
284
288
|
* Page text content part.
|
|
@@ -529,9 +533,6 @@ export const DefaultStandardFontDataFactory: typeof NodeStandardFontDataFactory;
|
|
|
529
533
|
* Float64Array
|
|
530
534
|
* } TypedArray
|
|
531
535
|
*/
|
|
532
|
-
/**
|
|
533
|
-
* @typedef { TypedArray | ArrayBuffer | Array<number> | string } BinaryData
|
|
534
|
-
*/
|
|
535
536
|
/**
|
|
536
537
|
* @typedef {Object} RefProxy
|
|
537
538
|
* @property {number} num
|
|
@@ -542,7 +543,8 @@ export const DefaultStandardFontDataFactory: typeof NodeStandardFontDataFactory;
|
|
|
542
543
|
*
|
|
543
544
|
* @typedef {Object} DocumentInitParameters
|
|
544
545
|
* @property {string | URL} [url] - The URL of the PDF.
|
|
545
|
-
* @property {
|
|
546
|
+
* @property {TypedArray | ArrayBuffer | Array<number> | string} [data] -
|
|
547
|
+
* Binary PDF data.
|
|
546
548
|
* Use TypedArrays (Uint8Array) to improve the memory usage. If PDF data is
|
|
547
549
|
* BASE64-encoded, use `atob()` to convert it to a binary string first.
|
|
548
550
|
*
|
|
@@ -598,8 +600,8 @@ export const DefaultStandardFontDataFactory: typeof NodeStandardFontDataFactory;
|
|
|
598
600
|
* pixels, i.e. width * height. Images above this value will not be rendered.
|
|
599
601
|
* Use -1 for no limit, which is also the default value.
|
|
600
602
|
* @property {boolean} [isEvalSupported] - Determines if we can evaluate strings
|
|
601
|
-
* as JavaScript. Primarily used to improve performance of
|
|
602
|
-
*
|
|
603
|
+
* as JavaScript. Primarily used to improve performance of PDF functions.
|
|
604
|
+
* The default value is `true`.
|
|
603
605
|
* @property {boolean} [isOffscreenCanvasSupported] - Determines if we can use
|
|
604
606
|
* `OffscreenCanvas` in the worker. Primarily used to improve performance of
|
|
605
607
|
* image conversion/rendering.
|
|
@@ -685,7 +687,7 @@ export class PDFDataRangeTransport {
|
|
|
685
687
|
_progressListeners: any[];
|
|
686
688
|
_progressiveReadListeners: any[];
|
|
687
689
|
_progressiveDoneListeners: any[];
|
|
688
|
-
_readyCapability:
|
|
690
|
+
_readyCapability: any;
|
|
689
691
|
/**
|
|
690
692
|
* @param {function} listener
|
|
691
693
|
*/
|
|
@@ -736,8 +738,8 @@ export class PDFDataRangeTransport {
|
|
|
736
738
|
* after which individual pages can be rendered.
|
|
737
739
|
*/
|
|
738
740
|
export class PDFDocumentLoadingTask {
|
|
739
|
-
static "__#
|
|
740
|
-
_capability:
|
|
741
|
+
static "__#45@#docId": number;
|
|
742
|
+
_capability: any;
|
|
741
743
|
_transport: any;
|
|
742
744
|
_worker: any;
|
|
743
745
|
/**
|
|
@@ -917,11 +919,32 @@ export class PDFDocumentProxy {
|
|
|
917
919
|
items: any[];
|
|
918
920
|
}[]>;
|
|
919
921
|
/**
|
|
922
|
+
* @typedef {Object} GetOptionalContentConfigParameters
|
|
923
|
+
* @property {string} [intent] - Determines the optional content groups that
|
|
924
|
+
* are visible by default; valid values are:
|
|
925
|
+
* - 'display' (viewable groups).
|
|
926
|
+
* - 'print' (printable groups).
|
|
927
|
+
* - 'any' (all groups).
|
|
928
|
+
* The default value is 'display'.
|
|
929
|
+
*/
|
|
930
|
+
/**
|
|
931
|
+
* @param {GetOptionalContentConfigParameters} [params] - Optional content
|
|
932
|
+
* config parameters.
|
|
920
933
|
* @returns {Promise<OptionalContentConfig>} A promise that is resolved with
|
|
921
934
|
* an {@link OptionalContentConfig} that contains all the optional content
|
|
922
935
|
* groups (assuming that the document has any).
|
|
923
936
|
*/
|
|
924
|
-
getOptionalContentConfig(
|
|
937
|
+
getOptionalContentConfig({ intent }?: {
|
|
938
|
+
/**
|
|
939
|
+
* - Determines the optional content groups that
|
|
940
|
+
* are visible by default; valid values are:
|
|
941
|
+
* - 'display' (viewable groups).
|
|
942
|
+
* - 'print' (printable groups).
|
|
943
|
+
* - 'any' (all groups).
|
|
944
|
+
* The default value is 'display'.
|
|
945
|
+
*/
|
|
946
|
+
intent?: string | undefined;
|
|
947
|
+
} | undefined): Promise<OptionalContentConfig>;
|
|
925
948
|
/**
|
|
926
949
|
* @returns {Promise<Array<number> | null>} A promise that is resolved with
|
|
927
950
|
* an {Array} that contains the permission flags for the PDF document, or
|
|
@@ -991,6 +1014,11 @@ export class PDFDocumentProxy {
|
|
|
991
1014
|
* Destroys the current document instance and terminates the worker.
|
|
992
1015
|
*/
|
|
993
1016
|
destroy(): Promise<void>;
|
|
1017
|
+
/**
|
|
1018
|
+
* @param {RefProxy} ref - The page reference.
|
|
1019
|
+
* @returns {number | null} The page number, if it's cached.
|
|
1020
|
+
*/
|
|
1021
|
+
cachedPageNumber(ref: RefProxy): number | null;
|
|
994
1022
|
/**
|
|
995
1023
|
* @type {DocumentInitParameters} A subset of the current
|
|
996
1024
|
* {DocumentInitParameters}, which are needed in the viewer.
|
|
@@ -1052,6 +1080,7 @@ export class PDFDocumentProxy {
|
|
|
1052
1080
|
* items are included when includeMarkedContent is true.
|
|
1053
1081
|
* @property {Object<string, TextStyle>} styles - {@link TextStyle} objects,
|
|
1054
1082
|
* indexed by font name.
|
|
1083
|
+
* @property {string | null} lang - The document /Lang attribute.
|
|
1055
1084
|
*/
|
|
1056
1085
|
/**
|
|
1057
1086
|
* Page text content part.
|
|
@@ -1226,11 +1255,11 @@ export class PDFPageProxy {
|
|
|
1226
1255
|
*/
|
|
1227
1256
|
getViewport({ scale, rotation, offsetX, offsetY, dontFlip, }?: GetViewportParameters): PageViewport;
|
|
1228
1257
|
/**
|
|
1229
|
-
* @param {GetAnnotationsParameters} params - Annotation parameters.
|
|
1258
|
+
* @param {GetAnnotationsParameters} [params] - Annotation parameters.
|
|
1230
1259
|
* @returns {Promise<Array<any>>} A promise that is resolved with an
|
|
1231
1260
|
* {Array} of the annotation objects.
|
|
1232
1261
|
*/
|
|
1233
|
-
getAnnotations({ intent }?: GetAnnotationsParameters): Promise<Array<any>>;
|
|
1262
|
+
getAnnotations({ intent }?: GetAnnotationsParameters | undefined): Promise<Array<any>>;
|
|
1234
1263
|
/**
|
|
1235
1264
|
* @returns {Promise<Object>} A promise that is resolved with an
|
|
1236
1265
|
* {Object} with JS actions.
|
|
@@ -1334,7 +1363,7 @@ export class PDFPageProxy {
|
|
|
1334
1363
|
* @param {PDFWorkerParameters} params - The worker initialization parameters.
|
|
1335
1364
|
*/
|
|
1336
1365
|
export class PDFWorker {
|
|
1337
|
-
static "__#
|
|
1366
|
+
static "__#48@#workerPorts": any;
|
|
1338
1367
|
/**
|
|
1339
1368
|
* @param {PDFWorkerParameters} params - The worker initialization parameters.
|
|
1340
1369
|
*/
|
|
@@ -1344,7 +1373,7 @@ export class PDFWorker {
|
|
|
1344
1373
|
* @type {string}
|
|
1345
1374
|
*/
|
|
1346
1375
|
static get workerSrc(): string;
|
|
1347
|
-
static get "__#
|
|
1376
|
+
static get "__#48@#mainThreadWorkerMessageHandler"(): any;
|
|
1348
1377
|
static get _setupFakeWorkerGlobal(): any;
|
|
1349
1378
|
constructor({ name, port, verbosity, }?: {
|
|
1350
1379
|
name?: null | undefined;
|
|
@@ -1354,7 +1383,7 @@ export class PDFWorker {
|
|
|
1354
1383
|
name: any;
|
|
1355
1384
|
destroyed: boolean;
|
|
1356
1385
|
verbosity: number;
|
|
1357
|
-
_readyCapability:
|
|
1386
|
+
_readyCapability: any;
|
|
1358
1387
|
_port: any;
|
|
1359
1388
|
_webWorker: Worker | null;
|
|
1360
1389
|
_messageHandler: MessageHandler | null;
|
|
@@ -1428,9 +1457,7 @@ import { NodeCMapReaderFactory } from "./node_utils";
|
|
|
1428
1457
|
import { DOMFilterFactory } from "./display_utils.js";
|
|
1429
1458
|
import { NodeFilterFactory } from "./node_utils";
|
|
1430
1459
|
import { NodeStandardFontDataFactory } from "./node_utils";
|
|
1431
|
-
import { PromiseCapability } from "../shared/util.js";
|
|
1432
1460
|
import { AnnotationStorage } from "./annotation_storage.js";
|
|
1433
|
-
import { info } from "../shared/util.js";
|
|
1434
1461
|
import { Metadata } from "./metadata.js";
|
|
1435
1462
|
import { StatTimer } from "./display_utils.js";
|
|
1436
1463
|
/**
|
|
@@ -28,7 +28,9 @@ export class BaseCMapReaderFactory {
|
|
|
28
28
|
export class BaseFilterFactory {
|
|
29
29
|
addFilter(maps: any): string;
|
|
30
30
|
addHCMFilter(fgColor: any, bgColor: any): string;
|
|
31
|
-
|
|
31
|
+
addAlphaFilter(map: any): string;
|
|
32
|
+
addLuminosityFilter(map: any): string;
|
|
33
|
+
addHighlightHCMFilter(filterName: any, fgColor: any, bgColor: any, newFgColor: any, newBgColor: any): string;
|
|
32
34
|
destroy(keepHCM?: boolean): void;
|
|
33
35
|
}
|
|
34
36
|
export class BaseStandardFontDataFactory {
|
|
@@ -79,6 +79,8 @@ export class CanvasGraphics {
|
|
|
79
79
|
beginSMaskMode(): void;
|
|
80
80
|
endSMaskMode(): void;
|
|
81
81
|
compose(dirtyBox: any): void;
|
|
82
|
+
composeSMask(ctx: any, smask: any, layerCtx: any, layerBox: any): void;
|
|
83
|
+
genericComposeSMask(maskCtx: any, layerCtx: any, width: any, height: any, subtype: any, backdrop: any, transferMap: any, layerOffsetX: any, layerOffsetY: any, maskOffsetX: any, maskOffsetY: any): void;
|
|
82
84
|
save(): void;
|
|
83
85
|
restore(): void;
|
|
84
86
|
transform(a: any, b: any, c: any, d: any, e: any, f: any): void;
|
|
@@ -91,7 +91,9 @@ export class DOMFilterFactory extends BaseFilterFactory {
|
|
|
91
91
|
});
|
|
92
92
|
addFilter(maps: any): any;
|
|
93
93
|
addHCMFilter(fgColor: any, bgColor: any): any;
|
|
94
|
-
|
|
94
|
+
addAlphaFilter(map: any): any;
|
|
95
|
+
addLuminosityFilter(map: any): any;
|
|
96
|
+
addHighlightHCMFilter(filterName: any, fgColor: any, bgColor: any, newFgColor: any, newBgColor: any): any;
|
|
95
97
|
#private;
|
|
96
98
|
}
|
|
97
99
|
export class DOMStandardFontDataFactory extends BaseStandardFontDataFactory {
|
|
@@ -113,10 +115,9 @@ export function getCurrentTransformInverse(ctx: any): any[];
|
|
|
113
115
|
/**
|
|
114
116
|
* Gets the filename from a given URL.
|
|
115
117
|
* @param {string} url
|
|
116
|
-
* @param {boolean} [onlyStripPath]
|
|
117
118
|
* @returns {string}
|
|
118
119
|
*/
|
|
119
|
-
export function getFilenameFromUrl(url: string
|
|
120
|
+
export function getFilenameFromUrl(url: string): string;
|
|
120
121
|
/**
|
|
121
122
|
* Returns the filename or guessed filename from the url (see issue 3455).
|
|
122
123
|
* @param {string} url - The original PDF location.
|
|
@@ -5,30 +5,28 @@
|
|
|
5
5
|
*/
|
|
6
6
|
export class DrawLayer {
|
|
7
7
|
static get _svgFactory(): any;
|
|
8
|
-
static "__#
|
|
9
|
-
x
|
|
10
|
-
y
|
|
11
|
-
width
|
|
12
|
-
height
|
|
8
|
+
static "__#26@#setBox"(element: any, { x, y, width, height }?: {
|
|
9
|
+
x?: number | undefined;
|
|
10
|
+
y?: number | undefined;
|
|
11
|
+
width?: number | undefined;
|
|
12
|
+
height?: number | undefined;
|
|
13
13
|
}): void;
|
|
14
|
-
static "__#21@#extractPathFromHighlightOutlines"(polygons: any): string;
|
|
15
14
|
constructor({ pageIndex }: {
|
|
16
15
|
pageIndex: any;
|
|
17
16
|
});
|
|
18
17
|
pageIndex: any;
|
|
19
18
|
setParent(parent: any): void;
|
|
20
|
-
highlight(
|
|
21
|
-
outlines: any;
|
|
22
|
-
box: any;
|
|
23
|
-
}, color: any, opacity: any): {
|
|
19
|
+
highlight(outlines: any, color: any, opacity: any, isPathUpdatable?: boolean): {
|
|
24
20
|
id: number;
|
|
25
21
|
clipPathId: string;
|
|
26
22
|
};
|
|
27
|
-
highlightOutline(
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
23
|
+
highlightOutline(outlines: any): number;
|
|
24
|
+
finalizeLine(id: any, line: any): void;
|
|
25
|
+
updateLine(id: any, line: any): void;
|
|
26
|
+
removeFreeHighlight(id: any): void;
|
|
27
|
+
updatePath(id: any, line: any): void;
|
|
31
28
|
updateBox(id: any, box: any): void;
|
|
29
|
+
show(id: any, visible: any): void;
|
|
32
30
|
rotate(id: any, angle: any): void;
|
|
33
31
|
changeColor(id: any, color: any): void;
|
|
34
32
|
changeOpacity(id: any, opacity: any): void;
|
|
@@ -43,7 +43,7 @@ export type RenderEditorLayerOptions = {
|
|
|
43
43
|
*/
|
|
44
44
|
export class AnnotationEditorLayer {
|
|
45
45
|
static _initialized: boolean;
|
|
46
|
-
static "__#
|
|
46
|
+
static "__#27@#editorTypes": Map<number, typeof FreeTextEditor | typeof HighlightEditor | typeof InkEditor | typeof StampEditor>;
|
|
47
47
|
/**
|
|
48
48
|
* @param {AnnotationEditorLayerOptions} options
|
|
49
49
|
*/
|
|
@@ -53,6 +53,7 @@ export class AnnotationEditorLayer {
|
|
|
53
53
|
viewport: import("../display_utils.js").PageViewport;
|
|
54
54
|
drawLayer: import("../draw_layer.js").DrawLayer;
|
|
55
55
|
get isEmpty(): boolean;
|
|
56
|
+
get isInvisible(): boolean;
|
|
56
57
|
/**
|
|
57
58
|
* Update the toolbar if it's required to reflect the tool currently used.
|
|
58
59
|
* @param {number} mode
|
|
@@ -63,6 +64,7 @@ export class AnnotationEditorLayer {
|
|
|
63
64
|
* @param {number} mode
|
|
64
65
|
*/
|
|
65
66
|
updateMode(mode?: number): void;
|
|
67
|
+
hasTextLayer(textLayer: any): boolean;
|
|
66
68
|
addInkEditorIfNeeded(isCommitting: any): void;
|
|
67
69
|
/**
|
|
68
70
|
* Set the editing state.
|
|
@@ -75,6 +77,7 @@ export class AnnotationEditorLayer {
|
|
|
75
77
|
*/
|
|
76
78
|
addCommands(params: Object): void;
|
|
77
79
|
togglePointerEvents(enabled?: boolean): void;
|
|
80
|
+
toggleAnnotationLayerPointerEvents(enabled?: boolean): void;
|
|
78
81
|
/**
|
|
79
82
|
* Enable pointer events on the main div in order to enable
|
|
80
83
|
* editor creation.
|
|
@@ -141,6 +144,14 @@ export class AnnotationEditorLayer {
|
|
|
141
144
|
* @returns {AnnotationEditor | null}
|
|
142
145
|
*/
|
|
143
146
|
deserialize(data: Object): AnnotationEditor | null;
|
|
147
|
+
/**
|
|
148
|
+
* Create and add a new editor.
|
|
149
|
+
* @param {PointerEvent} event
|
|
150
|
+
* @param {boolean} isCentered
|
|
151
|
+
* @param [Object] data
|
|
152
|
+
* @returns {AnnotationEditor}
|
|
153
|
+
*/
|
|
154
|
+
createAndAddNewEditor(event: PointerEvent, isCentered: boolean, data?: {}): AnnotationEditor;
|
|
144
155
|
/**
|
|
145
156
|
* Create and add a new editor.
|
|
146
157
|
*/
|
|
@@ -165,17 +176,6 @@ export class AnnotationEditorLayer {
|
|
|
165
176
|
* @param {AnnotationEditor} editor
|
|
166
177
|
*/
|
|
167
178
|
unselect(editor: AnnotationEditor): void;
|
|
168
|
-
/**
|
|
169
|
-
* SelectionChange callback.
|
|
170
|
-
* @param {Event} _event
|
|
171
|
-
*/
|
|
172
|
-
selectionStart(_event: Event): void;
|
|
173
|
-
/**
|
|
174
|
-
* Called when the user releases the mouse button after having selected
|
|
175
|
-
* some text.
|
|
176
|
-
* @param {PointerEvent} event
|
|
177
|
-
*/
|
|
178
|
-
pointerUpAfterSelection(event: PointerEvent): void;
|
|
179
179
|
/**
|
|
180
180
|
* Pointerup callback.
|
|
181
181
|
* @param {PointerEvent} event
|
|
@@ -213,6 +213,7 @@ export class AnnotationEditorLayer {
|
|
|
213
213
|
* @returns {Object} dimensions.
|
|
214
214
|
*/
|
|
215
215
|
get pageDimensions(): Object;
|
|
216
|
+
get scale(): number;
|
|
216
217
|
#private;
|
|
217
218
|
}
|
|
218
219
|
import { AnnotationEditor } from "./editor.js";
|
|
@@ -9,8 +9,8 @@ export class ColorPicker {
|
|
|
9
9
|
_colorSelectFromKeyboard(event: any): void;
|
|
10
10
|
_moveToNext(event: any): void;
|
|
11
11
|
_moveToPrevious(event: any): void;
|
|
12
|
-
_moveToBeginning(): void;
|
|
13
|
-
_moveToEnd(): void;
|
|
12
|
+
_moveToBeginning(event: any): void;
|
|
13
|
+
_moveToEnd(event: any): void;
|
|
14
14
|
hideDropdown(): void;
|
|
15
15
|
_hideDropdownFromKeyboard(): void;
|
|
16
16
|
updateColor(color: any): void;
|
|
@@ -36,6 +36,7 @@ export class AnnotationEditor {
|
|
|
36
36
|
static _borderLineWidth: number;
|
|
37
37
|
static _colorManager: ColorManager;
|
|
38
38
|
static _zIndex: number;
|
|
39
|
+
static _telemetryTimeout: number;
|
|
39
40
|
static get _resizerKeyboardManager(): any;
|
|
40
41
|
static get _defaultLineColor(): any;
|
|
41
42
|
static deleteAnnotationElement(editor: any): void;
|
|
@@ -43,7 +44,7 @@ export class AnnotationEditor {
|
|
|
43
44
|
* Initialize the l10n stuff for this type of editor.
|
|
44
45
|
* @param {Object} l10n
|
|
45
46
|
*/
|
|
46
|
-
static initialize(l10n: Object, options
|
|
47
|
+
static initialize(l10n: Object, _uiManager: any, options: any): void;
|
|
47
48
|
/**
|
|
48
49
|
* Update the default parameters for this type of editor.
|
|
49
50
|
* @param {number} _type
|
|
@@ -69,7 +70,7 @@ export class AnnotationEditor {
|
|
|
69
70
|
* @param {AnnotationEditorLayer} parent
|
|
70
71
|
*/
|
|
71
72
|
static paste(item: DataTransferItem, parent: AnnotationEditorLayer): void;
|
|
72
|
-
static "__#
|
|
73
|
+
static "__#34@#rotatePoint"(x: any, y: any, angle: any): any[];
|
|
73
74
|
/**
|
|
74
75
|
* Deserialize the editor.
|
|
75
76
|
* The result of the deserialization is a new editor.
|
|
@@ -87,6 +88,7 @@ export class AnnotationEditor {
|
|
|
87
88
|
*/
|
|
88
89
|
constructor(parameters: AnnotationEditorParameters);
|
|
89
90
|
_initialOptions: any;
|
|
91
|
+
_isVisible: boolean;
|
|
90
92
|
_uiManager: null;
|
|
91
93
|
_focusEventsAllowed: boolean;
|
|
92
94
|
_l10nPromise: null;
|
|
@@ -173,6 +175,20 @@ export class AnnotationEditor {
|
|
|
173
175
|
*/
|
|
174
176
|
translateInPage(x: number, y: number): void;
|
|
175
177
|
drag(tx: any, ty: any): void;
|
|
178
|
+
get _hasBeenMoved(): boolean;
|
|
179
|
+
/**
|
|
180
|
+
* Get the translation to take into account the editor border.
|
|
181
|
+
* The CSS engine positions the element by taking the border into account so
|
|
182
|
+
* we must apply the opposite translation to have the editor in the right
|
|
183
|
+
* position.
|
|
184
|
+
* @returns {Array<number>}
|
|
185
|
+
*/
|
|
186
|
+
getBaseTranslation(): Array<number>;
|
|
187
|
+
/**
|
|
188
|
+
* @returns {boolean} true if position must be fixed (i.e. make the x and y
|
|
189
|
+
* living in the page).
|
|
190
|
+
*/
|
|
191
|
+
get _mustFixPosition(): boolean;
|
|
176
192
|
/**
|
|
177
193
|
* Fix the position of the editor in order to keep it inside its parent page.
|
|
178
194
|
* @param {number} [rotation] - the rotation of the page.
|
|
@@ -219,6 +235,7 @@ export class AnnotationEditor {
|
|
|
219
235
|
*/
|
|
220
236
|
set altTextData(data: any);
|
|
221
237
|
get altTextData(): any;
|
|
238
|
+
hasAltText(): boolean;
|
|
222
239
|
/**
|
|
223
240
|
* Render this editor in a div.
|
|
224
241
|
* @returns {HTMLDivElement | null}
|
|
@@ -294,6 +311,12 @@ export class AnnotationEditor {
|
|
|
294
311
|
* @returns {Object | null}
|
|
295
312
|
*/
|
|
296
313
|
serialize(isForCopying?: boolean | undefined, context?: Object | null | undefined): Object | null;
|
|
314
|
+
/**
|
|
315
|
+
* Check if an existing annotation associated with this editor has been
|
|
316
|
+
* modified.
|
|
317
|
+
* @returns {boolean}
|
|
318
|
+
*/
|
|
319
|
+
get hasBeenModified(): boolean;
|
|
297
320
|
/**
|
|
298
321
|
* Remove this editor.
|
|
299
322
|
* It's used on ctrl+backspace action.
|
|
@@ -368,6 +391,31 @@ export class AnnotationEditor {
|
|
|
368
391
|
* @param {number} height
|
|
369
392
|
*/
|
|
370
393
|
setAspectRatio(width: number, height: number): void;
|
|
394
|
+
/**
|
|
395
|
+
* Get the data to report to the telemetry when the editor is added.
|
|
396
|
+
* @returns {Object}
|
|
397
|
+
*/
|
|
398
|
+
get telemetryInitialData(): Object;
|
|
399
|
+
/**
|
|
400
|
+
* The telemetry data to use when saving/printing.
|
|
401
|
+
* @returns {Object|null}
|
|
402
|
+
*/
|
|
403
|
+
get telemetryFinalData(): Object | null;
|
|
404
|
+
_reportTelemetry(data: any, mustWait?: boolean): void;
|
|
405
|
+
/**
|
|
406
|
+
* Show or hide this editor.
|
|
407
|
+
* @param {boolean|undefined} visible
|
|
408
|
+
*/
|
|
409
|
+
show(visible?: boolean | undefined): void;
|
|
410
|
+
enable(): void;
|
|
411
|
+
disable(): void;
|
|
412
|
+
/**
|
|
413
|
+
* Render an annotation in the annotation layer.
|
|
414
|
+
* @param {Object} annotation
|
|
415
|
+
* @returns {HTMLElement}
|
|
416
|
+
*/
|
|
417
|
+
renderAnnotationElement(annotation: Object): HTMLElement;
|
|
418
|
+
resetAnnotationElement(annotation: any): void;
|
|
371
419
|
#private;
|
|
372
420
|
}
|
|
373
421
|
import { AnnotationEditorUIManager } from "./tools.js";
|
|
@@ -11,11 +11,13 @@ export class FreeTextEditor extends AnnotationEditor {
|
|
|
11
11
|
static _type: string;
|
|
12
12
|
static _editorType: number;
|
|
13
13
|
/** @inheritdoc */
|
|
14
|
-
static initialize(l10n: any): void;
|
|
14
|
+
static initialize(l10n: any, uiManager: any): void;
|
|
15
15
|
/** @inheritdoc */
|
|
16
16
|
static updateDefaultParams(type: any, value: any): void;
|
|
17
17
|
/** @inheritdoc */
|
|
18
18
|
static get defaultPropertiesToUpdate(): any[][];
|
|
19
|
+
static "__#17@#getNodeContent"(node: any): any;
|
|
20
|
+
static "__#17@#deserializeContent"(content: any): any;
|
|
19
21
|
/** @inheritdoc */
|
|
20
22
|
static deserialize(data: any, parent: any, uiManager: any): AnnotationEditor | null;
|
|
21
23
|
constructor(params: any);
|
|
@@ -45,6 +47,7 @@ export class FreeTextEditor extends AnnotationEditor {
|
|
|
45
47
|
editorDivInput(event: any): void;
|
|
46
48
|
editorDiv: HTMLDivElement | undefined;
|
|
47
49
|
overlayDiv: HTMLDivElement | undefined;
|
|
50
|
+
editorDivPaste(event: any): void;
|
|
48
51
|
/** @inheritdoc */
|
|
49
52
|
serialize(isForCopying?: boolean): {
|
|
50
53
|
annotationType: number;
|
|
@@ -60,6 +63,8 @@ export class FreeTextEditor extends AnnotationEditor {
|
|
|
60
63
|
id: any;
|
|
61
64
|
deleted: boolean;
|
|
62
65
|
} | null;
|
|
66
|
+
/** @inheritdoc */
|
|
67
|
+
renderAnnotationElement(annotation: any): HTMLElement;
|
|
63
68
|
#private;
|
|
64
69
|
}
|
|
65
70
|
import { AnnotationEditor } from "./editor.js";
|
|
@@ -4,13 +4,23 @@
|
|
|
4
4
|
export class HighlightEditor extends AnnotationEditor {
|
|
5
5
|
static _defaultColor: null;
|
|
6
6
|
static _defaultOpacity: number;
|
|
7
|
+
static _defaultThickness: number;
|
|
7
8
|
static _l10nPromise: any;
|
|
8
9
|
static _type: string;
|
|
9
10
|
static _editorType: number;
|
|
10
|
-
static
|
|
11
|
+
static _freeHighlightId: number;
|
|
12
|
+
static _freeHighlight: null;
|
|
13
|
+
static _freeHighlightClipId: string;
|
|
14
|
+
static get _keyboardManager(): any;
|
|
15
|
+
static computeTelemetryFinalData(data: any): {
|
|
16
|
+
numberOfColors: any;
|
|
17
|
+
};
|
|
18
|
+
/** @inheritdoc */
|
|
19
|
+
static initialize(l10n: any, uiManager: any): void;
|
|
20
|
+
/** @inheritdoc */
|
|
11
21
|
static updateDefaultParams(type: any, value: any): void;
|
|
12
22
|
static get defaultPropertiesToUpdate(): (number | null)[][];
|
|
13
|
-
static "__#
|
|
23
|
+
static "__#23@#rotateBbox"({ x, y, width, height }: {
|
|
14
24
|
x: any;
|
|
15
25
|
y: any;
|
|
16
26
|
width: any;
|
|
@@ -21,11 +31,33 @@ export class HighlightEditor extends AnnotationEditor {
|
|
|
21
31
|
width: any;
|
|
22
32
|
height: any;
|
|
23
33
|
};
|
|
34
|
+
static startHighlighting(parent: any, isLTR: any, { target: textLayer, x, y }: {
|
|
35
|
+
target: any;
|
|
36
|
+
x: any;
|
|
37
|
+
y: any;
|
|
38
|
+
}): void;
|
|
39
|
+
static "__#23@#highlightMove"(parent: any, event: any): void;
|
|
40
|
+
static "__#23@#endHighlight"(parent: any, event: any): void;
|
|
24
41
|
/** @inheritdoc */
|
|
25
42
|
static deserialize(data: any, parent: any, uiManager: any): AnnotationEditor | null;
|
|
26
43
|
constructor(params: any);
|
|
27
44
|
color: any;
|
|
28
45
|
/** @inheritdoc */
|
|
46
|
+
get telemetryInitialData(): {
|
|
47
|
+
action: string;
|
|
48
|
+
type: string;
|
|
49
|
+
color: any;
|
|
50
|
+
thickness: any;
|
|
51
|
+
methodOfCreation: string;
|
|
52
|
+
};
|
|
53
|
+
/** @inheritdoc */
|
|
54
|
+
get telemetryFinalData(): {
|
|
55
|
+
type: string;
|
|
56
|
+
color: any;
|
|
57
|
+
};
|
|
58
|
+
/** @inheritdoc */
|
|
59
|
+
translateInPage(x: any, y: any): void;
|
|
60
|
+
/** @inheritdoc */
|
|
29
61
|
updateParams(type: any, value: any): void;
|
|
30
62
|
/** @inheritdoc */
|
|
31
63
|
get propertiesToUpdate(): any[][];
|
|
@@ -37,13 +69,15 @@ export class HighlightEditor extends AnnotationEditor {
|
|
|
37
69
|
rotate(angle: any): void;
|
|
38
70
|
pointerover(): void;
|
|
39
71
|
pointerleave(): void;
|
|
72
|
+
_moveCaret(direction: any): void;
|
|
40
73
|
/** @inheritdoc */
|
|
41
74
|
serialize(isForCopying?: boolean): {
|
|
42
75
|
annotationType: number;
|
|
43
76
|
color: number[];
|
|
44
77
|
opacity: any;
|
|
45
|
-
|
|
46
|
-
|
|
78
|
+
thickness: any;
|
|
79
|
+
quadPoints: any[] | null;
|
|
80
|
+
outlines: any;
|
|
47
81
|
pageIndex: number;
|
|
48
82
|
rect: any[];
|
|
49
83
|
rotation: number;
|