pdfjs-serverless 0.5.1 → 0.7.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.d.mts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.mjs +1 -1
- package/dist/types/src/display/annotation_layer.d.ts +14 -4
- package/dist/types/src/display/annotation_storage.d.ts +9 -0
- package/dist/types/src/display/api.d.ts +119 -53
- package/dist/types/src/display/canvas.d.ts +4 -1
- package/dist/types/src/display/canvas_factory.d.ts +27 -0
- package/dist/types/src/display/cmap_reader_factory.d.ts +25 -0
- package/dist/types/src/display/display_utils.d.ts +29 -59
- package/dist/types/src/display/draw_layer.d.ts +6 -19
- package/dist/types/src/display/editor/alt_text.d.ts +17 -5
- package/dist/types/src/display/editor/annotation_editor_layer.d.ts +15 -9
- package/dist/types/src/display/editor/color_picker.d.ts +1 -0
- package/dist/types/src/display/editor/draw.d.ts +120 -0
- package/dist/types/src/display/editor/drawers/freedraw.d.ts +31 -0
- package/dist/types/src/display/editor/drawers/highlight.d.ts +36 -0
- package/dist/types/src/display/editor/drawers/inkdraw.d.ts +128 -0
- package/dist/types/src/display/editor/drawers/outline.d.ts +19 -0
- package/dist/types/src/display/editor/editor.d.ts +60 -12
- package/dist/types/src/display/editor/freetext.d.ts +7 -18
- package/dist/types/src/display/editor/highlight.d.ts +9 -27
- package/dist/types/src/display/editor/ink.d.ts +15 -73
- package/dist/types/src/display/editor/stamp.d.ts +27 -10
- package/dist/types/src/display/editor/toolbar.d.ts +3 -1
- package/dist/types/src/display/editor/tools.d.ts +32 -7
- package/dist/types/src/display/fetch_stream.d.ts +6 -13
- package/dist/types/src/display/filter_factory.d.ts +29 -0
- package/dist/types/src/display/font_loader.d.ts +3 -1
- package/dist/types/src/display/network.d.ts +10 -6
- package/dist/types/src/display/network_utils.d.ts +5 -3
- package/dist/types/src/display/node_stream.d.ts +7 -23
- package/dist/types/src/display/node_utils.d.ts +8 -11
- package/dist/types/src/display/optional_content_config.d.ts +1 -1
- package/dist/types/src/display/standard_fontdata_factory.d.ts +20 -0
- package/dist/types/src/display/svg_factory.d.ts +14 -0
- package/dist/types/src/display/text_layer.d.ts +15 -13
- package/dist/types/src/display/touch_manager.d.ts +14 -0
- package/dist/types/src/display/transport_stream.d.ts +1 -1
- package/dist/types/src/display/worker_options.d.ts +2 -2
- package/dist/types/src/interfaces.d.ts +4 -0
- package/dist/types/src/pdf.d.ts +5 -6
- package/dist/types/src/shared/message_handler.d.ts +10 -4
- package/dist/types/src/shared/util.d.ts +12 -20
- package/dist/types/web/annotation_editor_layer_builder.d.ts +5 -2
- package/dist/types/web/annotation_layer_builder.d.ts +3 -1
- package/dist/types/web/app_options.d.ts +4 -2
- package/dist/types/web/download_manager.d.ts +1 -2
- package/dist/types/web/event_utils.d.ts +10 -8
- package/dist/types/web/genericl10n.d.ts +5 -5
- package/dist/types/web/interfaces.d.ts +7 -14
- package/dist/types/web/l10n.d.ts +6 -2
- package/dist/types/web/pdf_find_controller.d.ts +24 -0
- package/dist/types/web/pdf_link_service.d.ts +2 -2
- package/dist/types/web/pdf_page_view.d.ts +17 -17
- package/dist/types/web/pdf_rendering_queue.d.ts +1 -1
- package/dist/types/web/pdf_thumbnail_view.d.ts +11 -3
- package/dist/types/web/pdf_thumbnail_viewer.d.ts +16 -1
- package/dist/types/web/pdf_viewer.d.ts +24 -11
- package/dist/types/web/struct_tree_layer_builder.d.ts +4 -2
- package/dist/types/web/text_layer_builder.d.ts +5 -5
- package/dist/types/web/ui_utils.d.ts +10 -21
- package/package.json +19 -19
- package/dist/types/src/display/base_factory.d.ts +0 -56
- package/dist/types/src/display/editor/outliner.d.ts +0 -70
|
@@ -4,6 +4,10 @@ export type PageViewportParameters = {
|
|
|
4
4
|
* yMax coordinates.
|
|
5
5
|
*/
|
|
6
6
|
viewBox: Array<number>;
|
|
7
|
+
/**
|
|
8
|
+
* - The size of units.
|
|
9
|
+
*/
|
|
10
|
+
userUnit: number;
|
|
7
11
|
/**
|
|
8
12
|
* - The scale of the viewport.
|
|
9
13
|
*/
|
|
@@ -56,58 +60,6 @@ export type PageViewportCloneParameters = {
|
|
|
56
60
|
dontFlip?: boolean | undefined;
|
|
57
61
|
};
|
|
58
62
|
export function deprecated(details: any): void;
|
|
59
|
-
export class DOMCanvasFactory extends BaseCanvasFactory {
|
|
60
|
-
constructor({ ownerDocument }?: {
|
|
61
|
-
ownerDocument?: Document | undefined;
|
|
62
|
-
});
|
|
63
|
-
_document: Document;
|
|
64
|
-
/**
|
|
65
|
-
* @ignore
|
|
66
|
-
*/
|
|
67
|
-
_createCanvas(width: any, height: any): HTMLCanvasElement;
|
|
68
|
-
}
|
|
69
|
-
export class DOMCMapReaderFactory extends BaseCMapReaderFactory {
|
|
70
|
-
/**
|
|
71
|
-
* @ignore
|
|
72
|
-
*/
|
|
73
|
-
_fetchData(url: any, compressionType: any): Promise<{
|
|
74
|
-
cMapData: Uint8Array;
|
|
75
|
-
compressionType: any;
|
|
76
|
-
}>;
|
|
77
|
-
}
|
|
78
|
-
/**
|
|
79
|
-
* FilterFactory aims to create some SVG filters we can use when drawing an
|
|
80
|
-
* image (or whatever) on a canvas.
|
|
81
|
-
* Filters aren't applied with ctx.putImageData because it just overwrites the
|
|
82
|
-
* underlying pixels.
|
|
83
|
-
* With these filters, it's possible for example to apply some transfer maps on
|
|
84
|
-
* an image without the need to apply them on the pixel arrays: the renderer
|
|
85
|
-
* does the magic for us.
|
|
86
|
-
*/
|
|
87
|
-
export class DOMFilterFactory extends BaseFilterFactory {
|
|
88
|
-
constructor({ docId, ownerDocument }?: {
|
|
89
|
-
docId: any;
|
|
90
|
-
ownerDocument?: Document | undefined;
|
|
91
|
-
});
|
|
92
|
-
addFilter(maps: any): any;
|
|
93
|
-
addHCMFilter(fgColor: any, bgColor: any): any;
|
|
94
|
-
addAlphaFilter(map: any): any;
|
|
95
|
-
addLuminosityFilter(map: any): any;
|
|
96
|
-
addHighlightHCMFilter(filterName: any, fgColor: any, bgColor: any, newFgColor: any, newBgColor: any): any;
|
|
97
|
-
#private;
|
|
98
|
-
}
|
|
99
|
-
export class DOMStandardFontDataFactory extends BaseStandardFontDataFactory {
|
|
100
|
-
/**
|
|
101
|
-
* @ignore
|
|
102
|
-
*/
|
|
103
|
-
_fetchData(url: any): Promise<Uint8Array>;
|
|
104
|
-
}
|
|
105
|
-
export class DOMSVGFactory extends BaseSVGFactory {
|
|
106
|
-
/**
|
|
107
|
-
* @ignore
|
|
108
|
-
*/
|
|
109
|
-
_createSVG(type: any): any;
|
|
110
|
-
}
|
|
111
63
|
export function fetchData(url: any, type?: string): Promise<any>;
|
|
112
64
|
export function getColorValues(colors: any): void;
|
|
113
65
|
export function getCurrentTransform(ctx: any): any[];
|
|
@@ -141,10 +93,29 @@ export function isValidFetchUrl(url: any, baseUrl: any): boolean;
|
|
|
141
93
|
* Event handler to suppress context menu.
|
|
142
94
|
*/
|
|
143
95
|
export function noContextMenu(e: any): void;
|
|
96
|
+
/**
|
|
97
|
+
* Scale factors for the canvas, necessary with HiDPI displays.
|
|
98
|
+
*/
|
|
99
|
+
export class OutputScale {
|
|
100
|
+
/**
|
|
101
|
+
* @type {number} Horizontal scale.
|
|
102
|
+
*/
|
|
103
|
+
sx: number;
|
|
104
|
+
/**
|
|
105
|
+
* @type {number} Vertical scale.
|
|
106
|
+
*/
|
|
107
|
+
sy: number;
|
|
108
|
+
/**
|
|
109
|
+
* @type {boolean} Returns `true` when scaling is required, `false` otherwise.
|
|
110
|
+
*/
|
|
111
|
+
get scaled(): boolean;
|
|
112
|
+
get symmetric(): boolean;
|
|
113
|
+
}
|
|
144
114
|
/**
|
|
145
115
|
* @typedef {Object} PageViewportParameters
|
|
146
116
|
* @property {Array<number>} viewBox - The xMin, yMin, xMax and
|
|
147
117
|
* yMax coordinates.
|
|
118
|
+
* @property {number} userUnit - The size of units.
|
|
148
119
|
* @property {number} scale - The scale of the viewport.
|
|
149
120
|
* @property {number} rotation - The rotation, in degrees, of the viewport.
|
|
150
121
|
* @property {number} [offsetX] - The horizontal, i.e. x-axis, offset. The
|
|
@@ -174,8 +145,9 @@ export class PageViewport {
|
|
|
174
145
|
/**
|
|
175
146
|
* @param {PageViewportParameters}
|
|
176
147
|
*/
|
|
177
|
-
constructor({ viewBox, scale, rotation, offsetX, offsetY, dontFlip, }: PageViewportParameters);
|
|
148
|
+
constructor({ viewBox, userUnit, scale, rotation, offsetX, offsetY, dontFlip, }: PageViewportParameters);
|
|
178
149
|
viewBox: number[];
|
|
150
|
+
userUnit: number;
|
|
179
151
|
scale: number;
|
|
180
152
|
rotation: number;
|
|
181
153
|
offsetX: number;
|
|
@@ -193,7 +165,7 @@ export class PageViewport {
|
|
|
193
165
|
* @param {PageViewportCloneParameters} [params]
|
|
194
166
|
* @returns {PageViewport} Cloned viewport.
|
|
195
167
|
*/
|
|
196
|
-
clone({ scale, rotation, offsetX, offsetY, dontFlip, }?: PageViewportCloneParameters
|
|
168
|
+
clone({ scale, rotation, offsetX, offsetY, dontFlip, }?: PageViewportCloneParameters): PageViewport;
|
|
197
169
|
/**
|
|
198
170
|
* Converts PDF point to the viewport coordinates. For examples, useful for
|
|
199
171
|
* converting PDF location into canvas pixel coordinates.
|
|
@@ -225,6 +197,7 @@ export class PageViewport {
|
|
|
225
197
|
convertToPdfPoint(x: number, y: number): any[];
|
|
226
198
|
}
|
|
227
199
|
export class PDFDateString {
|
|
200
|
+
static "__#2@#regex": any;
|
|
228
201
|
/**
|
|
229
202
|
* Convert a PDF date string to a JavaScript `Date` object.
|
|
230
203
|
*
|
|
@@ -268,9 +241,6 @@ export class StatTimer {
|
|
|
268
241
|
timeEnd(name: any): void;
|
|
269
242
|
toString(): string;
|
|
270
243
|
}
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
import { BaseFilterFactory } from "./base_factory.js";
|
|
274
|
-
import { BaseStandardFontDataFactory } from "./base_factory.js";
|
|
275
|
-
import { BaseSVGFactory } from "./base_factory.js";
|
|
244
|
+
export function stopEvent(e: any): void;
|
|
245
|
+
export const SVG_NS: "http://www.w3.org/2000/svg";
|
|
276
246
|
export {};
|
|
@@ -5,33 +5,20 @@
|
|
|
5
5
|
*/
|
|
6
6
|
export class DrawLayer {
|
|
7
7
|
static get _svgFactory(): any;
|
|
8
|
-
static "__#
|
|
9
|
-
x?: number | undefined;
|
|
10
|
-
y?: number | undefined;
|
|
11
|
-
width?: number | undefined;
|
|
12
|
-
height?: number | undefined;
|
|
13
|
-
}): void;
|
|
8
|
+
static "__#32@#setBox"(element: any, [x, y, width, height]: [any, any, any, any]): void;
|
|
14
9
|
constructor({ pageIndex }: {
|
|
15
10
|
pageIndex: any;
|
|
16
11
|
});
|
|
17
12
|
pageIndex: any;
|
|
18
13
|
setParent(parent: any): void;
|
|
19
|
-
|
|
14
|
+
draw(properties: any, isPathUpdatable?: boolean, hasClip?: boolean): {
|
|
20
15
|
id: number;
|
|
21
16
|
clipPathId: string;
|
|
22
17
|
};
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
updatePath(id: any, line: any): void;
|
|
28
|
-
updateBox(id: any, box: any): void;
|
|
29
|
-
show(id: any, visible: any): void;
|
|
30
|
-
rotate(id: any, angle: any): void;
|
|
31
|
-
changeColor(id: any, color: any): void;
|
|
32
|
-
changeOpacity(id: any, opacity: any): void;
|
|
33
|
-
addClass(id: any, className: any): void;
|
|
34
|
-
removeClass(id: any, className: any): void;
|
|
18
|
+
drawOutline(properties: any, mustRemoveSelfIntersections: any): number;
|
|
19
|
+
finalizeDraw(id: any, properties: any): void;
|
|
20
|
+
updateProperties(elementOrId: any, properties: any): void;
|
|
21
|
+
updateParent(id: any, layer: any): void;
|
|
35
22
|
remove(id: any): void;
|
|
36
23
|
destroy(): void;
|
|
37
24
|
#private;
|
|
@@ -1,22 +1,34 @@
|
|
|
1
1
|
export class AltText {
|
|
2
|
-
static
|
|
3
|
-
static
|
|
2
|
+
static "__#39@#l10nNewButton": null;
|
|
3
|
+
static _l10n: null;
|
|
4
|
+
static initialize(l10n: any): void;
|
|
4
5
|
constructor(editor: any);
|
|
5
6
|
render(): Promise<HTMLButtonElement>;
|
|
6
7
|
finish(): void;
|
|
7
8
|
isEmpty(): boolean;
|
|
9
|
+
hasData(): boolean;
|
|
10
|
+
get guessedText(): null;
|
|
11
|
+
setGuessedText(guessedText: any): Promise<void>;
|
|
12
|
+
toggleAltTextBadge(visibility?: boolean): void;
|
|
13
|
+
serialize(isForCopying: any): {
|
|
14
|
+
altText: null;
|
|
15
|
+
decorative: boolean;
|
|
16
|
+
guessedText: null;
|
|
17
|
+
textWithDisclaimer: null;
|
|
18
|
+
};
|
|
8
19
|
/**
|
|
9
20
|
* Set the alt text data.
|
|
10
21
|
*/
|
|
11
|
-
set data({ altText, decorative }: {
|
|
12
|
-
altText:
|
|
22
|
+
set data({ altText, decorative, guessedText, textWithDisclaimer, cancel, }: {
|
|
23
|
+
altText: null;
|
|
13
24
|
decorative: boolean;
|
|
14
25
|
});
|
|
15
26
|
get data(): {
|
|
16
|
-
altText:
|
|
27
|
+
altText: null;
|
|
17
28
|
decorative: boolean;
|
|
18
29
|
};
|
|
19
30
|
toggle(enabled?: boolean): void;
|
|
31
|
+
shown(): void;
|
|
20
32
|
destroy(): void;
|
|
21
33
|
#private;
|
|
22
34
|
}
|
|
@@ -4,9 +4,11 @@ export type TextAccessibilityManager = import("../../../web/text_accessibility.j
|
|
|
4
4
|
export type IL10n = import("../../../web/interfaces").IL10n;
|
|
5
5
|
export type AnnotationLayer = import("../annotation_layer.js").AnnotationLayer;
|
|
6
6
|
export type DrawLayer = import("../draw_layer.js").DrawLayer;
|
|
7
|
+
export type StructTreeLayerBuilder = any;
|
|
7
8
|
export type AnnotationEditorLayerOptions = {
|
|
8
9
|
mode: Object;
|
|
9
10
|
div: HTMLDivElement;
|
|
11
|
+
structTreeLayer: StructTreeLayerBuilder;
|
|
10
12
|
uiManager: AnnotationEditorUIManager;
|
|
11
13
|
enabled: boolean;
|
|
12
14
|
accessibilityManager?: import("../../../web/text_accessibility.js").TextAccessibilityManager | undefined;
|
|
@@ -24,6 +26,7 @@ export type RenderEditorLayerOptions = {
|
|
|
24
26
|
* @typedef {Object} AnnotationEditorLayerOptions
|
|
25
27
|
* @property {Object} mode
|
|
26
28
|
* @property {HTMLDivElement} div
|
|
29
|
+
* @property {StructTreeLayerBuilder} structTreeLayer
|
|
27
30
|
* @property {AnnotationEditorUIManager} uiManager
|
|
28
31
|
* @property {boolean} enabled
|
|
29
32
|
* @property {TextAccessibilityManager} [accessibilityManager]
|
|
@@ -43,15 +46,16 @@ export type RenderEditorLayerOptions = {
|
|
|
43
46
|
*/
|
|
44
47
|
export class AnnotationEditorLayer {
|
|
45
48
|
static _initialized: boolean;
|
|
46
|
-
static "__#
|
|
49
|
+
static "__#33@#editorTypes": Map<number, typeof FreeTextEditor | typeof HighlightEditor | typeof InkEditor | typeof StampEditor>;
|
|
47
50
|
/**
|
|
48
51
|
* @param {AnnotationEditorLayerOptions} options
|
|
49
52
|
*/
|
|
50
|
-
constructor({ uiManager, pageIndex, div, accessibilityManager, annotationLayer, drawLayer, textLayer, viewport, l10n, }: AnnotationEditorLayerOptions);
|
|
53
|
+
constructor({ uiManager, pageIndex, div, structTreeLayer, accessibilityManager, annotationLayer, drawLayer, textLayer, viewport, l10n, }: AnnotationEditorLayerOptions);
|
|
51
54
|
pageIndex: number;
|
|
52
55
|
div: HTMLDivElement;
|
|
53
56
|
viewport: import("../display_utils.js").PageViewport;
|
|
54
57
|
drawLayer: import("../draw_layer.js").DrawLayer;
|
|
58
|
+
_structTree: any;
|
|
55
59
|
get isEmpty(): boolean;
|
|
56
60
|
get isInvisible(): boolean;
|
|
57
61
|
/**
|
|
@@ -65,7 +69,6 @@ export class AnnotationEditorLayer {
|
|
|
65
69
|
*/
|
|
66
70
|
updateMode(mode?: number): void;
|
|
67
71
|
hasTextLayer(textLayer: any): boolean;
|
|
68
|
-
addInkEditorIfNeeded(isCommitting: any): void;
|
|
69
72
|
/**
|
|
70
73
|
* Set the editing state.
|
|
71
74
|
* @param {boolean} isEditing
|
|
@@ -76,13 +79,15 @@ export class AnnotationEditorLayer {
|
|
|
76
79
|
* @param {Object} params
|
|
77
80
|
*/
|
|
78
81
|
addCommands(params: Object): void;
|
|
82
|
+
cleanUndoStack(type: any): void;
|
|
83
|
+
toggleDrawing(enabled?: boolean): void;
|
|
79
84
|
togglePointerEvents(enabled?: boolean): void;
|
|
80
85
|
toggleAnnotationLayerPointerEvents(enabled?: boolean): void;
|
|
81
86
|
/**
|
|
82
87
|
* Enable pointer events on the main div in order to enable
|
|
83
88
|
* editor creation.
|
|
84
89
|
*/
|
|
85
|
-
enable(): void
|
|
90
|
+
enable(): Promise<void>;
|
|
86
91
|
/**
|
|
87
92
|
* Disable editor creation.
|
|
88
93
|
*/
|
|
@@ -131,6 +136,7 @@ export class AnnotationEditorLayer {
|
|
|
131
136
|
* @returns {string}
|
|
132
137
|
*/
|
|
133
138
|
getNextId(): string;
|
|
139
|
+
combinedSignal(ac: any): AbortSignal;
|
|
134
140
|
canCreateNewEmptyEditor(): boolean | undefined;
|
|
135
141
|
/**
|
|
136
142
|
* Paste some content into a new editor.
|
|
@@ -166,11 +172,6 @@ export class AnnotationEditorLayer {
|
|
|
166
172
|
* @param {AnnotationEditor} editor
|
|
167
173
|
*/
|
|
168
174
|
toggleSelected(editor: AnnotationEditor): void;
|
|
169
|
-
/**
|
|
170
|
-
* Check if the editor is selected.
|
|
171
|
-
* @param {AnnotationEditor} editor
|
|
172
|
-
*/
|
|
173
|
-
isSelected(editor: AnnotationEditor): boolean;
|
|
174
175
|
/**
|
|
175
176
|
* Unselect an editor.
|
|
176
177
|
* @param {AnnotationEditor} editor
|
|
@@ -186,6 +187,9 @@ export class AnnotationEditorLayer {
|
|
|
186
187
|
* @param {PointerEvent} event
|
|
187
188
|
*/
|
|
188
189
|
pointerdown(event: PointerEvent): void;
|
|
190
|
+
startDrawingSession(event: any): void;
|
|
191
|
+
pause(on: any): void;
|
|
192
|
+
endDrawingSession(isAborted?: boolean): any;
|
|
189
193
|
/**
|
|
190
194
|
*
|
|
191
195
|
* @param {AnnotationEditor} editor
|
|
@@ -194,6 +198,8 @@ export class AnnotationEditorLayer {
|
|
|
194
198
|
* @returns
|
|
195
199
|
*/
|
|
196
200
|
findNewParent(editor: AnnotationEditor, x: number, y: number): boolean;
|
|
201
|
+
commitOrRemove(): boolean;
|
|
202
|
+
onScaleChanging(): void;
|
|
197
203
|
/**
|
|
198
204
|
* Destroy the main editor.
|
|
199
205
|
*/
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Basic draw editor.
|
|
3
|
+
*/
|
|
4
|
+
export class DrawingEditor extends AnnotationEditor {
|
|
5
|
+
static _currentDrawId: number;
|
|
6
|
+
static _currentParent: null;
|
|
7
|
+
static "__#26@#currentDraw": null;
|
|
8
|
+
static "__#26@#currentDrawingAC": null;
|
|
9
|
+
static "__#26@#currentDrawingOptions": null;
|
|
10
|
+
static "__#26@#currentPointerId": number;
|
|
11
|
+
static "__#26@#currentPointerType": null;
|
|
12
|
+
static "__#26@#currentPointerIds": null;
|
|
13
|
+
static "__#26@#currentMoveTimestamp": number;
|
|
14
|
+
static _INNER_MARGIN: number;
|
|
15
|
+
static _mergeSVGProperties(p1: any, p2: any): any;
|
|
16
|
+
/**
|
|
17
|
+
* @param {Object} options
|
|
18
|
+
* @return {DrawingOptions} the default options to use for a new editor.
|
|
19
|
+
*/
|
|
20
|
+
static getDefaultDrawingOptions(_options: any): DrawingOptions;
|
|
21
|
+
/**
|
|
22
|
+
* @return {Map<AnnotationEditorParamsType, string>} a map between the
|
|
23
|
+
* parameter types and the name of the options.
|
|
24
|
+
*/
|
|
25
|
+
static get typesMap(): Map<{
|
|
26
|
+
RESIZE: number;
|
|
27
|
+
CREATE: number;
|
|
28
|
+
FREETEXT_SIZE: number;
|
|
29
|
+
FREETEXT_COLOR: number;
|
|
30
|
+
FREETEXT_OPACITY: number;
|
|
31
|
+
INK_COLOR: number;
|
|
32
|
+
INK_THICKNESS: number;
|
|
33
|
+
INK_OPACITY: number;
|
|
34
|
+
HIGHLIGHT_COLOR: number;
|
|
35
|
+
HIGHLIGHT_DEFAULT_COLOR: number;
|
|
36
|
+
HIGHLIGHT_THICKNESS: number;
|
|
37
|
+
HIGHLIGHT_FREE: number;
|
|
38
|
+
HIGHLIGHT_SHOW_ALL: number;
|
|
39
|
+
DRAW_STEP: number;
|
|
40
|
+
}, string>;
|
|
41
|
+
/**
|
|
42
|
+
* @returns {boolean} `true` if several drawings can be added to the
|
|
43
|
+
* annotation.
|
|
44
|
+
*/
|
|
45
|
+
static get supportMultipleDrawings(): boolean;
|
|
46
|
+
/** @inheritdoc */
|
|
47
|
+
static updateDefaultParams(type: any, value: any): void;
|
|
48
|
+
/** @inheritdoc */
|
|
49
|
+
static get defaultPropertiesToUpdate(): any[][];
|
|
50
|
+
static onScaleChangingWhenDrawing(): void;
|
|
51
|
+
/**
|
|
52
|
+
* Create a new drawer instance.
|
|
53
|
+
* @param {number} x - The x coordinate of the event.
|
|
54
|
+
* @param {number} y - The y coordinate of the event.
|
|
55
|
+
* @param {number} parentWidth - The parent width.
|
|
56
|
+
* @param {number} parentHeight - The parent height.
|
|
57
|
+
* @param {number} rotation - The parent rotation.
|
|
58
|
+
*/
|
|
59
|
+
static createDrawerInstance(_x: any, _y: any, _parentWidth: any, _parentHeight: any, _rotation: any): void;
|
|
60
|
+
static startDrawing(parent: any, uiManager: any, _isLTR: any, event: any): void;
|
|
61
|
+
static _drawMove(event: any): void;
|
|
62
|
+
static _cleanup(all: any): void;
|
|
63
|
+
static _endDraw(event: any): void;
|
|
64
|
+
static endDrawing(isAborted: any): any;
|
|
65
|
+
/**
|
|
66
|
+
* Deserialize the drawing outlines.
|
|
67
|
+
* @param {number} pageX - The x coordinate of the page.
|
|
68
|
+
* @param {number} pageY - The y coordinate of the page.
|
|
69
|
+
* @param {number} pageWidth - The width of the page.
|
|
70
|
+
* @param {number} pageHeight - The height of the page.
|
|
71
|
+
* @param {number} innerWidth - The inner width.
|
|
72
|
+
* @param {Object} data - The data to deserialize.
|
|
73
|
+
* @returns {Object} The deserialized outlines.
|
|
74
|
+
*/
|
|
75
|
+
static deserializeDraw(_pageX: any, _pageY: any, _pageWidth: any, _pageHeight: any, _innerWidth: any, _data: any): Object;
|
|
76
|
+
/** @inheritdoc */
|
|
77
|
+
static deserialize(data: any, parent: any, uiManager: any): Promise<AnnotationEditor | null>;
|
|
78
|
+
constructor(params: any);
|
|
79
|
+
_drawId: null;
|
|
80
|
+
/** @inheritdoc */
|
|
81
|
+
updateParams(type: any, value: any): void;
|
|
82
|
+
/** @inheritdoc */
|
|
83
|
+
get propertiesToUpdate(): any[][];
|
|
84
|
+
/**
|
|
85
|
+
* Update a property and make this action undoable.
|
|
86
|
+
* @param {string} color
|
|
87
|
+
*/
|
|
88
|
+
_updateProperty(type: any, name: any, value: any): void;
|
|
89
|
+
/** @inheritdoc */
|
|
90
|
+
_onTranslating(x: any, y: any): void;
|
|
91
|
+
/** @inheritdoc */
|
|
92
|
+
_onTranslated(): void;
|
|
93
|
+
/** @inheritdoc */
|
|
94
|
+
onceAdded(focus: any): void;
|
|
95
|
+
/** @inheritdoc */
|
|
96
|
+
rotate(): void;
|
|
97
|
+
onScaleChanging(): void;
|
|
98
|
+
/**
|
|
99
|
+
* Create the drawing options.
|
|
100
|
+
* @param {Object} _data
|
|
101
|
+
*/
|
|
102
|
+
createDrawingOptions(_data: Object): void;
|
|
103
|
+
serializeDraw(isForCopying: any): any;
|
|
104
|
+
/** @inheritdoc */
|
|
105
|
+
renderAnnotationElement(annotation: any): null;
|
|
106
|
+
#private;
|
|
107
|
+
}
|
|
108
|
+
export class DrawingOptions {
|
|
109
|
+
updateProperty(name: any, value: any): void;
|
|
110
|
+
updateProperties(properties: any): void;
|
|
111
|
+
updateSVGProperty(name: any, value: any): void;
|
|
112
|
+
toSVGProperties(): {
|
|
113
|
+
root: any;
|
|
114
|
+
};
|
|
115
|
+
reset(): void;
|
|
116
|
+
updateAll(options?: this): void;
|
|
117
|
+
clone(): void;
|
|
118
|
+
#private;
|
|
119
|
+
}
|
|
120
|
+
import { AnnotationEditor } from "./editor.js";
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export class FreeDrawOutline extends Outline {
|
|
2
|
+
constructor(outline: any, points: any, box: any, scaleFactor: any, innerMargin: any, isLTR: any);
|
|
3
|
+
lastPoint: number[];
|
|
4
|
+
serialize([blX, blY, trX, trY]: [any, any, any, any], rotation: any): {
|
|
5
|
+
outline: any[];
|
|
6
|
+
points: any[][];
|
|
7
|
+
};
|
|
8
|
+
get box(): Float32Array<ArrayBuffer>;
|
|
9
|
+
newOutliner(point: any, box: any, scaleFactor: any, thickness: any, isLTR: any, innerMargin?: number): FreeDrawOutliner;
|
|
10
|
+
getNewOutline(thickness: any, innerMargin: any): FreeDrawOutline;
|
|
11
|
+
#private;
|
|
12
|
+
}
|
|
13
|
+
export class FreeDrawOutliner {
|
|
14
|
+
static "__#19@#MIN_DIST": number;
|
|
15
|
+
static "__#19@#MIN_DIFF": number;
|
|
16
|
+
static "__#19@#MIN": number;
|
|
17
|
+
constructor({ x, y }: {
|
|
18
|
+
x: any;
|
|
19
|
+
y: any;
|
|
20
|
+
}, box: any, scaleFactor: any, thickness: any, isLTR: any, innerMargin?: number);
|
|
21
|
+
isEmpty(): boolean;
|
|
22
|
+
add({ x, y }: {
|
|
23
|
+
x: any;
|
|
24
|
+
y: any;
|
|
25
|
+
}): boolean;
|
|
26
|
+
toSVGPath(): string;
|
|
27
|
+
newFreeDrawOutline(outline: any, points: any, box: any, scaleFactor: any, innerMargin: any, isLTR: any): FreeDrawOutline;
|
|
28
|
+
getOutlines(): FreeDrawOutline;
|
|
29
|
+
#private;
|
|
30
|
+
}
|
|
31
|
+
import { Outline } from "./outline.js";
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
export class FreeHighlightOutliner extends FreeDrawOutliner {
|
|
2
|
+
}
|
|
3
|
+
export class HighlightOutliner {
|
|
4
|
+
/**
|
|
5
|
+
* Construct an outliner.
|
|
6
|
+
* @param {Array<Object>} boxes - An array of axis-aligned rectangles.
|
|
7
|
+
* @param {number} borderWidth - The width of the border of the boxes, it
|
|
8
|
+
* allows to make the boxes bigger (or smaller).
|
|
9
|
+
* @param {number} innerMargin - The margin between the boxes and the
|
|
10
|
+
* outlines. It's important to not have a null innerMargin when we want to
|
|
11
|
+
* draw the outline else the stroked outline could be clipped because of its
|
|
12
|
+
* width.
|
|
13
|
+
* @param {boolean} isLTR - true if we're in LTR mode. It's used to determine
|
|
14
|
+
* the last point of the boxes.
|
|
15
|
+
*/
|
|
16
|
+
constructor(boxes: Array<Object>, borderWidth?: number, innerMargin?: number, isLTR?: boolean);
|
|
17
|
+
getOutlines(): HighlightOutline;
|
|
18
|
+
#private;
|
|
19
|
+
}
|
|
20
|
+
import { FreeDrawOutliner } from "./freedraw.js";
|
|
21
|
+
declare class HighlightOutline extends Outline {
|
|
22
|
+
constructor(outlines: any, box: any, lastPoint: any);
|
|
23
|
+
lastPoint: any;
|
|
24
|
+
/**
|
|
25
|
+
* Serialize the outlines into the PDF page coordinate system.
|
|
26
|
+
* @param {Array<number>} _bbox - the bounding box of the annotation.
|
|
27
|
+
* @param {number} _rotation - the rotation of the annotation.
|
|
28
|
+
* @returns {Array<Array<number>>}
|
|
29
|
+
*/
|
|
30
|
+
serialize([blX, blY, trX, trY]: Array<number>, _rotation: number): Array<Array<number>>;
|
|
31
|
+
get box(): any;
|
|
32
|
+
get classNamesForOutlining(): string[];
|
|
33
|
+
#private;
|
|
34
|
+
}
|
|
35
|
+
import { Outline } from "./outline.js";
|
|
36
|
+
export {};
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
export class InkDrawOutline extends Outline {
|
|
2
|
+
static deserialize(pageX: any, pageY: any, pageWidth: any, pageHeight: any, innerMargin: any, { paths: { lines, points }, rotation, thickness }: {
|
|
3
|
+
paths: {
|
|
4
|
+
lines: any;
|
|
5
|
+
points: any;
|
|
6
|
+
};
|
|
7
|
+
rotation: any;
|
|
8
|
+
thickness: any;
|
|
9
|
+
}): InkDrawOutline;
|
|
10
|
+
build(lines: any, parentWidth: any, parentHeight: any, parentScale: any, rotation: any, thickness: any, innerMargin: any): void;
|
|
11
|
+
setLastElement(element: any): {
|
|
12
|
+
path: {
|
|
13
|
+
d: string;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
removeLastElement(): {
|
|
17
|
+
path: {
|
|
18
|
+
d: string;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
serialize([pageX, pageY, pageWidth, pageHeight]: [any, any, any, any], isForCopying: any): {
|
|
22
|
+
lines: any[];
|
|
23
|
+
points: any[];
|
|
24
|
+
rect: any[];
|
|
25
|
+
};
|
|
26
|
+
get box(): any;
|
|
27
|
+
updateProperty(name: any, value: any): any;
|
|
28
|
+
updateParentDimensions([width, height]: [any, any], scale: any): any;
|
|
29
|
+
updateRotation(rotation: any): {
|
|
30
|
+
path: {
|
|
31
|
+
transform: string;
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
get viewBox(): any;
|
|
35
|
+
get defaultProperties(): {
|
|
36
|
+
root: {
|
|
37
|
+
viewBox: any;
|
|
38
|
+
};
|
|
39
|
+
path: {
|
|
40
|
+
"transform-origin": string;
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
get rotationTransform(): string;
|
|
44
|
+
getPathResizingSVGProperties([newX, newY, newWidth, newHeight]: [any, any, any, any]): {
|
|
45
|
+
path: {
|
|
46
|
+
"transform-origin": string;
|
|
47
|
+
transform: string;
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
getPathResizedSVGProperties([newX, newY, newWidth, newHeight]: [any, any, any, any]): {
|
|
51
|
+
root: {
|
|
52
|
+
viewBox: any;
|
|
53
|
+
};
|
|
54
|
+
path: {
|
|
55
|
+
"transform-origin": string;
|
|
56
|
+
transform: string | null;
|
|
57
|
+
d: string;
|
|
58
|
+
};
|
|
59
|
+
};
|
|
60
|
+
getPathTranslatedSVGProperties([newX, newY]: [any, any], parentDimensions: any): {
|
|
61
|
+
root: {
|
|
62
|
+
viewBox: any;
|
|
63
|
+
};
|
|
64
|
+
path: {
|
|
65
|
+
d: string;
|
|
66
|
+
"transform-origin": string;
|
|
67
|
+
};
|
|
68
|
+
};
|
|
69
|
+
get defaultSVGProperties(): {
|
|
70
|
+
root: {
|
|
71
|
+
viewBox: any;
|
|
72
|
+
};
|
|
73
|
+
rootClass: {
|
|
74
|
+
draw: boolean;
|
|
75
|
+
};
|
|
76
|
+
path: {
|
|
77
|
+
d: string;
|
|
78
|
+
"transform-origin": string;
|
|
79
|
+
transform: string | null;
|
|
80
|
+
};
|
|
81
|
+
bbox: any;
|
|
82
|
+
};
|
|
83
|
+
#private;
|
|
84
|
+
}
|
|
85
|
+
export class InkDrawOutliner {
|
|
86
|
+
constructor(x: any, y: any, parentWidth: any, parentHeight: any, rotation: any, thickness: any);
|
|
87
|
+
updateProperty(name: any, value: any): void;
|
|
88
|
+
isEmpty(): boolean;
|
|
89
|
+
isCancellable(): boolean;
|
|
90
|
+
add(x: any, y: any): {
|
|
91
|
+
path: {
|
|
92
|
+
d: string;
|
|
93
|
+
};
|
|
94
|
+
} | null;
|
|
95
|
+
end(x: any, y: any): {
|
|
96
|
+
path: {
|
|
97
|
+
d: string;
|
|
98
|
+
};
|
|
99
|
+
} | null;
|
|
100
|
+
startNew(x: any, y: any, parentWidth: any, parentHeight: any, rotation: any): null;
|
|
101
|
+
getLastElement(): {
|
|
102
|
+
line: any[];
|
|
103
|
+
points: any[];
|
|
104
|
+
} | undefined;
|
|
105
|
+
setLastElement(element: any): {
|
|
106
|
+
path: {
|
|
107
|
+
d: string;
|
|
108
|
+
};
|
|
109
|
+
};
|
|
110
|
+
removeLastElement(): {
|
|
111
|
+
path: {
|
|
112
|
+
d: string;
|
|
113
|
+
};
|
|
114
|
+
};
|
|
115
|
+
toSVGPath(): string;
|
|
116
|
+
getOutlines(parentWidth: any, parentHeight: any, scale: any, innerMargin: any): InkDrawOutline;
|
|
117
|
+
get defaultSVGProperties(): {
|
|
118
|
+
root: {
|
|
119
|
+
viewBox: string;
|
|
120
|
+
};
|
|
121
|
+
rootClass: {
|
|
122
|
+
draw: boolean;
|
|
123
|
+
};
|
|
124
|
+
bbox: number[];
|
|
125
|
+
};
|
|
126
|
+
#private;
|
|
127
|
+
}
|
|
128
|
+
import { Outline } from "./outline.js";
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export class Outline {
|
|
2
|
+
static PRECISION: number;
|
|
3
|
+
static _rescale(src: any, tx: any, ty: any, sx: any, sy: any, dest: any): any;
|
|
4
|
+
static _rescaleAndSwap(src: any, tx: any, ty: any, sx: any, sy: any, dest: any): any;
|
|
5
|
+
static _translate(src: any, tx: any, ty: any, dest: any): any;
|
|
6
|
+
static svgRound(x: any): number;
|
|
7
|
+
static _normalizePoint(x: any, y: any, parentWidth: any, parentHeight: any, rotation: any): number[];
|
|
8
|
+
static _normalizePagePoint(x: any, y: any, rotation: any): any[];
|
|
9
|
+
static createBezierPoints(x1: any, y1: any, x2: any, y2: any, x3: any, y3: any): number[];
|
|
10
|
+
/**
|
|
11
|
+
* @returns {string} The SVG path of the outline.
|
|
12
|
+
*/
|
|
13
|
+
toSVGPath(): string;
|
|
14
|
+
/**
|
|
15
|
+
* @type {Object|null} The bounding box of the outline.
|
|
16
|
+
*/
|
|
17
|
+
get box(): Object | null;
|
|
18
|
+
serialize(_bbox: any, _rotation: any): void;
|
|
19
|
+
}
|