pdfjs-serverless 0.1.0 → 0.2.1

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.
Files changed (60) hide show
  1. package/README.md +11 -8
  2. package/dist/index.d.ts +1 -1
  3. package/dist/index.mjs +236 -200
  4. package/dist/types/external/webL10n/l10n.d.ts +0 -0
  5. package/dist/types/src/display/annotation_layer.d.ts +203 -0
  6. package/dist/types/src/display/annotation_storage.d.ts +89 -0
  7. package/dist/types/src/display/api.d.ts +1472 -0
  8. package/dist/types/src/display/base_factory.d.ts +54 -0
  9. package/dist/types/src/display/canvas.d.ts +208 -0
  10. package/dist/types/src/display/display_utils.d.ts +277 -0
  11. package/dist/types/src/display/editor/annotation_editor_layer.d.ts +182 -0
  12. package/dist/types/src/display/editor/editor.d.ts +308 -0
  13. package/dist/types/src/display/editor/freetext.d.ts +72 -0
  14. package/dist/types/src/display/editor/ink.d.ts +95 -0
  15. package/dist/types/src/display/editor/stamp.d.ts +22 -0
  16. package/dist/types/src/display/editor/tools.d.ts +324 -0
  17. package/dist/types/src/display/font_loader.d.ts +43 -0
  18. package/dist/types/src/display/metadata.d.ts +11 -0
  19. package/dist/types/src/display/optional_content_config.d.ts +13 -0
  20. package/dist/types/src/display/pattern_helper.d.ts +73 -0
  21. package/dist/types/src/display/text_layer.d.ts +151 -0
  22. package/dist/types/src/display/transport_stream.d.ts +68 -0
  23. package/dist/types/src/display/worker_options.d.ts +27 -0
  24. package/dist/types/src/display/xfa_layer.d.ts +46 -0
  25. package/dist/types/src/display/xfa_text.d.ts +19 -0
  26. package/dist/types/src/pdf.d.ts +50 -0
  27. package/dist/types/src/shared/image_utils.d.ts +17 -0
  28. package/dist/types/src/shared/message_handler.d.ts +43 -0
  29. package/dist/types/src/shared/murmurhash3.d.ts +7 -0
  30. package/dist/types/src/shared/scripting_utils.d.ts +12 -0
  31. package/dist/types/src/shared/util.d.ts +396 -0
  32. package/dist/types/web/annotation_editor_layer_builder.d.ts +50 -0
  33. package/dist/types/web/annotation_layer_builder.d.ts +83 -0
  34. package/dist/types/web/app_options.d.ts +14 -0
  35. package/dist/types/web/download_manager.d.ts +14 -0
  36. package/dist/types/web/event_utils.d.ts +75 -0
  37. package/dist/types/web/generic_scripting.d.ts +8 -0
  38. package/dist/types/web/genericl10n.d.ts +13 -0
  39. package/dist/types/web/interfaces.d.ts +163 -0
  40. package/dist/types/web/l10n_utils.d.ts +7 -0
  41. package/dist/types/web/pdf_find_controller.d.ts +108 -0
  42. package/dist/types/web/pdf_find_utils.d.ts +16 -0
  43. package/dist/types/web/pdf_history.d.ts +168 -0
  44. package/dist/types/web/pdf_link_service.d.ts +243 -0
  45. package/dist/types/web/pdf_page_view.d.ts +209 -0
  46. package/dist/types/web/pdf_rendering_queue.d.ts +53 -0
  47. package/dist/types/web/pdf_scripting_manager.component.d.ts +5 -0
  48. package/dist/types/web/pdf_scripting_manager.d.ts +61 -0
  49. package/dist/types/web/pdf_single_page_viewer.d.ts +7 -0
  50. package/dist/types/web/pdf_thumbnail_view.d.ts +131 -0
  51. package/dist/types/web/pdf_thumbnail_viewer.d.ts +104 -0
  52. package/dist/types/web/pdf_viewer.component.d.ts +24 -0
  53. package/dist/types/web/pdf_viewer.d.ts +455 -0
  54. package/dist/types/web/struct_tree_layer_builder.d.ts +7 -0
  55. package/dist/types/web/text_accessibility.d.ts +42 -0
  56. package/dist/types/web/text_highlighter.d.ts +63 -0
  57. package/dist/types/web/text_layer_builder.d.ts +64 -0
  58. package/dist/types/web/ui_utils.d.ts +288 -0
  59. package/dist/types/web/xfa_layer_builder.d.ts +41 -0
  60. package/package.json +9 -7
@@ -0,0 +1,182 @@
1
+ export type AnnotationEditorUIManager = import("./tools.js").AnnotationEditorUIManager;
2
+ export type PageViewport = import("../display_utils.js").PageViewport;
3
+ export type TextAccessibilityManager = any;
4
+ export type IL10n = any;
5
+ export type AnnotationLayer = any;
6
+ export type AnnotationEditorLayerOptions = {
7
+ mode: Object;
8
+ div: HTMLDivElement;
9
+ uiManager: AnnotationEditorUIManager;
10
+ enabled: boolean;
11
+ accessibilityManager?: any;
12
+ pageIndex: number;
13
+ l10n: any;
14
+ annotationLayer?: any;
15
+ viewport: PageViewport;
16
+ };
17
+ export type RenderEditorLayerOptions = {
18
+ viewport: PageViewport;
19
+ };
20
+ /**
21
+ * @typedef {Object} AnnotationEditorLayerOptions
22
+ * @property {Object} mode
23
+ * @property {HTMLDivElement} div
24
+ * @property {AnnotationEditorUIManager} uiManager
25
+ * @property {boolean} enabled
26
+ * @property {TextAccessibilityManager} [accessibilityManager]
27
+ * @property {number} pageIndex
28
+ * @property {IL10n} l10n
29
+ * @property {AnnotationLayer} [annotationLayer]
30
+ * @property {PageViewport} viewport
31
+ */
32
+ /**
33
+ * @typedef {Object} RenderEditorLayerOptions
34
+ * @property {PageViewport} viewport
35
+ */
36
+ /**
37
+ * Manage all the different editors on a page.
38
+ */
39
+ export class AnnotationEditorLayer {
40
+ static _initialized: boolean;
41
+ /**
42
+ * @param {AnnotationEditorLayerOptions} options
43
+ */
44
+ constructor({ uiManager, pageIndex, div, accessibilityManager, annotationLayer, viewport, l10n, }: AnnotationEditorLayerOptions);
45
+ pageIndex: number;
46
+ div: HTMLDivElement;
47
+ viewport: import("../display_utils.js").PageViewport;
48
+ get isEmpty(): boolean;
49
+ /**
50
+ * Update the toolbar if it's required to reflect the tool currently used.
51
+ * @param {number} mode
52
+ */
53
+ updateToolbar(mode: number): void;
54
+ /**
55
+ * The mode has changed: it must be updated.
56
+ * @param {number} mode
57
+ */
58
+ updateMode(mode?: number): void;
59
+ addInkEditorIfNeeded(isCommitting: any): void;
60
+ /**
61
+ * Set the editing state.
62
+ * @param {boolean} isEditing
63
+ */
64
+ setEditingState(isEditing: boolean): void;
65
+ /**
66
+ * Add some commands into the CommandManager (undo/redo stuff).
67
+ * @param {Object} params
68
+ */
69
+ addCommands(params: Object): void;
70
+ /**
71
+ * Enable pointer events on the main div in order to enable
72
+ * editor creation.
73
+ */
74
+ enable(): void;
75
+ /**
76
+ * Disable editor creation.
77
+ */
78
+ disable(): void;
79
+ getEditableAnnotation(id: any): any;
80
+ /**
81
+ * Set the current editor.
82
+ * @param {AnnotationEditor} editor
83
+ */
84
+ setActiveEditor(editor: AnnotationEditor): void;
85
+ enableClick(): void;
86
+ disableClick(): void;
87
+ attach(editor: any): void;
88
+ detach(editor: any): void;
89
+ /**
90
+ * Remove an editor.
91
+ * @param {AnnotationEditor} editor
92
+ */
93
+ remove(editor: AnnotationEditor): void;
94
+ /**
95
+ * Add a new editor in the current view.
96
+ * @param {AnnotationEditor} editor
97
+ */
98
+ add(editor: AnnotationEditor): void;
99
+ moveEditorInDOM(editor: any): void;
100
+ /**
101
+ * Add or rebuild depending if it has been removed or not.
102
+ * @param {AnnotationEditor} editor
103
+ */
104
+ addOrRebuild(editor: AnnotationEditor): void;
105
+ /**
106
+ * Add a new editor and make this addition undoable.
107
+ * @param {AnnotationEditor} editor
108
+ */
109
+ addUndoableEditor(editor: AnnotationEditor): void;
110
+ /**
111
+ * Get an id for an editor.
112
+ * @returns {string}
113
+ */
114
+ getNextId(): string;
115
+ /**
116
+ * Create a new editor
117
+ * @param {Object} data
118
+ * @returns {AnnotationEditor}
119
+ */
120
+ deserialize(data: Object): AnnotationEditor;
121
+ /**
122
+ * Set the last selected editor.
123
+ * @param {AnnotationEditor} editor
124
+ */
125
+ setSelected(editor: AnnotationEditor): void;
126
+ /**
127
+ * Add or remove an editor the current selection.
128
+ * @param {AnnotationEditor} editor
129
+ */
130
+ toggleSelected(editor: AnnotationEditor): void;
131
+ /**
132
+ * Check if the editor is selected.
133
+ * @param {AnnotationEditor} editor
134
+ */
135
+ isSelected(editor: AnnotationEditor): boolean;
136
+ /**
137
+ * Unselect an editor.
138
+ * @param {AnnotationEditor} editor
139
+ */
140
+ unselect(editor: AnnotationEditor): void;
141
+ /**
142
+ * Pointerup callback.
143
+ * @param {PointerEvent} event
144
+ */
145
+ pointerup(event: PointerEvent): void;
146
+ /**
147
+ * Pointerdown callback.
148
+ * @param {PointerEvent} event
149
+ */
150
+ pointerdown(event: PointerEvent): void;
151
+ /**
152
+ * Drag callback.
153
+ * @param {DragEvent} event
154
+ */
155
+ drop(event: DragEvent): void;
156
+ /**
157
+ * Dragover callback.
158
+ * @param {DragEvent} event
159
+ */
160
+ dragover(event: DragEvent): void;
161
+ /**
162
+ * Destroy the main editor.
163
+ */
164
+ destroy(): void;
165
+ /**
166
+ * Render the main editor.
167
+ * @param {RenderEditorLayerOptions} parameters
168
+ */
169
+ render({ viewport }: RenderEditorLayerOptions): void;
170
+ /**
171
+ * Update the main editor.
172
+ * @param {RenderEditorLayerOptions} parameters
173
+ */
174
+ update({ viewport }: RenderEditorLayerOptions): void;
175
+ /**
176
+ * Get page dimensions.
177
+ * @returns {Object} dimensions.
178
+ */
179
+ get pageDimensions(): Object;
180
+ #private;
181
+ }
182
+ import { AnnotationEditor } from "./editor.js";
@@ -0,0 +1,308 @@
1
+ export type AnnotationEditorLayer = import("./annotation_editor_layer.js").AnnotationEditorLayer;
2
+ export type AnnotationEditorUIManager = import("./tools.js").AnnotationEditorUIManager;
3
+ export type AnnotationEditorParameters = {
4
+ /**
5
+ * - the global manager
6
+ */
7
+ uiManager: AnnotationEditorUIManager;
8
+ /**
9
+ * - the layer containing this editor
10
+ */
11
+ parent: AnnotationEditorLayer;
12
+ /**
13
+ * - editor id
14
+ */
15
+ id: string;
16
+ /**
17
+ * - x-coordinate
18
+ */
19
+ x: number;
20
+ /**
21
+ * - y-coordinate
22
+ */
23
+ y: number;
24
+ };
25
+ /**
26
+ * @typedef {Object} AnnotationEditorParameters
27
+ * @property {AnnotationEditorUIManager} uiManager - the global manager
28
+ * @property {AnnotationEditorLayer} parent - the layer containing this editor
29
+ * @property {string} id - editor id
30
+ * @property {number} x - x-coordinate
31
+ * @property {number} y - y-coordinate
32
+ */
33
+ /**
34
+ * Base class for editors.
35
+ */
36
+ export class AnnotationEditor {
37
+ static _colorManager: ColorManager;
38
+ static _zIndex: number;
39
+ static get _defaultLineColor(): any;
40
+ static deleteAnnotationElement(editor: any): void;
41
+ /**
42
+ * Initialize the l10n stuff for this type of editor.
43
+ * @param {Object} _l10n
44
+ */
45
+ static initialize(_l10n: Object): void;
46
+ /**
47
+ * Update the default parameters for this type of editor.
48
+ * @param {number} _type
49
+ * @param {*} _value
50
+ */
51
+ static updateDefaultParams(_type: number, _value: any): void;
52
+ /**
53
+ * Get the default properties to set in the UI for this type of editor.
54
+ * @returns {Array}
55
+ */
56
+ static get defaultPropertiesToUpdate(): any[];
57
+ /**
58
+ * Deserialize the editor.
59
+ * The result of the deserialization is a new editor.
60
+ *
61
+ * @param {Object} data
62
+ * @param {AnnotationEditorLayer} parent
63
+ * @param {AnnotationEditorUIManager} uiManager
64
+ * @returns {AnnotationEditor}
65
+ */
66
+ static deserialize(data: Object, parent: AnnotationEditorLayer, uiManager: AnnotationEditorUIManager): AnnotationEditor;
67
+ static get MIN_SIZE(): number;
68
+ /**
69
+ * @param {AnnotationEditorParameters} parameters
70
+ */
71
+ constructor(parameters: AnnotationEditorParameters);
72
+ _uiManager: null;
73
+ parent: import("./annotation_editor_layer.js").AnnotationEditorLayer;
74
+ id: string;
75
+ width: any;
76
+ height: any;
77
+ pageIndex: number;
78
+ name: any;
79
+ div: HTMLDivElement | null;
80
+ annotationElementId: any;
81
+ _willKeepAspectRatio: boolean;
82
+ rotation: number;
83
+ pageRotation: number;
84
+ pageDimensions: any[];
85
+ pageTranslation: any[];
86
+ x: number;
87
+ y: number;
88
+ isAttachedToDOM: boolean;
89
+ deleted: boolean;
90
+ /**
91
+ * Get the properties to update in the UI for this editor.
92
+ * @returns {Array}
93
+ */
94
+ get propertiesToUpdate(): any[];
95
+ /**
96
+ * Add some commands into the CommandManager (undo/redo stuff).
97
+ * @param {Object} params
98
+ */
99
+ addCommands(params: Object): void;
100
+ get currentLayer(): any;
101
+ /**
102
+ * This editor will be behind the others.
103
+ */
104
+ setInBackground(): void;
105
+ /**
106
+ * This editor will be in the foreground.
107
+ */
108
+ setInForeground(): void;
109
+ setParent(parent: any): void;
110
+ /**
111
+ * onfocus callback.
112
+ */
113
+ focusin(event: any): void;
114
+ /**
115
+ * onblur callback.
116
+ * @param {FocusEvent} event
117
+ */
118
+ focusout(event: FocusEvent): void;
119
+ commitOrRemove(): void;
120
+ /**
121
+ * Commit the data contained in this editor.
122
+ */
123
+ commit(): void;
124
+ addToAnnotationStorage(): void;
125
+ /**
126
+ * We use drag-and-drop in order to move an editor on a page.
127
+ * @param {DragEvent} event
128
+ */
129
+ dragstart(event: DragEvent): void;
130
+ startX: number | undefined;
131
+ startY: number | undefined;
132
+ /**
133
+ * Set the editor position within its parent.
134
+ * @param {number} x
135
+ * @param {number} y
136
+ * @param {number} tx - x-translation in screen coordinates.
137
+ * @param {number} ty - y-translation in screen coordinates.
138
+ */
139
+ setAt(x: number, y: number, tx: number, ty: number): void;
140
+ /**
141
+ * Translate the editor position within its parent.
142
+ * @param {number} x - x-translation in screen coordinates.
143
+ * @param {number} y - y-translation in screen coordinates.
144
+ */
145
+ translate(x: number, y: number): void;
146
+ /**
147
+ * Translate the editor position within its page and adjust the scroll
148
+ * in order to have the editor in the view.
149
+ * @param {number} x - x-translation in page coordinates.
150
+ * @param {number} y - y-translation in page coordinates.
151
+ */
152
+ translateInPage(x: number, y: number): void;
153
+ fixAndSetPosition(): void;
154
+ /**
155
+ * Convert a screen translation into a page one.
156
+ * @param {number} x
157
+ * @param {number} y
158
+ */
159
+ screenToPageTranslation(x: number, y: number): number[];
160
+ /**
161
+ * Convert a page translation into a screen one.
162
+ * @param {number} x
163
+ * @param {number} y
164
+ */
165
+ pageTranslationToScreen(x: number, y: number): number[];
166
+ get parentScale(): any;
167
+ get parentRotation(): number;
168
+ get parentDimensions(): number[];
169
+ /**
170
+ * Set the dimensions of this editor.
171
+ * @param {number} width
172
+ * @param {number} height
173
+ */
174
+ setDims(width: number, height: number): void;
175
+ fixDims(): void;
176
+ /**
177
+ * Get the translation used to position this editor when it's created.
178
+ * @returns {Array<number>}
179
+ */
180
+ getInitialTranslation(): Array<number>;
181
+ /**
182
+ * Render this editor in a div.
183
+ * @returns {HTMLDivElement}
184
+ */
185
+ render(): HTMLDivElement;
186
+ /**
187
+ * Onpointerdown callback.
188
+ * @param {PointerEvent} event
189
+ */
190
+ pointerdown(event: PointerEvent): void;
191
+ /**
192
+ * Convert the current rect into a page one.
193
+ */
194
+ getRect(tx: any, ty: any): any[];
195
+ getRectInCurrentCoords(rect: any, pageHeight: any): any[];
196
+ /**
197
+ * Executed once this editor has been rendered.
198
+ */
199
+ onceAdded(): void;
200
+ /**
201
+ * Check if the editor contains something.
202
+ * @returns {boolean}
203
+ */
204
+ isEmpty(): boolean;
205
+ /**
206
+ * Enable edit mode.
207
+ */
208
+ enableEditMode(): void;
209
+ /**
210
+ * Disable edit mode.
211
+ */
212
+ disableEditMode(): void;
213
+ /**
214
+ * Check if the editor is edited.
215
+ * @returns {boolean}
216
+ */
217
+ isInEditMode(): boolean;
218
+ /**
219
+ * If it returns true, then this editor handle the keyboard
220
+ * events itself.
221
+ * @returns {boolean}
222
+ */
223
+ shouldGetKeyboardEvents(): boolean;
224
+ /**
225
+ * Check if this editor needs to be rebuilt or not.
226
+ * @returns {boolean}
227
+ */
228
+ needsToBeRebuilt(): boolean;
229
+ /**
230
+ * Rebuild the editor in case it has been removed on undo.
231
+ *
232
+ * To implement in subclasses.
233
+ */
234
+ rebuild(): void;
235
+ /**
236
+ * Serialize the editor.
237
+ * The result of the serialization will be used to construct a
238
+ * new annotation to add to the pdf document.
239
+ *
240
+ * To implement in subclasses.
241
+ * @param {boolean} isForCopying
242
+ * @param {Object} [context]
243
+ */
244
+ serialize(_isForCopying?: boolean, _context?: null): void;
245
+ /**
246
+ * Remove this editor.
247
+ * It's used on ctrl+backspace action.
248
+ */
249
+ remove(): void;
250
+ /**
251
+ * @returns {boolean} true if this editor can be resized.
252
+ */
253
+ get isResizable(): boolean;
254
+ /**
255
+ * Add the resizers to this editor.
256
+ */
257
+ makeResizable(): void;
258
+ /**
259
+ * Select this editor.
260
+ */
261
+ select(): void;
262
+ /**
263
+ * Unselect this editor.
264
+ */
265
+ unselect(): void;
266
+ /**
267
+ * Update some parameters which have been changed through the UI.
268
+ * @param {number} type
269
+ * @param {*} value
270
+ */
271
+ updateParams(type: number, value: any): void;
272
+ /**
273
+ * When the user disables the editing mode some editors can change some of
274
+ * their properties.
275
+ */
276
+ disableEditing(): void;
277
+ /**
278
+ * When the user enables the editing mode some editors can change some of
279
+ * their properties.
280
+ */
281
+ enableEditing(): void;
282
+ /**
283
+ * The editor is about to be edited.
284
+ */
285
+ enterInEditMode(): void;
286
+ /**
287
+ * Get the div which really contains the displayed content.
288
+ */
289
+ get contentDiv(): HTMLDivElement | null;
290
+ /**
291
+ * When set to true, it means that this editor is currently edited.
292
+ * @param {boolean} value
293
+ */
294
+ set isEditing(arg: boolean);
295
+ /**
296
+ * If true then the editor is currently edited.
297
+ * @type {boolean}
298
+ */
299
+ get isEditing(): boolean;
300
+ /**
301
+ * Set the aspect ratio to use when resizing.
302
+ * @param {number} width
303
+ * @param {number} height
304
+ */
305
+ setAspectRatio(width: number, height: number): void;
306
+ #private;
307
+ }
308
+ import { ColorManager } from "./tools.js";
@@ -0,0 +1,72 @@
1
+ export type AnnotationEditorLayer = import("./annotation_editor_layer.js").AnnotationEditorLayer;
2
+ /**
3
+ * Basic text editor in order to create a FreeTex annotation.
4
+ */
5
+ export class FreeTextEditor extends AnnotationEditor {
6
+ static _freeTextDefaultContent: string;
7
+ static _l10nPromise: any;
8
+ static _internalPadding: number;
9
+ static _defaultColor: null;
10
+ static _defaultFontSize: number;
11
+ static get _keyboardManager(): any;
12
+ static _type: string;
13
+ /** @inheritdoc */
14
+ static initialize(l10n: any): void;
15
+ /** @inheritdoc */
16
+ static updateDefaultParams(type: any, value: any): void;
17
+ /** @inheritdoc */
18
+ static get defaultPropertiesToUpdate(): any[][];
19
+ /** @inheritdoc */
20
+ static deserialize(data: any, parent: any, uiManager: any): AnnotationEditor | null;
21
+ constructor(params: any);
22
+ /** @inheritdoc */
23
+ updateParams(type: any, value: any): void;
24
+ /** @inheritdoc */
25
+ get propertiesToUpdate(): any[][];
26
+ /**
27
+ * Helper to translate the editor with the keyboard when it's empty.
28
+ * @param {number} x in page units.
29
+ * @param {number} y in page units.
30
+ */
31
+ _translateEmpty(x: number, y: number): void;
32
+ /**
33
+ * Commit the content we have in this editor.
34
+ * @returns {undefined}
35
+ */
36
+ commit(): undefined;
37
+ /**
38
+ * ondblclick callback.
39
+ * @param {MouseEvent} event
40
+ */
41
+ dblclick(event: MouseEvent): void;
42
+ /**
43
+ * onkeydown callback.
44
+ * @param {KeyboardEvent} event
45
+ */
46
+ keydown(event: KeyboardEvent): void;
47
+ editorDivKeydown(event: any): void;
48
+ editorDivFocus(event: any): void;
49
+ editorDivBlur(event: any): void;
50
+ editorDivInput(event: any): void;
51
+ /** @inheritdoc */
52
+ render(): HTMLDivElement | null;
53
+ editorDiv: HTMLDivElement | undefined;
54
+ overlayDiv: HTMLDivElement | undefined;
55
+ get contentDiv(): HTMLDivElement | undefined;
56
+ /** @inheritdoc */
57
+ serialize(isForCopying?: boolean): {
58
+ annotationType: number;
59
+ color: number[];
60
+ fontSize: any;
61
+ value: string;
62
+ pageIndex: number;
63
+ rect: any[];
64
+ rotation: number;
65
+ } | {
66
+ pageIndex: number;
67
+ id: any;
68
+ deleted: boolean;
69
+ } | null;
70
+ #private;
71
+ }
72
+ import { AnnotationEditor } from "./editor.js";
@@ -0,0 +1,95 @@
1
+ /**
2
+ * Basic draw editor in order to generate an Ink annotation.
3
+ */
4
+ export class InkEditor extends AnnotationEditor {
5
+ static _defaultColor: null;
6
+ static _defaultOpacity: number;
7
+ static _defaultThickness: number;
8
+ static _l10nPromise: any;
9
+ static _type: string;
10
+ /** @inheritdoc */
11
+ static initialize(l10n: any): void;
12
+ /** @inheritdoc */
13
+ static updateDefaultParams(type: any, value: any): void;
14
+ /** @inheritdoc */
15
+ static get defaultPropertiesToUpdate(): any[][];
16
+ /**
17
+ * Convert into a Path2D.
18
+ * @param {Arra<Array<number>} bezier
19
+ * @returns {Path2D}
20
+ */
21
+ static "__#15@#buildPath2D"(bezier: Arra<number[]>): Path2D;
22
+ static "__#15@#toPDFCoordinates"(points: any, rect: any, rotation: any): any;
23
+ static "__#15@#fromPDFCoordinates"(points: any, rect: any, rotation: any): any;
24
+ /** @inheritdoc */
25
+ static deserialize(data: any, parent: any, uiManager: any): AnnotationEditor | null;
26
+ constructor(params: any);
27
+ color: any;
28
+ thickness: any;
29
+ opacity: any;
30
+ paths: any[];
31
+ bezierPath2D: any[];
32
+ allRawPaths: any[];
33
+ currentPath: any[];
34
+ scaleFactor: number;
35
+ translationX: number;
36
+ translationY: number;
37
+ /** @inheritdoc */
38
+ updateParams(type: any, value: any): void;
39
+ /** @inheritdoc */
40
+ get propertiesToUpdate(): any[][];
41
+ canvas: HTMLCanvasElement | null | undefined;
42
+ onScaleChanging(): void;
43
+ /**
44
+ * onpointerdown callback for the canvas we're drawing on.
45
+ * @param {PointerEvent} event
46
+ */
47
+ canvasPointerdown(event: PointerEvent): void;
48
+ /**
49
+ * oncontextmenu callback for the canvas we're drawing on.
50
+ * @param {PointerEvent} event
51
+ */
52
+ canvasContextMenu(event: PointerEvent): void;
53
+ /**
54
+ * onpointermove callback for the canvas we're drawing on.
55
+ * @param {PointerEvent} event
56
+ */
57
+ canvasPointermove(event: PointerEvent): void;
58
+ /**
59
+ * onpointerup callback for the canvas we're drawing on.
60
+ * @param {PointerEvent} event
61
+ */
62
+ canvasPointerup(event: PointerEvent): void;
63
+ /**
64
+ * onpointerleave callback for the canvas we're drawing on.
65
+ * @param {PointerEvent} event
66
+ */
67
+ canvasPointerleave(event: PointerEvent): void;
68
+ ctx: CanvasRenderingContext2D | null | undefined;
69
+ /** @inheritdoc */
70
+ render(): HTMLDivElement | null;
71
+ /**
72
+ * When the dimensions of the div change the inner canvas must
73
+ * renew its dimensions, hence it must redraw its own contents.
74
+ * @param {number} width - the new width of the div
75
+ * @param {number} height - the new height of the div
76
+ * @returns
77
+ */
78
+ setDimensions(width: number, height: number): void;
79
+ /** @inheritdoc */
80
+ serialize(): {
81
+ annotationType: number;
82
+ color: number[];
83
+ thickness: any;
84
+ opacity: any;
85
+ paths: {
86
+ bezier: any;
87
+ points: any;
88
+ }[];
89
+ pageIndex: number;
90
+ rect: any[];
91
+ rotation: number;
92
+ } | null;
93
+ #private;
94
+ }
95
+ import { AnnotationEditor } from "./editor.js";
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Basic text editor in order to create a FreeTex annotation.
3
+ */
4
+ export class StampEditor extends AnnotationEditor {
5
+ static _type: string;
6
+ /** @inheritdoc */
7
+ static deserialize(data: any, parent: any, uiManager: any): AnnotationEditor | null;
8
+ constructor(params: any);
9
+ /** @inheritdoc */
10
+ render(): HTMLDivElement | null;
11
+ /** @inheritdoc */
12
+ serialize(isForCopying?: boolean, context?: null): {
13
+ annotationType: number;
14
+ bitmapId: null;
15
+ pageIndex: number;
16
+ rect: any[];
17
+ rotation: number;
18
+ isSvg: boolean;
19
+ } | null;
20
+ #private;
21
+ }
22
+ import { AnnotationEditor } from "./editor.js";