@hailin-zheng/editor-core 2.2.1 → 2.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/editor.css +610 -559
- package/index-cjs.d.ts +31 -31
- package/index-cjs.js +22202 -22146
- package/index-cjs.js.map +1 -1
- package/index.d.ts +31 -31
- package/index.js +22204 -22149
- package/index.js.map +1 -1
- package/med_editor/doc-editor.d.ts +464 -461
- package/med_editor/doc-rule.d.ts +46 -46
- package/med_editor/editor-core.d.ts +21 -21
- package/med_editor/framework/code-interpreter/ast-parser.d.ts +4 -4
- package/med_editor/framework/code-interpreter/document-eval-func.d.ts +18 -18
- package/med_editor/framework/code-interpreter/dynamic-execute.d.ts +23 -23
- package/med_editor/framework/doc-layout/document-arrange.d.ts +86 -80
- package/med_editor/framework/doc-layout/paragraph-arrange.d.ts +107 -107
- package/med_editor/framework/document-change.d.ts +295 -295
- package/med_editor/framework/document-combine.d.ts +24 -24
- package/med_editor/framework/document-comment.d.ts +38 -38
- package/med_editor/framework/document-context.d.ts +133 -136
- package/med_editor/framework/document-event.d.ts +251 -251
- package/med_editor/framework/document-input-cursor.d.ts +43 -43
- package/med_editor/framework/document-paginator.d.ts +46 -41
- package/med_editor/framework/document-svg.d.ts +36 -36
- package/med_editor/framework/document-template.d.ts +13 -13
- package/med_editor/framework/document-textline-mode.d.ts +6 -6
- package/med_editor/framework/element-define.d.ts +409 -406
- package/med_editor/framework/element-event-define.d.ts +107 -107
- package/med_editor/framework/element-props.d.ts +343 -344
- package/med_editor/framework/element-reader.d.ts +20 -20
- package/med_editor/framework/element-serialize.d.ts +36 -36
- package/med_editor/framework/element-type-handler.d.ts +9 -9
- package/med_editor/framework/history/element-trace-manage.d.ts +107 -107
- package/med_editor/framework/history/element-trace-tracking.d.ts +89 -89
- package/med_editor/framework/impl/checkbox/checkbox-impl.d.ts +19 -19
- package/med_editor/framework/impl/comments/comment-content-impl.d.ts +39 -39
- package/med_editor/framework/impl/comments/comment-element-impl.d.ts +24 -24
- package/med_editor/framework/impl/comments/comments-container-impl.d.ts +19 -19
- package/med_editor/framework/impl/comments/validate-msg-impl.d.ts +19 -19
- package/med_editor/framework/impl/data-element/data-decorate-impl.d.ts +15 -15
- package/med_editor/framework/impl/data-element/data-element-barcode.d.ts +32 -32
- package/med_editor/framework/impl/data-element/data-element-base-impl.d.ts +96 -96
- package/med_editor/framework/impl/data-element/data-element-check-impl.d.ts +26 -26
- package/med_editor/framework/impl/data-element/data-element-date-impl.d.ts +23 -23
- package/med_editor/framework/impl/data-element/data-element-group-impl.d.ts +17 -17
- package/med_editor/framework/impl/data-element/data-element-image-impl.d.ts +23 -23
- package/med_editor/framework/impl/data-element/data-element-list-impl.d.ts +21 -21
- package/med_editor/framework/impl/data-element/data-element-text-impl.d.ts +22 -22
- package/med_editor/framework/impl/data-element/qrcode.d.ts +93 -93
- package/med_editor/framework/impl/decorate/fill-null-space-imple.d.ts +16 -16
- package/med_editor/framework/impl/document/doc-body-impl.d.ts +19 -20
- package/med_editor/framework/impl/document/doc-body-part-impl.d.ts +22 -22
- package/med_editor/framework/impl/document/doc-container-impl.d.ts +7 -7
- package/med_editor/framework/impl/document/doc-footer-impl.d.ts +19 -19
- package/med_editor/framework/impl/document/doc-header-impl.d.ts +19 -19
- package/med_editor/framework/impl/document/doc-impl.d.ts +72 -71
- package/med_editor/framework/impl/index.d.ts +39 -39
- package/med_editor/framework/impl/media-formula/menstrual-history.d.ts +31 -31
- package/med_editor/framework/impl/media-formula/permanent-teeth.d.ts +34 -34
- package/med_editor/framework/impl/paragraph/p-impl.d.ts +38 -38
- package/med_editor/framework/impl/picture/RectEle.d.ts +44 -44
- package/med_editor/framework/impl/picture/image-impl.d.ts +24 -24
- package/med_editor/framework/impl/radio/radio-impl.d.ts +17 -17
- package/med_editor/framework/impl/svg/svg-impl.d.ts +20 -20
- package/med_editor/framework/impl/symbol/br-symbol-impl.d.ts +18 -18
- package/med_editor/framework/impl/symbol/p-symbol-impl.d.ts +16 -16
- package/med_editor/framework/impl/symbol/page-br-symbol-impl.d.ts +20 -20
- package/med_editor/framework/impl/symbol/tab-symbol-impl.d.ts +15 -15
- package/med_editor/framework/impl/table/table-cell-impl.d.ts +34 -34
- package/med_editor/framework/impl/table/table-impl.d.ts +49 -49
- package/med_editor/framework/impl/table/table-row-impl.d.ts +27 -27
- package/med_editor/framework/impl/table/table-split-cell-patch.d.ts +20 -20
- package/med_editor/framework/impl/table/table-split-cell.d.ts +92 -92
- package/med_editor/framework/impl/table/table-util.d.ts +180 -180
- package/med_editor/framework/impl/text/text-impl.d.ts +34 -34
- package/med_editor/framework/impl/text/track-run-impl.d.ts +27 -27
- package/med_editor/framework/infrastructure/event-subject.d.ts +56 -56
- package/med_editor/framework/infrastructure/notify.d.ts +13 -13
- package/med_editor/framework/print/document-print-offscreen.d.ts +58 -58
- package/med_editor/framework/print/document-print.d.ts +18 -18
- package/med_editor/framework/render-context.d.ts +111 -111
- package/med_editor/framework/render-define.d.ts +141 -141
- package/med_editor/framework/selection/document-selection.d.ts +91 -97
- package/med_editor/framework/selection/range-util.d.ts +36 -36
- package/med_editor/framework/selection/selection-overlays.d.ts +32 -32
- package/med_editor/framework/util/adjust-viewport-elements.d.ts +12 -12
- package/med_editor/framework/util/common-util.d.ts +76 -76
- package/med_editor/framework/util/document-segmenter.d.ts +2 -2
- package/med_editor/framework/util/element-util.d.ts +410 -410
- package/med_editor/framework/vnode/editor-calendar-vnode.d.ts +42 -42
- package/package.json +19 -19
@@ -1,97 +1,91 @@
|
|
1
|
-
import { BranchElement, Element, LeafElement, Rect, SelectionContentRange } from "../element-define";
|
2
|
-
import { HitEventInfo, HitRegion } from "../element-event-define";
|
3
|
-
import { DocumentContainerRender } from "../impl/document/doc-container-impl";
|
4
|
-
import { RenderObject } from "../render-define";
|
5
|
-
import { Subject } from "../infrastructure/event-subject";
|
6
|
-
export declare class DocumentSelection {
|
7
|
-
constructor();
|
8
|
-
selectionState: SelectionState;
|
9
|
-
snapshotSelectionState: SelectionState | null;
|
10
|
-
setSelectionState(hitInfo: {
|
11
|
-
startHitInfo: HitEventInfo;
|
12
|
-
endHitInfo: HitEventInfo;
|
13
|
-
}): void;
|
14
|
-
/**
|
15
|
-
* 获取选区共同的祖先控件
|
16
|
-
*/
|
17
|
-
static getAncestorCommonControl(startControl: LeafElement, endControl: LeafElement): BranchElement;
|
18
|
-
/**
|
19
|
-
* 获取向上的嵌套父级节点集合
|
20
|
-
* @param control
|
21
|
-
* @param array
|
22
|
-
*/
|
23
|
-
static getNestParents(control: BranchElement | null): Array<BranchElement>;
|
24
|
-
static getCommonParenet(control: BranchElement | null | undefined, array: Array<BranchElement>): BranchElement | null;
|
25
|
-
/**
|
26
|
-
* 更新选区对象
|
27
|
-
* return:当前选区是否改变
|
28
|
-
* @private
|
29
|
-
*/
|
30
|
-
updateSelectionState(): boolean;
|
31
|
-
/**
|
32
|
-
*
|
33
|
-
*
|
34
|
-
*/
|
35
|
-
private
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
static getElementCursorPos(ele: LeafElement, offset: number, hitRegion: HitRegion | undefined, docNum: number): {
|
93
|
-
render: RenderObject;
|
94
|
-
rect: Rect;
|
95
|
-
};
|
96
|
-
private static getElementRenderPos;
|
97
|
-
}
|
1
|
+
import { BranchElement, Element, LeafElement, Rect, SelectionContentRange } from "../element-define";
|
2
|
+
import { HitEventInfo, HitRegion } from "../element-event-define";
|
3
|
+
import { DocumentContainerRender } from "../impl/document/doc-container-impl";
|
4
|
+
import { RenderObject } from "../render-define";
|
5
|
+
import { Subject } from "../infrastructure/event-subject";
|
6
|
+
export declare class DocumentSelection {
|
7
|
+
constructor();
|
8
|
+
selectionState: SelectionState;
|
9
|
+
snapshotSelectionState: SelectionState | null;
|
10
|
+
setSelectionState(hitInfo: {
|
11
|
+
startHitInfo: HitEventInfo;
|
12
|
+
endHitInfo: HitEventInfo;
|
13
|
+
}): void;
|
14
|
+
/**
|
15
|
+
* 获取选区共同的祖先控件
|
16
|
+
*/
|
17
|
+
static getAncestorCommonControl(startControl: LeafElement, endControl: LeafElement): BranchElement;
|
18
|
+
/**
|
19
|
+
* 获取向上的嵌套父级节点集合
|
20
|
+
* @param control
|
21
|
+
* @param array
|
22
|
+
*/
|
23
|
+
static getNestParents(control: BranchElement | null): Array<BranchElement>;
|
24
|
+
static getCommonParenet(control: BranchElement | null | undefined, array: Array<BranchElement>): BranchElement | null;
|
25
|
+
/**
|
26
|
+
* 更新选区对象
|
27
|
+
* return:当前选区是否改变
|
28
|
+
* @private
|
29
|
+
*/
|
30
|
+
updateSelectionState(): boolean;
|
31
|
+
/**
|
32
|
+
* 转换选区内容
|
33
|
+
* 处理结束选区在开始选区之前
|
34
|
+
*/
|
35
|
+
private transformRange;
|
36
|
+
takeSnapshot(): void;
|
37
|
+
clearSnapshot(): void;
|
38
|
+
}
|
39
|
+
export declare class SelectionState {
|
40
|
+
get startControl(): LeafElement;
|
41
|
+
set startControl(value: LeafElement | null);
|
42
|
+
get endControl(): LeafElement;
|
43
|
+
set endControl(value: LeafElement | null);
|
44
|
+
onChangedEvent: Subject<void>;
|
45
|
+
startControlIndex: number;
|
46
|
+
startOffset: number;
|
47
|
+
endControlIndex: number;
|
48
|
+
endOffset: number;
|
49
|
+
get collapsed(): boolean;
|
50
|
+
private _startControl;
|
51
|
+
private _endControl;
|
52
|
+
ancestorCommonControl: BranchElement | null;
|
53
|
+
range: SelectionRange | null;
|
54
|
+
startHitInfo: HitEventInfo | null;
|
55
|
+
selectedRange: SelectionContentRange | null;
|
56
|
+
editable: boolean;
|
57
|
+
renderContainer: DocumentContainerRender;
|
58
|
+
cursorPos: Rect | null;
|
59
|
+
constructor();
|
60
|
+
destroy(): void;
|
61
|
+
clear(): void;
|
62
|
+
/**
|
63
|
+
* 当前选区是否发生改变
|
64
|
+
*/
|
65
|
+
rangeDirty: boolean;
|
66
|
+
addRange(range: SelectionRange): void;
|
67
|
+
resetRange(startControl: Element, startOffset: number): SelectionRange;
|
68
|
+
surround(ele: Element): void;
|
69
|
+
clone(): SelectionState;
|
70
|
+
}
|
71
|
+
export declare class SelectionRange {
|
72
|
+
startControl: Element;
|
73
|
+
startOffset: number;
|
74
|
+
endControl: Element;
|
75
|
+
endOffset: number;
|
76
|
+
editable: boolean;
|
77
|
+
setStart(control: Element, offset: number): void;
|
78
|
+
setEnd(control: Element, offset: number): void;
|
79
|
+
private calcStart;
|
80
|
+
private calcEnd;
|
81
|
+
calcRange(): void;
|
82
|
+
private setInfo;
|
83
|
+
clone(): SelectionRange;
|
84
|
+
}
|
85
|
+
export declare class DocumentCursor {
|
86
|
+
static getElementCursorPos(ele: LeafElement, offset: number, hitRegion: HitRegion | undefined, docNum: number): {
|
87
|
+
render: RenderObject;
|
88
|
+
rect: Rect;
|
89
|
+
};
|
90
|
+
private static getElementRenderPos;
|
91
|
+
}
|
@@ -1,36 +1,36 @@
|
|
1
|
-
import { BranchElement, Element, LeafElement, SelectionContentRange } from "../element-define";
|
2
|
-
import { TableElement } from "../impl/table/table-impl";
|
3
|
-
export declare class RangeUtil {
|
4
|
-
static getSectionRange(startControl: LeafElement, startOffset: number, endControl: LeafElement, endOffset: number, ancestorCommonControl: BranchElement): SelectionContentRange;
|
5
|
-
static getCollapsedRange(startControl: LeafElement, startOffset: number, endOffset: number, ancestorCommonControl: BranchElement): SelectionContentRange;
|
6
|
-
/**
|
7
|
-
* 获取表格选区的内容
|
8
|
-
* @param startControl
|
9
|
-
* @param startOffset
|
10
|
-
* @param endControl
|
11
|
-
* @param endOffset
|
12
|
-
* @param tb
|
13
|
-
*/
|
14
|
-
static getTableSelectionRange(startControl: LeafElement, startOffset: number, endControl: LeafElement, endOffset: number, tb: TableElement): SelectionContentRange;
|
15
|
-
private static getStartForbackTreeData;
|
16
|
-
private static getEndForwardTreeData;
|
17
|
-
private static getChildTreeData;
|
18
|
-
private static setRangeFullSelected;
|
19
|
-
static rangeEquals(selRange1: SelectionContentRange, selRange2: SelectionContentRange): boolean;
|
20
|
-
static getStartRangeTarget(parentRange: SelectionContentRange): SelectionContentRange | null;
|
21
|
-
static getEndRangeTarget(parentRange: SelectionContentRange): SelectionContentRange | null;
|
22
|
-
/**
|
23
|
-
* 循环递归执行选区对象方法
|
24
|
-
* @param range
|
25
|
-
* @param handler
|
26
|
-
*/
|
27
|
-
static recursionTraversalRangeHandler(range: SelectionContentRange, handler: (range: SelectionContentRange) => void): void;
|
28
|
-
/**
|
29
|
-
* 判断元素是否被完全选中
|
30
|
-
* @param range
|
31
|
-
* @param ele
|
32
|
-
*/
|
33
|
-
static checkElementFullInRange(range: SelectionContentRange, ele: Element): boolean;
|
34
|
-
private static pushToArray;
|
35
|
-
private static unshiftToArray;
|
36
|
-
}
|
1
|
+
import { BranchElement, Element, LeafElement, SelectionContentRange } from "../element-define";
|
2
|
+
import { TableElement } from "../impl/table/table-impl";
|
3
|
+
export declare class RangeUtil {
|
4
|
+
static getSectionRange(startControl: LeafElement, startOffset: number, endControl: LeafElement, endOffset: number, ancestorCommonControl: BranchElement): SelectionContentRange;
|
5
|
+
static getCollapsedRange(startControl: LeafElement, startOffset: number, endOffset: number, ancestorCommonControl: BranchElement): SelectionContentRange;
|
6
|
+
/**
|
7
|
+
* 获取表格选区的内容
|
8
|
+
* @param startControl
|
9
|
+
* @param startOffset
|
10
|
+
* @param endControl
|
11
|
+
* @param endOffset
|
12
|
+
* @param tb
|
13
|
+
*/
|
14
|
+
static getTableSelectionRange(startControl: LeafElement, startOffset: number, endControl: LeafElement, endOffset: number, tb: TableElement): SelectionContentRange;
|
15
|
+
private static getStartForbackTreeData;
|
16
|
+
private static getEndForwardTreeData;
|
17
|
+
private static getChildTreeData;
|
18
|
+
private static setRangeFullSelected;
|
19
|
+
static rangeEquals(selRange1: SelectionContentRange, selRange2: SelectionContentRange): boolean;
|
20
|
+
static getStartRangeTarget(parentRange: SelectionContentRange): SelectionContentRange | null;
|
21
|
+
static getEndRangeTarget(parentRange: SelectionContentRange): SelectionContentRange | null;
|
22
|
+
/**
|
23
|
+
* 循环递归执行选区对象方法
|
24
|
+
* @param range
|
25
|
+
* @param handler
|
26
|
+
*/
|
27
|
+
static recursionTraversalRangeHandler(range: SelectionContentRange, handler: (range: SelectionContentRange) => void): void;
|
28
|
+
/**
|
29
|
+
* 判断元素是否被完全选中
|
30
|
+
* @param range
|
31
|
+
* @param ele
|
32
|
+
*/
|
33
|
+
static checkElementFullInRange(range: SelectionContentRange, ele: Element): boolean;
|
34
|
+
private static pushToArray;
|
35
|
+
private static unshiftToArray;
|
36
|
+
}
|
@@ -1,32 +1,32 @@
|
|
1
|
-
import { SelectionState } from "./document-selection";
|
2
|
-
import { Element, SelectionContentRange } from "../element-define";
|
3
|
-
/**
|
4
|
-
* 用于处理选区拖蓝
|
5
|
-
*/
|
6
|
-
export declare class SelectionOverlays {
|
7
|
-
private selectionState;
|
8
|
-
private selectionRange;
|
9
|
-
selectionEleSets: Map<Element, SelectionContentRange>;
|
10
|
-
commRangeSets: Map<Element, SelectionContentRange>;
|
11
|
-
constructor(selectionState: SelectionState);
|
12
|
-
getSelectionTreeData(): void;
|
13
|
-
private convertSelectRangeToSet;
|
14
|
-
static addToSets(range: SelectionContentRange, set: Map<Element, SelectionContentRange>): void;
|
15
|
-
/**
|
16
|
-
* 添加到批注集合
|
17
|
-
* @param range
|
18
|
-
* @param set
|
19
|
-
* @param rangeColor 用以显示批注区间的颜色
|
20
|
-
*/
|
21
|
-
static addToCommentSets(range: SelectionContentRange, set: Map<Element, SelectionContentRange>, rangeColor: string): void;
|
22
|
-
/**
|
23
|
-
* 修正开始选区内容
|
24
|
-
* 1.如果当前选区开始于表格内容,结束选区位于表格外,则需要开始选区内容重定位到单元格第一个元素
|
25
|
-
*/
|
26
|
-
private fixStartSelectionElement;
|
27
|
-
/**
|
28
|
-
* 修正开始选区内容
|
29
|
-
* 1.如果当前选区开始于表格内容,结束选区位于表格外,则需要开始选区内容重定位到单元格第一个元素
|
30
|
-
*/
|
31
|
-
private fixEndSelectionElement;
|
32
|
-
}
|
1
|
+
import { SelectionState } from "./document-selection";
|
2
|
+
import { Element, SelectionContentRange } from "../element-define";
|
3
|
+
/**
|
4
|
+
* 用于处理选区拖蓝
|
5
|
+
*/
|
6
|
+
export declare class SelectionOverlays {
|
7
|
+
private selectionState;
|
8
|
+
private selectionRange;
|
9
|
+
selectionEleSets: Map<Element, SelectionContentRange>;
|
10
|
+
commRangeSets: Map<Element, SelectionContentRange>;
|
11
|
+
constructor(selectionState: SelectionState);
|
12
|
+
getSelectionTreeData(): void;
|
13
|
+
private convertSelectRangeToSet;
|
14
|
+
static addToSets(range: SelectionContentRange, set: Map<Element, SelectionContentRange>): void;
|
15
|
+
/**
|
16
|
+
* 添加到批注集合
|
17
|
+
* @param range
|
18
|
+
* @param set
|
19
|
+
* @param rangeColor 用以显示批注区间的颜色
|
20
|
+
*/
|
21
|
+
static addToCommentSets(range: SelectionContentRange, set: Map<Element, SelectionContentRange>, rangeColor: string): void;
|
22
|
+
/**
|
23
|
+
* 修正开始选区内容
|
24
|
+
* 1.如果当前选区开始于表格内容,结束选区位于表格外,则需要开始选区内容重定位到单元格第一个元素
|
25
|
+
*/
|
26
|
+
private fixStartSelectionElement;
|
27
|
+
/**
|
28
|
+
* 修正开始选区内容
|
29
|
+
* 1.如果当前选区开始于表格内容,结束选区位于表格外,则需要开始选区内容重定位到单元格第一个元素
|
30
|
+
*/
|
31
|
+
private fixEndSelectionElement;
|
32
|
+
}
|
@@ -1,12 +1,12 @@
|
|
1
|
-
interface Viewport {
|
2
|
-
x: number;
|
3
|
-
y: number;
|
4
|
-
width: number;
|
5
|
-
height: number;
|
6
|
-
scale: number;
|
7
|
-
}
|
8
|
-
/**
|
9
|
-
* 调整页面提示框位置,使其在视窗内的位置合理
|
10
|
-
*/
|
11
|
-
export declare function adjustViewportElements(tipContainer: any, viewPort: Viewport): void;
|
12
|
-
export {};
|
1
|
+
interface Viewport {
|
2
|
+
x: number;
|
3
|
+
y: number;
|
4
|
+
width: number;
|
5
|
+
height: number;
|
6
|
+
scale: number;
|
7
|
+
}
|
8
|
+
/**
|
9
|
+
* 调整页面提示框位置,使其在视窗内的位置合理
|
10
|
+
*/
|
11
|
+
export declare function adjustViewportElements(tipContainer: any, viewPort: Viewport): void;
|
12
|
+
export {};
|
@@ -1,76 +1,76 @@
|
|
1
|
-
import { Rect } from "../element-define";
|
2
|
-
import { BorderType } from "../render-define";
|
3
|
-
interface Position {
|
4
|
-
x: number;
|
5
|
-
y: number;
|
6
|
-
}
|
7
|
-
export declare class CommonUtil {
|
8
|
-
/**
|
9
|
-
* 判断坐标是否在矩形框内
|
10
|
-
* @param rect
|
11
|
-
* @param position
|
12
|
-
* @returns
|
13
|
-
*/
|
14
|
-
static isInsideRectByPosition(rect: Omit<Rect, 'maxWidth' | 'maxHeight'>, position: Position): boolean;
|
15
|
-
static isInsideRectByRect(rect: Rect, position: Rect): boolean;
|
16
|
-
/**
|
17
|
-
* 判断坐标是否在矩形的边框上
|
18
|
-
* @param rect
|
19
|
-
* @param borderWidth
|
20
|
-
* @param position
|
21
|
-
*/
|
22
|
-
static isInRectBorder(rect: Rect, borderWidth: number, position: Position): {
|
23
|
-
borderType: BorderType;
|
24
|
-
};
|
25
|
-
/**
|
26
|
-
* 判断坐标是否在图片的缩放操作点上
|
27
|
-
*/
|
28
|
-
static isInPictureResizePoint(rect: Rect, pos: Position, r: number): {
|
29
|
-
borderType: BorderType;
|
30
|
-
} | null;
|
31
|
-
/**
|
32
|
-
* 整形符合连线要求
|
33
|
-
* @param points
|
34
|
-
* @param width
|
35
|
-
* @param strokeColor
|
36
|
-
*/
|
37
|
-
static resharpPoints(points: Array<Position>): Array<Position>;
|
38
|
-
static getOffsetX(node: HTMLElement): number;
|
39
|
-
static randomColor(): string;
|
40
|
-
static randomRgbColor(opacity?: number): string;
|
41
|
-
/**
|
42
|
-
* 判断一个数值是否在另一个数值的增益区间中
|
43
|
-
* @param val
|
44
|
-
* @param offset
|
45
|
-
* @param compareValue
|
46
|
-
* @returns
|
47
|
-
*/
|
48
|
-
static ApproxmateValueInRange(val: number, offset: number, compareValue: number): boolean;
|
49
|
-
static getEmptyValue<T>(val: T, emptyVal: T): T;
|
50
|
-
/**
|
51
|
-
* 移除并集
|
52
|
-
* @param array
|
53
|
-
* @param deleteItems
|
54
|
-
* @returns
|
55
|
-
*/
|
56
|
-
static removeUnionSet<T>(array: Array<T>, deleteItems: Array<T>): Array<T>;
|
57
|
-
static nullToString(val: any): string;
|
58
|
-
static formatDate(date: Date, format: string): string;
|
59
|
-
static formatNow(format: string): string;
|
60
|
-
static parseText(text: string, data: object): string;
|
61
|
-
static getNowDiffSeconds(date: Date | string): number;
|
62
|
-
static isDate(str: string): boolean;
|
63
|
-
static cloneValue(val: any): any;
|
64
|
-
static cloneDeep<T>(source: T, visited?: WeakMap<object, any>): T;
|
65
|
-
static isConstructor(f: any): boolean;
|
66
|
-
static toArray<T>(item: Array<T> | T): Array<T>;
|
67
|
-
static removeChild(ele: HTMLElement): void;
|
68
|
-
static findParent(curr: HTMLElement | null, predicate: (parent: HTMLElement) => boolean): HTMLElement | null;
|
69
|
-
static isIntersect(rect1: Rect, rect2: Rect): boolean;
|
70
|
-
static debounce<F extends AnyFunction>(fn: F, wait: number): (...args: Parameters<F>) => void;
|
71
|
-
static btoa(str: string): string;
|
72
|
-
static isEqual(a: any, b: any): boolean;
|
73
|
-
static getValue(val: any, defaultValue: any): any;
|
74
|
-
}
|
75
|
-
declare type AnyFunction = (...args: any[]) => any;
|
76
|
-
export {};
|
1
|
+
import { Rect } from "../element-define";
|
2
|
+
import { BorderType } from "../render-define";
|
3
|
+
interface Position {
|
4
|
+
x: number;
|
5
|
+
y: number;
|
6
|
+
}
|
7
|
+
export declare class CommonUtil {
|
8
|
+
/**
|
9
|
+
* 判断坐标是否在矩形框内
|
10
|
+
* @param rect
|
11
|
+
* @param position
|
12
|
+
* @returns
|
13
|
+
*/
|
14
|
+
static isInsideRectByPosition(rect: Omit<Rect, 'maxWidth' | 'maxHeight'>, position: Position): boolean;
|
15
|
+
static isInsideRectByRect(rect: Rect, position: Rect): boolean;
|
16
|
+
/**
|
17
|
+
* 判断坐标是否在矩形的边框上
|
18
|
+
* @param rect
|
19
|
+
* @param borderWidth
|
20
|
+
* @param position
|
21
|
+
*/
|
22
|
+
static isInRectBorder(rect: Rect, borderWidth: number, position: Position): {
|
23
|
+
borderType: BorderType;
|
24
|
+
};
|
25
|
+
/**
|
26
|
+
* 判断坐标是否在图片的缩放操作点上
|
27
|
+
*/
|
28
|
+
static isInPictureResizePoint(rect: Rect, pos: Position, r: number): {
|
29
|
+
borderType: BorderType;
|
30
|
+
} | null;
|
31
|
+
/**
|
32
|
+
* 整形符合连线要求
|
33
|
+
* @param points
|
34
|
+
* @param width
|
35
|
+
* @param strokeColor
|
36
|
+
*/
|
37
|
+
static resharpPoints(points: Array<Position>): Array<Position>;
|
38
|
+
static getOffsetX(node: HTMLElement): number;
|
39
|
+
static randomColor(): string;
|
40
|
+
static randomRgbColor(opacity?: number): string;
|
41
|
+
/**
|
42
|
+
* 判断一个数值是否在另一个数值的增益区间中
|
43
|
+
* @param val
|
44
|
+
* @param offset
|
45
|
+
* @param compareValue
|
46
|
+
* @returns
|
47
|
+
*/
|
48
|
+
static ApproxmateValueInRange(val: number, offset: number, compareValue: number): boolean;
|
49
|
+
static getEmptyValue<T>(val: T, emptyVal: T): T;
|
50
|
+
/**
|
51
|
+
* 移除并集
|
52
|
+
* @param array
|
53
|
+
* @param deleteItems
|
54
|
+
* @returns
|
55
|
+
*/
|
56
|
+
static removeUnionSet<T>(array: Array<T>, deleteItems: Array<T>): Array<T>;
|
57
|
+
static nullToString(val: any): string;
|
58
|
+
static formatDate(date: Date, format: string): string;
|
59
|
+
static formatNow(format: string): string;
|
60
|
+
static parseText(text: string, data: object): string;
|
61
|
+
static getNowDiffSeconds(date: Date | string): number;
|
62
|
+
static isDate(str: string): boolean;
|
63
|
+
static cloneValue(val: any): any;
|
64
|
+
static cloneDeep<T extends object>(source: T, visited?: WeakMap<object, any>): T;
|
65
|
+
static isConstructor(f: any): boolean;
|
66
|
+
static toArray<T>(item: Array<T> | T): Array<T>;
|
67
|
+
static removeChild(ele: HTMLElement): void;
|
68
|
+
static findParent(curr: HTMLElement | null, predicate: (parent: HTMLElement) => boolean): HTMLElement | null;
|
69
|
+
static isIntersect(rect1: Rect, rect2: Rect): boolean;
|
70
|
+
static debounce<F extends AnyFunction>(fn: F, wait: number): (...args: Parameters<F>) => void;
|
71
|
+
static btoa(str: string): string;
|
72
|
+
static isEqual(a: any, b: any): boolean;
|
73
|
+
static getValue(val: any, defaultValue: any): any;
|
74
|
+
}
|
75
|
+
declare type AnyFunction = (...args: any[]) => any;
|
76
|
+
export {};
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import { SelectionState } from "../selection/document-selection";
|
2
|
-
export declare function getFocusTextSegment(selection: SelectionState): boolean;
|
1
|
+
import { SelectionState } from "../selection/document-selection";
|
2
|
+
export declare function getFocusTextSegment(selection: SelectionState): boolean;
|