@hailin-zheng/editor-core 2.2.3 → 2.2.4
Sign up to get free protection for your applications and to get access to all the features.
- package/editor.css +694 -610
- package/index-cjs.d.ts +32 -31
- package/index-cjs.js +22648 -22205
- package/index-cjs.js.map +1 -1
- package/index.d.ts +32 -31
- package/index.js +22646 -22207
- package/index.js.map +1 -1
- package/med_editor/doc-editor.d.ts +493 -464
- 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 -86
- package/med_editor/framework/doc-layout/paragraph-arrange.d.ts +107 -107
- package/med_editor/framework/document-change.d.ts +314 -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 +138 -133
- package/med_editor/framework/document-event.d.ts +251 -251
- package/med_editor/framework/document-input-cursor.d.ts +32 -43
- package/med_editor/framework/document-paginator.d.ts +46 -46
- 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 +413 -409
- package/med_editor/framework/element-event-define.d.ts +104 -107
- package/med_editor/framework/element-props.d.ts +343 -343
- 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 +8 -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-container-impl.d.ts +25 -0
- 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 -19
- 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 -72
- package/med_editor/framework/impl/index.d.ts +40 -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 +93 -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 +57 -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 +92 -91
- 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/suggestions/input-suggestions.d.ts +29 -0
- 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,91 +1,92 @@
|
|
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
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
private
|
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
|
-
private
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
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
|
+
isSelectionChanged(): boolean;
|
32
|
+
/**
|
33
|
+
* 转换选区内容
|
34
|
+
* 处理结束选区在开始选区之前
|
35
|
+
*/
|
36
|
+
private transformRange;
|
37
|
+
takeSnapshot(): void;
|
38
|
+
clearSnapshot(): void;
|
39
|
+
}
|
40
|
+
export declare class SelectionState {
|
41
|
+
get startControl(): LeafElement;
|
42
|
+
set startControl(value: LeafElement | null);
|
43
|
+
get endControl(): LeafElement;
|
44
|
+
set endControl(value: LeafElement | null);
|
45
|
+
onChangedEvent: Subject<void>;
|
46
|
+
startControlIndex: number;
|
47
|
+
startOffset: number;
|
48
|
+
endControlIndex: number;
|
49
|
+
endOffset: number;
|
50
|
+
get collapsed(): boolean;
|
51
|
+
private _startControl;
|
52
|
+
private _endControl;
|
53
|
+
ancestorCommonControl: BranchElement | null;
|
54
|
+
range: SelectionRange | null;
|
55
|
+
startHitInfo: HitEventInfo | null;
|
56
|
+
selectedRange: SelectionContentRange | null;
|
57
|
+
editable: boolean;
|
58
|
+
renderContainer: DocumentContainerRender;
|
59
|
+
cursorPos: Rect | null;
|
60
|
+
constructor();
|
61
|
+
destroy(): void;
|
62
|
+
clear(): void;
|
63
|
+
/**
|
64
|
+
* 当前选区是否发生改变
|
65
|
+
*/
|
66
|
+
rangeDirty: boolean;
|
67
|
+
addRange(range: SelectionRange): void;
|
68
|
+
resetRange(startControl: Element, startOffset: number): SelectionRange;
|
69
|
+
surround(ele: Element): void;
|
70
|
+
clone(): SelectionState;
|
71
|
+
}
|
72
|
+
export declare class SelectionRange {
|
73
|
+
startControl: Element;
|
74
|
+
startOffset: number;
|
75
|
+
endControl: Element;
|
76
|
+
endOffset: number;
|
77
|
+
editable: boolean;
|
78
|
+
setStart(control: Element, offset: number): void;
|
79
|
+
setEnd(control: Element, offset: number): void;
|
80
|
+
private calcStart;
|
81
|
+
private calcEnd;
|
82
|
+
calcRange(): void;
|
83
|
+
private setInfo;
|
84
|
+
clone(): SelectionRange;
|
85
|
+
}
|
86
|
+
export declare class DocumentCursor {
|
87
|
+
static getElementCursorPos(ele: LeafElement, offset: number, hitRegion: HitRegion | undefined, docNum: number): {
|
88
|
+
render: RenderObject;
|
89
|
+
rect: Rect;
|
90
|
+
};
|
91
|
+
private static getElementRenderPos;
|
92
|
+
}
|
@@ -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
|
+
}
|
@@ -0,0 +1,29 @@
|
|
1
|
+
import { TextGroupElement } from "../impl";
|
2
|
+
/**
|
3
|
+
* 处理文档输入联想
|
4
|
+
*/
|
5
|
+
export declare class DocInputSuggestions {
|
6
|
+
currentInputTextGroup: TextGroupElement | undefined;
|
7
|
+
currentMatchedText: string;
|
8
|
+
currentInputOffset: number;
|
9
|
+
suggestionsList: Array<ISuggestionData>;
|
10
|
+
prepareSuggestions: Array<ISuggestionData>;
|
11
|
+
selectedIndex: number;
|
12
|
+
clear(): void;
|
13
|
+
destroy(): void;
|
14
|
+
}
|
15
|
+
/**
|
16
|
+
* 联想词数据
|
17
|
+
*/
|
18
|
+
export interface ISuggestionData {
|
19
|
+
label: string;
|
20
|
+
value?: string;
|
21
|
+
desc?: string;
|
22
|
+
action?: (data: ISuggestionData) => void;
|
23
|
+
}
|
24
|
+
export interface ISuggestionProvider {
|
25
|
+
filterSuggestions: Array<ISuggestionData>;
|
26
|
+
inputTextGroup: TextGroupElement;
|
27
|
+
inputOffset: number;
|
28
|
+
findText: string;
|
29
|
+
}
|
@@ -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 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
|
+
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;
|