@hufe921/canvas-editor 0.9.14 → 0.9.16

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 (128) hide show
  1. package/LICENSE +20 -20
  2. package/README.md +54 -54
  3. package/dist/canvas-editor.es.js +155 -50
  4. package/dist/canvas-editor.es.js.map +1 -1
  5. package/dist/canvas-editor.umd.js +9 -9
  6. package/dist/canvas-editor.umd.js.map +1 -1
  7. package/dist/src/editor/core/command/Command.d.ts +150 -150
  8. package/dist/src/editor/core/command/CommandAdapt.d.ts +93 -93
  9. package/dist/src/editor/core/contextmenu/ContextMenu.d.ts +28 -28
  10. package/dist/src/editor/core/contextmenu/menus/controlMenus.d.ts +2 -2
  11. package/dist/src/editor/core/contextmenu/menus/globalMenus.d.ts +2 -2
  12. package/dist/src/editor/core/contextmenu/menus/hyperlinkMenus.d.ts +2 -2
  13. package/dist/src/editor/core/contextmenu/menus/imageMenus.d.ts +2 -2
  14. package/dist/src/editor/core/contextmenu/menus/tableMenus.d.ts +2 -2
  15. package/dist/src/editor/core/cursor/Cursor.d.ts +17 -15
  16. package/dist/src/editor/core/cursor/CursorAgent.d.ts +15 -15
  17. package/dist/src/editor/core/draw/Draw.d.ts +143 -142
  18. package/dist/src/editor/core/draw/control/Control.d.ts +35 -35
  19. package/dist/src/editor/core/draw/control/checkbox/CheckboxControl.d.ts +15 -15
  20. package/dist/src/editor/core/draw/control/select/SelectControl.d.ts +21 -21
  21. package/dist/src/editor/core/draw/control/text/TextControl.d.ts +13 -13
  22. package/dist/src/editor/core/draw/frame/Background.d.ts +6 -6
  23. package/dist/src/editor/core/draw/frame/Header.d.ts +7 -7
  24. package/dist/src/editor/core/draw/frame/Margin.d.ts +7 -7
  25. package/dist/src/editor/core/draw/frame/PageNumber.d.ts +7 -7
  26. package/dist/src/editor/core/draw/frame/Watermark.d.ts +7 -7
  27. package/dist/src/editor/core/draw/interactive/Search.d.ts +26 -26
  28. package/dist/src/editor/core/draw/particle/CheckboxParticle.d.ts +7 -7
  29. package/dist/src/editor/core/draw/particle/HyperlinkParticle.d.ts +16 -16
  30. package/dist/src/editor/core/draw/particle/ImageParticle.d.ts +9 -9
  31. package/dist/src/editor/core/draw/particle/PageBreak.d.ts +12 -12
  32. package/dist/src/editor/core/draw/particle/Separator.d.ts +4 -4
  33. package/dist/src/editor/core/draw/particle/Subscript.d.ts +4 -4
  34. package/dist/src/editor/core/draw/particle/Superscript.d.ts +4 -4
  35. package/dist/src/editor/core/draw/particle/TextParticle.d.ts +18 -18
  36. package/dist/src/editor/core/draw/particle/block/BlockParticle.d.ts +14 -14
  37. package/dist/src/editor/core/draw/particle/block/modules/BaseBlock.d.ts +15 -15
  38. package/dist/src/editor/core/draw/particle/block/modules/IFrameBlock.d.ts +7 -7
  39. package/dist/src/editor/core/draw/particle/block/modules/VideoBlock.d.ts +6 -6
  40. package/dist/src/editor/core/draw/particle/date/DateParticle.d.ts +14 -14
  41. package/dist/src/editor/core/draw/particle/date/DatePicker.d.ts +64 -64
  42. package/dist/src/editor/core/draw/particle/latex/LaTexParticle.d.ts +7 -7
  43. package/dist/src/editor/core/draw/particle/latex/utils/LaTexUtils.d.ts +47 -47
  44. package/dist/src/editor/core/draw/particle/latex/utils/hershey.d.ts +10 -10
  45. package/dist/src/editor/core/draw/particle/latex/utils/symbols.d.ts +8 -8
  46. package/dist/src/editor/core/draw/particle/previewer/Previewer.d.ts +34 -34
  47. package/dist/src/editor/core/draw/particle/table/TableParticle.d.ts +11 -11
  48. package/dist/src/editor/core/draw/particle/table/TableTool.d.ts +22 -22
  49. package/dist/src/editor/core/draw/richtext/AbstractRichText.d.ts +14 -14
  50. package/dist/src/editor/core/draw/richtext/Highlight.d.ts +7 -7
  51. package/dist/src/editor/core/draw/richtext/Strikeout.d.ts +7 -7
  52. package/dist/src/editor/core/draw/richtext/Underline.d.ts +7 -7
  53. package/dist/src/editor/core/event/CanvasEvent.d.ts +48 -41
  54. package/dist/src/editor/core/event/GlobalEvent.d.ts +26 -24
  55. package/dist/src/editor/core/event/handlers/click.d.ts +8 -8
  56. package/dist/src/editor/core/event/handlers/composition.d.ts +8 -8
  57. package/dist/src/editor/core/event/handlers/copy.d.ts +2 -2
  58. package/dist/src/editor/core/event/handlers/cut.d.ts +2 -2
  59. package/dist/src/editor/core/event/handlers/drag.d.ts +6 -6
  60. package/dist/src/editor/core/event/handlers/drop.d.ts +2 -2
  61. package/dist/src/editor/core/event/handlers/input.d.ts +3 -2
  62. package/dist/src/editor/core/event/handlers/keydown.d.ts +2 -2
  63. package/dist/src/editor/core/event/handlers/mousedown.d.ts +2 -2
  64. package/dist/src/editor/core/event/handlers/mouseleave.d.ts +2 -2
  65. package/dist/src/editor/core/event/handlers/mousemove.d.ts +2 -2
  66. package/dist/src/editor/core/event/handlers/mouseup.d.ts +2 -2
  67. package/dist/src/editor/core/history/HistoryManager.d.ts +10 -10
  68. package/dist/src/editor/core/i18n/I18n.d.ts +10 -9
  69. package/dist/src/editor/core/listener/Listener.d.ts +13 -13
  70. package/dist/src/editor/core/observer/ScrollObserver.d.ts +11 -11
  71. package/dist/src/editor/core/observer/SelectionObserver.d.ts +18 -18
  72. package/dist/src/editor/core/position/Position.d.ts +20 -20
  73. package/dist/src/editor/core/range/RangeManager.d.ts +22 -22
  74. package/dist/src/editor/core/register/Register.d.ts +19 -18
  75. package/dist/src/editor/core/shortcut/Shortcut.d.ts +16 -16
  76. package/dist/src/editor/core/shortcut/keys/richtextKeys.d.ts +2 -2
  77. package/dist/src/editor/core/worker/WorkerManager.d.ts +7 -7
  78. package/dist/src/editor/core/worker/works/wordCount.d.ts +1 -1
  79. package/dist/src/editor/dataset/constant/Checkbox.d.ts +2 -2
  80. package/dist/src/editor/dataset/constant/Common.d.ts +4 -4
  81. package/dist/src/editor/dataset/constant/ContextMenu.d.ts +3 -3
  82. package/dist/src/editor/dataset/constant/Control.d.ts +2 -2
  83. package/dist/src/editor/dataset/constant/Cursor.d.ts +1 -1
  84. package/dist/src/editor/dataset/constant/Editor.d.ts +2 -2
  85. package/dist/src/editor/dataset/constant/Element.d.ts +6 -6
  86. package/dist/src/editor/dataset/constant/Header.d.ts +2 -2
  87. package/dist/src/editor/dataset/constant/Regular.d.ts +4 -4
  88. package/dist/src/editor/dataset/constant/Watermark.d.ts +2 -2
  89. package/dist/src/editor/dataset/enum/Block.d.ts +4 -4
  90. package/dist/src/editor/dataset/enum/Control.d.ts +16 -16
  91. package/dist/src/editor/dataset/enum/Editor.d.ts +21 -21
  92. package/dist/src/editor/dataset/enum/Element.d.ts +16 -16
  93. package/dist/src/editor/dataset/enum/ElementStyle.d.ts +12 -12
  94. package/dist/src/editor/dataset/enum/Event.d.ts +5 -5
  95. package/dist/src/editor/dataset/enum/KeyMap.d.ts +83 -82
  96. package/dist/src/editor/dataset/enum/Observer.d.ts +6 -6
  97. package/dist/src/editor/dataset/enum/Row.d.ts +6 -6
  98. package/dist/src/editor/dataset/enum/table/TableTool.d.ts +4 -4
  99. package/dist/src/editor/index.d.ts +27 -27
  100. package/dist/src/editor/interface/Block.d.ts +12 -12
  101. package/dist/src/editor/interface/Checkbox.d.ts +13 -13
  102. package/dist/src/editor/interface/Common.d.ts +8 -5
  103. package/dist/src/editor/interface/Control.d.ts +50 -50
  104. package/dist/src/editor/interface/Draw.d.ts +30 -30
  105. package/dist/src/editor/interface/Editor.d.ts +55 -55
  106. package/dist/src/editor/interface/Element.d.ts +99 -99
  107. package/dist/src/editor/interface/Header.d.ts +6 -6
  108. package/dist/src/editor/interface/Listener.d.ts +29 -29
  109. package/dist/src/editor/interface/Margin.d.ts +1 -1
  110. package/dist/src/editor/interface/Position.d.ts +37 -37
  111. package/dist/src/editor/interface/Previewer.d.ts +11 -11
  112. package/dist/src/editor/interface/Range.d.ts +11 -11
  113. package/dist/src/editor/interface/Row.d.ts +14 -14
  114. package/dist/src/editor/interface/Search.d.ts +14 -14
  115. package/dist/src/editor/interface/Watermark.d.ts +7 -7
  116. package/dist/src/editor/interface/contextmenu/ContextMenu.d.ts +60 -60
  117. package/dist/src/editor/interface/i18n/I18n.d.ts +6 -6
  118. package/dist/src/editor/interface/shortcut/Shortcut.d.ts +12 -10
  119. package/dist/src/editor/interface/table/Colgroup.d.ts +4 -4
  120. package/dist/src/editor/interface/table/Td.d.ts +19 -19
  121. package/dist/src/editor/interface/table/Tr.d.ts +6 -6
  122. package/dist/src/editor/utils/clipboard.d.ts +9 -9
  123. package/dist/src/editor/utils/element.d.ts +11 -11
  124. package/dist/src/editor/utils/hotkey.d.ts +1 -0
  125. package/dist/src/editor/utils/index.d.ts +11 -8
  126. package/dist/src/editor/utils/print.d.ts +1 -1
  127. package/dist/src/editor/utils/ua.d.ts +1 -0
  128. package/package.json +64 -64
@@ -1,9 +1,9 @@
1
- import { IEditorOption } from '../../../interface/Editor';
2
- import { IElement } from '../../../interface/Element';
3
- import { Draw } from '../Draw';
4
- export declare class ImageParticle {
5
- protected options: Required<IEditorOption>;
6
- protected imageCache: Map<string, HTMLImageElement>;
7
- constructor(draw: Draw);
8
- render(ctx: CanvasRenderingContext2D, element: IElement, x: number, y: number): void;
9
- }
1
+ import { IEditorOption } from '../../../interface/Editor';
2
+ import { IElement } from '../../../interface/Element';
3
+ import { Draw } from '../Draw';
4
+ export declare class ImageParticle {
5
+ protected options: Required<IEditorOption>;
6
+ protected imageCache: Map<string, HTMLImageElement>;
7
+ constructor(draw: Draw);
8
+ render(ctx: CanvasRenderingContext2D, element: IElement, x: number, y: number): void;
9
+ }
@@ -1,12 +1,12 @@
1
- import { IRowElement } from '../../../interface/Row';
2
- import { Draw } from '../Draw';
3
- export declare class PageBreakParticle {
4
- static readonly font: string;
5
- static readonly fontSize: number;
6
- static readonly displayName: string;
7
- static readonly lineDash: number[];
8
- private draw;
9
- private options;
10
- constructor(draw: Draw);
11
- render(ctx: CanvasRenderingContext2D, element: IRowElement, x: number, y: number): void;
12
- }
1
+ import { IRowElement } from '../../../interface/Row';
2
+ import { Draw } from '../Draw';
3
+ export declare class PageBreakParticle {
4
+ static readonly font: string;
5
+ static readonly fontSize: number;
6
+ static readonly displayName: string;
7
+ static readonly lineDash: number[];
8
+ private draw;
9
+ private options;
10
+ constructor(draw: Draw);
11
+ render(ctx: CanvasRenderingContext2D, element: IRowElement, x: number, y: number): void;
12
+ }
@@ -1,4 +1,4 @@
1
- import { IRowElement } from '../../../interface/Row';
2
- export declare class SeparatorParticle {
3
- render(ctx: CanvasRenderingContext2D, element: IRowElement, x: number, y: number): void;
4
- }
1
+ import { IRowElement } from '../../../interface/Row';
2
+ export declare class SeparatorParticle {
3
+ render(ctx: CanvasRenderingContext2D, element: IRowElement, x: number, y: number): void;
4
+ }
@@ -1,4 +1,4 @@
1
- import { IRowElement } from '../../../interface/Row';
2
- export declare class SubscriptParticle {
3
- render(ctx: CanvasRenderingContext2D, element: IRowElement, x: number, y: number): void;
4
- }
1
+ import { IRowElement } from '../../../interface/Row';
2
+ export declare class SubscriptParticle {
3
+ render(ctx: CanvasRenderingContext2D, element: IRowElement, x: number, y: number): void;
4
+ }
@@ -1,4 +1,4 @@
1
- import { IRowElement } from '../../../interface/Row';
2
- export declare class SuperscriptParticle {
3
- render(ctx: CanvasRenderingContext2D, element: IRowElement, x: number, y: number): void;
4
- }
1
+ import { IRowElement } from '../../../interface/Row';
2
+ export declare class SuperscriptParticle {
3
+ render(ctx: CanvasRenderingContext2D, element: IRowElement, x: number, y: number): void;
4
+ }
@@ -1,18 +1,18 @@
1
- import { IElement } from '../../..';
2
- import { IRowElement } from '../../../interface/Row';
3
- import { Draw } from '../Draw';
4
- export declare class TextParticle {
5
- private ctx;
6
- private curX;
7
- private curY;
8
- private text;
9
- private curStyle;
10
- private curColor?;
11
- cacheMeasureText: Map<string, TextMetrics>;
12
- constructor(draw: Draw);
13
- measureText(ctx: CanvasRenderingContext2D, element: IElement): TextMetrics;
14
- complete(): void;
15
- record(ctx: CanvasRenderingContext2D, element: IRowElement, x: number, y: number): void;
16
- private _setCurXY;
17
- private _render;
18
- }
1
+ import { IElement } from '../../..';
2
+ import { IRowElement } from '../../../interface/Row';
3
+ import { Draw } from '../Draw';
4
+ export declare class TextParticle {
5
+ private ctx;
6
+ private curX;
7
+ private curY;
8
+ private text;
9
+ private curStyle;
10
+ private curColor?;
11
+ cacheMeasureText: Map<string, TextMetrics>;
12
+ constructor(draw: Draw);
13
+ measureText(ctx: CanvasRenderingContext2D, element: IElement): TextMetrics;
14
+ complete(): void;
15
+ record(ctx: CanvasRenderingContext2D, element: IRowElement, x: number, y: number): void;
16
+ private _setCurXY;
17
+ private _render;
18
+ }
@@ -1,14 +1,14 @@
1
- import { IRowElement } from '../../../../interface/Row';
2
- import { Draw } from '../../Draw';
3
- export declare class BlockParticle {
4
- private draw;
5
- private container;
6
- private blockContainer;
7
- private blockMap;
8
- constructor(draw: Draw);
9
- private _createBlockContainer;
10
- getDraw(): Draw;
11
- getBlockContainer(): HTMLDivElement;
12
- render(pageNo: number, element: IRowElement, x: number, y: number): void;
13
- clear(): void;
14
- }
1
+ import { IRowElement } from '../../../../interface/Row';
2
+ import { Draw } from '../../Draw';
3
+ export declare class BlockParticle {
4
+ private draw;
5
+ private container;
6
+ private blockContainer;
7
+ private blockMap;
8
+ constructor(draw: Draw);
9
+ private _createBlockContainer;
10
+ getDraw(): Draw;
11
+ getBlockContainer(): HTMLDivElement;
12
+ render(pageNo: number, element: IRowElement, x: number, y: number): void;
13
+ clear(): void;
14
+ }
@@ -1,15 +1,15 @@
1
- import { IRowElement } from '../../../../../interface/Row';
2
- import { BlockParticle } from '../BlockParticle';
3
- export declare class BaseBlock {
4
- private draw;
5
- private element;
6
- private block;
7
- private blockContainer;
8
- private blockItem;
9
- constructor(blockParticle: BlockParticle, element: IRowElement);
10
- getBlockElement(): IRowElement;
11
- private _createBlockItem;
12
- render(): void;
13
- setClientRects(pageNo: number, x: number, y: number): void;
14
- remove(): void;
15
- }
1
+ import { IRowElement } from '../../../../../interface/Row';
2
+ import { BlockParticle } from '../BlockParticle';
3
+ export declare class BaseBlock {
4
+ private draw;
5
+ private element;
6
+ private block;
7
+ private blockContainer;
8
+ private blockItem;
9
+ constructor(blockParticle: BlockParticle, element: IRowElement);
10
+ getBlockElement(): IRowElement;
11
+ private _createBlockItem;
12
+ render(): void;
13
+ setClientRects(pageNo: number, x: number, y: number): void;
14
+ remove(): void;
15
+ }
@@ -1,7 +1,7 @@
1
- import { IRowElement } from '../../../../../interface/Row';
2
- export declare class IFrameBlock {
3
- private static readonly sandbox;
4
- private element;
5
- constructor(element: IRowElement);
6
- render(blockItemContainer: HTMLDivElement): void;
7
- }
1
+ import { IRowElement } from '../../../../../interface/Row';
2
+ export declare class IFrameBlock {
3
+ private static readonly sandbox;
4
+ private element;
5
+ constructor(element: IRowElement);
6
+ render(blockItemContainer: HTMLDivElement): void;
7
+ }
@@ -1,6 +1,6 @@
1
- import { IRowElement } from '../../../../../interface/Row';
2
- export declare class VideoBlock {
3
- private element;
4
- constructor(element: IRowElement);
5
- render(blockItemContainer: HTMLDivElement): void;
6
- }
1
+ import { IRowElement } from '../../../../../interface/Row';
2
+ export declare class VideoBlock {
3
+ private element;
4
+ constructor(element: IRowElement);
5
+ render(blockItemContainer: HTMLDivElement): void;
6
+ }
@@ -1,14 +1,14 @@
1
- import { IElement, IElementPosition } from '../../../../interface/Element';
2
- import { IRowElement } from '../../../../interface/Row';
3
- import { Draw } from '../../Draw';
4
- export declare class DateParticle {
5
- private draw;
6
- private range;
7
- private datePicker;
8
- constructor(draw: Draw);
9
- private _setValue;
10
- getDateElementRange(): [number, number] | null;
11
- clearDatePicker(): void;
12
- renderDatePicker(element: IElement, position: IElementPosition): void;
13
- render(ctx: CanvasRenderingContext2D, element: IRowElement, x: number, y: number): void;
14
- }
1
+ import { IElement, IElementPosition } from '../../../../interface/Element';
2
+ import { IRowElement } from '../../../../interface/Row';
3
+ import { Draw } from '../../Draw';
4
+ export declare class DateParticle {
5
+ private draw;
6
+ private range;
7
+ private datePicker;
8
+ constructor(draw: Draw);
9
+ private _setValue;
10
+ getDateElementRange(): [number, number] | null;
11
+ clearDatePicker(): void;
12
+ renderDatePicker(element: IElement, position: IElementPosition): void;
13
+ render(ctx: CanvasRenderingContext2D, element: IRowElement, x: number, y: number): void;
14
+ }
@@ -1,64 +1,64 @@
1
- import { IElement, IElementPosition } from '../../../../interface/Element';
2
- export interface IDatePickerLang {
3
- now: string;
4
- confirm: string;
5
- return: string;
6
- timeSelect: string;
7
- weeks: {
8
- sun: string;
9
- mon: string;
10
- tue: string;
11
- wed: string;
12
- thu: string;
13
- fri: string;
14
- sat: string;
15
- };
16
- year: string;
17
- month: string;
18
- hour: string;
19
- minute: string;
20
- second: string;
21
- }
22
- export interface IDatePickerOption {
23
- mountDom?: HTMLElement;
24
- onSubmit?: (date: string) => any;
25
- getLang?: () => IDatePickerLang;
26
- }
27
- interface IRenderOption {
28
- value: string;
29
- element: IElement;
30
- position: IElementPosition;
31
- startTop?: number;
32
- }
33
- export declare class DatePicker {
34
- private options;
35
- private now;
36
- private dom;
37
- private renderOptions;
38
- private isDatePicker;
39
- private pickDate;
40
- private lang;
41
- constructor(options?: IDatePickerOption);
42
- private _createDom;
43
- private _bindEvent;
44
- private _setPosition;
45
- isInvalidDate(value: Date): boolean;
46
- private _setValue;
47
- private _setLang;
48
- private _update;
49
- private _toggleDateTimePicker;
50
- private _setDatePick;
51
- private _setTimePick;
52
- private _scrollIntoView;
53
- private _preMonth;
54
- private _nextMonth;
55
- private _preYear;
56
- private _nextYear;
57
- private _now;
58
- private _toggleVisible;
59
- private _submit;
60
- formatDate(date: Date, format?: string): string;
61
- render(option: IRenderOption): void;
62
- dispose(): void;
63
- }
64
- export {};
1
+ import { IElement, IElementPosition } from '../../../../interface/Element';
2
+ export interface IDatePickerLang {
3
+ now: string;
4
+ confirm: string;
5
+ return: string;
6
+ timeSelect: string;
7
+ weeks: {
8
+ sun: string;
9
+ mon: string;
10
+ tue: string;
11
+ wed: string;
12
+ thu: string;
13
+ fri: string;
14
+ sat: string;
15
+ };
16
+ year: string;
17
+ month: string;
18
+ hour: string;
19
+ minute: string;
20
+ second: string;
21
+ }
22
+ export interface IDatePickerOption {
23
+ mountDom?: HTMLElement;
24
+ onSubmit?: (date: string) => any;
25
+ getLang?: () => IDatePickerLang;
26
+ }
27
+ interface IRenderOption {
28
+ value: string;
29
+ element: IElement;
30
+ position: IElementPosition;
31
+ startTop?: number;
32
+ }
33
+ export declare class DatePicker {
34
+ private options;
35
+ private now;
36
+ private dom;
37
+ private renderOptions;
38
+ private isDatePicker;
39
+ private pickDate;
40
+ private lang;
41
+ constructor(options?: IDatePickerOption);
42
+ private _createDom;
43
+ private _bindEvent;
44
+ private _setPosition;
45
+ isInvalidDate(value: Date): boolean;
46
+ private _setValue;
47
+ private _setLang;
48
+ private _update;
49
+ private _toggleDateTimePicker;
50
+ private _setDatePick;
51
+ private _setTimePick;
52
+ private _scrollIntoView;
53
+ private _preMonth;
54
+ private _nextMonth;
55
+ private _preYear;
56
+ private _nextYear;
57
+ private _now;
58
+ private _toggleVisible;
59
+ private _submit;
60
+ formatDate(date: Date, format?: string): string;
61
+ render(option: IRenderOption): void;
62
+ dispose(): void;
63
+ }
64
+ export {};
@@ -1,7 +1,7 @@
1
- import { IElement } from '../../../../interface/Element';
2
- import { ImageParticle } from '../ImageParticle';
3
- import { LaTexSVG } from './utils/LaTexUtils';
4
- export declare class LaTexParticle extends ImageParticle {
5
- static convertLaTextToSVG(laTex: string): LaTexSVG;
6
- render(ctx: CanvasRenderingContext2D, element: IElement, x: number, y: number): void;
7
- }
1
+ import { IElement } from '../../../../interface/Element';
2
+ import { ImageParticle } from '../ImageParticle';
3
+ import { LaTexSVG } from './utils/LaTexUtils';
4
+ export declare class LaTexParticle extends ImageParticle {
5
+ static convertLaTextToSVG(laTex: string): LaTexSVG;
6
+ render(ctx: CanvasRenderingContext2D, element: IElement, x: number, y: number): void;
7
+ }
@@ -1,47 +1,47 @@
1
- declare const CONFIG: Record<string, number>;
2
- interface Bbox {
3
- x: number;
4
- y: number;
5
- w: number;
6
- h: number;
7
- }
8
- interface Expr {
9
- type: string;
10
- text: string;
11
- mode: string;
12
- chld: Expr[];
13
- bbox: Bbox;
14
- }
15
- interface ExportOpt {
16
- MIN_CHAR_H?: number;
17
- MAX_W?: number;
18
- MAX_H?: number;
19
- MARGIN_X?: number;
20
- MARGIN_Y?: number;
21
- SCALE_X?: number;
22
- SCALE_Y?: number;
23
- STROKE_W?: number;
24
- FG_COLOR?: string;
25
- BG_COLOR?: string;
26
- }
27
- export interface LaTexSVG {
28
- svg: string;
29
- width: number;
30
- height: number;
31
- }
32
- export declare class LaTexUtils {
33
- _latex: string;
34
- _tree: Expr;
35
- _tokens: string[];
36
- _polylines: number[][][];
37
- constructor(latex: string);
38
- private resolveScale;
39
- polylines(opt?: ExportOpt): number[][][];
40
- pathd(opt?: ExportOpt): string;
41
- svg(opt: ExportOpt): LaTexSVG;
42
- pdf(opt: ExportOpt): string;
43
- boxes(opt: ExportOpt): Bbox[];
44
- box(opt: ExportOpt): Bbox;
45
- }
46
- declare const _impl: Record<string, Function>;
47
- export { CONFIG, _impl };
1
+ declare const CONFIG: Record<string, number>;
2
+ interface Bbox {
3
+ x: number;
4
+ y: number;
5
+ w: number;
6
+ h: number;
7
+ }
8
+ interface Expr {
9
+ type: string;
10
+ text: string;
11
+ mode: string;
12
+ chld: Expr[];
13
+ bbox: Bbox;
14
+ }
15
+ interface ExportOpt {
16
+ MIN_CHAR_H?: number;
17
+ MAX_W?: number;
18
+ MAX_H?: number;
19
+ MARGIN_X?: number;
20
+ MARGIN_Y?: number;
21
+ SCALE_X?: number;
22
+ SCALE_Y?: number;
23
+ STROKE_W?: number;
24
+ FG_COLOR?: string;
25
+ BG_COLOR?: string;
26
+ }
27
+ export interface LaTexSVG {
28
+ svg: string;
29
+ width: number;
30
+ height: number;
31
+ }
32
+ export declare class LaTexUtils {
33
+ _latex: string;
34
+ _tree: Expr;
35
+ _tokens: string[];
36
+ _polylines: number[][][];
37
+ constructor(latex: string);
38
+ private resolveScale;
39
+ polylines(opt?: ExportOpt): number[][][];
40
+ pathd(opt?: ExportOpt): string;
41
+ svg(opt: ExportOpt): LaTexSVG;
42
+ pdf(opt: ExportOpt): string;
43
+ boxes(opt: ExportOpt): Bbox[];
44
+ box(opt: ExportOpt): Bbox;
45
+ }
46
+ declare const _impl: Record<string, Function>;
47
+ export { CONFIG, _impl };
@@ -1,10 +1,10 @@
1
- interface HersheyEntry {
2
- w: number;
3
- xmin: number;
4
- xmax: number;
5
- ymin: number;
6
- ymax: number;
7
- polylines: Array<Array<Array<number>>>;
8
- }
9
- export declare function HERSHEY(i: number): HersheyEntry;
10
- export {};
1
+ interface HersheyEntry {
2
+ w: number;
3
+ xmin: number;
4
+ xmax: number;
5
+ ymin: number;
6
+ ymax: number;
7
+ polylines: Array<Array<Array<number>>>;
8
+ }
9
+ export declare function HERSHEY(i: number): HersheyEntry;
10
+ export {};
@@ -1,8 +1,8 @@
1
- export interface Symb {
2
- glyph: number;
3
- arity?: number;
4
- flags: Record<string, boolean>;
5
- }
6
- declare const SYMB: Record<string, Symb>;
7
- export { SYMB };
8
- export declare function asciiMap(x: string, mode?: string): number;
1
+ export interface Symb {
2
+ glyph: number;
3
+ arity?: number;
4
+ flags: Record<string, boolean>;
5
+ }
6
+ declare const SYMB: Record<string, Symb>;
7
+ export { SYMB };
8
+ export declare function asciiMap(x: string, mode?: string): number;
@@ -1,34 +1,34 @@
1
- import { IElement, IElementPosition } from '../../../../interface/Element';
2
- import { IPreviewerDrawOption } from '../../../../interface/Previewer';
3
- import { Draw } from '../../Draw';
4
- export declare class Previewer {
5
- private container;
6
- private canvas;
7
- private draw;
8
- private options;
9
- private curElement;
10
- private curElementSrc;
11
- private previewerDrawOption;
12
- private curPosition;
13
- private resizerSelection;
14
- private resizerHandleList;
15
- private resizerImageContainer;
16
- private resizerImage;
17
- private width;
18
- private height;
19
- private mousedownX;
20
- private mousedownY;
21
- private curHandleIndex;
22
- private previewerContainer;
23
- private previewerImage;
24
- constructor(draw: Draw);
25
- private _createResizerDom;
26
- private _mousedown;
27
- private _mousemove;
28
- private _dblclick;
29
- private _drawPreviewer;
30
- _setPreviewerTransform(scale: number, rotate: number, x: number, y: number): void;
31
- private _clearPreviewer;
32
- drawResizer(element: IElement, position: IElementPosition, options?: IPreviewerDrawOption): void;
33
- clearResizer(): void;
34
- }
1
+ import { IElement, IElementPosition } from '../../../../interface/Element';
2
+ import { IPreviewerDrawOption } from '../../../../interface/Previewer';
3
+ import { Draw } from '../../Draw';
4
+ export declare class Previewer {
5
+ private container;
6
+ private canvas;
7
+ private draw;
8
+ private options;
9
+ private curElement;
10
+ private curElementSrc;
11
+ private previewerDrawOption;
12
+ private curPosition;
13
+ private resizerSelection;
14
+ private resizerHandleList;
15
+ private resizerImageContainer;
16
+ private resizerImage;
17
+ private width;
18
+ private height;
19
+ private mousedownX;
20
+ private mousedownY;
21
+ private curHandleIndex;
22
+ private previewerContainer;
23
+ private previewerImage;
24
+ constructor(draw: Draw);
25
+ private _createResizerDom;
26
+ private _mousedown;
27
+ private _mousemove;
28
+ private _dblclick;
29
+ private _drawPreviewer;
30
+ _setPreviewerTransform(scale: number, rotate: number, x: number, y: number): void;
31
+ private _clearPreviewer;
32
+ drawResizer(element: IElement, position: IElementPosition, options?: IPreviewerDrawOption): void;
33
+ clearResizer(): void;
34
+ }
@@ -1,11 +1,11 @@
1
- import { IElement } from '../../../..';
2
- import { Draw } from '../../Draw';
3
- export declare class TableParticle {
4
- private range;
5
- private options;
6
- constructor(draw: Draw);
7
- private _drawBorder;
8
- computeRowColInfo(element: IElement): void;
9
- drawRange(ctx: CanvasRenderingContext2D, element: IElement, startX: number, startY: number): void;
10
- render(ctx: CanvasRenderingContext2D, element: IElement, startX: number, startY: number): void;
11
- }
1
+ import { IElement } from '../../../..';
2
+ import { Draw } from '../../Draw';
3
+ export declare class TableParticle {
4
+ private range;
5
+ private options;
6
+ constructor(draw: Draw);
7
+ private _drawBorder;
8
+ computeRowColInfo(element: IElement): void;
9
+ drawRange(ctx: CanvasRenderingContext2D, element: IElement, startX: number, startY: number): void;
10
+ render(ctx: CanvasRenderingContext2D, element: IElement, startX: number, startY: number): void;
11
+ }
@@ -1,22 +1,22 @@
1
- import { IElement } from '../../../..';
2
- import { IElementPosition } from '../../../../interface/Element';
3
- import { Draw } from '../../Draw';
4
- export declare class TableTool {
5
- private readonly translate;
6
- private minTdWidth;
7
- private draw;
8
- private canvas;
9
- private options;
10
- private position;
11
- private container;
12
- private toolRowContainer;
13
- private toolColContainer;
14
- private anchorLine;
15
- private mousedownX;
16
- private mousedownY;
17
- constructor(draw: Draw);
18
- dispose(): void;
19
- render(element: IElement, position: IElementPosition): void;
20
- private _mousedown;
21
- private _mousemove;
22
- }
1
+ import { IElement } from '../../../..';
2
+ import { IElementPosition } from '../../../../interface/Element';
3
+ import { Draw } from '../../Draw';
4
+ export declare class TableTool {
5
+ private readonly translate;
6
+ private minTdWidth;
7
+ private draw;
8
+ private canvas;
9
+ private options;
10
+ private position;
11
+ private container;
12
+ private toolRowContainer;
13
+ private toolColContainer;
14
+ private anchorLine;
15
+ private mousedownX;
16
+ private mousedownY;
17
+ constructor(draw: Draw);
18
+ dispose(): void;
19
+ render(element: IElement, position: IElementPosition): void;
20
+ private _mousedown;
21
+ private _mousemove;
22
+ }