unpdf 1.8.0 → 1.9.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.cjs +1 -1
- package/dist/index.d.cts +15 -15
- package/dist/index.d.mts +15 -15
- package/dist/index.mjs +1 -1
- package/dist/pdfjs.mjs +37 -37
- 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 +9 -20
- 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 +2 -0
- 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 +7 -12
- package/dist/types/src/display/xfa_text.d.ts +2 -5
- package/dist/types/src/pdf.d.ts +2 -1
- 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 +5 -3
- package/dist/types/web/annotation_layer_builder.d.ts +8 -12
- 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 +5 -6
- package/dist/types/web/pdf_find_utils.d.ts +8 -14
- package/dist/types/web/pdf_history.d.ts +1 -1
- package/dist/types/web/pdf_link_service.d.ts +5 -7
- package/dist/types/web/pdf_page_view.d.ts +3 -3
- package/dist/types/web/pdf_rendering_queue.d.ts +4 -5
- package/dist/types/web/pdf_scripting_manager.d.ts +4 -4
- package/dist/types/web/pdf_thumbnail_view.d.ts +2 -2
- package/dist/types/web/pdf_thumbnail_viewer.d.ts +14 -15
- package/dist/types/web/pdf_viewer.d.ts +36 -16
- package/dist/types/web/renderable_view.d.ts +1 -1
- package/dist/types/web/sidebar.d.ts +3 -3
- package/dist/types/web/struct_tree_layer_builder.d.ts +20 -6
- package/dist/types/web/text_accessibility.d.ts +4 -2
- package/dist/types/web/text_highlighter.d.ts +1 -2
- package/dist/types/web/text_layer_builder.d.ts +5 -5
- package/dist/types/web/ui_utils.d.ts +8 -13
- package/dist/types/web/xfa_layer_builder.d.ts +7 -7
- package/package.json +11 -11
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export class CanvasGraphics {
|
|
2
|
+
static #SCALE_MATRIX: null;
|
|
2
3
|
constructor(canvasCtx: any, commonObjs: any, objs: any, canvasFactory: any, filterFactory: any, { optionalContentConfig, markedContentStack }: {
|
|
3
4
|
optionalContentConfig: any;
|
|
4
5
|
markedContentStack?: null | undefined;
|
|
@@ -35,7 +36,6 @@ export class CanvasGraphics {
|
|
|
35
36
|
outputScaleY: number;
|
|
36
37
|
pageColors: any;
|
|
37
38
|
_cachedScaleForStroking: number[];
|
|
38
|
-
_cachedGetSinglePixelWidth: number | null;
|
|
39
39
|
_cachedBitmapsMap: Map<any, any>;
|
|
40
40
|
dependencyTracker: any;
|
|
41
41
|
imagesTracker: any;
|
|
@@ -244,6 +244,7 @@ declare class CanvasExtraState {
|
|
|
244
244
|
lineWidth: number;
|
|
245
245
|
activeSMask: null;
|
|
246
246
|
transferMaps: string;
|
|
247
|
+
transferMapsFallback: null;
|
|
247
248
|
minMax: Float32Array<ArrayBuffer>;
|
|
248
249
|
clipBox: Float32Array<ArrayBuffer>;
|
|
249
250
|
clone(): any;
|
|
@@ -26,8 +26,13 @@ export class CanvasBBoxTracker {
|
|
|
26
26
|
recordFullPageBBox(idx: any): this;
|
|
27
27
|
/**
|
|
28
28
|
* @param {number} idx
|
|
29
|
+
* @param {boolean} [preserve=false] - When false, the pending bounding box
|
|
30
|
+
* is cleared once recorded; pass true to keep it for subsequent
|
|
31
|
+
* operations.
|
|
32
|
+
* @param {Iterable<Iterable<number>>} [dependencyLists] - Groups of operation
|
|
33
|
+
* indices whose bounding boxes are also expanded to cover this operation.
|
|
29
34
|
*/
|
|
30
|
-
recordOperation(idx: number, preserve
|
|
35
|
+
recordOperation(idx: number, preserve?: boolean, dependencyLists?: Iterable<Iterable<number>>): this;
|
|
31
36
|
bboxToClipBoxDropOperation(idx: any): this;
|
|
32
37
|
take(): BBoxReader;
|
|
33
38
|
takeDebugMetadata(): void;
|
|
@@ -109,6 +114,8 @@ export class CanvasDependencyTracker {
|
|
|
109
114
|
recordNamedDependency(idx: any, name: any): this;
|
|
110
115
|
/**
|
|
111
116
|
* @param {number} idx
|
|
117
|
+
* @param {boolean} [preserve=false] - When false, the pending dependencies
|
|
118
|
+
* are cleared once recorded; pass true to keep them for later operations.
|
|
112
119
|
*/
|
|
113
120
|
recordOperation(idx: number, preserve?: boolean): this;
|
|
114
121
|
recordShowTextOperation(idx: any, preserve?: boolean): this;
|
|
@@ -133,7 +140,6 @@ export class CanvasImagesTracker {
|
|
|
133
140
|
* Used to track dependencies of nested operations list, that
|
|
134
141
|
* should actually all map to the index of the operation that
|
|
135
142
|
* contains the nested list.
|
|
136
|
-
*
|
|
137
143
|
* @implements {CanvasDependencyTracker}
|
|
138
144
|
*/
|
|
139
145
|
export class CanvasNestedDependencyTracker implements CanvasDependencyTracker {
|
|
@@ -184,7 +190,6 @@ export class CanvasNestedDependencyTracker implements CanvasDependencyTracker {
|
|
|
184
190
|
recordNamedDependency(idx: any, name: any): this;
|
|
185
191
|
/**
|
|
186
192
|
* @param {number} idx
|
|
187
|
-
* @param {SimpleDependency[]} dependencyNames
|
|
188
193
|
*/
|
|
189
194
|
recordOperation(idx: number): this;
|
|
190
195
|
recordShowTextOperation(idx: any): this;
|
|
@@ -2,6 +2,7 @@ export function applyOpacity(color: any, opacity: any): any;
|
|
|
2
2
|
export class ColorScheme {
|
|
3
3
|
static get isDarkMode(): any;
|
|
4
4
|
}
|
|
5
|
+
export function computeLuminance(x: any): number;
|
|
5
6
|
export class CSSConstants {
|
|
6
7
|
static get commentForegroundColor(): any;
|
|
7
8
|
}
|
|
@@ -87,7 +88,6 @@ export class PDFDateString {
|
|
|
87
88
|
* Moreover, Adobe Acrobat doesn't handle changing the date to universal time
|
|
88
89
|
* and doesn't use the user's time zone (effectively ignoring the HH' and mm'
|
|
89
90
|
* parts of the date string).
|
|
90
|
-
*
|
|
91
91
|
* @param {string} input
|
|
92
92
|
* @returns {Date|null}
|
|
93
93
|
*/
|
|
@@ -124,6 +124,6 @@ export class StatTimer {
|
|
|
124
124
|
#private;
|
|
125
125
|
}
|
|
126
126
|
export function stopEvent(e: any): void;
|
|
127
|
-
export const SupportedImageMimeTypes: string
|
|
127
|
+
export const SupportedImageMimeTypes: Set<string>;
|
|
128
128
|
import { PageViewport } from "./page_viewport.js";
|
|
129
129
|
export {};
|
|
@@ -5,11 +5,11 @@ export type DrawLayerOptions = {
|
|
|
5
5
|
/**
|
|
6
6
|
* Filter factory used to style selections (optional).
|
|
7
7
|
*/
|
|
8
|
-
filterFactory?:
|
|
8
|
+
filterFactory?: object | null | undefined;
|
|
9
9
|
/**
|
|
10
10
|
* Page foreground/background colors for HCM (optional).
|
|
11
11
|
*/
|
|
12
|
-
pageColors?:
|
|
12
|
+
pageColors?: object | null | undefined;
|
|
13
13
|
/**
|
|
14
14
|
* Zero-based page index.
|
|
15
15
|
*/
|
|
@@ -95,7 +95,6 @@ export class DrawLayer {
|
|
|
95
95
|
static #textLayers: WeakMap<Element, TextLayerSelectionData>;
|
|
96
96
|
/**
|
|
97
97
|
* Clean up the selection for a text layer.
|
|
98
|
-
*
|
|
99
98
|
* @param {Element} textLayer
|
|
100
99
|
* Text layer.
|
|
101
100
|
* @returns {undefined}
|
|
@@ -117,7 +116,6 @@ export class DrawLayer {
|
|
|
117
116
|
* We want to display the selection in a separate layer on top of the text
|
|
118
117
|
* layer because the text layer has `mix-blend-mode: multiply` and we want
|
|
119
118
|
* the selection to have a different blend mode.
|
|
120
|
-
*
|
|
121
119
|
* @returns {undefined}
|
|
122
120
|
* Nothing.
|
|
123
121
|
*/
|
|
@@ -127,8 +125,6 @@ export class DrawLayer {
|
|
|
127
125
|
/**
|
|
128
126
|
* @param {DrawLayerOptions} options
|
|
129
127
|
* Configuration.
|
|
130
|
-
* @returns
|
|
131
|
-
* Instance.
|
|
132
128
|
*/
|
|
133
129
|
constructor({ filterFactory, pageColors, pageIndex, textLayer, }: DrawLayerOptions);
|
|
134
130
|
pageIndex: number;
|
|
@@ -6,7 +6,7 @@ export type DrawLayer = import("../draw_layer.js").DrawLayer;
|
|
|
6
6
|
export type StructTreeLayerBuilder = import("../../../web/struct_tree_layer_builder.js").StructTreeLayerBuilder;
|
|
7
7
|
export type L10n = import("../../../web/l10n.js").L10n;
|
|
8
8
|
export type AnnotationEditorLayerOptions = {
|
|
9
|
-
mode:
|
|
9
|
+
mode: object;
|
|
10
10
|
div: HTMLDivElement;
|
|
11
11
|
structTreeLayer: StructTreeLayerBuilder;
|
|
12
12
|
uiManager: AnnotationEditorUIManager;
|
|
@@ -23,8 +23,8 @@ export type RenderEditorLayerOptions = {
|
|
|
23
23
|
viewport: PageViewport;
|
|
24
24
|
};
|
|
25
25
|
/**
|
|
26
|
-
* @typedef {
|
|
27
|
-
* @property {
|
|
26
|
+
* @typedef {object} AnnotationEditorLayerOptions
|
|
27
|
+
* @property {object} mode
|
|
28
28
|
* @property {HTMLDivElement} div
|
|
29
29
|
* @property {StructTreeLayerBuilder} structTreeLayer
|
|
30
30
|
* @property {AnnotationEditorUIManager} uiManager
|
|
@@ -38,7 +38,7 @@ export type RenderEditorLayerOptions = {
|
|
|
38
38
|
* @property {PageViewport} viewport
|
|
39
39
|
*/
|
|
40
40
|
/**
|
|
41
|
-
* @typedef {
|
|
41
|
+
* @typedef {object} RenderEditorLayerOptions
|
|
42
42
|
* @property {PageViewport} viewport
|
|
43
43
|
*/
|
|
44
44
|
/**
|
|
@@ -60,9 +60,9 @@ export class AnnotationEditorLayer {
|
|
|
60
60
|
get isInvisible(): boolean;
|
|
61
61
|
/**
|
|
62
62
|
* Update the toolbar if it's required to reflect the tool currently used.
|
|
63
|
-
* @param {
|
|
63
|
+
* @param {object} options
|
|
64
64
|
*/
|
|
65
|
-
updateToolbar(options:
|
|
65
|
+
updateToolbar(options: object): void;
|
|
66
66
|
/**
|
|
67
67
|
* The mode has changed: it must be updated.
|
|
68
68
|
* @param {number} mode
|
|
@@ -76,9 +76,9 @@ export class AnnotationEditorLayer {
|
|
|
76
76
|
setEditingState(isEditing: boolean): void;
|
|
77
77
|
/**
|
|
78
78
|
* Add some commands into the CommandManager (undo/redo stuff).
|
|
79
|
-
* @param {
|
|
79
|
+
* @param {object} params
|
|
80
80
|
*/
|
|
81
|
-
addCommands(params:
|
|
81
|
+
addCommands(params: object): void;
|
|
82
82
|
cleanUndoStack(type: any): void;
|
|
83
83
|
toggleDrawing(enabled?: boolean): void;
|
|
84
84
|
togglePointerEvents(enabled?: boolean): void;
|
|
@@ -136,24 +136,24 @@ export class AnnotationEditorLayer {
|
|
|
136
136
|
canCreateNewEmptyEditor(): boolean | undefined;
|
|
137
137
|
/**
|
|
138
138
|
* Paste some content into a new editor.
|
|
139
|
-
* @param {
|
|
140
|
-
* @param {
|
|
139
|
+
* @param {object} options
|
|
140
|
+
* @param {object} params
|
|
141
141
|
*/
|
|
142
|
-
pasteEditor(options:
|
|
142
|
+
pasteEditor(options: object, params: object): Promise<void>;
|
|
143
143
|
/**
|
|
144
144
|
* Create a new editor
|
|
145
|
-
* @param {
|
|
145
|
+
* @param {object} data
|
|
146
146
|
* @returns {Promise<AnnotationEditor | null>}
|
|
147
147
|
*/
|
|
148
|
-
deserialize(data:
|
|
148
|
+
deserialize(data: object): Promise<AnnotationEditor | null>;
|
|
149
149
|
/**
|
|
150
150
|
* Create and add a new editor.
|
|
151
151
|
* @param {PointerEvent} event
|
|
152
152
|
* @param {boolean} isCentered
|
|
153
|
-
* @param [
|
|
153
|
+
* @param {object} [data]
|
|
154
154
|
* @returns {AnnotationEditor}
|
|
155
155
|
*/
|
|
156
|
-
createAndAddNewEditor(event: PointerEvent, isCentered: boolean, data?:
|
|
156
|
+
createAndAddNewEditor(event: PointerEvent, isCentered: boolean, data?: object): AnnotationEditor;
|
|
157
157
|
get boundingClientRect(): DOMRect;
|
|
158
158
|
/**
|
|
159
159
|
* Create and add a new editor.
|
|
@@ -188,11 +188,10 @@ export class AnnotationEditorLayer {
|
|
|
188
188
|
pause(on: any): void;
|
|
189
189
|
endDrawingSession(isAborted?: boolean): any;
|
|
190
190
|
/**
|
|
191
|
-
*
|
|
192
191
|
* @param {AnnotationEditor} editor
|
|
193
192
|
* @param {number} x
|
|
194
193
|
* @param {number} y
|
|
195
|
-
* @returns
|
|
194
|
+
* @returns {boolean}
|
|
196
195
|
*/
|
|
197
196
|
findNewParent(editor: AnnotationEditor, x: number, y: number): boolean;
|
|
198
197
|
commitOrRemove(): boolean;
|
|
@@ -213,9 +212,9 @@ export class AnnotationEditorLayer {
|
|
|
213
212
|
update({ viewport }: RenderEditorLayerOptions): void;
|
|
214
213
|
/**
|
|
215
214
|
* Get page dimensions.
|
|
216
|
-
* @returns {
|
|
215
|
+
* @returns {object} dimensions.
|
|
217
216
|
*/
|
|
218
|
-
get pageDimensions():
|
|
217
|
+
get pageDimensions(): object;
|
|
219
218
|
get scale(): number;
|
|
220
219
|
#private;
|
|
221
220
|
}
|
|
@@ -42,7 +42,7 @@ export class Comment {
|
|
|
42
42
|
};
|
|
43
43
|
/**
|
|
44
44
|
* Restore the comment data (used for undo).
|
|
45
|
-
* @param {
|
|
45
|
+
* @param {object} data - The comment data to restore.
|
|
46
46
|
* @param {string} data.text - The comment text.
|
|
47
47
|
* @param {string|null} data.richText - The rich text content.
|
|
48
48
|
* @param {Date|null} data.date - The original date.
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
export type AnnotationEditorLayer = import("./annotation_editor_layer.js").AnnotationEditorLayer;
|
|
2
|
+
export type AnnotationEditorUIManager = import("./tools.js").AnnotationEditorUIManager;
|
|
1
3
|
/**
|
|
2
4
|
* Basic draw editor.
|
|
3
5
|
*/
|
|
@@ -7,15 +9,18 @@ export class DrawingEditor extends AnnotationEditor {
|
|
|
7
9
|
static #currentDraw: null;
|
|
8
10
|
static #currentDrawingAC: null;
|
|
9
11
|
static #currentDrawingOptions: null;
|
|
12
|
+
static #currentClipPathId: null;
|
|
10
13
|
static _INNER_MARGIN: number;
|
|
11
14
|
static _mergeSVGProperties(p1: any, p2: any): any;
|
|
12
15
|
/**
|
|
13
|
-
* @
|
|
14
|
-
* @
|
|
16
|
+
* @abstract
|
|
17
|
+
* @param {object} _options
|
|
18
|
+
* @returns {DrawingOptions} the default options to use for a new editor.
|
|
15
19
|
*/
|
|
16
|
-
static getDefaultDrawingOptions(_options:
|
|
20
|
+
static getDefaultDrawingOptions(_options: object): DrawingOptions;
|
|
17
21
|
/**
|
|
18
|
-
* @
|
|
22
|
+
* @abstract
|
|
23
|
+
* @returns {Map<AnnotationEditorParamsType, string>} a map between the
|
|
19
24
|
* parameter types and the name of the options.
|
|
20
25
|
*/
|
|
21
26
|
static get typesMap(): Map<{
|
|
@@ -34,6 +39,8 @@ export class DrawingEditor extends AnnotationEditor {
|
|
|
34
39
|
HIGHLIGHT_SHOW_ALL: number;
|
|
35
40
|
DRAW_STEP: number;
|
|
36
41
|
}, string>;
|
|
42
|
+
static get _hasClipPath(): boolean;
|
|
43
|
+
static get _hasDrawClass(): boolean;
|
|
37
44
|
/**
|
|
38
45
|
* @returns {boolean} `true` if several drawings can be added to the
|
|
39
46
|
* annotation.
|
|
@@ -45,65 +52,109 @@ export class DrawingEditor extends AnnotationEditor {
|
|
|
45
52
|
static get defaultPropertiesToUpdate(): any[][];
|
|
46
53
|
static onScaleChangingWhenDrawing(): void;
|
|
47
54
|
/**
|
|
48
|
-
*
|
|
49
|
-
* @param {
|
|
50
|
-
* @param {number}
|
|
51
|
-
* @param {number}
|
|
52
|
-
* @param {number}
|
|
53
|
-
*
|
|
55
|
+
* @abstract
|
|
56
|
+
* @param {object} _params
|
|
57
|
+
* @param {number} _params.x - The x coordinate of the event.
|
|
58
|
+
* @param {number} _params.y - The y coordinate of the event.
|
|
59
|
+
* @param {[number, number, number, number]} _params.box - The target's
|
|
60
|
+
* client bounding box.
|
|
61
|
+
* @param {number} _params.rotation - The viewport rotation.
|
|
62
|
+
* @param {AnnotationEditorLayer} _params.parent - The parent layer.
|
|
63
|
+
* @param {boolean} _params.isLTR - Whether the direction is left-to-right.
|
|
54
64
|
*/
|
|
55
|
-
static createDrawerInstance(
|
|
56
|
-
|
|
65
|
+
static createDrawerInstance(_params: {
|
|
66
|
+
x: number;
|
|
67
|
+
y: number;
|
|
68
|
+
box: [number, number, number, number];
|
|
69
|
+
rotation: number;
|
|
70
|
+
parent: AnnotationEditorLayer;
|
|
71
|
+
isLTR: boolean;
|
|
72
|
+
}): void;
|
|
73
|
+
/**
|
|
74
|
+
* @param {AnnotationEditorLayer} _parent
|
|
75
|
+
* @param {PointerEvent} event
|
|
76
|
+
* @returns {HTMLElement}
|
|
77
|
+
*/
|
|
78
|
+
static _getDrawingTarget(_parent: AnnotationEditorLayer, { target }: PointerEvent): HTMLElement;
|
|
79
|
+
/**
|
|
80
|
+
* @param {PointerEvent} event
|
|
81
|
+
* @param {PointerEvent} [referenceEvent]
|
|
82
|
+
* @returns {Array<number>}
|
|
83
|
+
*/
|
|
84
|
+
static _getPointerCoords({ offsetX, offsetY, clientX, clientY }: PointerEvent, referenceEvent?: PointerEvent): Array<number>;
|
|
85
|
+
/**
|
|
86
|
+
* @param {HTMLElement} _target
|
|
87
|
+
* @param {AbortSignal} _signal
|
|
88
|
+
*/
|
|
89
|
+
static _addDrawingListeners(_target: HTMLElement, _signal: AbortSignal): void;
|
|
90
|
+
/** @param {boolean} isAborted */
|
|
91
|
+
static _endDrawingSession(isAborted?: boolean): any;
|
|
92
|
+
static startDrawing(parent: any, uiManager: any, isLTR: any, event: any): void;
|
|
57
93
|
static _drawMove(event: any): void;
|
|
58
94
|
static _cleanup(all: any): void;
|
|
59
95
|
static _endDraw(event: any): void;
|
|
60
96
|
static endDrawing(isAborted: any): any;
|
|
61
97
|
/**
|
|
62
98
|
* Deserialize the drawing outlines.
|
|
63
|
-
* @
|
|
64
|
-
* @param {number}
|
|
65
|
-
* @param {number}
|
|
66
|
-
* @param {number}
|
|
67
|
-
* @param {number}
|
|
68
|
-
* @param {
|
|
69
|
-
* @
|
|
99
|
+
* @abstract
|
|
100
|
+
* @param {number} _pageX - The x coordinate of the page.
|
|
101
|
+
* @param {number} _pageY - The y coordinate of the page.
|
|
102
|
+
* @param {number} _pageWidth - The width of the page.
|
|
103
|
+
* @param {number} _pageHeight - The height of the page.
|
|
104
|
+
* @param {number} _innerMargin - The outline's inner margin.
|
|
105
|
+
* @param {object} _data - The data to deserialize.
|
|
106
|
+
* @param {AnnotationEditorUIManager} _uiManager
|
|
107
|
+
* @returns {object} The deserialized outlines.
|
|
70
108
|
*/
|
|
71
|
-
static deserializeDraw(_pageX:
|
|
109
|
+
static deserializeDraw(_pageX: number, _pageY: number, _pageWidth: number, _pageHeight: number, _innerMargin: number, _data: object, _uiManager: AnnotationEditorUIManager): object;
|
|
72
110
|
/** @inheritdoc */
|
|
73
111
|
static deserialize(data: any, parent: any, uiManager: any): Promise<AnnotationEditor | null>;
|
|
74
112
|
constructor(params: any);
|
|
113
|
+
_clipPathId: null;
|
|
75
114
|
_colorPicker: null;
|
|
76
115
|
_drawId: null;
|
|
116
|
+
_drawOutlines: null;
|
|
117
|
+
_focusDrawId: null;
|
|
77
118
|
/** @inheritdoc */
|
|
78
119
|
onUpdatedOpacity(): void;
|
|
79
120
|
_addOutlines(params: any): void;
|
|
121
|
+
get _drawRotation(): number;
|
|
122
|
+
get _opacityName(): any;
|
|
80
123
|
/** @inheritdoc */
|
|
81
124
|
updateParams(type: any, value: any): void;
|
|
82
125
|
/** @inheritdoc */
|
|
83
126
|
get propertiesToUpdate(): any[][];
|
|
84
127
|
/**
|
|
85
128
|
* Update a property and make this action undoable.
|
|
86
|
-
* @param {
|
|
129
|
+
* @param {number} type
|
|
130
|
+
* @param {string} name
|
|
131
|
+
* @param {*} value
|
|
87
132
|
*/
|
|
88
|
-
_updateProperty(type:
|
|
133
|
+
_updateProperty(type: number, name: string, value: any): void;
|
|
89
134
|
/**
|
|
90
135
|
* Update color and opacity atomically as one undoable command.
|
|
91
136
|
*/
|
|
92
|
-
_updateColorAndOpacity(color: any, opacity: any): void;
|
|
137
|
+
_updateColorAndOpacity(color: any, opacity: any, type?: any): void;
|
|
93
138
|
/** @inheritdoc */
|
|
94
139
|
_onTranslating(_x: any, _y: any): void;
|
|
95
140
|
/** @inheritdoc */
|
|
96
141
|
_onTranslated(): void;
|
|
142
|
+
get _mustBeDisabledOnCommit(): boolean;
|
|
97
143
|
/** @inheritdoc */
|
|
98
144
|
onceAdded(focus: any): void;
|
|
99
|
-
/**
|
|
100
|
-
|
|
145
|
+
/**
|
|
146
|
+
* @inheritdoc
|
|
147
|
+
* @param {number} [parentRotation] - The parent rotation to apply.
|
|
148
|
+
*/
|
|
149
|
+
rotate(parentRotation?: number): void;
|
|
150
|
+
pointerover(): void;
|
|
151
|
+
pointerleave(): void;
|
|
101
152
|
onScaleChanging(): void;
|
|
102
153
|
/**
|
|
103
154
|
* Create the drawing options.
|
|
104
|
-
* @param {
|
|
155
|
+
* @param {object} _data
|
|
105
156
|
*/
|
|
106
|
-
createDrawingOptions(_data:
|
|
157
|
+
createDrawingOptions(_data: object): void;
|
|
107
158
|
serializeDraw(isForCopying: any): any;
|
|
108
159
|
/** @inheritdoc */
|
|
109
160
|
renderAnnotationElement(annotation: any): null;
|
|
@@ -7,7 +7,12 @@ export class FreeDrawOutline extends Outline {
|
|
|
7
7
|
points: any[][];
|
|
8
8
|
};
|
|
9
9
|
get box(): Float32Array<ArrayBuffer>;
|
|
10
|
-
newOutliner(
|
|
10
|
+
newOutliner(x: any, y: any, box: any, scaleFactor: any, thickness: any, isLTR: any, innerMargin?: number): FreeDrawOutliner;
|
|
11
|
+
/**
|
|
12
|
+
* @param {number} thickness
|
|
13
|
+
* @returns {Float32Array} The new bounding box.
|
|
14
|
+
*/
|
|
15
|
+
updateThickness(thickness: number): Float32Array;
|
|
11
16
|
getNewOutline(thickness: any, innerMargin: any): FreeDrawOutline;
|
|
12
17
|
#private;
|
|
13
18
|
}
|
|
@@ -15,15 +20,12 @@ export class FreeDrawOutliner {
|
|
|
15
20
|
static #MIN_DIST: number;
|
|
16
21
|
static #MIN_DIFF: number;
|
|
17
22
|
static #MIN: number;
|
|
18
|
-
constructor(
|
|
19
|
-
x: any;
|
|
20
|
-
y: any;
|
|
21
|
-
}, box: any, scaleFactor: any, thickness: any, isLTR: any, innerMargin?: number);
|
|
23
|
+
constructor(x: any, y: any, box: any, scaleFactor: any, thickness: any, isLTR: any, innerMargin?: number);
|
|
22
24
|
isEmpty(): boolean;
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
isCancellable(): boolean;
|
|
26
|
+
/** @returns {object} The SVG properties to apply. */
|
|
27
|
+
removeLastElement(): object;
|
|
28
|
+
add(x: any, y: any): boolean;
|
|
27
29
|
toSVGPath(): string;
|
|
28
30
|
newFreeDrawOutline(outline: any, points: any, box: any, scaleFactor: any, innerMargin: any, isLTR: any): FreeDrawOutline;
|
|
29
31
|
getOutlines(): FreeDrawOutline;
|
|
@@ -1,9 +1,81 @@
|
|
|
1
|
+
export class FreeHighlightDrawer {
|
|
2
|
+
constructor(x: any, y: any, box: any, scaleFactor: any, thickness: any, isLTR: any, innerMargin: any);
|
|
3
|
+
add(x: any, y: any): {
|
|
4
|
+
path: {
|
|
5
|
+
d: string;
|
|
6
|
+
};
|
|
7
|
+
} | null;
|
|
8
|
+
addPoints(points: any): {
|
|
9
|
+
path: {
|
|
10
|
+
d: string;
|
|
11
|
+
};
|
|
12
|
+
} | null;
|
|
13
|
+
end(x: any, y: any): {
|
|
14
|
+
path: {
|
|
15
|
+
d: string;
|
|
16
|
+
};
|
|
17
|
+
} | null;
|
|
18
|
+
isEmpty(): boolean;
|
|
19
|
+
isCancellable(): boolean;
|
|
20
|
+
removeLastElement(): object;
|
|
21
|
+
updateProperty(_name: any, _value: any): null;
|
|
22
|
+
getOutlines(): FreeDrawOutline;
|
|
23
|
+
get defaultSVGProperties(): {
|
|
24
|
+
bbox: number[];
|
|
25
|
+
root: {
|
|
26
|
+
viewBox: string;
|
|
27
|
+
};
|
|
28
|
+
rootClass: {
|
|
29
|
+
highlight: boolean;
|
|
30
|
+
free: boolean;
|
|
31
|
+
};
|
|
32
|
+
path: {
|
|
33
|
+
d: string;
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
#private;
|
|
37
|
+
}
|
|
1
38
|
export class FreeHighlightOutliner extends FreeDrawOutliner {
|
|
39
|
+
newFreeDrawOutline(outline: any, points: any, box: any, scaleFactor: any, innerMargin: any, isLTR: any): FreeHighlightOutline;
|
|
40
|
+
}
|
|
41
|
+
export class HighlightOutline extends Outline {
|
|
42
|
+
/**
|
|
43
|
+
* Build a text selection and its hover/selection outline.
|
|
44
|
+
* @param {Array<object>} boxes - the boxes of the selected text.
|
|
45
|
+
* @param {boolean} isLTR
|
|
46
|
+
* @returns {HighlightOutline}
|
|
47
|
+
*/
|
|
48
|
+
static build(boxes: Array<object>, isLTR: boolean): HighlightOutline;
|
|
49
|
+
constructor(outlines: any, box: any, firstPoint: any, lastPoint: any);
|
|
50
|
+
firstPoint: any;
|
|
51
|
+
lastPoint: any;
|
|
52
|
+
get isFree(): boolean;
|
|
53
|
+
/** @inheritdoc */
|
|
54
|
+
get defaultSVGProperties(): any;
|
|
55
|
+
/** @inheritdoc */
|
|
56
|
+
getFocusSVGProperties(rotation: any): object;
|
|
57
|
+
/** @inheritdoc */
|
|
58
|
+
updateRotation(rotation: any): {
|
|
59
|
+
root: {
|
|
60
|
+
"data-main-rotation": any;
|
|
61
|
+
};
|
|
62
|
+
};
|
|
63
|
+
/** @inheritdoc */
|
|
64
|
+
serializeQuadPoints([pageX, pageY]: [any, any], [pageWidth, pageHeight]: [any, any]): Float32Array<ArrayBuffer>;
|
|
65
|
+
/**
|
|
66
|
+
* Serialize the outlines into the PDF page coordinate system.
|
|
67
|
+
* @param {Array<number>} _bbox - the bounding box of the annotation.
|
|
68
|
+
* @param {number} _rotation - the rotation of the annotation.
|
|
69
|
+
* @returns {Array<Array<number>>}
|
|
70
|
+
*/
|
|
71
|
+
serialize([blX, blY, trX, trY]: Array<number>, _rotation: number): Array<Array<number>>;
|
|
72
|
+
get box(): any;
|
|
73
|
+
#private;
|
|
2
74
|
}
|
|
3
75
|
export class HighlightOutliner {
|
|
4
76
|
/**
|
|
5
77
|
* Construct an outliner.
|
|
6
|
-
* @param {Array<
|
|
78
|
+
* @param {Array<object>} boxes - An array of axis-aligned rectangles.
|
|
7
79
|
* @param {number} borderWidth - The width of the border of the boxes, it
|
|
8
80
|
* allows to make the boxes bigger (or smaller).
|
|
9
81
|
* @param {number} innerMargin - The margin between the boxes and the
|
|
@@ -13,24 +85,36 @@ export class HighlightOutliner {
|
|
|
13
85
|
* @param {boolean} isLTR - true if we're in LTR mode. It's used to determine
|
|
14
86
|
* the last point of the boxes.
|
|
15
87
|
*/
|
|
16
|
-
constructor(boxes: Array<
|
|
88
|
+
constructor(boxes: Array<object>, borderWidth?: number, innerMargin?: number, isLTR?: boolean);
|
|
17
89
|
getOutlines(): HighlightOutline;
|
|
18
90
|
#private;
|
|
19
91
|
}
|
|
92
|
+
import { FreeDrawOutline } from "./freedraw.js";
|
|
20
93
|
import { FreeDrawOutliner } from "./freedraw.js";
|
|
21
|
-
declare class
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
94
|
+
declare class FreeHighlightOutline extends FreeDrawOutline {
|
|
95
|
+
static #EXTRA_THICKNESS: number;
|
|
96
|
+
newOutliner(x: any, y: any, box: any, scaleFactor: any, thickness: any, isLTR: any, innerMargin?: number): FreeHighlightOutliner;
|
|
97
|
+
get isFree(): boolean;
|
|
98
|
+
/** @param {number} thickness */
|
|
99
|
+
buildFocusOutline(thickness: number): void;
|
|
100
|
+
/** @inheritdoc */
|
|
101
|
+
get defaultSVGProperties(): any;
|
|
102
|
+
/** @inheritdoc */
|
|
103
|
+
getFocusSVGProperties(rotation: any): object;
|
|
104
|
+
/** @inheritdoc */
|
|
105
|
+
updateRotation(rotation: any): {
|
|
106
|
+
root: {
|
|
107
|
+
"data-main-rotation": any;
|
|
108
|
+
};
|
|
109
|
+
};
|
|
110
|
+
/** @inheritdoc */
|
|
111
|
+
updateProperty(name: any, value: any): Float32Array<ArrayBufferLike> | null;
|
|
112
|
+
/** @inheritdoc */
|
|
113
|
+
getPathResizedSVGProperties(): {
|
|
114
|
+
path: {
|
|
115
|
+
d: string;
|
|
116
|
+
};
|
|
117
|
+
};
|
|
34
118
|
}
|
|
35
119
|
import { Outline } from "./outline.js";
|
|
36
120
|
export {};
|
|
@@ -92,12 +92,17 @@ export class InkDrawOutliner {
|
|
|
92
92
|
path: {
|
|
93
93
|
d: string;
|
|
94
94
|
};
|
|
95
|
-
}
|
|
95
|
+
};
|
|
96
|
+
addPoints(points: any): {
|
|
97
|
+
path: {
|
|
98
|
+
d: string;
|
|
99
|
+
};
|
|
100
|
+
};
|
|
96
101
|
end(x: any, y: any): {
|
|
97
102
|
path: {
|
|
98
103
|
d: string;
|
|
99
104
|
};
|
|
100
|
-
}
|
|
105
|
+
};
|
|
101
106
|
startNew(x: any, y: any, parentWidth: any, parentHeight: any, rotation: any): null;
|
|
102
107
|
getLastElement(): {
|
|
103
108
|
line: any[];
|