@windoc/core 0.1.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.
Files changed (48) hide show
  1. package/dist/close-L5SCCSCB.svg +1 -0
  2. package/dist/delete-col-PJ7H2VME.svg +1 -0
  3. package/dist/delete-row-KRYK75UN.svg +1 -0
  4. package/dist/delete-row-col-AXTTBTJL.svg +1 -0
  5. package/dist/delete-table-ZQGIE7OX.svg +1 -0
  6. package/dist/image-KPDHUCUH.svg +1 -0
  7. package/dist/image-change-6XDDRDRA.svg +1 -0
  8. package/dist/image-download-SO26QHKO.svg +1 -0
  9. package/dist/image-next-JCBVCCB6.svg +1 -0
  10. package/dist/image-pre-AYOSFV6K.svg +1 -0
  11. package/dist/index.css +1246 -0
  12. package/dist/index.css.map +1 -0
  13. package/dist/index.d.mts +3200 -0
  14. package/dist/index.d.ts +3200 -0
  15. package/dist/index.js +26497 -0
  16. package/dist/index.js.map +1 -0
  17. package/dist/index.mjs +26423 -0
  18. package/dist/index.mjs.map +1 -0
  19. package/dist/insert-bottom-row-UXTNCMIA.svg +1 -0
  20. package/dist/insert-left-col-WKNVQRJU.svg +1 -0
  21. package/dist/insert-right-col-GFY3POPH.svg +1 -0
  22. package/dist/insert-row-col-DPJQ5OT2.svg +1 -0
  23. package/dist/insert-top-row-YCIWVAKE.svg +1 -0
  24. package/dist/merge-cancel-cell-L27MJAPT.svg +1 -0
  25. package/dist/merge-cell-NRL3YFFW.svg +1 -0
  26. package/dist/original-size-PECN7EBE.svg +1 -0
  27. package/dist/print-LVCRTYBR.svg +1 -0
  28. package/dist/rotate-7DOTSPFX.svg +1 -0
  29. package/dist/submenu-dropdown-YTAUMLFH.svg +1 -0
  30. package/dist/table-border-all-44ZWUFEF.svg +1 -0
  31. package/dist/table-border-dash-WAJLONDH.svg +1 -0
  32. package/dist/table-border-empty-JJV7KGOH.svg +1 -0
  33. package/dist/table-border-external-TB57BNDP.svg +1 -0
  34. package/dist/table-border-internal-ODMAMVLL.svg +1 -0
  35. package/dist/table-border-td-XRMSRWS4.svg +1 -0
  36. package/dist/table-border-td-back-NJJGCRBU.svg +1 -0
  37. package/dist/table-border-td-bottom-CUNHU7Z5.svg +1 -0
  38. package/dist/table-border-td-forward-5N5PN7SK.svg +1 -0
  39. package/dist/table-border-td-left-PH2BQBNW.svg +1 -0
  40. package/dist/table-border-td-right-IG6XSDFO.svg +1 -0
  41. package/dist/table-border-td-top-RNZ7YE2E.svg +1 -0
  42. package/dist/vertical-align-GRMW6UMN.svg +1 -0
  43. package/dist/vertical-align-bottom-KOLLKBRO.svg +1 -0
  44. package/dist/vertical-align-middle-SNHGOWIM.svg +1 -0
  45. package/dist/vertical-align-top-EGVPDCAJ.svg +1 -0
  46. package/dist/zoom-in-377XBLTC.svg +1 -0
  47. package/dist/zoom-out-M6FQBFNX.svg +1 -0
  48. package/package.json +27 -0
@@ -0,0 +1,3200 @@
1
+ declare enum EditorComponent {
2
+ COMPONENT = "component",
3
+ MENU = "menu",
4
+ MAIN = "main",
5
+ FOOTER = "footer",
6
+ CONTEXTMENU = "contextmenu",
7
+ POPUP = "popup",
8
+ CATALOG = "catalog",
9
+ COMMENT = "comment"
10
+ }
11
+ declare enum EditorContext {
12
+ PAGE = "page",
13
+ TABLE = "table"
14
+ }
15
+ declare enum EditorMode {
16
+ EDIT = "edit",
17
+ CLEAN = "clean",
18
+ READONLY = "readonly",
19
+ FORM = "form",
20
+ PRINT = "print",
21
+ DESIGN = "design",
22
+ GRAFFITI = "graffiti"
23
+ }
24
+ declare enum EditorZone {
25
+ HEADER = "header",
26
+ MAIN = "main",
27
+ FOOTER = "footer"
28
+ }
29
+ declare enum PageMode {
30
+ PAGING = "paging",
31
+ CONTINUITY = "continuity"
32
+ }
33
+ declare enum PaperDirection {
34
+ VERTICAL = "vertical",
35
+ HORIZONTAL = "horizontal"
36
+ }
37
+ declare enum WordBreak {
38
+ BREAK_ALL = "break-all",
39
+ BREAK_WORD = "break-word"
40
+ }
41
+ declare enum RenderMode {
42
+ SPEED = "speed",
43
+ COMPATIBILITY = "compatibility"
44
+ }
45
+
46
+ declare enum BackgroundSize {
47
+ CONTAIN = "contain",
48
+ COVER = "cover"
49
+ }
50
+ declare enum BackgroundRepeat {
51
+ REPEAT = "repeat",
52
+ NO_REPEAT = "no-repeat",
53
+ REPEAT_X = "repeat-x",
54
+ REPEAT_Y = "repeat-y"
55
+ }
56
+
57
+ interface IBackgroundOption {
58
+ color?: string;
59
+ image?: string;
60
+ size?: BackgroundSize;
61
+ repeat?: BackgroundRepeat;
62
+ applyPageNumbers?: number[];
63
+ }
64
+
65
+ declare enum VerticalAlign {
66
+ TOP = "top",
67
+ MIDDLE = "middle",
68
+ BOTTOM = "bottom"
69
+ }
70
+
71
+ interface ICheckbox {
72
+ value: boolean | null;
73
+ code?: string;
74
+ disabled?: boolean;
75
+ }
76
+ interface ICheckboxOption {
77
+ width?: number;
78
+ height?: number;
79
+ gap?: number;
80
+ lineWidth?: number;
81
+ fillStyle?: string;
82
+ strokeStyle?: string;
83
+ verticalAlign?: VerticalAlign;
84
+ }
85
+
86
+ interface IRadio {
87
+ value: boolean | null;
88
+ code?: string;
89
+ disabled?: boolean;
90
+ }
91
+ interface IRadioOption {
92
+ width?: number;
93
+ height?: number;
94
+ gap?: number;
95
+ lineWidth?: number;
96
+ fillStyle?: string;
97
+ strokeStyle?: string;
98
+ verticalAlign?: VerticalAlign;
99
+ }
100
+
101
+ declare enum MaxHeightRatio {
102
+ HALF = "half",
103
+ ONE_THIRD = "one-third",
104
+ QUARTER = "quarter"
105
+ }
106
+ declare enum NumberType {
107
+ ARABIC = "arabic",
108
+ CHINESE = "chinese"
109
+ }
110
+ declare enum ImageDisplay {
111
+ INLINE = "inline",
112
+ BLOCK = "block",
113
+ SURROUND = "surround",
114
+ FLOAT_TOP = "float-top",
115
+ FLOAT_BOTTOM = "float-bottom"
116
+ }
117
+ declare enum LocationPosition {
118
+ BEFORE = "before",
119
+ AFTER = "after",
120
+ OUTER_BEFORE = "outer-before",
121
+ OUTER_AFTER = "outer-after"
122
+ }
123
+ declare enum FlexDirection {
124
+ ROW = "row",
125
+ COLUMN = "column"
126
+ }
127
+
128
+ declare enum ControlType {
129
+ TEXT = "text",
130
+ SELECT = "select",
131
+ CHECKBOX = "checkbox",
132
+ RADIO = "radio",
133
+ DATE = "date",
134
+ NUMBER = "number"
135
+ }
136
+ declare enum ControlComponent {
137
+ PREFIX = "prefix",
138
+ POSTFIX = "postfix",
139
+ PRE_TEXT = "preText",
140
+ POST_TEXT = "postText",
141
+ PLACEHOLDER = "placeholder",
142
+ VALUE = "value",
143
+ CHECKBOX = "checkbox",
144
+ RADIO = "radio"
145
+ }
146
+ declare enum ControlIndentation {
147
+ ROW_START = "rowStart",
148
+ VALUE_START = "valueStart"
149
+ }
150
+ declare enum ControlState {
151
+ ACTIVE = "active",
152
+ INACTIVE = "inactive"
153
+ }
154
+
155
+ declare enum MoveDirection {
156
+ UP = "top",
157
+ DOWN = "down",
158
+ LEFT = "left",
159
+ RIGHT = "right"
160
+ }
161
+
162
+ declare enum RowFlex {
163
+ LEFT = "left",
164
+ CENTER = "center",
165
+ RIGHT = "right",
166
+ ALIGNMENT = "alignment",
167
+ JUSTIFY = "justify"
168
+ }
169
+
170
+ declare enum ElementType {
171
+ TEXT = "text",
172
+ IMAGE = "image",
173
+ TABLE = "table",
174
+ HYPERLINK = "hyperlink",
175
+ SUPERSCRIPT = "superscript",
176
+ SUBSCRIPT = "subscript",
177
+ SEPARATOR = "separator",
178
+ PAGE_BREAK = "pageBreak",
179
+ CONTROL = "control",
180
+ AREA = "area",
181
+ CHECKBOX = "checkbox",
182
+ RADIO = "radio",
183
+ LATEX = "latex",
184
+ TAB = "tab",
185
+ DATE = "date",
186
+ BLOCK = "block",
187
+ TITLE = "title",
188
+ LIST = "list",
189
+ LABEL = "label",
190
+ COLUMN_BREAK = "columnBreak"
191
+ }
192
+
193
+ declare enum ListType {
194
+ UL = "ul",
195
+ OL = "ol"
196
+ }
197
+ declare enum ListStyle {
198
+ DISC = "disc",
199
+ CIRCLE = "circle",
200
+ SQUARE = "square",
201
+ DECIMAL = "decimal",
202
+ CHECKBOX = "checkbox"
203
+ }
204
+ declare enum OlPreset {
205
+ DEFAULT = "olDefault",
206
+ PARENTHESIS = "olParen",
207
+ OUTLINE = "olOutline",
208
+ UPPER_ALPHA = "olUpperA",
209
+ ROMAN = "olRoman",
210
+ ZERO_PAD = "olZeroPad"
211
+ }
212
+ declare enum UlPreset {
213
+ DEFAULT = "ulDefault",
214
+ DIAMOND = "ulDiamond",
215
+ HOLLOW_SQ = "ulHollowSq",
216
+ ARROW = "ulArrow",
217
+ STAR = "ulStar",
218
+ CHECK_ARROW = "ulCheckArr"
219
+ }
220
+
221
+ declare enum TitleLevel {
222
+ FIRST = "first",
223
+ SECOND = "second",
224
+ THIRD = "third",
225
+ FOURTH = "fourth",
226
+ FIFTH = "fifth",
227
+ SIXTH = "sixth"
228
+ }
229
+
230
+ declare enum TableBorder {
231
+ ALL = "all",
232
+ EMPTY = "empty",
233
+ EXTERNAL = "external",
234
+ INTERNAL = "internal",
235
+ DASH = "dash"
236
+ }
237
+ declare enum TdBorder {
238
+ TOP = "top",
239
+ RIGHT = "right",
240
+ BOTTOM = "bottom",
241
+ LEFT = "left"
242
+ }
243
+ declare enum TdSlash {
244
+ FORWARD = "forward",
245
+ BACK = "back"
246
+ }
247
+
248
+ declare enum AreaMode {
249
+ EDIT = "edit",
250
+ READONLY = "readonly",
251
+ FORM = "form"
252
+ }
253
+
254
+ interface IPlaceholder {
255
+ data: string;
256
+ color?: string;
257
+ opacity?: number;
258
+ size?: number;
259
+ font?: string;
260
+ }
261
+
262
+ interface IRange {
263
+ startIndex: number;
264
+ endIndex: number;
265
+ isCrossRowCol?: boolean;
266
+ tableId?: string;
267
+ startTdIndex?: number;
268
+ endTdIndex?: number;
269
+ startTrIndex?: number;
270
+ endTrIndex?: number;
271
+ zone?: EditorZone;
272
+ }
273
+ type RangeRowArray = Map<number, number[]>;
274
+ type RangeRowMap = Map<number, Set<number>>;
275
+ type RangeRect = IElementFillRect;
276
+ type RangeContext = {
277
+ isCollapsed: boolean;
278
+ startElement: IElement;
279
+ endElement: IElement;
280
+ startPageNo: number;
281
+ endPageNo: number;
282
+ startRowNo: number;
283
+ endRowNo: number;
284
+ startColNo: number;
285
+ endColNo: number;
286
+ rangeRects: RangeRect[];
287
+ zone: EditorZone;
288
+ isTable: boolean;
289
+ trIndex: number | null;
290
+ tdIndex: number | null;
291
+ tableElement: IElement | null;
292
+ selectionText: string | null;
293
+ selectionElementList: IElement[];
294
+ titleId: string | null;
295
+ titleStartPageNo: number | null;
296
+ };
297
+ interface IRangeParagraphInfo {
298
+ elementList: IElement[];
299
+ startIndex: number;
300
+ }
301
+ type IRangeElementStyle = Pick<IElementStyle, 'bold' | 'color' | 'highlight' | 'font' | 'size' | 'italic' | 'underline' | 'strikeout'>;
302
+
303
+ interface IAreaBasic {
304
+ extension?: unknown;
305
+ placeholder?: IPlaceholder;
306
+ }
307
+ interface IAreaStyle {
308
+ top?: number;
309
+ borderColor?: string;
310
+ backgroundColor?: string;
311
+ }
312
+ interface IAreaRule {
313
+ mode?: AreaMode;
314
+ hide?: boolean;
315
+ deletable?: boolean;
316
+ }
317
+ type IArea = IAreaBasic & IAreaStyle & IAreaRule;
318
+ interface IInsertAreaOption {
319
+ id?: string;
320
+ area: IArea;
321
+ value: IElement[];
322
+ position?: LocationPosition;
323
+ range?: Pick<IRange, 'startIndex' | 'endIndex'>;
324
+ }
325
+ interface ISetAreaValueOption {
326
+ id?: string;
327
+ value: IElement[];
328
+ }
329
+ interface ISetAreaPropertiesOption {
330
+ id?: string;
331
+ properties: IArea;
332
+ }
333
+ interface IGetAreaValueOption {
334
+ id?: string;
335
+ }
336
+ interface IGetAreaValueResult {
337
+ id?: string;
338
+ area: IArea;
339
+ startPageNo: number;
340
+ endPageNo: number;
341
+ value: IElement[];
342
+ }
343
+ interface IAreaInfo {
344
+ id: string;
345
+ area: IArea;
346
+ elementList: IElement[];
347
+ positionList: IElementPosition[];
348
+ }
349
+ interface ILocationAreaOption {
350
+ position: LocationPosition;
351
+ isAppendLastLineBreak?: boolean;
352
+ }
353
+
354
+ declare enum BlockType {
355
+ IFRAME = "iframe",
356
+ VIDEO = "video"
357
+ }
358
+
359
+ interface IIFrameBlock {
360
+ src?: string;
361
+ srcdoc?: string;
362
+ sandbox?: string[];
363
+ allow?: string[];
364
+ }
365
+ interface IVideoBlock {
366
+ src: string;
367
+ }
368
+ interface IBlock {
369
+ type: BlockType;
370
+ iframeBlock?: IIFrameBlock;
371
+ videoBlock?: IVideoBlock;
372
+ }
373
+
374
+ type Primitive = string | number | boolean | bigint | symbol | undefined | null;
375
+ type Builtin = Primitive | Function | Date | Error | RegExp;
376
+ type DeepRequired<T> = T extends Error ? Required<T> : T extends Builtin ? T : T extends Map<infer K, infer V> ? Map<DeepRequired<K>, DeepRequired<V>> : T extends ReadonlyMap<infer K, infer V> ? ReadonlyMap<DeepRequired<K>, DeepRequired<V>> : T extends WeakMap<infer K, infer V> ? WeakMap<DeepRequired<K>, DeepRequired<V>> : T extends Set<infer U> ? Set<DeepRequired<U>> : T extends ReadonlySet<infer U> ? ReadonlySet<DeepRequired<U>> : T extends WeakSet<infer U> ? WeakSet<DeepRequired<U>> : T extends Promise<infer U> ? Promise<DeepRequired<U>> : T extends {} ? {
377
+ [K in keyof T]-?: DeepRequired<T[K]>;
378
+ } : Required<T>;
379
+ type DeepPartial<T> = {
380
+ [P in keyof T]?: DeepPartial<T[P]>;
381
+ };
382
+ type IPadding = [
383
+ top: number,
384
+ right: number,
385
+ bottom: number,
386
+ left: number
387
+ ];
388
+
389
+ declare enum TextDecorationStyle {
390
+ SOLID = "solid",
391
+ DOUBLE = "double",
392
+ DASHED = "dashed",
393
+ DOTTED = "dotted",
394
+ WAVY = "wavy"
395
+ }
396
+
397
+ interface ITextMetrics {
398
+ width: number;
399
+ actualBoundingBoxAscent: number;
400
+ actualBoundingBoxDescent: number;
401
+ actualBoundingBoxLeft: number;
402
+ actualBoundingBoxRight: number;
403
+ fontBoundingBoxAscent: number;
404
+ fontBoundingBoxDescent: number;
405
+ }
406
+ interface ITextDecoration {
407
+ style?: TextDecorationStyle;
408
+ }
409
+
410
+ interface ITitleSizeOption {
411
+ defaultFirstSize?: number;
412
+ defaultSecondSize?: number;
413
+ defaultThirdSize?: number;
414
+ defaultFourthSize?: number;
415
+ defaultFifthSize?: number;
416
+ defaultSixthSize?: number;
417
+ }
418
+ type ITitleOption = ITitleSizeOption & {};
419
+ interface ITitleRule {
420
+ deletable?: boolean;
421
+ disabled?: boolean;
422
+ }
423
+ type ITitle = ITitleRule & {
424
+ conceptId?: string;
425
+ };
426
+ interface IGetTitleValueOption {
427
+ conceptId: string;
428
+ }
429
+ type IGetTitleValueResult = (ITitle & {
430
+ value: string | null;
431
+ elementList: IElement[];
432
+ zone: EditorZone;
433
+ })[];
434
+
435
+ interface IColgroup {
436
+ id?: string;
437
+ width: number;
438
+ }
439
+
440
+ type IRowElement = IElement & {
441
+ metrics: IElementMetrics;
442
+ style: string;
443
+ left?: number;
444
+ };
445
+ interface IRow {
446
+ width: number;
447
+ height: number;
448
+ ascent: number;
449
+ rowFlex?: RowFlex;
450
+ startIndex: number;
451
+ isPageBreak?: boolean;
452
+ isColumnBreak?: boolean;
453
+ isList?: boolean;
454
+ listIndex?: number;
455
+ offsetX?: number;
456
+ offsetY?: number;
457
+ elementList: IRowElement[];
458
+ isWidthNotEnough?: boolean;
459
+ rowIndex: number;
460
+ isSurround?: boolean;
461
+ columnNo?: number;
462
+ }
463
+
464
+ interface ITd {
465
+ conceptId?: string;
466
+ id?: string;
467
+ extension?: unknown;
468
+ externalId?: string;
469
+ x?: number;
470
+ y?: number;
471
+ width?: number;
472
+ height?: number;
473
+ colspan: number;
474
+ rowspan: number;
475
+ value: IElement[];
476
+ trIndex?: number;
477
+ tdIndex?: number;
478
+ isLastRowTd?: boolean;
479
+ isLastColTd?: boolean;
480
+ isLastTd?: boolean;
481
+ rowIndex?: number;
482
+ colIndex?: number;
483
+ rowList?: IRow[];
484
+ positionList?: IElementPosition[];
485
+ verticalAlign?: VerticalAlign;
486
+ backgroundColor?: string;
487
+ borderTypes?: TdBorder[];
488
+ slashTypes?: TdSlash[];
489
+ mainHeight?: number;
490
+ realHeight?: number;
491
+ realMinHeight?: number;
492
+ disabled?: boolean;
493
+ deletable?: boolean;
494
+ }
495
+
496
+ interface ITr {
497
+ id?: string;
498
+ extension?: unknown;
499
+ externalId?: string;
500
+ height: number;
501
+ tdList: ITd[];
502
+ minHeight?: number;
503
+ pagingRepeat?: boolean;
504
+ }
505
+
506
+ interface IElementBasic {
507
+ id?: string;
508
+ type?: ElementType;
509
+ value: string;
510
+ extension?: unknown;
511
+ externalId?: string;
512
+ }
513
+ interface IElementStyle {
514
+ font?: string;
515
+ size?: number;
516
+ width?: number;
517
+ height?: number;
518
+ bold?: boolean;
519
+ color?: string;
520
+ highlight?: string;
521
+ italic?: boolean;
522
+ underline?: boolean;
523
+ strikeout?: boolean;
524
+ rowFlex?: RowFlex;
525
+ rowMargin?: number;
526
+ letterSpacing?: number;
527
+ textDecoration?: ITextDecoration;
528
+ }
529
+ interface IElementRule {
530
+ hide?: boolean;
531
+ }
532
+ interface IElementGroup {
533
+ groupIds?: string[];
534
+ }
535
+ interface ITitleElement {
536
+ valueList?: IElement[];
537
+ level?: TitleLevel;
538
+ titleId?: string;
539
+ title?: ITitle;
540
+ }
541
+ interface IListElement {
542
+ valueList?: IElement[];
543
+ listType?: ListType;
544
+ listStyle?: ListStyle;
545
+ listId?: string;
546
+ listWrap?: boolean;
547
+ listLevel?: number;
548
+ listPreset?: string;
549
+ }
550
+ interface ITableAttr {
551
+ colgroup?: IColgroup[];
552
+ trList?: ITr[];
553
+ borderType?: TableBorder;
554
+ borderColor?: string;
555
+ borderWidth?: number;
556
+ borderExternalWidth?: number;
557
+ translateX?: number;
558
+ }
559
+ interface ITableRule {
560
+ tableToolDisabled?: boolean;
561
+ }
562
+ interface ITableElement {
563
+ tdId?: string;
564
+ trId?: string;
565
+ tableId?: string;
566
+ conceptId?: string;
567
+ pagingId?: string;
568
+ pagingIndex?: number;
569
+ }
570
+ type ITable = ITableAttr & ITableRule & ITableElement;
571
+ interface IHyperlinkElement {
572
+ valueList?: IElement[];
573
+ url?: string;
574
+ hyperlinkId?: string;
575
+ }
576
+ interface ISuperscriptSubscript {
577
+ actualSize?: number;
578
+ }
579
+ interface ISeparator {
580
+ dashArray?: number[];
581
+ lineWidth?: number;
582
+ }
583
+ interface IControlElement {
584
+ control?: IControl;
585
+ controlId?: string;
586
+ controlComponent?: ControlComponent;
587
+ }
588
+ interface ICheckboxElement {
589
+ checkbox?: ICheckbox;
590
+ }
591
+ interface IRadioElement {
592
+ radio?: IRadio;
593
+ }
594
+ interface ILaTexElement {
595
+ laTexSVG?: string;
596
+ }
597
+ interface IDateElement {
598
+ dateFormat?: string;
599
+ dateId?: string;
600
+ }
601
+ interface IImageRule {
602
+ imgToolDisabled?: boolean;
603
+ imgPreviewDisabled?: boolean;
604
+ }
605
+ interface IImageCrop {
606
+ x: number;
607
+ y: number;
608
+ width: number;
609
+ height: number;
610
+ }
611
+ interface IImageBasic {
612
+ imgDisplay?: ImageDisplay;
613
+ imgFloatPosition?: {
614
+ x: number;
615
+ y: number;
616
+ pageNo?: number;
617
+ };
618
+ imgCrop?: IImageCrop;
619
+ }
620
+ type IImageElement = IImageBasic & IImageRule;
621
+ interface IBlockElement {
622
+ block?: IBlock;
623
+ }
624
+ interface IAreaElement {
625
+ valueList?: IElement[];
626
+ areaId?: string;
627
+ areaIndex?: number;
628
+ area?: IArea;
629
+ }
630
+ interface ILabelElement {
631
+ labelId?: string;
632
+ label?: {
633
+ color?: string;
634
+ backgroundColor?: string;
635
+ borderColor?: string;
636
+ borderRadius?: number;
637
+ padding?: IPadding;
638
+ };
639
+ }
640
+ type IElement = IElementBasic & IElementStyle & IElementRule & IElementGroup & ITable & IHyperlinkElement & ISuperscriptSubscript & ISeparator & IControlElement & ICheckboxElement & IRadioElement & ILaTexElement & IDateElement & IImageElement & IBlockElement & ITitleElement & IListElement & IAreaElement & ILabelElement;
641
+ interface IElementMetrics {
642
+ width: number;
643
+ height: number;
644
+ boundingBoxAscent: number;
645
+ boundingBoxDescent: number;
646
+ }
647
+ interface IElementPosition {
648
+ pageNo: number;
649
+ index: number;
650
+ value: string;
651
+ rowIndex: number;
652
+ rowNo: number;
653
+ columnNo: number;
654
+ ascent: number;
655
+ lineHeight: number;
656
+ left: number;
657
+ metrics: IElementMetrics;
658
+ isFirstLetter: boolean;
659
+ isLastLetter: boolean;
660
+ coordinate: {
661
+ leftTop: number[];
662
+ leftBottom: number[];
663
+ rightTop: number[];
664
+ rightBottom: number[];
665
+ };
666
+ }
667
+ interface IElementFillRect {
668
+ x: number;
669
+ y: number;
670
+ width: number;
671
+ height: number;
672
+ }
673
+ interface IUpdateElementByIdOption {
674
+ id?: string;
675
+ conceptId?: string;
676
+ properties: Omit<Partial<IElement>, 'id'>;
677
+ }
678
+ interface IDeleteElementByIdOption {
679
+ id?: string;
680
+ conceptId?: string;
681
+ }
682
+ interface IGetElementByIdOption {
683
+ id?: string;
684
+ conceptId?: string;
685
+ }
686
+ interface IInsertElementListOption {
687
+ isReplace?: boolean;
688
+ isSubmitHistory?: boolean;
689
+ ignoreContextKeys?: Array<keyof IElement>;
690
+ }
691
+ interface ISpliceElementListOption {
692
+ isIgnoreDeletedRule?: boolean;
693
+ }
694
+
695
+ interface IDrawOption {
696
+ curIndex?: number;
697
+ isSetCursor?: boolean;
698
+ isSubmitHistory?: boolean;
699
+ isCompute?: boolean;
700
+ isLazy?: boolean;
701
+ isInit?: boolean;
702
+ isSourceHistory?: boolean;
703
+ isFirstRender?: boolean;
704
+ }
705
+ interface IForceUpdateOption {
706
+ isSubmitHistory?: boolean;
707
+ }
708
+ interface IDrawImagePayload {
709
+ id?: string;
710
+ conceptId?: string;
711
+ width: number;
712
+ height: number;
713
+ value: string;
714
+ imgDisplay?: ImageDisplay;
715
+ extension?: unknown;
716
+ }
717
+ interface IDrawRowPayload {
718
+ elementList: IElement[];
719
+ positionList: IElementPosition[];
720
+ rowList: IRow[];
721
+ pageNo: number;
722
+ startIndex: number;
723
+ innerWidth: number;
724
+ zone?: EditorZone;
725
+ isDrawLineBreak?: boolean;
726
+ isDrawWhiteSpace?: boolean;
727
+ }
728
+ interface IPainterOption {
729
+ isDblclick: boolean;
730
+ }
731
+ interface IGetValueOption {
732
+ pageNo?: number;
733
+ extraPickAttrs?: Array<keyof IElement>;
734
+ }
735
+ type IGetOriginValueOption = Omit<IGetValueOption, 'extraPickAttrs'>;
736
+ interface IAppendElementListOption {
737
+ isPrepend?: boolean;
738
+ isSubmitHistory?: boolean;
739
+ }
740
+ interface IGetImageOption {
741
+ pixelRatio?: number;
742
+ mode?: EditorMode;
743
+ }
744
+ interface IComputeRowListPayload {
745
+ innerWidth: number;
746
+ elementList: IElement[];
747
+ startX?: number;
748
+ startY?: number;
749
+ isFromTable?: boolean;
750
+ isPagingMode?: boolean;
751
+ pageHeight?: number;
752
+ mainOuterHeight?: number;
753
+ surroundElementList?: IElement[];
754
+ }
755
+
756
+ interface ICurrentPosition {
757
+ index: number;
758
+ x?: number;
759
+ y?: number;
760
+ isCheckbox?: boolean;
761
+ isRadio?: boolean;
762
+ isControl?: boolean;
763
+ isImage?: boolean;
764
+ isLabel?: boolean;
765
+ isTable?: boolean;
766
+ isDirectHit?: boolean;
767
+ trIndex?: number;
768
+ tdIndex?: number;
769
+ tdValueIndex?: number;
770
+ tdId?: string;
771
+ trId?: string;
772
+ tableId?: string;
773
+ zone?: EditorZone;
774
+ hitLineStartIndex?: number;
775
+ }
776
+ interface IGetPositionByXYPayload {
777
+ x: number;
778
+ y: number;
779
+ pageNo?: number;
780
+ isTable?: boolean;
781
+ td?: ITd;
782
+ tablePosition?: IElementPosition;
783
+ elementList?: IElement[];
784
+ positionList?: IElementPosition[];
785
+ }
786
+ type IGetFloatPositionByXYPayload = IGetPositionByXYPayload & {
787
+ imgDisplays: ImageDisplay[];
788
+ };
789
+ interface IPositionContext {
790
+ isTable: boolean;
791
+ isCheckbox?: boolean;
792
+ isRadio?: boolean;
793
+ isControl?: boolean;
794
+ isImage?: boolean;
795
+ isLabel?: boolean;
796
+ isDirectHit?: boolean;
797
+ index?: number;
798
+ trIndex?: number;
799
+ tdIndex?: number;
800
+ tdId?: string;
801
+ trId?: string;
802
+ tableId?: string;
803
+ }
804
+ interface IComputeRowPositionPayload {
805
+ row: IRow;
806
+ innerWidth: number;
807
+ }
808
+ interface IComputePageRowPositionPayload {
809
+ positionList: IElementPosition[];
810
+ rowList: IRow[];
811
+ pageNo: number;
812
+ startRowIndex: number;
813
+ startIndex: number;
814
+ startX: number;
815
+ startY: number;
816
+ innerWidth: number;
817
+ rowNoOffset?: number;
818
+ columnNo?: number;
819
+ isTable?: boolean;
820
+ index?: number;
821
+ tdIndex?: number;
822
+ trIndex?: number;
823
+ tdValueIndex?: number;
824
+ zone?: EditorZone;
825
+ }
826
+ interface IComputePageRowPositionResult {
827
+ x: number;
828
+ y: number;
829
+ index: number;
830
+ }
831
+ interface IFloatPosition {
832
+ pageNo: number;
833
+ element: IElement;
834
+ position: IElementPosition;
835
+ isTable?: boolean;
836
+ index?: number;
837
+ tdIndex?: number;
838
+ trIndex?: number;
839
+ tdValueIndex?: number;
840
+ zone?: EditorZone;
841
+ }
842
+ interface ISetSurroundPositionPayload {
843
+ row: IRow;
844
+ rowElement: IRowElement;
845
+ rowElementRect: IElementFillRect;
846
+ pageNo: number;
847
+ availableWidth: number;
848
+ surroundElementList: IElement[];
849
+ }
850
+
851
+ interface IValueSet {
852
+ value: string;
853
+ code: string;
854
+ }
855
+ interface IControlSelect {
856
+ code: string | null;
857
+ valueSets: IValueSet[];
858
+ isMultiSelect?: boolean;
859
+ multiSelectDelimiter?: string;
860
+ selectExclusiveOptions?: {
861
+ inputAble?: boolean;
862
+ };
863
+ }
864
+ interface IControlCheckbox {
865
+ code: string | null;
866
+ min?: number;
867
+ max?: number;
868
+ flexDirection: FlexDirection;
869
+ valueSets: IValueSet[];
870
+ }
871
+ interface IControlRadio {
872
+ code: string | null;
873
+ flexDirection: FlexDirection;
874
+ valueSets: IValueSet[];
875
+ }
876
+ interface IControlDate {
877
+ dateFormat?: string;
878
+ }
879
+ interface IControlNumber {
880
+ numberExclusiveOptions?: {
881
+ calculatorDisabled?: boolean;
882
+ };
883
+ }
884
+ interface IControlHighlightRule {
885
+ keyword: string;
886
+ alpha?: number;
887
+ backgroundColor?: string;
888
+ }
889
+ interface IControlHighlight {
890
+ ruleList: IControlHighlightRule[];
891
+ id?: string;
892
+ conceptId?: string;
893
+ }
894
+ interface IControlRule {
895
+ deletable?: boolean;
896
+ disabled?: boolean;
897
+ pasteDisabled?: boolean;
898
+ hide?: boolean;
899
+ }
900
+ interface IControlBasic {
901
+ type: ControlType;
902
+ value: IElement[] | null;
903
+ placeholder?: string;
904
+ conceptId?: string;
905
+ groupId?: string;
906
+ prefix?: string;
907
+ postfix?: string;
908
+ minWidth?: number;
909
+ underline?: boolean;
910
+ border?: boolean;
911
+ extension?: unknown;
912
+ indentation?: ControlIndentation;
913
+ rowFlex?: RowFlex;
914
+ preText?: string;
915
+ postText?: string;
916
+ }
917
+ interface IControlStyle {
918
+ font?: string;
919
+ size?: number;
920
+ bold?: boolean;
921
+ highlight?: string;
922
+ italic?: boolean;
923
+ strikeout?: boolean;
924
+ }
925
+ type IControl = IControlBasic & IControlRule & Partial<IControlStyle> & Partial<IControlSelect> & Partial<IControlCheckbox> & Partial<IControlRadio> & Partial<IControlDate> & Partial<IControlNumber>;
926
+ interface IControlOption {
927
+ placeholderColor?: string;
928
+ bracketColor?: string;
929
+ prefix?: string;
930
+ postfix?: string;
931
+ borderWidth?: number;
932
+ borderColor?: string;
933
+ activeBackgroundColor?: string;
934
+ disabledBackgroundColor?: string;
935
+ existValueBackgroundColor?: string;
936
+ noValueBackgroundColor?: string;
937
+ }
938
+ interface IControlInitOption {
939
+ index: number;
940
+ isTable?: boolean;
941
+ trIndex?: number;
942
+ tdIndex?: number;
943
+ tdValueIndex?: number;
944
+ }
945
+ interface IControlInstance {
946
+ setElement(element: IElement): void;
947
+ getElement(): IElement;
948
+ getValue(context?: IControlContext): IElement[];
949
+ setValue(data: IElement[], context?: IControlContext, options?: IControlRuleOption): number;
950
+ keydown(evt: KeyboardEvent): number | null;
951
+ cut(): number;
952
+ }
953
+ interface IControlContext {
954
+ range?: IRange;
955
+ elementList?: IElement[];
956
+ }
957
+ interface IControlRuleOption {
958
+ isIgnoreDisabledRule?: boolean;
959
+ isIgnoreDeletedRule?: boolean;
960
+ isAddPlaceholder?: boolean;
961
+ }
962
+ interface IGetControlValueOption {
963
+ id?: string;
964
+ groupId?: string;
965
+ conceptId?: string;
966
+ areaId?: string;
967
+ }
968
+ type IGetControlValueResult = (Omit<IControl, 'value'> & {
969
+ value: string | null;
970
+ innerText: string | null;
971
+ zone: EditorZone;
972
+ elementList?: IElement[];
973
+ })[];
974
+ interface ISetControlValueOption {
975
+ id?: string;
976
+ groupId?: string;
977
+ conceptId?: string;
978
+ areaId?: string;
979
+ value: string | IElement[] | null;
980
+ isSubmitHistory?: boolean;
981
+ }
982
+ interface ISetControlExtensionOption {
983
+ id?: string;
984
+ groupId?: string;
985
+ conceptId?: string;
986
+ areaId?: string;
987
+ extension: unknown;
988
+ }
989
+ type ISetControlHighlightOption = IControlHighlight[];
990
+ type ISetControlProperties = {
991
+ id?: string;
992
+ groupId?: string;
993
+ conceptId?: string;
994
+ areaId?: string;
995
+ properties: Partial<Omit<IControl, 'value'>>;
996
+ isSubmitHistory?: boolean;
997
+ };
998
+ type IRepaintControlOption = Pick<IDrawOption, 'curIndex' | 'isCompute' | 'isSubmitHistory' | 'isSetCursor'>;
999
+ interface IControlChangeOption {
1000
+ context?: IControlContext;
1001
+ controlElement?: IElement;
1002
+ controlValue?: IElement[];
1003
+ }
1004
+ interface INextControlContext {
1005
+ positionContext: IPositionContext;
1006
+ nextIndex: number;
1007
+ }
1008
+ interface IInitNextControlOption {
1009
+ direction?: MoveDirection;
1010
+ }
1011
+ interface ILocationControlOption {
1012
+ position: LocationPosition;
1013
+ }
1014
+ interface ISetControlRowFlexOption {
1015
+ row: IRow;
1016
+ rowElement: IRowElement;
1017
+ availableWidth: number;
1018
+ controlRealWidth: number;
1019
+ }
1020
+ interface IControlChangeResult {
1021
+ state: ControlState;
1022
+ control: IControl;
1023
+ controlId: string;
1024
+ }
1025
+ interface IControlContentChangeResult {
1026
+ control: IControl;
1027
+ controlId: string;
1028
+ }
1029
+ interface IDestroyControlOption {
1030
+ isEmitEvent?: boolean;
1031
+ }
1032
+ interface IRemoveControlOption {
1033
+ id?: string;
1034
+ conceptId?: string;
1035
+ }
1036
+
1037
+ interface ICursorOption {
1038
+ width?: number;
1039
+ color?: string;
1040
+ dragWidth?: number;
1041
+ dragColor?: string;
1042
+ dragFloatImageDisabled?: boolean;
1043
+ }
1044
+
1045
+ interface IFooter {
1046
+ bottom?: number;
1047
+ inactiveAlpha?: number;
1048
+ maxHeightRadio?: MaxHeightRatio;
1049
+ disabled?: boolean;
1050
+ editable?: boolean;
1051
+ backgroundColor?: string;
1052
+ }
1053
+
1054
+ interface IGroup {
1055
+ opacity?: number;
1056
+ backgroundColor?: string;
1057
+ activeOpacity?: number;
1058
+ activeBackgroundColor?: string;
1059
+ disabled?: boolean;
1060
+ deletable?: boolean;
1061
+ }
1062
+
1063
+ interface IHeader {
1064
+ top?: number;
1065
+ inactiveAlpha?: number;
1066
+ maxHeightRadio?: MaxHeightRatio;
1067
+ disabled?: boolean;
1068
+ editable?: boolean;
1069
+ }
1070
+
1071
+ interface ILabelOption {
1072
+ defaultColor?: string;
1073
+ defaultBackgroundColor?: string;
1074
+ defaultBorderRadius?: number;
1075
+ defaultPadding?: IPadding;
1076
+ }
1077
+
1078
+ interface ILineBreakOption {
1079
+ disabled?: boolean;
1080
+ color?: string;
1081
+ lineWidth?: number;
1082
+ }
1083
+
1084
+ type IMargin = [top: number, right: number, bottom: number, left: number];
1085
+
1086
+ interface IPageBreak {
1087
+ font?: string;
1088
+ fontSize?: number;
1089
+ lineDash?: number[];
1090
+ }
1091
+
1092
+ interface IPageNumber {
1093
+ bottom?: number;
1094
+ size?: number;
1095
+ font?: string;
1096
+ color?: string;
1097
+ rowFlex?: RowFlex;
1098
+ format?: string;
1099
+ numberType?: NumberType;
1100
+ disabled?: boolean;
1101
+ startPageNo?: number;
1102
+ fromPageNo?: number;
1103
+ maxPageNo?: number | null;
1104
+ }
1105
+
1106
+ declare enum WatermarkType {
1107
+ TEXT = "text",
1108
+ IMAGE = "image"
1109
+ }
1110
+
1111
+ interface IWatermark {
1112
+ data: string;
1113
+ type?: WatermarkType;
1114
+ width?: number;
1115
+ height?: number;
1116
+ color?: string;
1117
+ opacity?: number;
1118
+ size?: number;
1119
+ font?: string;
1120
+ repeat?: boolean;
1121
+ numberType?: NumberType;
1122
+ gap?: [horizontal: number, vertical: number];
1123
+ rotation?: number;
1124
+ inFront?: boolean;
1125
+ }
1126
+
1127
+ interface IZoneOption {
1128
+ tipDisabled?: boolean;
1129
+ }
1130
+
1131
+ interface ISeparatorOption {
1132
+ strokeStyle?: string;
1133
+ lineWidth?: number;
1134
+ }
1135
+
1136
+ interface ITableOption {
1137
+ tdPadding?: IPadding;
1138
+ defaultTrMinHeight?: number;
1139
+ defaultColMinWidth?: number;
1140
+ defaultBorderColor?: string;
1141
+ overflow?: boolean;
1142
+ }
1143
+
1144
+ declare enum LineNumberType {
1145
+ PAGE = "page",
1146
+ CONTINUITY = "continuity"
1147
+ }
1148
+
1149
+ interface ILineNumberOption {
1150
+ size?: number;
1151
+ font?: string;
1152
+ color?: string;
1153
+ disabled?: boolean;
1154
+ right?: number;
1155
+ type?: LineNumberType;
1156
+ }
1157
+
1158
+ interface IPageBorderOption {
1159
+ color?: string;
1160
+ lineWidth?: number;
1161
+ padding?: IPadding;
1162
+ disabled?: boolean;
1163
+ }
1164
+
1165
+ interface IBadge {
1166
+ top?: number;
1167
+ left?: number;
1168
+ width: number;
1169
+ height: number;
1170
+ value: string;
1171
+ }
1172
+ interface IBadgeOption {
1173
+ top?: number;
1174
+ left?: number;
1175
+ }
1176
+ interface IAreaBadge {
1177
+ areaId: string;
1178
+ badge: IBadge;
1179
+ }
1180
+
1181
+ interface IGraffitiStroke {
1182
+ lineWidth?: number;
1183
+ lineColor?: string;
1184
+ points: number[];
1185
+ }
1186
+ interface IGraffitiData {
1187
+ pageNo: number;
1188
+ strokes: IGraffitiStroke[];
1189
+ }
1190
+ interface IGraffitiOption {
1191
+ defaultLineWidth?: number;
1192
+ defaultLineColor?: string;
1193
+ }
1194
+
1195
+ interface IWhiteSpaceOption {
1196
+ disabled?: boolean;
1197
+ color?: string;
1198
+ radius?: number;
1199
+ }
1200
+
1201
+ interface IColumnOption {
1202
+ count?: number;
1203
+ gap?: number;
1204
+ }
1205
+ interface IEditorData {
1206
+ header?: IElement[];
1207
+ main: IElement[];
1208
+ footer?: IElement[];
1209
+ graffiti?: IGraffitiData[];
1210
+ }
1211
+ interface IEditorOption {
1212
+ mode?: EditorMode;
1213
+ locale?: string;
1214
+ defaultType?: string;
1215
+ defaultColor?: string;
1216
+ defaultFont?: string;
1217
+ defaultSize?: number;
1218
+ minSize?: number;
1219
+ maxSize?: number;
1220
+ defaultBasicRowMarginHeight?: number;
1221
+ defaultRowMargin?: number;
1222
+ defaultTabWidth?: number;
1223
+ width?: number;
1224
+ height?: number;
1225
+ scale?: number;
1226
+ pageGap?: number;
1227
+ underlineColor?: string;
1228
+ strikeoutColor?: string;
1229
+ rangeColor?: string;
1230
+ rangeAlpha?: number;
1231
+ rangeMinWidth?: number;
1232
+ searchMatchColor?: string;
1233
+ searchNavigateMatchColor?: string;
1234
+ searchMatchAlpha?: number;
1235
+ highlightAlpha?: number;
1236
+ highlightMarginHeight?: number;
1237
+ resizerColor?: string;
1238
+ resizerSize?: number;
1239
+ marginIndicatorSize?: number;
1240
+ marginIndicatorColor?: string;
1241
+ margins?: IMargin;
1242
+ pageMode?: PageMode;
1243
+ renderMode?: RenderMode;
1244
+ defaultHyperlinkColor?: string;
1245
+ paperDirection?: PaperDirection;
1246
+ inactiveAlpha?: number;
1247
+ historyMaxRecordCount?: number;
1248
+ printPixelRatio?: number;
1249
+ maskMargin?: IMargin;
1250
+ letterClass?: string[];
1251
+ contextMenuDisableKeys?: string[];
1252
+ shortcutDisableKeys?: string[];
1253
+ scrollContainerSelector?: string;
1254
+ pageOuterSelectionDisable?: boolean;
1255
+ wordBreak?: WordBreak;
1256
+ table?: ITableOption;
1257
+ header?: IHeader;
1258
+ footer?: IFooter;
1259
+ pageNumber?: IPageNumber;
1260
+ watermark?: IWatermark;
1261
+ control?: IControlOption;
1262
+ checkbox?: ICheckboxOption;
1263
+ radio?: IRadioOption;
1264
+ cursor?: ICursorOption;
1265
+ title?: ITitleOption;
1266
+ placeholder?: IPlaceholder;
1267
+ group?: IGroup;
1268
+ pageBreak?: IPageBreak;
1269
+ zone?: IZoneOption;
1270
+ background?: IBackgroundOption;
1271
+ lineBreak?: ILineBreakOption;
1272
+ whiteSpace?: IWhiteSpaceOption;
1273
+ separator?: ISeparatorOption;
1274
+ lineNumber?: ILineNumberOption;
1275
+ pageBorder?: IPageBorderOption;
1276
+ badge?: IBadgeOption;
1277
+ modeRule?: IModeRule;
1278
+ graffiti?: IGraffitiOption;
1279
+ label?: ILabelOption;
1280
+ column?: IColumnOption;
1281
+ }
1282
+ interface IEditorResult {
1283
+ version: string;
1284
+ data: IEditorData;
1285
+ options: IEditorOption;
1286
+ }
1287
+ interface IEditorHTML {
1288
+ header: string;
1289
+ main: string;
1290
+ footer: string;
1291
+ }
1292
+ type IEditorText = IEditorHTML;
1293
+ type IUpdateOption = Omit<IEditorOption, 'mode' | 'width' | 'height' | 'scale' | 'pageGap' | 'pageMode' | 'paperDirection' | 'historyMaxRecordCount' | 'scrollContainerSelector'>;
1294
+ interface ISetValueOption {
1295
+ isSetCursor?: boolean;
1296
+ }
1297
+ interface IFocusOption {
1298
+ rowNo?: number;
1299
+ range?: IRange;
1300
+ position?: LocationPosition;
1301
+ isMoveCursorToVisible?: boolean;
1302
+ }
1303
+ interface IPrintModeRule {
1304
+ imagePreviewerDisabled?: boolean;
1305
+ backgroundDisabled?: boolean;
1306
+ }
1307
+ interface IReadonlyModeRule {
1308
+ imagePreviewerDisabled?: boolean;
1309
+ }
1310
+ interface IFormModeRule {
1311
+ controlDeletableDisabled?: boolean;
1312
+ }
1313
+ interface IModeRule {
1314
+ [EditorMode.PRINT]?: IPrintModeRule;
1315
+ [EditorMode.READONLY]?: IReadonlyModeRule;
1316
+ [EditorMode.FORM]?: IFormModeRule;
1317
+ }
1318
+
1319
+ interface ICatalogItem {
1320
+ id: string;
1321
+ name: string;
1322
+ level: TitleLevel;
1323
+ pageNo: number;
1324
+ subCatalog: ICatalogItem[];
1325
+ }
1326
+ type ICatalog = ICatalogItem[];
1327
+
1328
+ interface IPasteOption {
1329
+ isPlainText: boolean;
1330
+ }
1331
+ interface ITableInfoByEvent {
1332
+ element: IElement;
1333
+ trIndex: number;
1334
+ tdIndex: number;
1335
+ }
1336
+ interface IPositionContextByEventResult {
1337
+ pageNo: number;
1338
+ element: IElement | null;
1339
+ rangeRect: RangeRect | null;
1340
+ tableInfo: ITableInfoByEvent | null;
1341
+ }
1342
+ interface IPositionContextByEventOption {
1343
+ isMustDirectHit?: boolean;
1344
+ }
1345
+ interface ICopyOption {
1346
+ isPlainText: boolean;
1347
+ }
1348
+
1349
+ interface ISearchResultBasic {
1350
+ type: EditorContext;
1351
+ index: number;
1352
+ groupId: string;
1353
+ }
1354
+ interface ISearchResultRestArgs {
1355
+ tableId?: string;
1356
+ tableIndex?: number;
1357
+ trIndex?: number;
1358
+ tdIndex?: number;
1359
+ tdId?: string;
1360
+ startIndex?: number;
1361
+ }
1362
+ type ISearchResult = ISearchResultBasic & ISearchResultRestArgs;
1363
+ interface ISearchResultContext {
1364
+ range: IRange;
1365
+ startPosition: IElementPosition;
1366
+ endPosition: IElementPosition;
1367
+ }
1368
+ interface IReplaceOption {
1369
+ index?: number;
1370
+ }
1371
+ interface ISearchOption {
1372
+ isRegEnable?: boolean;
1373
+ isIgnoreCase?: boolean;
1374
+ isLimitSelection?: boolean;
1375
+ }
1376
+
1377
+ interface ICompositionInfo {
1378
+ elementList: IElement[];
1379
+ startIndex: number;
1380
+ endIndex: number;
1381
+ value: string;
1382
+ defaultStyle: IRangeElementStyle | null;
1383
+ }
1384
+ declare class CanvasEvent {
1385
+ isAllowSelection: boolean;
1386
+ isComposing: boolean;
1387
+ compositionInfo: ICompositionInfo | null;
1388
+ isAllowDrag: boolean;
1389
+ isAllowDrop: boolean;
1390
+ cacheRange: IRange | null;
1391
+ cacheElementList: IElement[] | null;
1392
+ cachePositionList: IElementPosition[] | null;
1393
+ cachePositionContext: IPositionContext | null;
1394
+ mouseDownStartPosition: ICurrentPosition | null;
1395
+ private draw;
1396
+ private pageContainer;
1397
+ private pageList;
1398
+ private range;
1399
+ private position;
1400
+ constructor(draw: Draw);
1401
+ getDraw(): Draw;
1402
+ register(): void;
1403
+ setIsAllowSelection(payload: boolean): void;
1404
+ setIsAllowDrag(payload: boolean): void;
1405
+ clearPainterStyle(): void;
1406
+ applyPainterStyle(): void;
1407
+ selectAll(): void;
1408
+ mousemove(evt: MouseEvent): void;
1409
+ mousedown(evt: MouseEvent): void;
1410
+ click(): void;
1411
+ mouseup(evt: MouseEvent): void;
1412
+ mouseleave(evt: MouseEvent): void;
1413
+ keydown(evt: KeyboardEvent): void;
1414
+ dblclick(evt: MouseEvent): void;
1415
+ threeClick(): void;
1416
+ input(data: string): void;
1417
+ cut(): Promise<void>;
1418
+ copy(options?: ICopyOption): Promise<void>;
1419
+ compositionstart(): void;
1420
+ compositionend(evt: CompositionEvent): void;
1421
+ drop(evt: DragEvent): void;
1422
+ dragover(evt: DragEvent | MouseEvent): void;
1423
+ }
1424
+
1425
+ type IDrawCursorOption = ICursorOption & {
1426
+ isShow?: boolean;
1427
+ isBlink?: boolean;
1428
+ isFocus?: boolean;
1429
+ hitLineStartIndex?: number;
1430
+ };
1431
+ interface IMoveCursorToVisibleOption {
1432
+ direction: MoveDirection;
1433
+ cursorPosition: IElementPosition;
1434
+ }
1435
+ declare class Cursor {
1436
+ private readonly ANIMATION_CLASS;
1437
+ private draw;
1438
+ private container;
1439
+ private options;
1440
+ private position;
1441
+ private cursorDom;
1442
+ private cursorAgent;
1443
+ private blinkTimeout;
1444
+ private hitLineStartIndex;
1445
+ constructor(draw: Draw, canvasEvent: CanvasEvent);
1446
+ getCursorDom(): HTMLDivElement;
1447
+ getAgentDom(): HTMLTextAreaElement;
1448
+ getAgentIsActive(): boolean;
1449
+ getAgentDomValue(): string;
1450
+ clearAgentDomValue(): void;
1451
+ getHitLineStartIndex(): number | undefined;
1452
+ private _blinkStart;
1453
+ private _blinkStop;
1454
+ private _setBlinkTimeout;
1455
+ private _clearBlinkTimeout;
1456
+ focus(): void;
1457
+ drawCursor(payload?: IDrawCursorOption): void;
1458
+ recoveryCursor(): void;
1459
+ moveCursorToVisible(payload: IMoveCursorToVisibleOption): void;
1460
+ }
1461
+
1462
+ declare class GlobalEvent {
1463
+ private draw;
1464
+ private options;
1465
+ private cursor;
1466
+ private canvasEvent;
1467
+ private range;
1468
+ private previewer;
1469
+ private tableTool;
1470
+ private hyperlinkParticle;
1471
+ private control;
1472
+ private dateParticle;
1473
+ private imageParticle;
1474
+ private dprMediaQueryList;
1475
+ constructor(draw: Draw, canvasEvent: CanvasEvent);
1476
+ register(): void;
1477
+ private addEvent;
1478
+ removeEvent(): void;
1479
+ clearSideEffect: (evt: Event) => void;
1480
+ setCanvasEventAbility: () => void;
1481
+ watchCursorActive(): void;
1482
+ setPageScale: (evt: WheelEvent) => void;
1483
+ private _handleVisibilityChange;
1484
+ private _handleDprChange;
1485
+ }
1486
+
1487
+ declare class HistoryManager {
1488
+ private undoStack;
1489
+ private redoStack;
1490
+ private maxRecordCount;
1491
+ constructor(draw: Draw);
1492
+ undo(): void;
1493
+ redo(): void;
1494
+ execute(fn: Function): void;
1495
+ isCanUndo(): boolean;
1496
+ isCanRedo(): boolean;
1497
+ isStackEmpty(): boolean;
1498
+ recovery(): void;
1499
+ popUndo(): Function | undefined;
1500
+ }
1501
+
1502
+ interface IRangeStyle {
1503
+ type: ElementType | null;
1504
+ undo: boolean;
1505
+ redo: boolean;
1506
+ painter: boolean;
1507
+ font: string;
1508
+ size: number;
1509
+ bold: boolean;
1510
+ italic: boolean;
1511
+ underline: boolean;
1512
+ strikeout: boolean;
1513
+ color: string | null;
1514
+ highlight: string | null;
1515
+ rowFlex: RowFlex | null;
1516
+ rowMargin: number;
1517
+ dashArray: number[];
1518
+ level: TitleLevel | null;
1519
+ listType: ListType | null;
1520
+ listStyle: ListStyle | null;
1521
+ groupIds: string[] | null;
1522
+ textDecoration: ITextDecoration | null;
1523
+ extension?: unknown | null;
1524
+ }
1525
+ type IRangeStyleChange = (payload: IRangeStyle) => void;
1526
+ type IVisiblePageNoListChange = (payload: number[]) => void;
1527
+ type IIntersectionPageNoChange = (payload: number) => void;
1528
+ type IPageSizeChange = (payload: number) => void;
1529
+ type IPageScaleChange = (payload: number) => void;
1530
+ type ISaved = (payload: IEditorResult) => void;
1531
+ type IContentChange = () => void;
1532
+ type IControlChange = (payload: IControlChangeResult) => void;
1533
+ type IControlContentChange = (payload: IControlContentChangeResult) => void;
1534
+ type IPageModeChange = (payload: PageMode) => void;
1535
+ type IZoneChange = (payload: EditorZone) => void;
1536
+ type IMouseEventChange = (evt: MouseEvent) => void;
1537
+ type IInputEventChange = (evt: Event) => void;
1538
+ interface IPositionContextChangePayload {
1539
+ value: IPositionContext;
1540
+ oldValue: IPositionContext;
1541
+ }
1542
+ type IPositionContextChange = (payload: IPositionContextChangePayload) => void;
1543
+ type IImageSizeChange = (payload: {
1544
+ element: IElement;
1545
+ }) => void;
1546
+ type IImageMousedown = (payload: {
1547
+ evt: MouseEvent;
1548
+ element: IElement;
1549
+ }) => void;
1550
+ type IImageDblclick = (payload: {
1551
+ evt: MouseEvent;
1552
+ element: IElement;
1553
+ }) => void;
1554
+ type ILabelMousedown = (payload: {
1555
+ evt: MouseEvent;
1556
+ element: IElement;
1557
+ }) => void;
1558
+
1559
+ declare class Listener {
1560
+ rangeStyleChange: IRangeStyleChange | null;
1561
+ visiblePageNoListChange: IVisiblePageNoListChange | null;
1562
+ intersectionPageNoChange: IIntersectionPageNoChange | null;
1563
+ pageSizeChange: IPageSizeChange | null;
1564
+ pageScaleChange: IPageScaleChange | null;
1565
+ saved: ISaved | null;
1566
+ contentChange: IContentChange | null;
1567
+ controlChange: IControlChange | null;
1568
+ controlContentChange: IControlContentChange | null;
1569
+ pageModeChange: IPageModeChange | null;
1570
+ zoneChange: IZoneChange | null;
1571
+ constructor();
1572
+ }
1573
+
1574
+ declare class Position {
1575
+ private cursorPosition;
1576
+ private positionContext;
1577
+ private positionList;
1578
+ private floatPositionList;
1579
+ private draw;
1580
+ private eventBus;
1581
+ private options;
1582
+ constructor(draw: Draw);
1583
+ getFloatPositionList(): IFloatPosition[];
1584
+ getTablePositionList(sourceElementList: IElement[]): IElementPosition[];
1585
+ getPositionList(): IElementPosition[];
1586
+ getMainPositionList(): IElementPosition[];
1587
+ getOriginalPositionList(): IElementPosition[];
1588
+ getOriginalMainPositionList(): IElementPosition[];
1589
+ getSelectionPositionList(): IElementPosition[] | null;
1590
+ setPositionList(payload: IElementPosition[]): void;
1591
+ setFloatPositionList(payload: IFloatPosition[]): void;
1592
+ computePageRowPosition(payload: IComputePageRowPositionPayload): IComputePageRowPositionResult;
1593
+ computePositionList(): void;
1594
+ computeRowPosition(payload: IComputeRowPositionPayload): IElementPosition[];
1595
+ setCursorPosition(position: IElementPosition | null): void;
1596
+ getCursorPosition(): IElementPosition | null;
1597
+ getPositionContext(): IPositionContext;
1598
+ setPositionContext(payload: IPositionContext): void;
1599
+ getPositionByXY(payload: IGetPositionByXYPayload): ICurrentPosition;
1600
+ getFloatPositionByXY(payload: IGetFloatPositionByXYPayload): ICurrentPosition | void;
1601
+ adjustPositionContext(payload: IGetPositionByXYPayload): ICurrentPosition | null;
1602
+ setSurroundPosition(payload: ISetSurroundPositionPayload): {
1603
+ x: number;
1604
+ rowIncreaseWidth: number;
1605
+ };
1606
+ }
1607
+
1608
+ declare class RangeManager {
1609
+ private draw;
1610
+ private options;
1611
+ private range;
1612
+ private listener;
1613
+ private eventBus;
1614
+ private position;
1615
+ private historyManager;
1616
+ private defaultStyle;
1617
+ constructor(draw: Draw);
1618
+ getRange(): IRange;
1619
+ clearRange(): void;
1620
+ setDefaultStyle(style: IRangeElementStyle | null): void;
1621
+ getDefaultStyle(): IRangeElementStyle | null;
1622
+ getRangeAnchorStyle(elementList: IElement[], anchorIndex: number): IElement | null;
1623
+ getIsRangeChange(startIndex: number, endIndex: number, tableId?: string, startTdIndex?: number, endTdIndex?: number, startTrIndex?: number, endTrIndex?: number): boolean;
1624
+ getIsCollapsed(): boolean;
1625
+ getIsSelection(): boolean;
1626
+ getSelection(): IElement[] | null;
1627
+ getSelectionElementList(): IElement[] | null;
1628
+ getTextLikeSelection(): IElement[] | null;
1629
+ getTextLikeSelectionElementList(): IElement[] | null;
1630
+ getRangeRow(): RangeRowMap | null;
1631
+ getRangeRowElementList(): IElement[] | null;
1632
+ getRangeParagraph(): RangeRowArray | null;
1633
+ getRangeParagraphInfo(): IRangeParagraphInfo | null;
1634
+ getRangeParagraphElementList(): IElement[] | null;
1635
+ getRangeTableElement(): IElement | null;
1636
+ getIsSelectAll(): boolean;
1637
+ getIsPointInRange(x: number, y: number): boolean;
1638
+ getKeywordRangeList(payload: string): IRange[];
1639
+ getIsCanInput(): boolean;
1640
+ setRange(startIndex: number, endIndex: number, tableId?: string, startTdIndex?: number, endTdIndex?: number, startTrIndex?: number, endTrIndex?: number): void;
1641
+ replaceRange(range: IRange): void;
1642
+ shrinkRange(): void;
1643
+ setRangeStyle(): void;
1644
+ recoveryRangeStyle(): void;
1645
+ shrinkBoundary(context?: IControlContext): void;
1646
+ render(ctx: CanvasRenderingContext2D, x: number, y: number, width: number, height: number): void;
1647
+ toString(): string;
1648
+ }
1649
+
1650
+ interface INavigateInfo {
1651
+ index: number;
1652
+ count: number;
1653
+ }
1654
+ declare class Search {
1655
+ private draw;
1656
+ private options;
1657
+ private position;
1658
+ private range;
1659
+ private searchKeyword;
1660
+ private searchNavigateIndex;
1661
+ private searchOptions;
1662
+ private searchMatchList;
1663
+ constructor(draw: Draw);
1664
+ getSearchKeyword(): string | null;
1665
+ setSearchKeyword(payload: string | null, options?: ISearchOption): void;
1666
+ searchNavigatePre(): number | null;
1667
+ searchNavigateNext(): number | null;
1668
+ searchNavigateScrollIntoView(position: IElementPosition): void;
1669
+ getSearchNavigateIndexList(): any[];
1670
+ getSearchMatchList(): ISearchResult[];
1671
+ getSearchNavigateInfo(): null | INavigateInfo;
1672
+ getMatchList(payload: string, originalElementList: IElement[]): ISearchResult[];
1673
+ compute(payload: string): void;
1674
+ render(ctx: CanvasRenderingContext2D, pageIndex: number): void;
1675
+ replace(payload: string, option?: IReplaceOption): void;
1676
+ }
1677
+
1678
+ declare class ImageParticle {
1679
+ private draw;
1680
+ protected options: Required<IEditorOption>;
1681
+ protected imageCache: Map<string, HTMLImageElement>;
1682
+ private container;
1683
+ private floatImageContainer;
1684
+ private floatImage;
1685
+ constructor(draw: Draw);
1686
+ getOriginalMainImageList(): IElement[];
1687
+ createFloatImage(element: IElement): void;
1688
+ dragFloatImage(movementX: number, movementY: number): void;
1689
+ destroyFloatImage(): void;
1690
+ protected addImageObserver(promise: Promise<unknown>): void;
1691
+ protected getFallbackImage(width: number, height: number): HTMLImageElement;
1692
+ private _drawImageWithCrop;
1693
+ render(ctx: CanvasRenderingContext2D, element: IElement, x: number, y: number): void;
1694
+ }
1695
+
1696
+ interface IMeasureWordResult {
1697
+ width: number;
1698
+ endElement: IElement | null;
1699
+ }
1700
+ declare class TextParticle {
1701
+ private draw;
1702
+ private options;
1703
+ private ctx;
1704
+ private curX;
1705
+ private curY;
1706
+ private text;
1707
+ private curStyle;
1708
+ private curColor?;
1709
+ cacheMeasureText: Map<string, TextMetrics>;
1710
+ constructor(draw: Draw);
1711
+ measureBasisWord(ctx: CanvasRenderingContext2D, font: string): ITextMetrics;
1712
+ measureWord(ctx: CanvasRenderingContext2D, elementList: IElement[], curIndex: number): IMeasureWordResult;
1713
+ measurePunctuationWidth(ctx: CanvasRenderingContext2D, element: IElement): number;
1714
+ measureText(ctx: CanvasRenderingContext2D, element: IElement): ITextMetrics;
1715
+ getBasisWordBoundingBoxAscent(ctx: CanvasRenderingContext2D, font: string): number;
1716
+ complete(): void;
1717
+ record(ctx: CanvasRenderingContext2D, element: IRowElement, x: number, y: number): void;
1718
+ private _setCurXY;
1719
+ private _render;
1720
+ }
1721
+
1722
+ declare class TableParticle {
1723
+ private draw;
1724
+ private range;
1725
+ private options;
1726
+ constructor(draw: Draw);
1727
+ getTrListGroupByCol(payload: ITr[]): ITr[];
1728
+ getRangeRowCol(): ITd[][] | null;
1729
+ private _drawOuterBorder;
1730
+ private _drawSlash;
1731
+ private _drawBorder;
1732
+ private _drawBackgroundColor;
1733
+ getTableWidth(element: IElement): number;
1734
+ getTableHeight(element: IElement): number;
1735
+ getRowCountByColIndex(trList: ITr[], colIndex: number): number;
1736
+ getTdListByColIndex(trList: ITr[], colIndex: number): ITd[];
1737
+ getTdListByRowIndex(trList: ITr[], rowIndex: number): ITd[];
1738
+ computeRowColInfo(element: IElement): void;
1739
+ drawRange(ctx: CanvasRenderingContext2D, element: IElement, startX: number, startY: number): void;
1740
+ render(ctx: CanvasRenderingContext2D, element: IElement, startX: number, startY: number): void;
1741
+ }
1742
+
1743
+ declare class TableTool {
1744
+ private readonly MIN_TD_WIDTH;
1745
+ private readonly ROW_COL_OFFSET;
1746
+ private readonly ROW_COL_QUICK_WIDTH;
1747
+ private readonly ROW_COL_QUICK_OFFSET;
1748
+ private readonly ROW_COL_QUICK_POSITION;
1749
+ private readonly BORDER_VALUE;
1750
+ private readonly TABLE_SELECT_OFFSET;
1751
+ private draw;
1752
+ private canvas;
1753
+ private options;
1754
+ private position;
1755
+ private range;
1756
+ private container;
1757
+ private toolRowContainer;
1758
+ private toolRowAddBtn;
1759
+ private toolColAddBtn;
1760
+ private toolTableSelectBtn;
1761
+ private toolColContainer;
1762
+ private toolBorderContainer;
1763
+ private anchorLine;
1764
+ private mousedownX;
1765
+ private mousedownY;
1766
+ constructor(draw: Draw);
1767
+ dispose(): void;
1768
+ render(): void;
1769
+ private _setAnchorActive;
1770
+ private _mousedown;
1771
+ private _mousemove;
1772
+ }
1773
+
1774
+ declare class HyperlinkParticle {
1775
+ private draw;
1776
+ private options;
1777
+ private container;
1778
+ private hyperlinkPopupContainer;
1779
+ private hyperlinkDom;
1780
+ constructor(draw: Draw);
1781
+ private _createHyperlinkPopupDom;
1782
+ drawHyperlinkPopup(element: IElement, position: IElementPosition): void;
1783
+ clearHyperlinkPopup(): void;
1784
+ openHyperlink(element: IElement): void;
1785
+ render(ctx: CanvasRenderingContext2D, element: IRowElement, x: number, y: number): void;
1786
+ }
1787
+
1788
+ declare class Header {
1789
+ private draw;
1790
+ private position;
1791
+ private zone;
1792
+ private options;
1793
+ private elementList;
1794
+ private rowList;
1795
+ private positionList;
1796
+ constructor(draw: Draw, data?: IElement[]);
1797
+ getRowList(): IRow[];
1798
+ setElementList(elementList: IElement[]): void;
1799
+ getElementList(): IElement[];
1800
+ getPositionList(): IElementPosition[];
1801
+ compute(): void;
1802
+ recovery(): void;
1803
+ private _computeRowList;
1804
+ private _computePositionList;
1805
+ getHeaderTop(): number;
1806
+ getMaxHeight(): number;
1807
+ getHeight(): number;
1808
+ getRowHeight(): number;
1809
+ getEffectiveBottomY(): number;
1810
+ getExtraHeight(): number;
1811
+ render(ctx: CanvasRenderingContext2D, pageNo: number): void;
1812
+ }
1813
+
1814
+ interface IMoveCursorResult {
1815
+ newIndex: number;
1816
+ newElement: IElement;
1817
+ }
1818
+ declare class Control {
1819
+ private controlBorder;
1820
+ private draw;
1821
+ private range;
1822
+ private listener;
1823
+ private eventBus;
1824
+ private controlSearch;
1825
+ private options;
1826
+ private controlOptions;
1827
+ private activeControl;
1828
+ private activeControlValue;
1829
+ private preElement;
1830
+ constructor(draw: Draw);
1831
+ setHighlightList(payload: IControlHighlight[]): void;
1832
+ computeHighlightList(): void;
1833
+ renderHighlightList(ctx: CanvasRenderingContext2D, pageNo: number): void;
1834
+ getDraw(): Draw;
1835
+ filterAssistElement(elementList: IElement[]): IElement[];
1836
+ getIsRangeCanCaptureEvent(): boolean;
1837
+ getIsRangeInPostfix(): boolean;
1838
+ getIsRangeWithinControl(): boolean;
1839
+ getIsElementListContainFullControl(elementList: IElement[]): boolean;
1840
+ getIsDisabledControl(context?: IControlContext): boolean;
1841
+ getIsDisabledPasteControl(context?: IControlContext): boolean;
1842
+ getIsExistValueByElementListIndex(elementList: IElement[], index: number): boolean;
1843
+ getControlHighlight(elementList: IElement[], index: number): string;
1844
+ getContainer(): HTMLDivElement;
1845
+ getElementList(): IElement[];
1846
+ getPosition(): IElementPosition | null;
1847
+ getPreY(): number;
1848
+ getRange(): IRange;
1849
+ getValueRange(context?: IControlContext): IRange | null;
1850
+ shrinkBoundary(context?: IControlContext): void;
1851
+ getActiveControl(): IControlInstance | null;
1852
+ getControlElementList(context?: IControlContext): IElement[];
1853
+ updateActiveControlValue(): void;
1854
+ emitControlChange(state: ControlState): void;
1855
+ initControl(): void;
1856
+ destroyControl(options?: IDestroyControlOption): void;
1857
+ repaintControl(options?: IRepaintControlOption): void;
1858
+ emitControlContentChange(options?: IControlChangeOption): void;
1859
+ reAwakeControl(): void;
1860
+ selectValue(): boolean;
1861
+ moveCursor(position: IControlInitOption): IMoveCursorResult;
1862
+ removeControl(startIndex: number, context?: IControlContext): number | null;
1863
+ removePlaceholder(startIndex: number, context?: IControlContext): void;
1864
+ addPlaceholder(startIndex: number, context?: IControlContext): void;
1865
+ setValue(data: IElement[]): number;
1866
+ setControlProperties(properties: Partial<IControl>, context?: IControlContext): void;
1867
+ keydown(evt: KeyboardEvent): number | null;
1868
+ cut(): number;
1869
+ getValueById(payload: IGetControlValueOption): IGetControlValueResult;
1870
+ setValueListById(payload: ISetControlValueOption[]): void;
1871
+ setExtensionListById(payload: ISetControlExtensionOption[]): void;
1872
+ setPropertiesListById(payload: ISetControlProperties[]): void;
1873
+ getList(): IElement[];
1874
+ recordBorderInfo(x: number, y: number, width: number, height: number): void;
1875
+ drawBorder(ctx: CanvasRenderingContext2D): void;
1876
+ getPreControlContext(): INextControlContext | null;
1877
+ getNextControlContext(): INextControlContext | null;
1878
+ initNextControl(option?: IInitNextControlOption): void;
1879
+ setMinWidthControlInfo(option: ISetControlRowFlexOption): void;
1880
+ }
1881
+
1882
+ interface ICheckboxRenderOption {
1883
+ ctx: CanvasRenderingContext2D;
1884
+ x: number;
1885
+ y: number;
1886
+ row: IRow;
1887
+ index: number;
1888
+ }
1889
+ declare class CheckboxParticle {
1890
+ private draw;
1891
+ private options;
1892
+ constructor(draw: Draw);
1893
+ setSelect(element: IElement): void;
1894
+ render(payload: ICheckboxRenderOption): void;
1895
+ }
1896
+
1897
+ interface IRadioRenderOption {
1898
+ ctx: CanvasRenderingContext2D;
1899
+ x: number;
1900
+ y: number;
1901
+ row: IRow;
1902
+ index: number;
1903
+ }
1904
+ declare class RadioParticle {
1905
+ private draw;
1906
+ private options;
1907
+ constructor(draw: Draw);
1908
+ setSelect(element: IElement): void;
1909
+ render(payload: IRadioRenderOption): void;
1910
+ }
1911
+
1912
+ declare class WorkerManager {
1913
+ private draw;
1914
+ constructor(draw: Draw);
1915
+ getWordCount(): Promise<number>;
1916
+ getCatalog(): Promise<ICatalog | null>;
1917
+ getGroupIds(): Promise<string[]>;
1918
+ getValue(options?: IGetValueOption): Promise<IEditorResult>;
1919
+ }
1920
+
1921
+ interface IPreviewerDrawOption {
1922
+ mime?: 'png' | 'jpg' | 'jpeg' | 'svg';
1923
+ srcKey?: keyof Pick<IElement, 'value' | 'laTexSVG'>;
1924
+ dragDisable?: boolean;
1925
+ }
1926
+
1927
+ declare class Previewer {
1928
+ private container;
1929
+ private canvas;
1930
+ private draw;
1931
+ private options;
1932
+ private curElement;
1933
+ private curElementSrc;
1934
+ private previewerDrawOption;
1935
+ private curPosition;
1936
+ private eventBus;
1937
+ private imageList;
1938
+ private curShowElement;
1939
+ private imageCount;
1940
+ private imagePre;
1941
+ private imageNext;
1942
+ private resizerSelection;
1943
+ private resizerHandleList;
1944
+ private resizerImageContainer;
1945
+ private resizerImage;
1946
+ private resizerSize;
1947
+ private width;
1948
+ private height;
1949
+ private mousedownX;
1950
+ private mousedownY;
1951
+ private curHandleIndex;
1952
+ private previewerContainer;
1953
+ private previewerImage;
1954
+ constructor(draw: Draw);
1955
+ private _getElementPosition;
1956
+ private _createResizerDom;
1957
+ private _keydown;
1958
+ private _mousedown;
1959
+ private _mousemove;
1960
+ private _drawPreviewer;
1961
+ private _updateImageNavigate;
1962
+ _setPreviewerTransform(scale: number, rotate: number, x: number, y: number): void;
1963
+ private _clearPreviewer;
1964
+ _updateResizerRect(width: number, height: number): void;
1965
+ _updateResizerSizeView(width: number, height: number): void;
1966
+ render(): void;
1967
+ drawResizer(element: IElement, position?: IElementPosition | null, options?: IPreviewerDrawOption): void;
1968
+ updateResizer(element: IElement, position?: IElementPosition | null): void;
1969
+ clearResizer(): void;
1970
+ }
1971
+
1972
+ declare class DateParticle {
1973
+ private draw;
1974
+ private range;
1975
+ private datePicker;
1976
+ private options;
1977
+ constructor(draw: Draw);
1978
+ private _setValue;
1979
+ getDateElementRange(): [number, number] | null;
1980
+ clearDatePicker(): void;
1981
+ renderDatePicker(element: IElement, position: IElementPosition): void;
1982
+ }
1983
+
1984
+ interface IDatePickerLang {
1985
+ now: string;
1986
+ confirm: string;
1987
+ return: string;
1988
+ timeSelect: string;
1989
+ weeks: {
1990
+ sun: string;
1991
+ mon: string;
1992
+ tue: string;
1993
+ wed: string;
1994
+ thu: string;
1995
+ fri: string;
1996
+ sat: string;
1997
+ };
1998
+ year: string;
1999
+ month: string;
2000
+ hour: string;
2001
+ minute: string;
2002
+ second: string;
2003
+ }
2004
+
2005
+ interface IContextMenuContext {
2006
+ startElement: IElement | null;
2007
+ endElement: IElement | null;
2008
+ isReadonly: boolean;
2009
+ editorHasSelection: boolean;
2010
+ editorTextFocus: boolean;
2011
+ isInTable: boolean;
2012
+ isCrossRowCol: boolean;
2013
+ zone: EditorZone;
2014
+ trIndex: number | null;
2015
+ tdIndex: number | null;
2016
+ tableElement: IElement | null;
2017
+ options: DeepRequired<IEditorOption>;
2018
+ }
2019
+ interface IRegisterContextMenu {
2020
+ key?: string;
2021
+ i18nPath?: string;
2022
+ isDivider?: boolean;
2023
+ icon?: string;
2024
+ name?: string;
2025
+ shortCut?: string;
2026
+ disable?: boolean;
2027
+ when?: (payload: IContextMenuContext) => boolean;
2028
+ callback?: (command: Command, context: IContextMenuContext) => void;
2029
+ childMenus?: IRegisterContextMenu[];
2030
+ }
2031
+ interface IContextmenuLang {
2032
+ global: {
2033
+ cut: string;
2034
+ copy: string;
2035
+ paste: string;
2036
+ selectAll: string;
2037
+ print: string;
2038
+ };
2039
+ control: {
2040
+ delete: string;
2041
+ };
2042
+ hyperlink: {
2043
+ delete: string;
2044
+ cancel: string;
2045
+ edit: string;
2046
+ };
2047
+ image: {
2048
+ change: string;
2049
+ saveAs: string;
2050
+ textWrap: string;
2051
+ textWrapType: {
2052
+ embed: string;
2053
+ upDown: string;
2054
+ };
2055
+ };
2056
+ table: {
2057
+ insertRowCol: string;
2058
+ insertTopRow: string;
2059
+ insertBottomRow: string;
2060
+ insertLeftCol: string;
2061
+ insertRightCol: string;
2062
+ deleteRowCol: string;
2063
+ deleteRow: string;
2064
+ deleteCol: string;
2065
+ deleteTable: string;
2066
+ mergeCell: string;
2067
+ mergeCancelCell: string;
2068
+ };
2069
+ }
2070
+
2071
+ interface ILang {
2072
+ contextmenu: IContextmenuLang;
2073
+ datePicker: IDatePickerLang;
2074
+ }
2075
+
2076
+ declare class I18n {
2077
+ private currentLocale;
2078
+ private langMap;
2079
+ constructor(locale: string);
2080
+ registerLangMap(locale: string, lang: DeepPartial<ILang>): void;
2081
+ getLocale(): string;
2082
+ setLocale(locale: string): void;
2083
+ getLang(): ILang;
2084
+ t(path: string): string;
2085
+ }
2086
+
2087
+ declare class ImageObserver {
2088
+ private promiseList;
2089
+ constructor();
2090
+ add(payload: Promise<unknown>): void;
2091
+ clearAll(): void;
2092
+ allSettled(): Promise<PromiseSettledResult<unknown>[]>;
2093
+ }
2094
+
2095
+ declare class Zone {
2096
+ private readonly INDICATOR_PADDING;
2097
+ private readonly INDICATOR_TITLE_TRANSLATE;
2098
+ private draw;
2099
+ private options;
2100
+ private i18n;
2101
+ private container;
2102
+ private currentZone;
2103
+ private indicatorContainer;
2104
+ private dropdownContainer;
2105
+ private dropdownClickHandler;
2106
+ constructor(draw: Draw);
2107
+ isHeaderActive(): boolean;
2108
+ isMainActive(): boolean;
2109
+ isFooterActive(): boolean;
2110
+ getZone(): EditorZone;
2111
+ setZone(payload: EditorZone): void;
2112
+ getZoneByY(y: number): EditorZone;
2113
+ drawZoneIndicator(): void;
2114
+ private _toggleDropdown;
2115
+ private _closeDropdown;
2116
+ private _openFormatDialog;
2117
+ private _clearZoneIndicator;
2118
+ }
2119
+
2120
+ declare class Footer {
2121
+ private readonly MIN_BAR_HEIGHT;
2122
+ private draw;
2123
+ private position;
2124
+ private zone;
2125
+ private options;
2126
+ private elementList;
2127
+ private rowList;
2128
+ private positionList;
2129
+ constructor(draw: Draw, data?: IElement[]);
2130
+ getRowList(): IRow[];
2131
+ setElementList(elementList: IElement[]): void;
2132
+ getElementList(): IElement[];
2133
+ getPositionList(): IElementPosition[];
2134
+ compute(): void;
2135
+ recovery(): void;
2136
+ private _computeRowList;
2137
+ private _computePositionList;
2138
+ getFooterBottom(): number;
2139
+ getMaxHeight(): number;
2140
+ getHeight(): number;
2141
+ getRowHeight(): number;
2142
+ getEffectiveTopY(): number;
2143
+ getExtraHeight(): number;
2144
+ render(ctx: CanvasRenderingContext2D, pageNo: number): void;
2145
+ }
2146
+
2147
+ declare class ListParticle {
2148
+ private draw;
2149
+ private range;
2150
+ private options;
2151
+ private readonly UN_COUNT_STYLE_WIDTH;
2152
+ private readonly MEASURE_BASE_TEXT;
2153
+ private readonly LIST_GAP;
2154
+ constructor(draw: Draw);
2155
+ setList(listType: ListType | null, listStyle?: ListStyle): void;
2156
+ setListWithPreset(listType: ListType, listStyle: ListStyle, preset: string): void;
2157
+ indent(): void;
2158
+ outdent(): void;
2159
+ unsetList(): void;
2160
+ getListIndentWidth(element: IElement): number;
2161
+ computeListStyle(ctx: CanvasRenderingContext2D, elementList: IElement[]): Map<string, number>;
2162
+ getListStyleWidth(ctx: CanvasRenderingContext2D, listElementList: IElement[]): number;
2163
+ private _getOlStyleForLevel;
2164
+ private _getUlBulletForLevel;
2165
+ drawListStyle(ctx: CanvasRenderingContext2D, row: IRow, position: IElementPosition): void;
2166
+ }
2167
+
2168
+ declare class EventBus<EventMap> {
2169
+ private eventHub;
2170
+ constructor();
2171
+ on<K extends string & keyof EventMap>(eventName: K, callback: EventMap[K]): void;
2172
+ emit<K extends string & keyof EventMap>(eventName: K, payload?: EventMap[K] extends (payload: infer P) => void ? P : never): any;
2173
+ off<K extends string & keyof EventMap>(eventName: K, callback: EventMap[K]): void;
2174
+ isSubscribe<K extends string & keyof EventMap>(eventName: K): boolean;
2175
+ dangerouslyClearAll(): void;
2176
+ }
2177
+
2178
+ interface EventBusMap {
2179
+ rangeStyleChange: IRangeStyleChange;
2180
+ visiblePageNoListChange: IVisiblePageNoListChange;
2181
+ intersectionPageNoChange: IIntersectionPageNoChange;
2182
+ pageSizeChange: IPageSizeChange;
2183
+ pageScaleChange: IPageScaleChange;
2184
+ saved: ISaved;
2185
+ contentChange: IContentChange;
2186
+ controlChange: IControlChange;
2187
+ controlContentChange: IControlContentChange;
2188
+ pageModeChange: IPageModeChange;
2189
+ zoneChange: IZoneChange;
2190
+ mousemove: IMouseEventChange;
2191
+ mouseleave: IMouseEventChange;
2192
+ mouseenter: IMouseEventChange;
2193
+ mousedown: IMouseEventChange;
2194
+ mouseup: IMouseEventChange;
2195
+ click: IMouseEventChange;
2196
+ input: IInputEventChange;
2197
+ positionContextChange: IPositionContextChange;
2198
+ imageSizeChange: IImageSizeChange;
2199
+ imageMousedown: IImageMousedown;
2200
+ imageDblclick: IImageDblclick;
2201
+ labelMousedown: ILabelMousedown;
2202
+ }
2203
+
2204
+ declare class Group {
2205
+ private draw;
2206
+ private options;
2207
+ private range;
2208
+ private fillRectMap;
2209
+ constructor(draw: Draw);
2210
+ setGroup(): string | null;
2211
+ getElementListByGroupId(elementList: IElement[], groupId: string): IElement[];
2212
+ deleteGroup(groupId: string): void;
2213
+ getContextByGroupId(elementList: IElement[], groupId: string): (IRange & IPositionContext) | null;
2214
+ clearFillInfo(): void;
2215
+ recordFillInfo(element: IElement, x: number, y: number, width: number, height: number): void;
2216
+ render(ctx: CanvasRenderingContext2D): void;
2217
+ }
2218
+
2219
+ interface IOverrideResult {
2220
+ preventDefault?: boolean;
2221
+ }
2222
+ declare class Override {
2223
+ paste: ((evt?: ClipboardEvent) => unknown | IOverrideResult) | undefined;
2224
+ copy: (() => unknown | IOverrideResult) | undefined;
2225
+ drop: ((evt: DragEvent) => unknown | IOverrideResult) | undefined;
2226
+ }
2227
+
2228
+ declare class LineBreakParticle {
2229
+ private options;
2230
+ static readonly WIDTH = 12;
2231
+ static readonly HEIGHT = 9;
2232
+ static readonly GAP = 3;
2233
+ constructor(draw: Draw);
2234
+ render(ctx: CanvasRenderingContext2D, element: IRowElement, x: number, y: number): void;
2235
+ }
2236
+
2237
+ declare class TableOperate {
2238
+ private draw;
2239
+ private range;
2240
+ private position;
2241
+ private tableTool;
2242
+ private tableParticle;
2243
+ private options;
2244
+ constructor(draw: Draw);
2245
+ insertTable(row: number, col: number): void;
2246
+ insertTableTopRow(): void;
2247
+ insertTableBottomRow(): void;
2248
+ adjustColWidth(element: IElement): void;
2249
+ insertTableLeftCol(): void;
2250
+ insertTableRightCol(): void;
2251
+ deleteTableRow(): void;
2252
+ deleteTableCol(): void;
2253
+ deleteTable(): void;
2254
+ mergeTableCell(): void;
2255
+ cancelMergeTableCell(): void;
2256
+ splitVerticalTableCell(): void;
2257
+ splitHorizontalTableCell(): void;
2258
+ tableTdVerticalAlign(payload: VerticalAlign): void;
2259
+ tableBorderType(payload: TableBorder): void;
2260
+ tableBorderColor(payload: string): void;
2261
+ tableTdBorderType(payload: TdBorder): void;
2262
+ tableTdSlashType(payload: TdSlash): void;
2263
+ tableTdBackgroundColor(payload: string): void;
2264
+ tableSelectAll(): void;
2265
+ }
2266
+
2267
+ declare class Area {
2268
+ private draw;
2269
+ private zone;
2270
+ private range;
2271
+ private position;
2272
+ private options;
2273
+ private areaInfoMap;
2274
+ constructor(draw: Draw);
2275
+ getAreaInfo(): Map<string, IAreaInfo>;
2276
+ getActiveAreaId(): string | null;
2277
+ getActiveAreaInfo(): IAreaInfo | null;
2278
+ isReadonly(): boolean;
2279
+ insertArea(payload: IInsertAreaOption): string | null;
2280
+ render(ctx: CanvasRenderingContext2D, pageNo: number): void;
2281
+ compute(): void;
2282
+ getAreaValue(options?: IGetAreaValueOption): IGetAreaValueResult | null;
2283
+ getContextByAreaId(areaId: string, options?: ILocationAreaOption): {
2284
+ range: IRange;
2285
+ elementPosition: IElementPosition;
2286
+ } | null;
2287
+ setAreaProperties(payload: ISetAreaPropertiesOption): void;
2288
+ setAreaValue(payload: ISetAreaValueOption): void;
2289
+ }
2290
+
2291
+ declare class Badge {
2292
+ private draw;
2293
+ private options;
2294
+ private imageCache;
2295
+ private mainBadge;
2296
+ private areaBadgeMap;
2297
+ constructor(draw: Draw);
2298
+ setMainBadge(payload: IBadge | null): void;
2299
+ setAreaBadgeMap(payload: IAreaBadge[]): void;
2300
+ private _drawImage;
2301
+ render(ctx: CanvasRenderingContext2D, pageNo: number): void;
2302
+ }
2303
+
2304
+ declare class Graffiti {
2305
+ private draw;
2306
+ private options;
2307
+ private data;
2308
+ private pageContainer;
2309
+ private isDrawing;
2310
+ private startStroke;
2311
+ constructor(draw: Draw, data?: IGraffitiData[]);
2312
+ private register;
2313
+ private start;
2314
+ private stop;
2315
+ private drawing;
2316
+ getValue(): IGraffitiData[];
2317
+ compute(): void;
2318
+ clear(): void;
2319
+ render(ctx: CanvasRenderingContext2D, pageNo: number): void;
2320
+ }
2321
+
2322
+ declare class Draw {
2323
+ private container;
2324
+ private pageContainer;
2325
+ private pageList;
2326
+ private ctxList;
2327
+ private pageNo;
2328
+ private renderCount;
2329
+ private pagePixelRatio;
2330
+ private mode;
2331
+ private options;
2332
+ private position;
2333
+ private zone;
2334
+ private elementList;
2335
+ private listener;
2336
+ private eventBus;
2337
+ private override;
2338
+ private i18n;
2339
+ private canvasEvent;
2340
+ private globalEvent;
2341
+ private cursor;
2342
+ private range;
2343
+ private margin;
2344
+ private background;
2345
+ private badge;
2346
+ private search;
2347
+ private group;
2348
+ private area;
2349
+ private underline;
2350
+ private strikeout;
2351
+ private highlight;
2352
+ private historyManager;
2353
+ private previewer;
2354
+ private imageParticle;
2355
+ private laTexParticle;
2356
+ private textParticle;
2357
+ private tableParticle;
2358
+ private tableTool;
2359
+ private tableOperate;
2360
+ private pageNumber;
2361
+ private lineNumber;
2362
+ private waterMark;
2363
+ private placeholder;
2364
+ private header;
2365
+ private footer;
2366
+ private hyperlinkParticle;
2367
+ private labelParticle;
2368
+ private dateParticle;
2369
+ private separatorParticle;
2370
+ private pageBreakParticle;
2371
+ private columnBreakParticle;
2372
+ private superscriptParticle;
2373
+ private subscriptParticle;
2374
+ private checkboxParticle;
2375
+ private radioParticle;
2376
+ private blockParticle;
2377
+ private listParticle;
2378
+ private lineBreakParticle;
2379
+ private whiteSpaceParticle;
2380
+ private control;
2381
+ private pageBorder;
2382
+ private workerManager;
2383
+ private scrollObserver;
2384
+ private selectionObserver;
2385
+ private imageObserver;
2386
+ private graffiti;
2387
+ private LETTER_REG;
2388
+ private WORD_LIKE_REG;
2389
+ private rowList;
2390
+ private pageRowList;
2391
+ private painterStyle;
2392
+ private painterOptions;
2393
+ private visiblePageNoList;
2394
+ private intersectionPageNo;
2395
+ private lazyRenderIntersectionObserver;
2396
+ private printModeData;
2397
+ constructor(rootContainer: HTMLElement, options: DeepRequired<IEditorOption>, data: IEditorData, listener: Listener, eventBus: EventBus<EventBusMap>, override: Override);
2398
+ setPrintData(): void;
2399
+ clearPrintData(): void;
2400
+ getLetterReg(): RegExp;
2401
+ getMode(): EditorMode;
2402
+ setMode(payload: EditorMode): void;
2403
+ isReadonly(): boolean;
2404
+ isDisabled(): boolean;
2405
+ isDesignMode(): boolean;
2406
+ isPrintMode(): boolean;
2407
+ isGraffitiMode(): boolean;
2408
+ getOriginalWidth(): number;
2409
+ getOriginalHeight(): number;
2410
+ getWidth(): number;
2411
+ getHeight(): number;
2412
+ getMainHeight(): number;
2413
+ getMainOuterHeight(): number;
2414
+ getCanvasWidth(pageNo?: number): number;
2415
+ getCanvasHeight(pageNo?: number): number;
2416
+ getInnerWidth(): number;
2417
+ getColumnCount(): number;
2418
+ getColumnWidth(): number;
2419
+ getOriginalInnerWidth(): number;
2420
+ getContextInnerWidth(): number;
2421
+ getMargins(): IMargin;
2422
+ getOriginalMargins(): number[];
2423
+ getPageGap(): number;
2424
+ getOriginalPageGap(): number;
2425
+ getPageNumberBottom(): number;
2426
+ getMarginIndicatorSize(): number;
2427
+ getDefaultBasicRowMarginHeight(): number;
2428
+ getHighlightMarginHeight(): number;
2429
+ getTdPadding(): IPadding;
2430
+ getContainer(): HTMLDivElement;
2431
+ getPageContainer(): HTMLDivElement;
2432
+ getVisiblePageNoList(): number[];
2433
+ setVisiblePageNoList(payload: number[]): void;
2434
+ getIntersectionPageNo(): number;
2435
+ setIntersectionPageNo(payload: number): void;
2436
+ getPageNo(): number;
2437
+ setPageNo(payload: number): void;
2438
+ getRenderCount(): number;
2439
+ getPage(pageNo?: number): HTMLCanvasElement;
2440
+ getPageList(): HTMLCanvasElement[];
2441
+ getPageCount(): number;
2442
+ getTableRowList(sourceElementList: IElement[]): IRow[];
2443
+ getOriginalRowList(): IRow[];
2444
+ getRowList(): IRow[];
2445
+ getPageRowList(): IRow[][];
2446
+ getCtx(): CanvasRenderingContext2D;
2447
+ getOptions(): DeepRequired<IEditorOption>;
2448
+ getSearch(): Search;
2449
+ getGroup(): Group;
2450
+ getArea(): Area;
2451
+ getBadge(): Badge;
2452
+ getHistoryManager(): HistoryManager;
2453
+ getPosition(): Position;
2454
+ getZone(): Zone;
2455
+ getRange(): RangeManager;
2456
+ getLineBreakParticle(): LineBreakParticle;
2457
+ getTextParticle(): TextParticle;
2458
+ getHeaderElementList(): IElement[];
2459
+ getTableElementList(sourceElementList: IElement[]): IElement[];
2460
+ getElementList(): IElement[];
2461
+ getMainElementList(): IElement[];
2462
+ getOriginalElementList(): IElement[];
2463
+ getOriginalMainElementList(): IElement[];
2464
+ getFooterElementList(): IElement[];
2465
+ getTd(): ITd | null;
2466
+ insertElementList(payload: IElement[], options?: IInsertElementListOption): void;
2467
+ appendElementList(elementList: IElement[], options?: IAppendElementListOption): void;
2468
+ spliceElementList(elementList: IElement[], start: number, deleteCount: number, items?: IElement[], options?: ISpliceElementListOption): void;
2469
+ getCanvasEvent(): CanvasEvent;
2470
+ getGlobalEvent(): GlobalEvent;
2471
+ getListener(): Listener;
2472
+ getEventBus(): EventBus<EventBusMap>;
2473
+ getOverride(): Override;
2474
+ getCursor(): Cursor;
2475
+ getPreviewer(): Previewer;
2476
+ getImageParticle(): ImageParticle;
2477
+ getTableTool(): TableTool;
2478
+ getTableOperate(): TableOperate;
2479
+ getTableParticle(): TableParticle;
2480
+ getHeader(): Header;
2481
+ getFooter(): Footer;
2482
+ getHyperlinkParticle(): HyperlinkParticle;
2483
+ getDateParticle(): DateParticle;
2484
+ getListParticle(): ListParticle;
2485
+ getCheckboxParticle(): CheckboxParticle;
2486
+ getRadioParticle(): RadioParticle;
2487
+ getControl(): Control;
2488
+ getWorkerManager(): WorkerManager;
2489
+ getImageObserver(): ImageObserver;
2490
+ getI18n(): I18n;
2491
+ getGraffiti(): Graffiti;
2492
+ getRowCount(): number;
2493
+ getDataURL(payload?: IGetImageOption): Promise<string[]>;
2494
+ getPainterStyle(): IElementStyle | null;
2495
+ getPainterOptions(): IPainterOption | null;
2496
+ setPainterStyle(payload: IElementStyle | null, options?: IPainterOption): void;
2497
+ setDefaultRange(): void;
2498
+ getIsPagingMode(): boolean;
2499
+ setPageMode(payload: PageMode): void;
2500
+ setColumnCount(count: number): void;
2501
+ setColumnGap(gap: number): void;
2502
+ setPageScale(payload: number): void;
2503
+ getPagePixelRatio(): number;
2504
+ setPagePixelRatio(payload: number | null): void;
2505
+ setPageDevicePixel(): void;
2506
+ setPaperSize(width: number, height: number): void;
2507
+ setPaperDirection(payload: PaperDirection): void;
2508
+ setPaperMargin(payload: IMargin): void;
2509
+ getOriginValue(options?: IGetOriginValueOption): Required<IEditorData>;
2510
+ getValue(options?: IGetValueOption): IEditorResult;
2511
+ setValue(payload: Partial<IEditorData>, options?: ISetValueOption): void;
2512
+ setEditorData(payload: Partial<Omit<IEditorData, 'graffiti'>>): void;
2513
+ private _wrapContainer;
2514
+ private _formatContainer;
2515
+ private _createPageContainer;
2516
+ private _createPage;
2517
+ private _initPageContext;
2518
+ getElementFont(el: IElement, scale?: number): string;
2519
+ getElementSize(el: IElement): number;
2520
+ getElementRowMargin(el: IElement): number;
2521
+ computeRowList(payload: IComputeRowListPayload): IRow[];
2522
+ private _computePageList;
2523
+ private _drawHighlight;
2524
+ drawRow(ctx: CanvasRenderingContext2D, payload: IDrawRowPayload): void;
2525
+ private _drawFloat;
2526
+ private _clearPage;
2527
+ private _drawColumnGuide;
2528
+ private _drawPage;
2529
+ private _disconnectLazyRender;
2530
+ private _lazyRender;
2531
+ private _immediateRender;
2532
+ render(payload?: IDrawOption): void;
2533
+ setCursor(curIndex: number | undefined): number | undefined;
2534
+ submitHistory(curIndex: number | undefined): void;
2535
+ destroy(): void;
2536
+ clearSideEffect(): void;
2537
+ }
2538
+
2539
+ interface IRichtextOption {
2540
+ isIgnoreDisabledRule: boolean;
2541
+ }
2542
+
2543
+ declare class CommandAdapt {
2544
+ private draw;
2545
+ private range;
2546
+ private position;
2547
+ private historyManager;
2548
+ private canvasEvent;
2549
+ private options;
2550
+ private control;
2551
+ private workerManager;
2552
+ private searchManager;
2553
+ private i18n;
2554
+ private zone;
2555
+ private tableOperate;
2556
+ constructor(draw: Draw);
2557
+ mode(payload: EditorMode): void;
2558
+ cut(): Promise<void>;
2559
+ copy(payload?: ICopyOption): Promise<void>;
2560
+ paste(payload?: IPasteOption): void;
2561
+ selectAll(): void;
2562
+ backspace(): void;
2563
+ setRange(startIndex: number, endIndex: number, tableId?: string, startTdIndex?: number, endTdIndex?: number, startTrIndex?: number, endTrIndex?: number): void;
2564
+ replaceRange(range: IRange): void;
2565
+ setPositionContext(range: IRange): void;
2566
+ forceUpdate(options?: IForceUpdateOption): void;
2567
+ blur(): void;
2568
+ undo(): void;
2569
+ redo(): void;
2570
+ painter(options: IPainterOption): void;
2571
+ applyPainterStyle(): void;
2572
+ format(options?: IRichtextOption): void;
2573
+ font(payload: string, options?: IRichtextOption): void;
2574
+ size(payload: number, options?: IRichtextOption): void;
2575
+ sizeAdd(options?: IRichtextOption): void;
2576
+ sizeMinus(options?: IRichtextOption): void;
2577
+ bold(options?: IRichtextOption): void;
2578
+ italic(options?: IRichtextOption): void;
2579
+ underline(textDecoration?: ITextDecoration, options?: IRichtextOption): void;
2580
+ strikeout(options?: IRichtextOption): void;
2581
+ superscript(options?: IRichtextOption): void;
2582
+ subscript(options?: IRichtextOption): void;
2583
+ color(payload: string | null, options?: IRichtextOption): void;
2584
+ highlight(payload: string | null, options?: IRichtextOption): void;
2585
+ title(payload: TitleLevel | null): void;
2586
+ list(listType: ListType | null, listStyle?: ListStyle): void;
2587
+ listWithPreset(listType: ListType, listStyle: ListStyle, preset: string): void;
2588
+ listIndent(): void;
2589
+ listOutdent(): void;
2590
+ rowFlex(payload: RowFlex): void;
2591
+ rowMargin(payload: number): void;
2592
+ insertTable(row: number, col: number): void;
2593
+ insertTableTopRow(): void;
2594
+ insertTableBottomRow(): void;
2595
+ insertTableLeftCol(): void;
2596
+ insertTableRightCol(): void;
2597
+ deleteTableRow(): void;
2598
+ deleteTableCol(): void;
2599
+ deleteTable(): void;
2600
+ mergeTableCell(): void;
2601
+ cancelMergeTableCell(): void;
2602
+ splitVerticalTableCell(): void;
2603
+ splitHorizontalTableCell(): void;
2604
+ tableTdVerticalAlign(payload: VerticalAlign): void;
2605
+ tableBorderType(payload: TableBorder): void;
2606
+ tableBorderColor(payload: string): void;
2607
+ tableTdBorderType(payload: TdBorder): void;
2608
+ tableTdSlashType(payload: TdSlash): void;
2609
+ tableTdBackgroundColor(payload: string): void;
2610
+ tableSelectAll(): void;
2611
+ hyperlink(payload: Pick<IElement, 'valueList' | 'hyperlinkId' | 'url'>): void;
2612
+ getHyperlinkRange(): [number, number] | null;
2613
+ deleteHyperlink(): void;
2614
+ cancelHyperlink(): void;
2615
+ editHyperlink(payload: string): void;
2616
+ separator(dashArray: number[], option?: {
2617
+ lineWidth?: number;
2618
+ color?: string;
2619
+ }): void;
2620
+ pageBreak(): void;
2621
+ addWatermark(payload: IWatermark): void;
2622
+ deleteWatermark(): void;
2623
+ image(payload: IDrawImagePayload): string | null;
2624
+ search(payload: string | null, options?: ISearchOption): void;
2625
+ searchNavigatePre(): void;
2626
+ searchNavigateNext(): void;
2627
+ getSearchNavigateInfo(): null | INavigateInfo;
2628
+ replace(payload: string, option?: IReplaceOption): void;
2629
+ print(): Promise<void>;
2630
+ replaceImageElement(payload: string): void;
2631
+ saveAsImageElement(): void;
2632
+ setImageCrop(crop: IImageCrop): void;
2633
+ changeImageDisplay(element: IElement, display: ImageDisplay): void;
2634
+ getImage(payload?: IGetImageOption): Promise<string[]>;
2635
+ getOptions(): DeepRequired<IEditorOption>;
2636
+ getValue(options?: IGetValueOption): IEditorResult;
2637
+ getValueAsync(options?: IGetValueOption): Promise<IEditorResult>;
2638
+ getAreaValue(options?: IGetAreaValueOption): IGetAreaValueResult | null;
2639
+ getHTML(): IEditorHTML;
2640
+ getText(): IEditorText;
2641
+ getWordCount(): Promise<number>;
2642
+ getCursorPosition(): IElementPosition | null;
2643
+ getRange(): IRange;
2644
+ getRangeText(): string;
2645
+ getRangeContext(): RangeContext | null;
2646
+ getRangeRow(): IElement[] | null;
2647
+ getRangeParagraph(): IElement[] | null;
2648
+ getKeywordRangeList(payload: string): IRange[];
2649
+ getKeywordContext(payload: string): ISearchResultContext[] | null;
2650
+ pageMode(payload: PageMode): void;
2651
+ pageScale(scale: number): void;
2652
+ pageScaleRecovery(): void;
2653
+ pageScaleMinus(): void;
2654
+ pageScaleAdd(): void;
2655
+ paperSize(width: number, height: number): void;
2656
+ paperDirection(payload: PaperDirection): void;
2657
+ getPaperMargin(): number[];
2658
+ setPaperMargin(payload: IMargin): void;
2659
+ setMainBadge(payload: IBadge | null): void;
2660
+ setAreaBadge(payload: IAreaBadge[]): void;
2661
+ insertElementList(payload: IElement[], options?: IInsertElementListOption): void;
2662
+ appendElementList(elementList: IElement[], options?: IAppendElementListOption): void;
2663
+ updateElementById(payload: IUpdateElementByIdOption): void;
2664
+ deleteElementById(payload: IDeleteElementByIdOption): void;
2665
+ getElementById(payload: IGetElementByIdOption): IElement[];
2666
+ setValue(payload: Partial<IEditorData>, options?: ISetValueOption): void;
2667
+ removeControl(payload?: IRemoveControlOption): void;
2668
+ translate(path: string): string;
2669
+ setLocale(payload: string): void;
2670
+ getLocale(): string;
2671
+ getCatalog(): Promise<ICatalog | null>;
2672
+ locationCatalog(titleId: string): void;
2673
+ wordTool(): void;
2674
+ setHTML(payload: Partial<IEditorHTML>): void;
2675
+ setGroup(): string | null;
2676
+ deleteGroup(groupId: string): void;
2677
+ getGroupIds(): Promise<string[]>;
2678
+ locationGroup(groupId: string): void;
2679
+ setZone(zone: EditorZone): void;
2680
+ getControlValue(payload: IGetControlValueOption): IGetControlValueResult | null;
2681
+ setControlValue(payload: ISetControlValueOption): void;
2682
+ setControlValueList(payload: ISetControlValueOption[]): void;
2683
+ setControlExtension(payload: ISetControlExtensionOption): void;
2684
+ setControlExtensionList(payload: ISetControlExtensionOption[]): void;
2685
+ setControlProperties(payload: ISetControlProperties): void;
2686
+ setControlPropertiesList(payload: ISetControlProperties[]): void;
2687
+ setControlHighlight(payload: ISetControlHighlightOption): void;
2688
+ updateOptions(payload: IUpdateOption): void;
2689
+ getControlList(): IElement[];
2690
+ locationControl(controlId: string, options?: ILocationControlOption): void;
2691
+ insertControl(payload: IElement): void;
2692
+ jumpControl(payload?: {
2693
+ direction?: MoveDirection;
2694
+ }): void;
2695
+ getContainer(): HTMLDivElement;
2696
+ getTitleValue(payload: IGetTitleValueOption): IGetTitleValueResult | null;
2697
+ getPositionContextByEvent(evt: MouseEvent, options?: IPositionContextByEventOption): IPositionContextByEventResult | null;
2698
+ insertTitle(payload: IElement): void;
2699
+ focus(payload?: IFocusOption): void;
2700
+ insertArea(payload: IInsertAreaOption): string | null;
2701
+ setAreaValue(payload: ISetAreaValueOption): void;
2702
+ setAreaProperties(payload: ISetAreaPropertiesOption): void;
2703
+ locationArea(areaId: string, options?: ILocationAreaOption): void;
2704
+ clearGraffiti(): void;
2705
+ columnCount(payload: number): void;
2706
+ columnBreak(): void;
2707
+ columnGap(gap: number): void;
2708
+ }
2709
+
2710
+ declare class Command {
2711
+ executeMode: CommandAdapt['mode'];
2712
+ executeCut: CommandAdapt['cut'];
2713
+ executeCopy: CommandAdapt['copy'];
2714
+ executePaste: CommandAdapt['paste'];
2715
+ executeSelectAll: CommandAdapt['selectAll'];
2716
+ executeBackspace: CommandAdapt['backspace'];
2717
+ executeSetRange: CommandAdapt['setRange'];
2718
+ executeReplaceRange: CommandAdapt['replaceRange'];
2719
+ executeSetPositionContext: CommandAdapt['setPositionContext'];
2720
+ executeForceUpdate: CommandAdapt['forceUpdate'];
2721
+ executeBlur: CommandAdapt['blur'];
2722
+ executeUndo: CommandAdapt['undo'];
2723
+ executeRedo: CommandAdapt['redo'];
2724
+ executePainter: CommandAdapt['painter'];
2725
+ executeApplyPainterStyle: CommandAdapt['applyPainterStyle'];
2726
+ executeFormat: CommandAdapt['format'];
2727
+ executeFont: CommandAdapt['font'];
2728
+ executeSize: CommandAdapt['size'];
2729
+ executeSizeAdd: CommandAdapt['sizeAdd'];
2730
+ executeSizeMinus: CommandAdapt['sizeMinus'];
2731
+ executeBold: CommandAdapt['bold'];
2732
+ executeItalic: CommandAdapt['italic'];
2733
+ executeUnderline: CommandAdapt['underline'];
2734
+ executeStrikeout: CommandAdapt['strikeout'];
2735
+ executeSuperscript: CommandAdapt['superscript'];
2736
+ executeSubscript: CommandAdapt['subscript'];
2737
+ executeColor: CommandAdapt['color'];
2738
+ executeHighlight: CommandAdapt['highlight'];
2739
+ executeTitle: CommandAdapt['title'];
2740
+ executeList: CommandAdapt['list'];
2741
+ executeListWithPreset: CommandAdapt['listWithPreset'];
2742
+ executeListIndent: CommandAdapt['listIndent'];
2743
+ executeListOutdent: CommandAdapt['listOutdent'];
2744
+ executeRowFlex: CommandAdapt['rowFlex'];
2745
+ executeRowMargin: CommandAdapt['rowMargin'];
2746
+ executeInsertTable: CommandAdapt['insertTable'];
2747
+ executeInsertTableTopRow: CommandAdapt['insertTableTopRow'];
2748
+ executeInsertTableBottomRow: CommandAdapt['insertTableBottomRow'];
2749
+ executeInsertTableLeftCol: CommandAdapt['insertTableLeftCol'];
2750
+ executeInsertTableRightCol: CommandAdapt['insertTableRightCol'];
2751
+ executeDeleteTableRow: CommandAdapt['deleteTableRow'];
2752
+ executeDeleteTableCol: CommandAdapt['deleteTableCol'];
2753
+ executeDeleteTable: CommandAdapt['deleteTable'];
2754
+ executeMergeTableCell: CommandAdapt['mergeTableCell'];
2755
+ executeCancelMergeTableCell: CommandAdapt['cancelMergeTableCell'];
2756
+ executeSplitVerticalTableCell: CommandAdapt['splitVerticalTableCell'];
2757
+ executeSplitHorizontalTableCell: CommandAdapt['splitHorizontalTableCell'];
2758
+ executeTableTdVerticalAlign: CommandAdapt['tableTdVerticalAlign'];
2759
+ executeTableBorderType: CommandAdapt['tableBorderType'];
2760
+ executeTableBorderColor: CommandAdapt['tableBorderColor'];
2761
+ executeTableTdBorderType: CommandAdapt['tableTdBorderType'];
2762
+ executeTableTdSlashType: CommandAdapt['tableTdSlashType'];
2763
+ executeTableTdBackgroundColor: CommandAdapt['tableTdBackgroundColor'];
2764
+ executeTableSelectAll: CommandAdapt['tableSelectAll'];
2765
+ executeImage: CommandAdapt['image'];
2766
+ executeHyperlink: CommandAdapt['hyperlink'];
2767
+ executeDeleteHyperlink: CommandAdapt['deleteHyperlink'];
2768
+ executeCancelHyperlink: CommandAdapt['cancelHyperlink'];
2769
+ executeEditHyperlink: CommandAdapt['editHyperlink'];
2770
+ executeSeparator: CommandAdapt['separator'];
2771
+ executePageBreak: CommandAdapt['pageBreak'];
2772
+ executeAddWatermark: CommandAdapt['addWatermark'];
2773
+ executeDeleteWatermark: CommandAdapt['deleteWatermark'];
2774
+ executeSearch: CommandAdapt['search'];
2775
+ executeSearchNavigatePre: CommandAdapt['searchNavigatePre'];
2776
+ executeSearchNavigateNext: CommandAdapt['searchNavigateNext'];
2777
+ executeReplace: CommandAdapt['replace'];
2778
+ executePrint: CommandAdapt['print'];
2779
+ executeReplaceImageElement: CommandAdapt['replaceImageElement'];
2780
+ executeSaveAsImageElement: CommandAdapt['saveAsImageElement'];
2781
+ executeSetImageCrop: CommandAdapt['setImageCrop'];
2782
+ executeChangeImageDisplay: CommandAdapt['changeImageDisplay'];
2783
+ executePageMode: CommandAdapt['pageMode'];
2784
+ executePageScale: CommandAdapt['pageScale'];
2785
+ executePageScaleRecovery: CommandAdapt['pageScaleRecovery'];
2786
+ executePageScaleMinus: CommandAdapt['pageScaleMinus'];
2787
+ executePageScaleAdd: CommandAdapt['pageScaleAdd'];
2788
+ executePaperSize: CommandAdapt['paperSize'];
2789
+ executePaperDirection: CommandAdapt['paperDirection'];
2790
+ executeSetPaperMargin: CommandAdapt['setPaperMargin'];
2791
+ executeSetMainBadge: CommandAdapt['setMainBadge'];
2792
+ executeSetAreaBadge: CommandAdapt['setAreaBadge'];
2793
+ executeInsertElementList: CommandAdapt['insertElementList'];
2794
+ executeInsertArea: CommandAdapt['insertArea'];
2795
+ executeSetAreaValue: CommandAdapt['setAreaValue'];
2796
+ executeSetAreaProperties: CommandAdapt['setAreaProperties'];
2797
+ executeLocationArea: CommandAdapt['locationArea'];
2798
+ executeClearGraffiti: CommandAdapt['clearGraffiti'];
2799
+ executeColumnCount: CommandAdapt['columnCount'];
2800
+ executeColumnBreak: CommandAdapt['columnBreak'];
2801
+ executeColumnGap: CommandAdapt['columnGap'];
2802
+ executeAppendElementList: CommandAdapt['appendElementList'];
2803
+ executeUpdateElementById: CommandAdapt['updateElementById'];
2804
+ executeDeleteElementById: CommandAdapt['deleteElementById'];
2805
+ executeSetValue: CommandAdapt['setValue'];
2806
+ executeRemoveControl: CommandAdapt['removeControl'];
2807
+ executeTranslate: CommandAdapt['translate'];
2808
+ executeSetLocale: CommandAdapt['setLocale'];
2809
+ executeLocationCatalog: CommandAdapt['locationCatalog'];
2810
+ executeWordTool: CommandAdapt['wordTool'];
2811
+ executeSetHTML: CommandAdapt['setHTML'];
2812
+ executeSetGroup: CommandAdapt['setGroup'];
2813
+ executeDeleteGroup: CommandAdapt['deleteGroup'];
2814
+ executeLocationGroup: CommandAdapt['locationGroup'];
2815
+ executeSetZone: CommandAdapt['setZone'];
2816
+ executeSetControlValue: CommandAdapt['setControlValue'];
2817
+ executeSetControlValueList: CommandAdapt['setControlValueList'];
2818
+ executeSetControlExtension: CommandAdapt['setControlExtension'];
2819
+ executeSetControlExtensionList: CommandAdapt['setControlExtensionList'];
2820
+ executeSetControlProperties: CommandAdapt['setControlProperties'];
2821
+ executeSetControlPropertiesList: CommandAdapt['setControlPropertiesList'];
2822
+ executeSetControlHighlight: CommandAdapt['setControlHighlight'];
2823
+ executeLocationControl: CommandAdapt['locationControl'];
2824
+ executeInsertControl: CommandAdapt['insertControl'];
2825
+ executeJumpControl: CommandAdapt['jumpControl'];
2826
+ executeUpdateOptions: CommandAdapt['updateOptions'];
2827
+ executeInsertTitle: CommandAdapt['insertTitle'];
2828
+ executeFocus: CommandAdapt['focus'];
2829
+ getCatalog: CommandAdapt['getCatalog'];
2830
+ getImage: CommandAdapt['getImage'];
2831
+ getOptions: CommandAdapt['getOptions'];
2832
+ getValue: CommandAdapt['getValue'];
2833
+ getValueAsync: CommandAdapt['getValueAsync'];
2834
+ getAreaValue: CommandAdapt['getAreaValue'];
2835
+ getHTML: CommandAdapt['getHTML'];
2836
+ getText: CommandAdapt['getText'];
2837
+ getWordCount: CommandAdapt['getWordCount'];
2838
+ getCursorPosition: CommandAdapt['getCursorPosition'];
2839
+ getRange: CommandAdapt['getRange'];
2840
+ getRangeText: CommandAdapt['getRangeText'];
2841
+ getRangeContext: CommandAdapt['getRangeContext'];
2842
+ getRangeRow: CommandAdapt['getRangeRow'];
2843
+ getRangeParagraph: CommandAdapt['getRangeParagraph'];
2844
+ getKeywordRangeList: CommandAdapt['getKeywordRangeList'];
2845
+ getKeywordContext: CommandAdapt['getKeywordContext'];
2846
+ getPaperMargin: CommandAdapt['getPaperMargin'];
2847
+ getSearchNavigateInfo: CommandAdapt['getSearchNavigateInfo'];
2848
+ getLocale: CommandAdapt['getLocale'];
2849
+ getGroupIds: CommandAdapt['getGroupIds'];
2850
+ getControlValue: CommandAdapt['getControlValue'];
2851
+ getControlList: CommandAdapt['getControlList'];
2852
+ getContainer: CommandAdapt['getContainer'];
2853
+ getTitleValue: CommandAdapt['getTitleValue'];
2854
+ getPositionContextByEvent: CommandAdapt['getPositionContextByEvent'];
2855
+ getElementById: CommandAdapt['getElementById'];
2856
+ constructor(adapt: CommandAdapt);
2857
+ }
2858
+
2859
+ declare enum KeyMap {
2860
+ Delete = "Delete",
2861
+ Backspace = "Backspace",
2862
+ Enter = "Enter",
2863
+ Left = "ArrowLeft",
2864
+ Right = "ArrowRight",
2865
+ Up = "ArrowUp",
2866
+ Down = "ArrowDown",
2867
+ ESC = "Escape",
2868
+ TAB = "Tab",
2869
+ META = "Meta",
2870
+ LEFT_BRACKET = "[",
2871
+ RIGHT_BRACKET = "]",
2872
+ COMMA = ",",
2873
+ PERIOD = ".",
2874
+ LEFT_ANGLE_BRACKET = "<",
2875
+ RIGHT_ANGLE_BRACKET = ">",
2876
+ EQUAL = "=",
2877
+ MINUS = "-",
2878
+ PLUS = "+",
2879
+ A = "a",
2880
+ B = "b",
2881
+ C = "c",
2882
+ D = "d",
2883
+ E = "e",
2884
+ F = "f",
2885
+ G = "g",
2886
+ H = "h",
2887
+ I = "i",
2888
+ J = "j",
2889
+ K = "k",
2890
+ L = "l",
2891
+ M = "m",
2892
+ N = "n",
2893
+ O = "o",
2894
+ P = "p",
2895
+ Q = "q",
2896
+ R = "r",
2897
+ S = "s",
2898
+ T = "t",
2899
+ U = "u",
2900
+ V = "v",
2901
+ W = "w",
2902
+ X = "x",
2903
+ Y = "y",
2904
+ Z = "z",
2905
+ A_UPPERCASE = "A",
2906
+ B_UPPERCASE = "B",
2907
+ C_UPPERCASE = "C",
2908
+ D_UPPERCASE = "D",
2909
+ E_UPPERCASE = "E",
2910
+ F_UPPERCASE = "F",
2911
+ G_UPPERCASE = "G",
2912
+ H_UPPERCASE = "H",
2913
+ I_UPPERCASE = "I",
2914
+ J_UPPERCASE = "J",
2915
+ K_UPPERCASE = "K",
2916
+ L_UPPERCASE = "L",
2917
+ M_UPPERCASE = "M",
2918
+ N_UPPERCASE = "N",
2919
+ O_UPPERCASE = "O",
2920
+ P_UPPERCASE = "P",
2921
+ Q_UPPERCASE = "Q",
2922
+ R_UPPERCASE = "R",
2923
+ S_UPPERCASE = "S",
2924
+ T_UPPERCASE = "T",
2925
+ U_UPPERCASE = "U",
2926
+ V_UPPERCASE = "V",
2927
+ W_UPPERCASE = "W",
2928
+ X_UPPERCASE = "X",
2929
+ Y_UPPERCASE = "Y",
2930
+ Z_UPPERCASE = "Z",
2931
+ ZERO = "0",
2932
+ ONE = "1",
2933
+ TWO = "2",
2934
+ THREE = "3",
2935
+ FOUR = "4",
2936
+ FIVE = "5",
2937
+ SIX = "6",
2938
+ SEVEN = "7",
2939
+ EIGHT = "8",
2940
+ NINE = "9"
2941
+ }
2942
+
2943
+ interface IRegisterShortcut {
2944
+ key: KeyMap;
2945
+ ctrl?: boolean;
2946
+ meta?: boolean;
2947
+ mod?: boolean;
2948
+ shift?: boolean;
2949
+ alt?: boolean;
2950
+ isGlobal?: boolean;
2951
+ callback?: (command: Command) => void;
2952
+ disable?: boolean;
2953
+ }
2954
+
2955
+ declare class ContextMenu {
2956
+ private options;
2957
+ private draw;
2958
+ private command;
2959
+ private range;
2960
+ private position;
2961
+ private i18n;
2962
+ private container;
2963
+ private contextMenuList;
2964
+ private contextMenuContainerList;
2965
+ private contextMenuRelationShip;
2966
+ private context;
2967
+ constructor(draw: Draw, command: Command);
2968
+ getContextMenuList(): IRegisterContextMenu[];
2969
+ private _addEvent;
2970
+ removeEvent(): void;
2971
+ private _filterMenuList;
2972
+ private _proxyContextMenuEvent;
2973
+ private _handleSideEffect;
2974
+ private _getContext;
2975
+ private _createContextMenuContainer;
2976
+ private _render;
2977
+ private _removeSubMenu;
2978
+ private _setHoverStatus;
2979
+ private _formatName;
2980
+ registerContextMenuList(payload: IRegisterContextMenu[]): void;
2981
+ dispose(): void;
2982
+ }
2983
+
2984
+ declare class Shortcut {
2985
+ private command;
2986
+ private globalShortcutList;
2987
+ private agentShortcutList;
2988
+ constructor(draw: Draw, command: Command);
2989
+ private _addEvent;
2990
+ removeEvent(): void;
2991
+ private _addShortcutList;
2992
+ registerShortcutList(payload: IRegisterShortcut[]): void;
2993
+ private _globalKeydown;
2994
+ private _agentKeydown;
2995
+ private _execute;
2996
+ }
2997
+
2998
+ interface IRegisterPayload {
2999
+ contextMenu: ContextMenu;
3000
+ shortcut: Shortcut;
3001
+ i18n: I18n;
3002
+ }
3003
+ declare class Register {
3004
+ contextMenuList: (payload: IRegisterContextMenu[]) => void;
3005
+ getContextMenuList: () => IRegisterContextMenu[];
3006
+ shortcutList: (payload: IRegisterShortcut[]) => void;
3007
+ langMap: (locale: string, lang: DeepPartial<ILang>) => void;
3008
+ constructor(payload: IRegisterPayload);
3009
+ }
3010
+
3011
+ declare const EDITOR_COMPONENT = "editor-component";
3012
+ declare const EDITOR_CLIPBOARD = "ce-clipboard";
3013
+
3014
+ type PluginFunction<Options> = (editor: Editor, options?: Options) => void;
3015
+ type UsePlugin = <Options>(pluginFunction: PluginFunction<Options>, options?: Options) => void;
3016
+
3017
+ declare const LETTER_CLASS: {
3018
+ ENGLISH: string;
3019
+ SPANISH: string;
3020
+ FRENCH: string;
3021
+ GERMAN: string;
3022
+ RUSSIAN: string;
3023
+ PORTUGUESE: string;
3024
+ ITALIAN: string;
3025
+ DUTCH: string;
3026
+ SWEDISH: string;
3027
+ GREEK: string;
3028
+ };
3029
+
3030
+ declare const INTERNAL_CONTEXT_MENU_KEY: {
3031
+ GLOBAL: {
3032
+ CUT: string;
3033
+ COPY: string;
3034
+ PASTE: string;
3035
+ SELECT_ALL: string;
3036
+ PRINT: string;
3037
+ };
3038
+ CONTROL: {
3039
+ DELETE: string;
3040
+ };
3041
+ HYPERLINK: {
3042
+ DELETE: string;
3043
+ CANCEL: string;
3044
+ EDIT: string;
3045
+ };
3046
+ IMAGE: {
3047
+ CHANGE: string;
3048
+ SAVE_AS: string;
3049
+ TEXT_WRAP: string;
3050
+ TEXT_WRAP_EMBED: string;
3051
+ TEXT_WRAP_UP_DOWN: string;
3052
+ TEXT_WRAP_SURROUND: string;
3053
+ TEXT_WRAP_FLOAT_TOP: string;
3054
+ TEXT_WRAP_FLOAT_BOTTOM: string;
3055
+ };
3056
+ TABLE: {
3057
+ BORDER: string;
3058
+ BORDER_ALL: string;
3059
+ BORDER_EMPTY: string;
3060
+ BORDER_DASH: string;
3061
+ BORDER_EXTERNAL: string;
3062
+ BORDER_INTERNAL: string;
3063
+ BORDER_TD: string;
3064
+ BORDER_TD_TOP: string;
3065
+ BORDER_TD_RIGHT: string;
3066
+ BORDER_TD_BOTTOM: string;
3067
+ BORDER_TD_LEFT: string;
3068
+ BORDER_TD_FORWARD: string;
3069
+ BORDER_TD_BACK: string;
3070
+ VERTICAL_ALIGN: string;
3071
+ VERTICAL_ALIGN_TOP: string;
3072
+ VERTICAL_ALIGN_MIDDLE: string;
3073
+ VERTICAL_ALIGN_BOTTOM: string;
3074
+ INSERT_ROW_COL: string;
3075
+ INSERT_TOP_ROW: string;
3076
+ INSERT_BOTTOM_ROW: string;
3077
+ INSERT_LEFT_COL: string;
3078
+ INSERT_RIGHT_COL: string;
3079
+ DELETE_ROW_COL: string;
3080
+ DELETE_ROW: string;
3081
+ DELETE_COL: string;
3082
+ DELETE_TABLE: string;
3083
+ MERGE_CELL: string;
3084
+ CANCEL_MERGE_CELL: string;
3085
+ };
3086
+ };
3087
+
3088
+ declare function splitText(text: string): string[];
3089
+
3090
+ declare function createDomFromElementList(elementList: IElement[], options?: IEditorOption): HTMLDivElement;
3091
+ interface IGetElementListByHTMLOption {
3092
+ innerWidth: number;
3093
+ }
3094
+ declare function getElementListByHTML(htmlText: string, options: IGetElementListByHTMLOption): IElement[];
3095
+ declare function getTextFromElementList(elementList: IElement[]): string;
3096
+
3097
+ declare const INTERNAL_SHORTCUT_KEY: {
3098
+ PAGE_SCALE: string;
3099
+ };
3100
+
3101
+ interface IDialogData {
3102
+ type: string;
3103
+ label?: string;
3104
+ name: string;
3105
+ value?: string;
3106
+ options?: {
3107
+ label: string;
3108
+ value: string;
3109
+ }[];
3110
+ placeholder?: string;
3111
+ width?: number;
3112
+ height?: number;
3113
+ required?: boolean;
3114
+ step?: string;
3115
+ }
3116
+ interface IDialogConfirm {
3117
+ name: string;
3118
+ value: string;
3119
+ }
3120
+ interface IDialogOptions {
3121
+ onClose?: () => void;
3122
+ onCancel?: () => void;
3123
+ onConfirm?: (payload: IDialogConfirm[]) => void;
3124
+ title: string;
3125
+ data: IDialogData[];
3126
+ }
3127
+ declare class Dialog {
3128
+ private options;
3129
+ private mask;
3130
+ private container;
3131
+ private inputList;
3132
+ constructor(options: IDialogOptions);
3133
+ private _render;
3134
+ private _dispose;
3135
+ }
3136
+
3137
+ interface ISignatureResult {
3138
+ value: string;
3139
+ width: number;
3140
+ height: number;
3141
+ }
3142
+ interface ISignatureOptions {
3143
+ width?: number;
3144
+ height?: number;
3145
+ onClose?: () => void;
3146
+ onCancel?: () => void;
3147
+ onConfirm?: (payload: ISignatureResult | null) => void;
3148
+ }
3149
+ declare class Signature {
3150
+ private readonly MAX_RECORD_COUNT;
3151
+ private readonly DEFAULT_WIDTH;
3152
+ private readonly DEFAULT_HEIGHT;
3153
+ private undoStack;
3154
+ private x;
3155
+ private y;
3156
+ private isDrawing;
3157
+ private isDrawn;
3158
+ private linePoints;
3159
+ private canvasWidth;
3160
+ private canvasHeight;
3161
+ private options;
3162
+ private mask;
3163
+ private container;
3164
+ private trashContainer;
3165
+ private undoContainer;
3166
+ private canvas;
3167
+ private ctx;
3168
+ private preTimeStamp;
3169
+ private dpr;
3170
+ constructor(options: ISignatureOptions);
3171
+ private _render;
3172
+ private _bindEvent;
3173
+ private _undo;
3174
+ private _saveUndoFn;
3175
+ private _clearUndoFn;
3176
+ private _clearCanvas;
3177
+ private _startDraw;
3178
+ private _draw;
3179
+ private _stopDraw;
3180
+ private _toData;
3181
+ private registerTouchmove;
3182
+ private registerTouchstart;
3183
+ private registerTouchend;
3184
+ private registerTouchEvent;
3185
+ private _dispose;
3186
+ }
3187
+
3188
+ declare class Editor {
3189
+ command: Command;
3190
+ version: string;
3191
+ listener: Listener;
3192
+ eventBus: EventBus<EventBusMap>;
3193
+ override: Override;
3194
+ register: Register;
3195
+ destroy: () => void;
3196
+ use: UsePlugin;
3197
+ constructor(container: HTMLDivElement, data: IEditorData | IElement[], options?: IEditorOption);
3198
+ }
3199
+
3200
+ export { AreaMode, BackgroundRepeat, BackgroundSize, BlockType, Command, ControlComponent, ControlIndentation, ControlState, ControlType, Dialog, EDITOR_CLIPBOARD, EDITOR_COMPONENT, Editor, EditorComponent, EditorMode, EditorZone, ElementType, FlexDirection, type IBadge, type IBlock, type ICatalog, type ICatalogItem, type IContextMenuContext, type IEditorData, type IEditorOption, type IEditorResult, type IElement, type IGetElementListByHTMLOption, type ILang, INTERNAL_CONTEXT_MENU_KEY, INTERNAL_SHORTCUT_KEY, type INavigateInfo, type IRange, type IRangeStyle, type IRegisterContextMenu, type IWatermark, ImageDisplay, KeyMap, LETTER_CLASS, LineNumberType, ListStyle, ListType, LocationPosition, MaxHeightRatio, NumberType, OlPreset, PageMode, PaperDirection, RenderMode, RowFlex, Signature, TableBorder, TdBorder, TdSlash, TextDecorationStyle, TitleLevel, UlPreset, VerticalAlign, WatermarkType, WordBreak, createDomFromElementList, Editor as default, getElementListByHTML, getTextFromElementList, splitText };