@divriots/pdfjs-dist 3.10.111-divriots2.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/CODE_OF_CONDUCT.md +15 -0
- package/LICENSE +177 -0
- package/README.md +14 -0
- package/build/pdf.js +18009 -0
- package/build/pdf.js.map +1 -0
- package/build/pdf.min.js +22 -0
- package/build/pdf.sandbox.js +280 -0
- package/build/pdf.sandbox.js.map +1 -0
- package/build/pdf.sandbox.min.js +22 -0
- package/build/pdf.worker.entry.js +19 -0
- package/build/pdf.worker.js +57863 -0
- package/build/pdf.worker.js.map +1 -0
- package/build/pdf.worker.min.js +22 -0
- package/cmaps/78-EUC-H.bcmap +0 -0
- package/cmaps/78-EUC-V.bcmap +0 -0
- package/cmaps/78-H.bcmap +0 -0
- package/cmaps/78-RKSJ-H.bcmap +0 -0
- package/cmaps/78-RKSJ-V.bcmap +0 -0
- package/cmaps/78-V.bcmap +0 -0
- package/cmaps/78ms-RKSJ-H.bcmap +0 -0
- package/cmaps/78ms-RKSJ-V.bcmap +0 -0
- package/cmaps/83pv-RKSJ-H.bcmap +0 -0
- package/cmaps/90ms-RKSJ-H.bcmap +0 -0
- package/cmaps/90ms-RKSJ-V.bcmap +0 -0
- package/cmaps/90msp-RKSJ-H.bcmap +0 -0
- package/cmaps/90msp-RKSJ-V.bcmap +0 -0
- package/cmaps/90pv-RKSJ-H.bcmap +0 -0
- package/cmaps/90pv-RKSJ-V.bcmap +0 -0
- package/cmaps/Add-H.bcmap +0 -0
- package/cmaps/Add-RKSJ-H.bcmap +0 -0
- package/cmaps/Add-RKSJ-V.bcmap +0 -0
- package/cmaps/Add-V.bcmap +0 -0
- package/cmaps/Adobe-CNS1-0.bcmap +0 -0
- package/cmaps/Adobe-CNS1-1.bcmap +0 -0
- package/cmaps/Adobe-CNS1-2.bcmap +0 -0
- package/cmaps/Adobe-CNS1-3.bcmap +0 -0
- package/cmaps/Adobe-CNS1-4.bcmap +0 -0
- package/cmaps/Adobe-CNS1-5.bcmap +0 -0
- package/cmaps/Adobe-CNS1-6.bcmap +0 -0
- package/cmaps/Adobe-CNS1-UCS2.bcmap +0 -0
- package/cmaps/Adobe-GB1-0.bcmap +0 -0
- package/cmaps/Adobe-GB1-1.bcmap +0 -0
- package/cmaps/Adobe-GB1-2.bcmap +0 -0
- package/cmaps/Adobe-GB1-3.bcmap +0 -0
- package/cmaps/Adobe-GB1-4.bcmap +0 -0
- package/cmaps/Adobe-GB1-5.bcmap +0 -0
- package/cmaps/Adobe-GB1-UCS2.bcmap +0 -0
- package/cmaps/Adobe-Japan1-0.bcmap +0 -0
- package/cmaps/Adobe-Japan1-1.bcmap +0 -0
- package/cmaps/Adobe-Japan1-2.bcmap +0 -0
- package/cmaps/Adobe-Japan1-3.bcmap +0 -0
- package/cmaps/Adobe-Japan1-4.bcmap +0 -0
- package/cmaps/Adobe-Japan1-5.bcmap +0 -0
- package/cmaps/Adobe-Japan1-6.bcmap +0 -0
- package/cmaps/Adobe-Japan1-UCS2.bcmap +0 -0
- package/cmaps/Adobe-Korea1-0.bcmap +0 -0
- package/cmaps/Adobe-Korea1-1.bcmap +0 -0
- package/cmaps/Adobe-Korea1-2.bcmap +0 -0
- package/cmaps/Adobe-Korea1-UCS2.bcmap +0 -0
- package/cmaps/B5-H.bcmap +0 -0
- package/cmaps/B5-V.bcmap +0 -0
- package/cmaps/B5pc-H.bcmap +0 -0
- package/cmaps/B5pc-V.bcmap +0 -0
- package/cmaps/CNS-EUC-H.bcmap +0 -0
- package/cmaps/CNS-EUC-V.bcmap +0 -0
- package/cmaps/CNS1-H.bcmap +0 -0
- package/cmaps/CNS1-V.bcmap +0 -0
- package/cmaps/CNS2-H.bcmap +0 -0
- package/cmaps/CNS2-V.bcmap +3 -0
- package/cmaps/ETHK-B5-H.bcmap +0 -0
- package/cmaps/ETHK-B5-V.bcmap +0 -0
- package/cmaps/ETen-B5-H.bcmap +0 -0
- package/cmaps/ETen-B5-V.bcmap +0 -0
- package/cmaps/ETenms-B5-H.bcmap +3 -0
- package/cmaps/ETenms-B5-V.bcmap +0 -0
- package/cmaps/EUC-H.bcmap +0 -0
- package/cmaps/EUC-V.bcmap +0 -0
- package/cmaps/Ext-H.bcmap +0 -0
- package/cmaps/Ext-RKSJ-H.bcmap +0 -0
- package/cmaps/Ext-RKSJ-V.bcmap +0 -0
- package/cmaps/Ext-V.bcmap +0 -0
- package/cmaps/GB-EUC-H.bcmap +0 -0
- package/cmaps/GB-EUC-V.bcmap +0 -0
- package/cmaps/GB-H.bcmap +4 -0
- package/cmaps/GB-V.bcmap +0 -0
- package/cmaps/GBK-EUC-H.bcmap +0 -0
- package/cmaps/GBK-EUC-V.bcmap +0 -0
- package/cmaps/GBK2K-H.bcmap +0 -0
- package/cmaps/GBK2K-V.bcmap +0 -0
- package/cmaps/GBKp-EUC-H.bcmap +0 -0
- package/cmaps/GBKp-EUC-V.bcmap +0 -0
- package/cmaps/GBT-EUC-H.bcmap +0 -0
- package/cmaps/GBT-EUC-V.bcmap +0 -0
- package/cmaps/GBT-H.bcmap +0 -0
- package/cmaps/GBT-V.bcmap +0 -0
- package/cmaps/GBTpc-EUC-H.bcmap +0 -0
- package/cmaps/GBTpc-EUC-V.bcmap +0 -0
- package/cmaps/GBpc-EUC-H.bcmap +0 -0
- package/cmaps/GBpc-EUC-V.bcmap +0 -0
- package/cmaps/H.bcmap +0 -0
- package/cmaps/HKdla-B5-H.bcmap +0 -0
- package/cmaps/HKdla-B5-V.bcmap +0 -0
- package/cmaps/HKdlb-B5-H.bcmap +0 -0
- package/cmaps/HKdlb-B5-V.bcmap +0 -0
- package/cmaps/HKgccs-B5-H.bcmap +0 -0
- package/cmaps/HKgccs-B5-V.bcmap +0 -0
- package/cmaps/HKm314-B5-H.bcmap +0 -0
- package/cmaps/HKm314-B5-V.bcmap +0 -0
- package/cmaps/HKm471-B5-H.bcmap +0 -0
- package/cmaps/HKm471-B5-V.bcmap +0 -0
- package/cmaps/HKscs-B5-H.bcmap +0 -0
- package/cmaps/HKscs-B5-V.bcmap +0 -0
- package/cmaps/Hankaku.bcmap +0 -0
- package/cmaps/Hiragana.bcmap +0 -0
- package/cmaps/KSC-EUC-H.bcmap +0 -0
- package/cmaps/KSC-EUC-V.bcmap +0 -0
- package/cmaps/KSC-H.bcmap +0 -0
- package/cmaps/KSC-Johab-H.bcmap +0 -0
- package/cmaps/KSC-Johab-V.bcmap +0 -0
- package/cmaps/KSC-V.bcmap +0 -0
- package/cmaps/KSCms-UHC-H.bcmap +0 -0
- package/cmaps/KSCms-UHC-HW-H.bcmap +0 -0
- package/cmaps/KSCms-UHC-HW-V.bcmap +0 -0
- package/cmaps/KSCms-UHC-V.bcmap +0 -0
- package/cmaps/KSCpc-EUC-H.bcmap +0 -0
- package/cmaps/KSCpc-EUC-V.bcmap +0 -0
- package/cmaps/Katakana.bcmap +0 -0
- package/cmaps/LICENSE +36 -0
- package/cmaps/NWP-H.bcmap +0 -0
- package/cmaps/NWP-V.bcmap +0 -0
- package/cmaps/RKSJ-H.bcmap +0 -0
- package/cmaps/RKSJ-V.bcmap +0 -0
- package/cmaps/Roman.bcmap +0 -0
- package/cmaps/UniCNS-UCS2-H.bcmap +0 -0
- package/cmaps/UniCNS-UCS2-V.bcmap +0 -0
- package/cmaps/UniCNS-UTF16-H.bcmap +0 -0
- package/cmaps/UniCNS-UTF16-V.bcmap +0 -0
- package/cmaps/UniCNS-UTF32-H.bcmap +0 -0
- package/cmaps/UniCNS-UTF32-V.bcmap +0 -0
- package/cmaps/UniCNS-UTF8-H.bcmap +0 -0
- package/cmaps/UniCNS-UTF8-V.bcmap +0 -0
- package/cmaps/UniGB-UCS2-H.bcmap +0 -0
- package/cmaps/UniGB-UCS2-V.bcmap +0 -0
- package/cmaps/UniGB-UTF16-H.bcmap +0 -0
- package/cmaps/UniGB-UTF16-V.bcmap +0 -0
- package/cmaps/UniGB-UTF32-H.bcmap +0 -0
- package/cmaps/UniGB-UTF32-V.bcmap +0 -0
- package/cmaps/UniGB-UTF8-H.bcmap +0 -0
- package/cmaps/UniGB-UTF8-V.bcmap +0 -0
- package/cmaps/UniJIS-UCS2-H.bcmap +0 -0
- package/cmaps/UniJIS-UCS2-HW-H.bcmap +0 -0
- package/cmaps/UniJIS-UCS2-HW-V.bcmap +0 -0
- package/cmaps/UniJIS-UCS2-V.bcmap +0 -0
- package/cmaps/UniJIS-UTF16-H.bcmap +0 -0
- package/cmaps/UniJIS-UTF16-V.bcmap +0 -0
- package/cmaps/UniJIS-UTF32-H.bcmap +0 -0
- package/cmaps/UniJIS-UTF32-V.bcmap +0 -0
- package/cmaps/UniJIS-UTF8-H.bcmap +0 -0
- package/cmaps/UniJIS-UTF8-V.bcmap +0 -0
- package/cmaps/UniJIS2004-UTF16-H.bcmap +0 -0
- package/cmaps/UniJIS2004-UTF16-V.bcmap +0 -0
- package/cmaps/UniJIS2004-UTF32-H.bcmap +0 -0
- package/cmaps/UniJIS2004-UTF32-V.bcmap +0 -0
- package/cmaps/UniJIS2004-UTF8-H.bcmap +0 -0
- package/cmaps/UniJIS2004-UTF8-V.bcmap +0 -0
- package/cmaps/UniJISPro-UCS2-HW-V.bcmap +0 -0
- package/cmaps/UniJISPro-UCS2-V.bcmap +0 -0
- package/cmaps/UniJISPro-UTF8-V.bcmap +0 -0
- package/cmaps/UniJISX0213-UTF32-H.bcmap +0 -0
- package/cmaps/UniJISX0213-UTF32-V.bcmap +0 -0
- package/cmaps/UniJISX02132004-UTF32-H.bcmap +0 -0
- package/cmaps/UniJISX02132004-UTF32-V.bcmap +0 -0
- package/cmaps/UniKS-UCS2-H.bcmap +0 -0
- package/cmaps/UniKS-UCS2-V.bcmap +0 -0
- package/cmaps/UniKS-UTF16-H.bcmap +0 -0
- package/cmaps/UniKS-UTF16-V.bcmap +0 -0
- package/cmaps/UniKS-UTF32-H.bcmap +0 -0
- package/cmaps/UniKS-UTF32-V.bcmap +0 -0
- package/cmaps/UniKS-UTF8-H.bcmap +0 -0
- package/cmaps/UniKS-UTF8-V.bcmap +0 -0
- package/cmaps/V.bcmap +0 -0
- package/cmaps/WP-Symbol.bcmap +0 -0
- package/image_decoders/pdf.image_decoders.js +7490 -0
- package/image_decoders/pdf.image_decoders.js.map +1 -0
- package/image_decoders/pdf.image_decoders.min.js +22 -0
- package/legacy/build/pdf.d.ts +1 -0
- package/legacy/build/pdf.js +22941 -0
- package/legacy/build/pdf.js.map +1 -0
- package/legacy/build/pdf.min.js +22 -0
- package/legacy/build/pdf.sandbox.js +3274 -0
- package/legacy/build/pdf.sandbox.js.map +1 -0
- package/legacy/build/pdf.sandbox.min.js +22 -0
- package/legacy/build/pdf.worker.entry.js +19 -0
- package/legacy/build/pdf.worker.js +62058 -0
- package/legacy/build/pdf.worker.js.map +1 -0
- package/legacy/build/pdf.worker.min.js +22 -0
- package/legacy/image_decoders/pdf.image_decoders.js +10615 -0
- package/legacy/image_decoders/pdf.image_decoders.js.map +1 -0
- package/legacy/image_decoders/pdf.image_decoders.min.js +22 -0
- package/legacy/web/images/annotation-check.svg +11 -0
- package/legacy/web/images/annotation-comment.svg +16 -0
- package/legacy/web/images/annotation-help.svg +26 -0
- package/legacy/web/images/annotation-insert.svg +10 -0
- package/legacy/web/images/annotation-key.svg +11 -0
- package/legacy/web/images/annotation-newparagraph.svg +11 -0
- package/legacy/web/images/annotation-noicon.svg +7 -0
- package/legacy/web/images/annotation-note.svg +42 -0
- package/legacy/web/images/annotation-paperclip.svg +6 -0
- package/legacy/web/images/annotation-paragraph.svg +16 -0
- package/legacy/web/images/annotation-pushpin.svg +7 -0
- package/legacy/web/images/loading-icon.gif +0 -0
- package/legacy/web/pdf_viewer.css +1375 -0
- package/legacy/web/pdf_viewer.d.ts +1 -0
- package/legacy/web/pdf_viewer.js +10502 -0
- package/legacy/web/pdf_viewer.js.map +1 -0
- package/package.json +35 -0
- package/standard_fonts/FoxitDingbats.pfb +0 -0
- package/standard_fonts/FoxitFixed.pfb +0 -0
- package/standard_fonts/FoxitFixedBold.pfb +0 -0
- package/standard_fonts/FoxitFixedBoldItalic.pfb +0 -0
- package/standard_fonts/FoxitFixedItalic.pfb +0 -0
- package/standard_fonts/FoxitSerif.pfb +0 -0
- package/standard_fonts/FoxitSerifBold.pfb +0 -0
- package/standard_fonts/FoxitSerifBoldItalic.pfb +0 -0
- package/standard_fonts/FoxitSerifItalic.pfb +0 -0
- package/standard_fonts/FoxitSymbol.pfb +0 -0
- package/standard_fonts/LICENSE_FOXIT +27 -0
- package/standard_fonts/LICENSE_LIBERATION +102 -0
- package/standard_fonts/LiberationSans-Bold.ttf +0 -0
- package/standard_fonts/LiberationSans-BoldItalic.ttf +0 -0
- package/standard_fonts/LiberationSans-Italic.ttf +0 -0
- package/standard_fonts/LiberationSans-Regular.ttf +0 -0
- package/types/external/webL10n/l10n.d.ts +0 -0
- package/types/src/display/annotation_layer.d.ts +203 -0
- package/types/src/display/annotation_storage.d.ts +89 -0
- package/types/src/display/api.d.ts +1592 -0
- package/types/src/display/base_factory.d.ts +54 -0
- package/types/src/display/canvas.d.ts +208 -0
- package/types/src/display/display_utils.d.ts +277 -0
- package/types/src/display/editor/annotation_editor_layer.d.ts +196 -0
- package/types/src/display/editor/editor.d.ts +325 -0
- package/types/src/display/editor/freetext.d.ts +72 -0
- package/types/src/display/editor/ink.d.ts +95 -0
- package/types/src/display/editor/stamp.d.ts +28 -0
- package/types/src/display/editor/tools.d.ts +349 -0
- package/types/src/display/font_loader.d.ts +43 -0
- package/types/src/display/metadata.d.ts +11 -0
- package/types/src/display/optional_content_config.d.ts +13 -0
- package/types/src/display/pattern_helper.d.ts +73 -0
- package/types/src/display/text_layer.d.ts +151 -0
- package/types/src/display/transport_stream.d.ts +68 -0
- package/types/src/display/worker_options.d.ts +27 -0
- package/types/src/display/xfa_layer.d.ts +46 -0
- package/types/src/display/xfa_text.d.ts +19 -0
- package/types/src/pdf.d.ts +62 -0
- package/types/src/shared/image_utils.d.ts +17 -0
- package/types/src/shared/message_handler.d.ts +43 -0
- package/types/src/shared/murmurhash3.d.ts +7 -0
- package/types/src/shared/scripting_utils.d.ts +16 -0
- package/types/src/shared/util.d.ts +398 -0
- package/types/web/annotation_editor_layer_builder.d.ts +50 -0
- package/types/web/annotation_layer_builder.d.ts +83 -0
- package/types/web/app_options.d.ts +14 -0
- package/types/web/download_manager.d.ts +14 -0
- package/types/web/event_utils.d.ts +75 -0
- package/types/web/generic_scripting.d.ts +8 -0
- package/types/web/genericl10n.d.ts +13 -0
- package/types/web/interfaces.d.ts +163 -0
- package/types/web/l10n_utils.d.ts +7 -0
- package/types/web/pdf_find_controller.d.ts +108 -0
- package/types/web/pdf_find_utils.d.ts +16 -0
- package/types/web/pdf_history.d.ts +168 -0
- package/types/web/pdf_link_service.d.ts +243 -0
- package/types/web/pdf_page_view.d.ts +209 -0
- package/types/web/pdf_rendering_queue.d.ts +53 -0
- package/types/web/pdf_scripting_manager.component.d.ts +5 -0
- package/types/web/pdf_scripting_manager.d.ts +61 -0
- package/types/web/pdf_single_page_viewer.d.ts +7 -0
- package/types/web/pdf_thumbnail_view.d.ts +131 -0
- package/types/web/pdf_thumbnail_viewer.d.ts +104 -0
- package/types/web/pdf_viewer.component.d.ts +24 -0
- package/types/web/pdf_viewer.d.ts +455 -0
- package/types/web/struct_tree_layer_builder.d.ts +7 -0
- package/types/web/text_accessibility.d.ts +42 -0
- package/types/web/text_highlighter.d.ts +63 -0
- package/types/web/text_layer_builder.d.ts +64 -0
- package/types/web/ui_utils.d.ts +288 -0
- package/types/web/xfa_layer_builder.d.ts +41 -0
- package/web/images/annotation-check.svg +11 -0
- package/web/images/annotation-comment.svg +16 -0
- package/web/images/annotation-help.svg +26 -0
- package/web/images/annotation-insert.svg +10 -0
- package/web/images/annotation-key.svg +11 -0
- package/web/images/annotation-newparagraph.svg +11 -0
- package/web/images/annotation-noicon.svg +7 -0
- package/web/images/annotation-note.svg +42 -0
- package/web/images/annotation-paperclip.svg +6 -0
- package/web/images/annotation-paragraph.svg +16 -0
- package/web/images/annotation-pushpin.svg +7 -0
- package/web/images/loading-icon.gif +0 -0
- package/web/pdf_viewer.css +1375 -0
- package/web/pdf_viewer.d.ts +1 -0
- package/web/pdf_viewer.js +7752 -0
- package/web/pdf_viewer.js.map +1 -0
- package/webpack.js +26 -0
|
@@ -0,0 +1,196 @@
|
|
|
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
|
+
* An editor can have a different parent, for example after having
|
|
96
|
+
* being dragged and droped from a page to another.
|
|
97
|
+
* @param {AnnotationEditor} editor
|
|
98
|
+
*/
|
|
99
|
+
changeParent(editor: AnnotationEditor): void;
|
|
100
|
+
/**
|
|
101
|
+
* Add a new editor in the current view.
|
|
102
|
+
* @param {AnnotationEditor} editor
|
|
103
|
+
*/
|
|
104
|
+
add(editor: AnnotationEditor): void;
|
|
105
|
+
moveEditorInDOM(editor: any): void;
|
|
106
|
+
/**
|
|
107
|
+
* Add or rebuild depending if it has been removed or not.
|
|
108
|
+
* @param {AnnotationEditor} editor
|
|
109
|
+
*/
|
|
110
|
+
addOrRebuild(editor: AnnotationEditor): void;
|
|
111
|
+
/**
|
|
112
|
+
* Add a new editor and make this addition undoable.
|
|
113
|
+
* @param {AnnotationEditor} editor
|
|
114
|
+
*/
|
|
115
|
+
addUndoableEditor(editor: AnnotationEditor): void;
|
|
116
|
+
/**
|
|
117
|
+
* Get an id for an editor.
|
|
118
|
+
* @returns {string}
|
|
119
|
+
*/
|
|
120
|
+
getNextId(): string;
|
|
121
|
+
/**
|
|
122
|
+
* Paste some content into a new editor.
|
|
123
|
+
* @param {number} mode
|
|
124
|
+
* @param {Object} params
|
|
125
|
+
*/
|
|
126
|
+
pasteEditor(mode: number, params: Object): void;
|
|
127
|
+
/**
|
|
128
|
+
* Create a new editor
|
|
129
|
+
* @param {Object} data
|
|
130
|
+
* @returns {AnnotationEditor}
|
|
131
|
+
*/
|
|
132
|
+
deserialize(data: Object): AnnotationEditor;
|
|
133
|
+
/**
|
|
134
|
+
* Create and add a new editor.
|
|
135
|
+
*/
|
|
136
|
+
addNewEditor(): void;
|
|
137
|
+
/**
|
|
138
|
+
* Set the last selected editor.
|
|
139
|
+
* @param {AnnotationEditor} editor
|
|
140
|
+
*/
|
|
141
|
+
setSelected(editor: AnnotationEditor): void;
|
|
142
|
+
/**
|
|
143
|
+
* Add or remove an editor the current selection.
|
|
144
|
+
* @param {AnnotationEditor} editor
|
|
145
|
+
*/
|
|
146
|
+
toggleSelected(editor: AnnotationEditor): void;
|
|
147
|
+
/**
|
|
148
|
+
* Check if the editor is selected.
|
|
149
|
+
* @param {AnnotationEditor} editor
|
|
150
|
+
*/
|
|
151
|
+
isSelected(editor: AnnotationEditor): boolean;
|
|
152
|
+
/**
|
|
153
|
+
* Unselect an editor.
|
|
154
|
+
* @param {AnnotationEditor} editor
|
|
155
|
+
*/
|
|
156
|
+
unselect(editor: AnnotationEditor): void;
|
|
157
|
+
/**
|
|
158
|
+
* Pointerup callback.
|
|
159
|
+
* @param {PointerEvent} event
|
|
160
|
+
*/
|
|
161
|
+
pointerup(event: PointerEvent): void;
|
|
162
|
+
/**
|
|
163
|
+
* Pointerdown callback.
|
|
164
|
+
* @param {PointerEvent} event
|
|
165
|
+
*/
|
|
166
|
+
pointerdown(event: PointerEvent): void;
|
|
167
|
+
/**
|
|
168
|
+
*
|
|
169
|
+
* @param {AnnotationEditor} editor
|
|
170
|
+
* @param {number} x
|
|
171
|
+
* @param {number} y
|
|
172
|
+
* @returns
|
|
173
|
+
*/
|
|
174
|
+
findNewParent(editor: AnnotationEditor, x: number, y: number): boolean;
|
|
175
|
+
/**
|
|
176
|
+
* Destroy the main editor.
|
|
177
|
+
*/
|
|
178
|
+
destroy(): void;
|
|
179
|
+
/**
|
|
180
|
+
* Render the main editor.
|
|
181
|
+
* @param {RenderEditorLayerOptions} parameters
|
|
182
|
+
*/
|
|
183
|
+
render({ viewport }: RenderEditorLayerOptions): void;
|
|
184
|
+
/**
|
|
185
|
+
* Update the main editor.
|
|
186
|
+
* @param {RenderEditorLayerOptions} parameters
|
|
187
|
+
*/
|
|
188
|
+
update({ viewport }: RenderEditorLayerOptions): void;
|
|
189
|
+
/**
|
|
190
|
+
* Get page dimensions.
|
|
191
|
+
* @returns {Object} dimensions.
|
|
192
|
+
*/
|
|
193
|
+
get pageDimensions(): Object;
|
|
194
|
+
#private;
|
|
195
|
+
}
|
|
196
|
+
import { AnnotationEditor } from "./editor.js";
|
|
@@ -0,0 +1,325 @@
|
|
|
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
|
+
* Check if this kind of editor is able to handle the given mime type for
|
|
59
|
+
* pasting.
|
|
60
|
+
* @param {string} mime
|
|
61
|
+
* @returns {boolean}
|
|
62
|
+
*/
|
|
63
|
+
static isHandlingMimeForPasting(_mime: any): boolean;
|
|
64
|
+
/**
|
|
65
|
+
* Extract the data from the clipboard item and delegate the creation of the
|
|
66
|
+
* editor to the parent.
|
|
67
|
+
* @param {DataTransferItem} item
|
|
68
|
+
* @param {AnnotationEditorLayer} parent
|
|
69
|
+
*/
|
|
70
|
+
static paste(item: DataTransferItem, parent: AnnotationEditorLayer): void;
|
|
71
|
+
static "__#23@#rotatePoint"(x: any, y: any, angle: any): any[];
|
|
72
|
+
static "__#23@#noContextMenu"(e: any): void;
|
|
73
|
+
/**
|
|
74
|
+
* Deserialize the editor.
|
|
75
|
+
* The result of the deserialization is a new editor.
|
|
76
|
+
*
|
|
77
|
+
* @param {Object} data
|
|
78
|
+
* @param {AnnotationEditorLayer} parent
|
|
79
|
+
* @param {AnnotationEditorUIManager} uiManager
|
|
80
|
+
* @returns {AnnotationEditor}
|
|
81
|
+
*/
|
|
82
|
+
static deserialize(data: Object, parent: AnnotationEditorLayer, uiManager: AnnotationEditorUIManager): AnnotationEditor;
|
|
83
|
+
static get MIN_SIZE(): number;
|
|
84
|
+
/**
|
|
85
|
+
* @param {AnnotationEditorParameters} parameters
|
|
86
|
+
*/
|
|
87
|
+
constructor(parameters: AnnotationEditorParameters);
|
|
88
|
+
_initialOptions: any;
|
|
89
|
+
_uiManager: null;
|
|
90
|
+
_focusEventsAllowed: boolean;
|
|
91
|
+
parent: import("./annotation_editor_layer.js").AnnotationEditorLayer;
|
|
92
|
+
id: string;
|
|
93
|
+
width: any;
|
|
94
|
+
height: any;
|
|
95
|
+
pageIndex: number;
|
|
96
|
+
name: any;
|
|
97
|
+
div: HTMLDivElement | null;
|
|
98
|
+
annotationElementId: any;
|
|
99
|
+
_willKeepAspectRatio: boolean;
|
|
100
|
+
rotation: number;
|
|
101
|
+
pageRotation: number;
|
|
102
|
+
pageDimensions: any[];
|
|
103
|
+
pageTranslation: any[];
|
|
104
|
+
x: number;
|
|
105
|
+
y: number;
|
|
106
|
+
isAttachedToDOM: boolean;
|
|
107
|
+
deleted: boolean;
|
|
108
|
+
/**
|
|
109
|
+
* Get the properties to update in the UI for this editor.
|
|
110
|
+
* @returns {Array}
|
|
111
|
+
*/
|
|
112
|
+
get propertiesToUpdate(): any[];
|
|
113
|
+
set _isDraggable(arg: boolean);
|
|
114
|
+
get _isDraggable(): boolean;
|
|
115
|
+
center(): void;
|
|
116
|
+
/**
|
|
117
|
+
* Add some commands into the CommandManager (undo/redo stuff).
|
|
118
|
+
* @param {Object} params
|
|
119
|
+
*/
|
|
120
|
+
addCommands(params: Object): void;
|
|
121
|
+
get currentLayer(): any;
|
|
122
|
+
/**
|
|
123
|
+
* This editor will be behind the others.
|
|
124
|
+
*/
|
|
125
|
+
setInBackground(): void;
|
|
126
|
+
/**
|
|
127
|
+
* This editor will be in the foreground.
|
|
128
|
+
*/
|
|
129
|
+
setInForeground(): void;
|
|
130
|
+
setParent(parent: any): void;
|
|
131
|
+
/**
|
|
132
|
+
* onfocus callback.
|
|
133
|
+
*/
|
|
134
|
+
focusin(event: any): void;
|
|
135
|
+
/**
|
|
136
|
+
* onblur callback.
|
|
137
|
+
* @param {FocusEvent} event
|
|
138
|
+
*/
|
|
139
|
+
focusout(event: FocusEvent): void;
|
|
140
|
+
commitOrRemove(): void;
|
|
141
|
+
/**
|
|
142
|
+
* Commit the data contained in this editor.
|
|
143
|
+
*/
|
|
144
|
+
commit(): void;
|
|
145
|
+
addToAnnotationStorage(): void;
|
|
146
|
+
/**
|
|
147
|
+
* Set the editor position within its parent.
|
|
148
|
+
* @param {number} x
|
|
149
|
+
* @param {number} y
|
|
150
|
+
* @param {number} tx - x-translation in screen coordinates.
|
|
151
|
+
* @param {number} ty - y-translation in screen coordinates.
|
|
152
|
+
*/
|
|
153
|
+
setAt(x: number, y: number, tx: number, ty: number): void;
|
|
154
|
+
/**
|
|
155
|
+
* Translate the editor position within its parent.
|
|
156
|
+
* @param {number} x - x-translation in screen coordinates.
|
|
157
|
+
* @param {number} y - y-translation in screen coordinates.
|
|
158
|
+
*/
|
|
159
|
+
translate(x: number, y: number): void;
|
|
160
|
+
/**
|
|
161
|
+
* Translate the editor position within its page and adjust the scroll
|
|
162
|
+
* in order to have the editor in the view.
|
|
163
|
+
* @param {number} x - x-translation in page coordinates.
|
|
164
|
+
* @param {number} y - y-translation in page coordinates.
|
|
165
|
+
*/
|
|
166
|
+
translateInPage(x: number, y: number): void;
|
|
167
|
+
drag(tx: any, ty: any): void;
|
|
168
|
+
fixAndSetPosition(): void;
|
|
169
|
+
/**
|
|
170
|
+
* Convert a screen translation into a page one.
|
|
171
|
+
* @param {number} x
|
|
172
|
+
* @param {number} y
|
|
173
|
+
*/
|
|
174
|
+
screenToPageTranslation(x: number, y: number): any[];
|
|
175
|
+
/**
|
|
176
|
+
* Convert a page translation into a screen one.
|
|
177
|
+
* @param {number} x
|
|
178
|
+
* @param {number} y
|
|
179
|
+
*/
|
|
180
|
+
pageTranslationToScreen(x: number, y: number): any[];
|
|
181
|
+
get parentScale(): any;
|
|
182
|
+
get parentRotation(): number;
|
|
183
|
+
get parentDimensions(): number[];
|
|
184
|
+
/**
|
|
185
|
+
* Set the dimensions of this editor.
|
|
186
|
+
* @param {number} width
|
|
187
|
+
* @param {number} height
|
|
188
|
+
*/
|
|
189
|
+
setDims(width: number, height: number): void;
|
|
190
|
+
fixDims(): void;
|
|
191
|
+
/**
|
|
192
|
+
* Get the translation used to position this editor when it's created.
|
|
193
|
+
* @returns {Array<number>}
|
|
194
|
+
*/
|
|
195
|
+
getInitialTranslation(): Array<number>;
|
|
196
|
+
/**
|
|
197
|
+
* Render this editor in a div.
|
|
198
|
+
* @returns {HTMLDivElement}
|
|
199
|
+
*/
|
|
200
|
+
render(): HTMLDivElement;
|
|
201
|
+
/**
|
|
202
|
+
* Onpointerdown callback.
|
|
203
|
+
* @param {PointerEvent} event
|
|
204
|
+
*/
|
|
205
|
+
pointerdown(event: PointerEvent): void;
|
|
206
|
+
moveInDOM(): void;
|
|
207
|
+
_setParentAndPosition(parent: any, x: any, y: any): void;
|
|
208
|
+
/**
|
|
209
|
+
* Convert the current rect into a page one.
|
|
210
|
+
*/
|
|
211
|
+
getRect(tx: any, ty: any): any[];
|
|
212
|
+
getRectInCurrentCoords(rect: any, pageHeight: any): any[];
|
|
213
|
+
/**
|
|
214
|
+
* Executed once this editor has been rendered.
|
|
215
|
+
*/
|
|
216
|
+
onceAdded(): void;
|
|
217
|
+
/**
|
|
218
|
+
* Check if the editor contains something.
|
|
219
|
+
* @returns {boolean}
|
|
220
|
+
*/
|
|
221
|
+
isEmpty(): boolean;
|
|
222
|
+
/**
|
|
223
|
+
* Enable edit mode.
|
|
224
|
+
*/
|
|
225
|
+
enableEditMode(): void;
|
|
226
|
+
/**
|
|
227
|
+
* Disable edit mode.
|
|
228
|
+
*/
|
|
229
|
+
disableEditMode(): void;
|
|
230
|
+
/**
|
|
231
|
+
* Check if the editor is edited.
|
|
232
|
+
* @returns {boolean}
|
|
233
|
+
*/
|
|
234
|
+
isInEditMode(): boolean;
|
|
235
|
+
/**
|
|
236
|
+
* If it returns true, then this editor handle the keyboard
|
|
237
|
+
* events itself.
|
|
238
|
+
* @returns {boolean}
|
|
239
|
+
*/
|
|
240
|
+
shouldGetKeyboardEvents(): boolean;
|
|
241
|
+
/**
|
|
242
|
+
* Check if this editor needs to be rebuilt or not.
|
|
243
|
+
* @returns {boolean}
|
|
244
|
+
*/
|
|
245
|
+
needsToBeRebuilt(): boolean;
|
|
246
|
+
/**
|
|
247
|
+
* Rebuild the editor in case it has been removed on undo.
|
|
248
|
+
*
|
|
249
|
+
* To implement in subclasses.
|
|
250
|
+
*/
|
|
251
|
+
rebuild(): void;
|
|
252
|
+
/**
|
|
253
|
+
* Serialize the editor.
|
|
254
|
+
* The result of the serialization will be used to construct a
|
|
255
|
+
* new annotation to add to the pdf document.
|
|
256
|
+
*
|
|
257
|
+
* To implement in subclasses.
|
|
258
|
+
* @param {boolean} isForCopying
|
|
259
|
+
* @param {Object} [context]
|
|
260
|
+
*/
|
|
261
|
+
serialize(_isForCopying?: boolean, _context?: null): void;
|
|
262
|
+
/**
|
|
263
|
+
* Remove this editor.
|
|
264
|
+
* It's used on ctrl+backspace action.
|
|
265
|
+
*/
|
|
266
|
+
remove(): void;
|
|
267
|
+
/**
|
|
268
|
+
* @returns {boolean} true if this editor can be resized.
|
|
269
|
+
*/
|
|
270
|
+
get isResizable(): boolean;
|
|
271
|
+
/**
|
|
272
|
+
* Add the resizers to this editor.
|
|
273
|
+
*/
|
|
274
|
+
makeResizable(): void;
|
|
275
|
+
/**
|
|
276
|
+
* Select this editor.
|
|
277
|
+
*/
|
|
278
|
+
select(): void;
|
|
279
|
+
/**
|
|
280
|
+
* Unselect this editor.
|
|
281
|
+
*/
|
|
282
|
+
unselect(): void;
|
|
283
|
+
/**
|
|
284
|
+
* Update some parameters which have been changed through the UI.
|
|
285
|
+
* @param {number} type
|
|
286
|
+
* @param {*} value
|
|
287
|
+
*/
|
|
288
|
+
updateParams(type: number, value: any): void;
|
|
289
|
+
/**
|
|
290
|
+
* When the user disables the editing mode some editors can change some of
|
|
291
|
+
* their properties.
|
|
292
|
+
*/
|
|
293
|
+
disableEditing(): void;
|
|
294
|
+
/**
|
|
295
|
+
* When the user enables the editing mode some editors can change some of
|
|
296
|
+
* their properties.
|
|
297
|
+
*/
|
|
298
|
+
enableEditing(): void;
|
|
299
|
+
/**
|
|
300
|
+
* The editor is about to be edited.
|
|
301
|
+
*/
|
|
302
|
+
enterInEditMode(): void;
|
|
303
|
+
/**
|
|
304
|
+
* Get the div which really contains the displayed content.
|
|
305
|
+
*/
|
|
306
|
+
get contentDiv(): HTMLDivElement | null;
|
|
307
|
+
/**
|
|
308
|
+
* When set to true, it means that this editor is currently edited.
|
|
309
|
+
* @param {boolean} value
|
|
310
|
+
*/
|
|
311
|
+
set isEditing(arg: boolean);
|
|
312
|
+
/**
|
|
313
|
+
* If true then the editor is currently edited.
|
|
314
|
+
* @type {boolean}
|
|
315
|
+
*/
|
|
316
|
+
get isEditing(): boolean;
|
|
317
|
+
/**
|
|
318
|
+
* Set the aspect ratio to use when resizing.
|
|
319
|
+
* @param {number} width
|
|
320
|
+
* @param {number} height
|
|
321
|
+
*/
|
|
322
|
+
setAspectRatio(width: number, height: number): void;
|
|
323
|
+
#private;
|
|
324
|
+
}
|
|
325
|
+
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";
|