@hailin-zheng/editor-core 1.0.23 → 1.0.26
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/package.json +3 -5
- package/lib/doc-ruler.d.ts +0 -51
- package/lib/framework/common-util.d.ts +0 -63
- package/lib/framework/document-change.d.ts +0 -265
- package/lib/framework/document-combine.d.ts +0 -24
- package/lib/framework/document-comment.d.ts +0 -46
- package/lib/framework/document-context.d.ts +0 -149
- package/lib/framework/document-eval-func.d.ts +0 -18
- package/lib/framework/document-event.d.ts +0 -213
- package/lib/framework/document-history.d.ts +0 -26
- package/lib/framework/document-images-loader.d.ts +0 -16
- package/lib/framework/document-input-cursor.d.ts +0 -78
- package/lib/framework/document-paint.d.ts +0 -34
- package/lib/framework/document-print-offscreen.d.ts +0 -38
- package/lib/framework/document-print.d.ts +0 -60
- package/lib/framework/document-segmenter.d.ts +0 -2
- package/lib/framework/document-selection.d.ts +0 -89
- package/lib/framework/document-template.d.ts +0 -4
- package/lib/framework/document-textline-mode.d.ts +0 -7
- package/lib/framework/element-define.d.ts +0 -319
- package/lib/framework/element-event-define.d.ts +0 -98
- package/lib/framework/element-measure.d.ts +0 -97
- package/lib/framework/element-paint.d.ts +0 -42
- package/lib/framework/element-props.d.ts +0 -301
- package/lib/framework/element-reader.d.ts +0 -19
- package/lib/framework/element-render-cut.d.ts +0 -55
- package/lib/framework/element-serialize.d.ts +0 -30
- package/lib/framework/element-util.d.ts +0 -369
- package/lib/framework/impl/checkbox/checkbox-impl.d.ts +0 -24
- package/lib/framework/impl/comments/comment-content-impl.d.ts +0 -40
- package/lib/framework/impl/comments/comment-element-impl.d.ts +0 -21
- package/lib/framework/impl/comments/comments-container-impl.d.ts +0 -22
- package/lib/framework/impl/comments/comments-util.d.ts +0 -12
- package/lib/framework/impl/comments/validate-msg-impl.d.ts +0 -21
- package/lib/framework/impl/data-element/data-decorate-impl.d.ts +0 -30
- package/lib/framework/impl/data-element/data-element-barcode.d.ts +0 -31
- package/lib/framework/impl/data-element/data-element-base-impl.d.ts +0 -68
- package/lib/framework/impl/data-element/data-element-check-impl.d.ts +0 -35
- package/lib/framework/impl/data-element/data-element-date-impl.d.ts +0 -23
- package/lib/framework/impl/data-element/data-element-group-impl.d.ts +0 -23
- package/lib/framework/impl/data-element/data-element-image-impl.d.ts +0 -30
- package/lib/framework/impl/data-element/data-element-list-impl.d.ts +0 -22
- package/lib/framework/impl/data-element/data-element-text-impl.d.ts +0 -23
- package/lib/framework/impl/decorate/fill-null-space-imple.d.ts +0 -21
- package/lib/framework/impl/document/doc-body-impl.d.ts +0 -27
- package/lib/framework/impl/document/doc-body-part-impl.d.ts +0 -30
- package/lib/framework/impl/document/doc-container-impl.d.ts +0 -16
- package/lib/framework/impl/document/doc-footer-impl.d.ts +0 -26
- package/lib/framework/impl/document/doc-header-impl.d.ts +0 -26
- package/lib/framework/impl/document/doc-impl.d.ts +0 -61
- package/lib/framework/impl/index.d.ts +0 -36
- package/lib/framework/impl/media-formula/menstrual-history.d.ts +0 -35
- package/lib/framework/impl/paragraph/p-impl.d.ts +0 -45
- package/lib/framework/impl/picture/image-impl.d.ts +0 -31
- package/lib/framework/impl/radio/radio-impl.d.ts +0 -22
- package/lib/framework/impl/symbol/br-symbol-impl.d.ts +0 -22
- package/lib/framework/impl/symbol/p-symbol-impl.d.ts +0 -19
- package/lib/framework/impl/table/table-cell-impl.d.ts +0 -37
- package/lib/framework/impl/table/table-impl.d.ts +0 -55
- package/lib/framework/impl/table/table-row-impl.d.ts +0 -26
- package/lib/framework/impl/table/table-split-cell-patch.d.ts +0 -20
- package/lib/framework/impl/table/table-split-cell.d.ts +0 -90
- package/lib/framework/impl/table/table-util.d.ts +0 -150
- package/lib/framework/impl/text/text-impl.d.ts +0 -32
- package/lib/framework/impl/text/track-run-impl.d.ts +0 -27
- package/lib/framework/notify.d.ts +0 -13
- package/lib/framework/range-util.d.ts +0 -40
- package/lib/framework/render-context.d.ts +0 -91
- package/lib/framework/render-define.d.ts +0 -109
- package/lib/framework/selection-overlays.d.ts +0 -30
- package/lib/index.d.ts +0 -34
- package/lib/index.js +0 -15672
- package/lib/texteditor.d.ts +0 -318
- package/lib/util/subject.d.ts +0 -34
- package/lib/util/table-bind.d.ts +0 -5
@@ -1,213 +0,0 @@
|
|
1
|
-
import { Subject, Subscription } from "rxjs";
|
2
|
-
import { DocumentPaint } from "./document-paint";
|
3
|
-
import { SelectionState } from "./document-selection";
|
4
|
-
import { LeafElement, Rect, Element, Position, ViewOptions } from "./element-define";
|
5
|
-
import { ElementEvent, EventStage, EventTypes, HitEventInfo, HitRegion, ITrackTips, MouseElementEvent } from "./element-event-define";
|
6
|
-
import { BorderType, CursorType, RenderObject } from "./render-define";
|
7
|
-
import { EditorContext } from "./document-context";
|
8
|
-
interface EdgeRenderInfo {
|
9
|
-
renderElement: Element;
|
10
|
-
relativePos: Position;
|
11
|
-
mousedown: boolean;
|
12
|
-
mousedownPos?: Position;
|
13
|
-
border: BorderType;
|
14
|
-
}
|
15
|
-
/**
|
16
|
-
* 事件系统
|
17
|
-
*/
|
18
|
-
export declare class DocumentEvent {
|
19
|
-
private canvas;
|
20
|
-
private documentPaint;
|
21
|
-
private viewOptions;
|
22
|
-
private selectionState;
|
23
|
-
private docCtx;
|
24
|
-
private ismousedown;
|
25
|
-
startHitInfo: HitEventInfo | null;
|
26
|
-
endHitInfo: HitEventInfo | null;
|
27
|
-
focusedElement: LeafElement | null;
|
28
|
-
focusedRect: Rect | null;
|
29
|
-
currentMouseoverRender: {
|
30
|
-
render: RenderObject;
|
31
|
-
absoluteRenderRect: Rect;
|
32
|
-
} | null;
|
33
|
-
hitInfoChanged: Subject<{
|
34
|
-
startHitInfo: HitEventInfo;
|
35
|
-
endHitInfo: HitEventInfo;
|
36
|
-
}>;
|
37
|
-
clickEvent: Subject<MouseEvent>;
|
38
|
-
dblClickEvent: Subject<MouseEvent>;
|
39
|
-
changeCursor: Subject<CursorType>;
|
40
|
-
contextMenu: Subject<MouseEvent>;
|
41
|
-
trackTipsChanged: Subject<{
|
42
|
-
pos: Position;
|
43
|
-
tips: ITrackTips;
|
44
|
-
}>;
|
45
|
-
edgeRenderInfo: EdgeRenderInfo | null;
|
46
|
-
currentPos: Position;
|
47
|
-
mousedownPos: Position;
|
48
|
-
subs: Array<Subscription>;
|
49
|
-
constructor(canvas: HTMLCanvasElement, documentPaint: DocumentPaint, viewOptions: ViewOptions, selectionState: SelectionState, docCtx: EditorContext);
|
50
|
-
private bindEvent;
|
51
|
-
addSubEvent(sub: Subscription): void;
|
52
|
-
clearSubEvent(): void;
|
53
|
-
clear(): void;
|
54
|
-
private mousedown;
|
55
|
-
private mouseup;
|
56
|
-
private mousemove;
|
57
|
-
private prevTrackInfo;
|
58
|
-
/**
|
59
|
-
* 显示提示信息
|
60
|
-
* 显示留痕提示信息等
|
61
|
-
*/
|
62
|
-
private getTips;
|
63
|
-
/**
|
64
|
-
* 滚动视图的时候,需要手动触发mousemove
|
65
|
-
*/
|
66
|
-
onScrollView(): void;
|
67
|
-
/**
|
68
|
-
* 处理鼠标按下事件
|
69
|
-
* @param evt
|
70
|
-
* @returns
|
71
|
-
*/
|
72
|
-
private mousedownHandle;
|
73
|
-
/**
|
74
|
-
* 设置元素焦点状态
|
75
|
-
*/
|
76
|
-
private switchElementFocus;
|
77
|
-
clearHitInfo(): void;
|
78
|
-
/**
|
79
|
-
* 获取当前鼠标所在位置的元素信息
|
80
|
-
* @param evt
|
81
|
-
* @returns
|
82
|
-
*/
|
83
|
-
private getHitInfo;
|
84
|
-
private getMouseoverRenderInfo;
|
85
|
-
/**
|
86
|
-
* 鼠标移动事件
|
87
|
-
* 主要处理选区改变
|
88
|
-
*/
|
89
|
-
private mousemoveHandle;
|
90
|
-
private isCellRenderObject;
|
91
|
-
/**
|
92
|
-
* 当前绘制元素是否在单元格上面
|
93
|
-
* @param render
|
94
|
-
* @returns
|
95
|
-
*/
|
96
|
-
private isInCellRenderObject;
|
97
|
-
private isResizeRenderObject;
|
98
|
-
/**
|
99
|
-
* 触发鼠标移动事件
|
100
|
-
*/
|
101
|
-
private invokeMousemoveEvent;
|
102
|
-
prevCursorItems: Array<Element>;
|
103
|
-
/**
|
104
|
-
* 触发获取焦点事件
|
105
|
-
* 需要根据上次获取焦点的元素,比较触发失去焦点事件
|
106
|
-
* @param focusElement
|
107
|
-
*/
|
108
|
-
invokeCursor(focusElement: LeafElement): void;
|
109
|
-
/**
|
110
|
-
* mousedown-mouseup-click
|
111
|
-
*/
|
112
|
-
private mouseClickHandle;
|
113
|
-
/**
|
114
|
-
* 鼠标双击事件
|
115
|
-
*/
|
116
|
-
private mouseDblClickHandle;
|
117
|
-
/**
|
118
|
-
* 获取点击的渲染元素对象
|
119
|
-
* @param renderObject
|
120
|
-
* @param parPos
|
121
|
-
* @param hitPos
|
122
|
-
* @returns
|
123
|
-
*/
|
124
|
-
private getHitLeafRender;
|
125
|
-
private getTRowHitLeafRender;
|
126
|
-
/**
|
127
|
-
* 如果当前范围未击中任何元素,则需要匹配最近的元素
|
128
|
-
* @param renderObject
|
129
|
-
* @param parent
|
130
|
-
* @param position
|
131
|
-
*/
|
132
|
-
private getRecentHitRender;
|
133
|
-
/**
|
134
|
-
* 获取点击的doc-page
|
135
|
-
*/
|
136
|
-
private getHitDocPage;
|
137
|
-
/**
|
138
|
-
* 触发事件
|
139
|
-
* @param type
|
140
|
-
* @param sourceElement
|
141
|
-
*/
|
142
|
-
static invokeEvent(type: EventTypes, sourceElement: Element, event: ElementEvent, eventStage: EventStage, docCtx: EditorContext): ElementEvent | null;
|
143
|
-
/**
|
144
|
-
* 发布当前的点击信息
|
145
|
-
*/
|
146
|
-
private pubHitInfo;
|
147
|
-
/**
|
148
|
-
* 获取鼠标所在的渲染元素对象
|
149
|
-
* @param renderObject
|
150
|
-
* @param parent
|
151
|
-
* @param position
|
152
|
-
* @returns
|
153
|
-
*/
|
154
|
-
private getMouseoverRender;
|
155
|
-
/**
|
156
|
-
* 缩放元素
|
157
|
-
*/
|
158
|
-
private resizeRender;
|
159
|
-
/**
|
160
|
-
* 缩放表格
|
161
|
-
*/
|
162
|
-
private resizeTableCell;
|
163
|
-
private getResizeTableCell;
|
164
|
-
/**
|
165
|
-
* 调整元素大小
|
166
|
-
*/
|
167
|
-
private resizeElement;
|
168
|
-
/**
|
169
|
-
* 选中当前全部 ctrl+A
|
170
|
-
*/
|
171
|
-
selectAll(): void;
|
172
|
-
/**
|
173
|
-
* 移动光标到行首
|
174
|
-
*/
|
175
|
-
moveCursorToLineStart(): void;
|
176
|
-
/**
|
177
|
-
* 移动光标到行尾
|
178
|
-
*/
|
179
|
-
moveCursorToLineEnd(): void;
|
180
|
-
/**
|
181
|
-
* 处理移动光标到行尾或行首
|
182
|
-
* @param home
|
183
|
-
* @returns
|
184
|
-
*/
|
185
|
-
private moveCursorToHomeOrEnd;
|
186
|
-
/**
|
187
|
-
* 向左移动光标
|
188
|
-
*/
|
189
|
-
moveCursorToLeft(): void;
|
190
|
-
/**
|
191
|
-
* 向右移动光标
|
192
|
-
*/
|
193
|
-
moveCursorToRight(): void;
|
194
|
-
/**
|
195
|
-
* 向上移动光标
|
196
|
-
*/
|
197
|
-
moveCursorToUpOrDown(up?: boolean): void;
|
198
|
-
/**
|
199
|
-
* 当前偏移量是否处于当前元素的末尾
|
200
|
-
* @param ele
|
201
|
-
* @param offset
|
202
|
-
* @returns
|
203
|
-
*/
|
204
|
-
private isLeafEleEndOffset;
|
205
|
-
/**
|
206
|
-
* 获取点击的文档区域
|
207
|
-
* @param docRender
|
208
|
-
* @param pos
|
209
|
-
* @returns
|
210
|
-
*/
|
211
|
-
getHitRegion(docEvent: MouseElementEvent): HitRegion | null;
|
212
|
-
}
|
213
|
-
export {};
|
@@ -1,26 +0,0 @@
|
|
1
|
-
import { Subject } from "rxjs";
|
2
|
-
import { EditorContext } from "./document-context";
|
3
|
-
import { ElementReader } from "./element-reader";
|
4
|
-
export interface DocumentHistoryItem {
|
5
|
-
content: any;
|
6
|
-
time: Date;
|
7
|
-
}
|
8
|
-
/**
|
9
|
-
* 支持文档重做和撤销的类
|
10
|
-
*/
|
11
|
-
export declare class DocumentHistory {
|
12
|
-
docCtx: EditorContext;
|
13
|
-
reader: ElementReader;
|
14
|
-
task: Promise<void>;
|
15
|
-
constructor(docCtx: EditorContext, reader: ElementReader, onDocChangedEvent: Subject<void>);
|
16
|
-
private _undoStack;
|
17
|
-
private _index;
|
18
|
-
maxLength: number;
|
19
|
-
generateHistoryItem(): void;
|
20
|
-
get index(): number;
|
21
|
-
get canUndo(): boolean;
|
22
|
-
get canRedo(): boolean;
|
23
|
-
undo(): void;
|
24
|
-
redo(): void;
|
25
|
-
clear(): void;
|
26
|
-
}
|
@@ -1,16 +0,0 @@
|
|
1
|
-
import { IImageLoader, ImageSourceItem } from "./document-context";
|
2
|
-
import { ImgLoadStatus } from "./element-define";
|
3
|
-
export declare class DocumentImagesLoader implements IImageLoader {
|
4
|
-
images: Array<ImageSourceItem>;
|
5
|
-
clear(): void;
|
6
|
-
loadImage(src: string, onCallback: (status: ImgLoadStatus) => void): void;
|
7
|
-
invokeImgLoad(src: string, status: ImgLoadStatus): void;
|
8
|
-
getLoadTasks(): Array<Promise<void>>;
|
9
|
-
getImage(src: string): HTMLImageElement | undefined;
|
10
|
-
/**
|
11
|
-
* 判断图片是否都已经加载完毕
|
12
|
-
* 用于打印时判断,如果当前图片没有加载完毕就打印,图片是打印不出来
|
13
|
-
* @returns
|
14
|
-
*/
|
15
|
-
imagesLoadCompleted(): boolean;
|
16
|
-
}
|
@@ -1,78 +0,0 @@
|
|
1
|
-
import { Subject } from "rxjs";
|
2
|
-
import { LeafElement } from "./element-define";
|
3
|
-
import { EditorContext } from "./document-context";
|
4
|
-
export interface ICompositionStartInfo {
|
5
|
-
element: LeafElement;
|
6
|
-
offset: number;
|
7
|
-
}
|
8
|
-
export interface InputData {
|
9
|
-
composition?: boolean;
|
10
|
-
compositionStartInfo?: ICompositionStartInfo;
|
11
|
-
prevInputData?: string;
|
12
|
-
data: string;
|
13
|
-
}
|
14
|
-
/**
|
15
|
-
* 输入处理
|
16
|
-
*/
|
17
|
-
export declare class DocumentInput {
|
18
|
-
private editInput;
|
19
|
-
private editCursor;
|
20
|
-
private cursorWrapper;
|
21
|
-
private docCtx;
|
22
|
-
/**
|
23
|
-
* 光标是否可见
|
24
|
-
*/
|
25
|
-
private _cursorVisibility;
|
26
|
-
/**
|
27
|
-
* 光标闪烁状态
|
28
|
-
*/
|
29
|
-
private _cursorBlinksState;
|
30
|
-
private cursorBlinksIntervalID;
|
31
|
-
private compositionStart;
|
32
|
-
private compositionPrevData;
|
33
|
-
private compositionStartInfo;
|
34
|
-
onInputEvent: Subject<InputData>;
|
35
|
-
onBackspaceEvent: Subject<KeyboardEvent>;
|
36
|
-
onDeleteEvent: Subject<KeyboardEvent>;
|
37
|
-
onEnterEvent: Subject<void>;
|
38
|
-
onLeftEvent: Subject<void>;
|
39
|
-
onRightEvent: Subject<void>;
|
40
|
-
onCopyEvent: Subject<ClipboardEvent>;
|
41
|
-
onCutEvent: Subject<ClipboardEvent>;
|
42
|
-
onPasteEvent: Subject<ClipboardEvent>;
|
43
|
-
onInsertBr: Subject<void>;
|
44
|
-
onSelectAllEvent: Subject<void>;
|
45
|
-
onHomeEvent: Subject<void>;
|
46
|
-
onEndEvent: Subject<void>;
|
47
|
-
onUpEvent: Subject<void>;
|
48
|
-
onDownEvent: Subject<void>;
|
49
|
-
constructor(editInput: HTMLInputElement, editCursor: HTMLSpanElement, cursorWrapper: HTMLDivElement, docCtx: EditorContext);
|
50
|
-
/**
|
51
|
-
* 设置光标闪烁
|
52
|
-
*/
|
53
|
-
startCursorBlinks(): void;
|
54
|
-
destroy(): void;
|
55
|
-
/**
|
56
|
-
* 设置光标闪烁
|
57
|
-
*/
|
58
|
-
setCursorBlinks(): void;
|
59
|
-
/**
|
60
|
-
* 设置光标位置
|
61
|
-
* @param position
|
62
|
-
*/
|
63
|
-
setCursorPosition(position: {
|
64
|
-
x: number;
|
65
|
-
y: number;
|
66
|
-
height: number;
|
67
|
-
}): void;
|
68
|
-
/**
|
69
|
-
* 设置虚拟光标的可见性
|
70
|
-
* @param visibility
|
71
|
-
*/
|
72
|
-
setCursorVisibility(visibility: boolean): void;
|
73
|
-
/**
|
74
|
-
* 设置输入状态
|
75
|
-
* @param focus
|
76
|
-
*/
|
77
|
-
setInputFocus(focus: boolean): void;
|
78
|
-
}
|
@@ -1,34 +0,0 @@
|
|
1
|
-
import { ElementMeasure } from "./element-measure";
|
2
|
-
import { ElementPaint } from "./element-paint";
|
3
|
-
import { ElementRenderCut } from "./element-render-cut";
|
4
|
-
import { DocumentRenderObject } from "./impl/document/doc-impl";
|
5
|
-
import { RenderContenxtType } from "./render-context";
|
6
|
-
import { Element, SelectionContentRange, ViewOptions } from "./element-define";
|
7
|
-
import { DocumentContainerRender } from "./impl/document/doc-container-impl";
|
8
|
-
import { CommsContainerRenderObject } from "./impl/comments/comments-container-impl";
|
9
|
-
import { EditorContext } from "./document-context";
|
10
|
-
export declare class DocumentPaint {
|
11
|
-
private viewOptions;
|
12
|
-
private renderContext;
|
13
|
-
private docCtx;
|
14
|
-
private selectedSets;
|
15
|
-
elementMeasure: ElementMeasure;
|
16
|
-
elementRenderCut: ElementRenderCut;
|
17
|
-
elementPaint: ElementPaint;
|
18
|
-
docPages: Array<DocumentRenderObject>;
|
19
|
-
docContainer: DocumentContainerRender;
|
20
|
-
commsContainer: CommsContainerRenderObject;
|
21
|
-
constructor(viewOptions: ViewOptions, renderContext: RenderContenxtType, docCtx: EditorContext, selectedSets: Map<Element, SelectionContentRange>);
|
22
|
-
rePages(): void;
|
23
|
-
/**
|
24
|
-
* 获取设置文档容器的总高度
|
25
|
-
*/
|
26
|
-
getDocumentContainerHeight(): number;
|
27
|
-
refreshView(rePaint?: boolean): void;
|
28
|
-
getDocPages(): Array<DocumentRenderObject>;
|
29
|
-
getDocContainer(): DocumentContainerRender;
|
30
|
-
/***
|
31
|
-
* 设置审阅区间样式痕迹
|
32
|
-
*/
|
33
|
-
setCommRangeMark(): void;
|
34
|
-
}
|
@@ -1,38 +0,0 @@
|
|
1
|
-
import { EditorContext } from "./document-context";
|
2
|
-
import { DocumentPaint } from "./document-paint";
|
3
|
-
import { ViewOptions } from "./element-define";
|
4
|
-
import { ElementReader } from "./element-reader";
|
5
|
-
import { DocumentElement } from "./impl/document/doc-impl";
|
6
|
-
import { RenderContenxt } from "./render-context";
|
7
|
-
/**
|
8
|
-
* 离屏打印
|
9
|
-
*/
|
10
|
-
export declare class DocumentPrintOffscreen {
|
11
|
-
documentPaint: DocumentPaint;
|
12
|
-
viewOptions: ViewOptions;
|
13
|
-
docCtx: EditorContext;
|
14
|
-
renderCtx: RenderContenxt;
|
15
|
-
elementReader: ElementReader;
|
16
|
-
ctx: CanvasRenderingContext2D;
|
17
|
-
constructor();
|
18
|
-
print(data: any | DocumentElement, ranges?: Array<number> | null): Promise<void>;
|
19
|
-
/**
|
20
|
-
* 导出PDF
|
21
|
-
* @param fileName
|
22
|
-
* @param ss
|
23
|
-
* @param viewOptions
|
24
|
-
* @param docCtx
|
25
|
-
* @param ranges
|
26
|
-
*/
|
27
|
-
exportToPDF(data: any | DocumentElement, fileName: string, ranges?: Array<number> | null): Promise<void>;
|
28
|
-
/**
|
29
|
-
* 获取绘制的图片,格式为Base64编码
|
30
|
-
*/
|
31
|
-
getImagesContent(data: any | DocumentElement, ranges?: Array<number> | null): Promise<Array<string>>;
|
32
|
-
/**
|
33
|
-
* 读取数据,排版
|
34
|
-
* @param data
|
35
|
-
*/
|
36
|
-
private prepare;
|
37
|
-
private getCanvasNodes;
|
38
|
-
}
|
@@ -1,60 +0,0 @@
|
|
1
|
-
import { EditorContext } from "./document-context";
|
2
|
-
import { SelectionState } from "./document-selection";
|
3
|
-
import { OrientType, PageOptions, ViewOptions } from "./element-define";
|
4
|
-
export declare class documentPrint {
|
5
|
-
static print(ss: SelectionState, viewOptions: ViewOptions, docCtx: EditorContext, printRanges?: Array<number> | null): void;
|
6
|
-
/**
|
7
|
-
* 获取绘制的canvas节点
|
8
|
-
* @param ss
|
9
|
-
* @param viewOptions
|
10
|
-
* @param docCtx
|
11
|
-
* @param printRanges
|
12
|
-
* @returns
|
13
|
-
*/
|
14
|
-
private static getRenderCanvasNodes;
|
15
|
-
/**
|
16
|
-
* 导出base64
|
17
|
-
* @param ss
|
18
|
-
* @param viewOptions
|
19
|
-
* @param docCtx
|
20
|
-
* @param printRanges
|
21
|
-
* @returns
|
22
|
-
*/
|
23
|
-
static exportCanvasNodes(ss: SelectionState, viewOptions: ViewOptions, docCtx: EditorContext, printRanges?: Array<number> | null): Array<HTMLCanvasElement>;
|
24
|
-
/**
|
25
|
-
* 导出PDF
|
26
|
-
* @param fileName
|
27
|
-
* @param ss
|
28
|
-
* @param viewOptions
|
29
|
-
* @param docCtx
|
30
|
-
* @param printRanges
|
31
|
-
*/
|
32
|
-
static exportPDF(fileName: string, ss: SelectionState, viewOptions: ViewOptions, docCtx: EditorContext, printRanges?: Array<number> | null): void;
|
33
|
-
/**
|
34
|
-
* 当前当前页
|
35
|
-
* @param ss
|
36
|
-
* @param viewOptions
|
37
|
-
*/
|
38
|
-
static printCurrPage(ss: SelectionState, viewOptions: ViewOptions, docCtx: EditorContext): void;
|
39
|
-
}
|
40
|
-
export declare function createPrintTemplate({ width, height, orient }: PageOptions): string;
|
41
|
-
declare type PrintPaperOptions = {
|
42
|
-
width: number;
|
43
|
-
height: number;
|
44
|
-
orient: OrientType;
|
45
|
-
};
|
46
|
-
/**
|
47
|
-
* 打印DOM
|
48
|
-
* @param printNodes
|
49
|
-
* @param options
|
50
|
-
* @returns
|
51
|
-
*/
|
52
|
-
export declare function printNodes(printNodes: Array<Node>, options: PrintPaperOptions): void;
|
53
|
-
/**
|
54
|
-
* canvas节点导出到PDF
|
55
|
-
* @param fileName
|
56
|
-
* @param nodes
|
57
|
-
* @param options
|
58
|
-
*/
|
59
|
-
export declare function exportCanvasToPDF(fileName: string, nodes: Array<HTMLCanvasElement>, options: PrintPaperOptions): void;
|
60
|
-
export {};
|
@@ -1,89 +0,0 @@
|
|
1
|
-
import { Subject } from "rxjs";
|
2
|
-
import { BranchElement, LeafElement, Rect, Element, SelectionContentRange } from "./element-define";
|
3
|
-
import { HitEventInfo, HitRegion } from "./element-event-define";
|
4
|
-
import { DocumentContainerRender } from "./impl/document/doc-container-impl";
|
5
|
-
import { RenderObject } from "./render-define";
|
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, array: Array<BranchElement>): BranchElement | null;
|
25
|
-
updateSelectionState(): boolean;
|
26
|
-
/**
|
27
|
-
* 获取当前选区区域内是否支持留痕
|
28
|
-
* @private
|
29
|
-
*/
|
30
|
-
private getEnableTrackChanges;
|
31
|
-
private compareSelectionEquals;
|
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
|
-
afterSelectionChanged: ((newVal: SelectionState) => boolean) | null;
|
61
|
-
enableTrackChanges: boolean;
|
62
|
-
constructor();
|
63
|
-
clear(): void;
|
64
|
-
addRange(range: SelectionRange): void;
|
65
|
-
resetRange(startControl: Element, startOffset: number): SelectionRange;
|
66
|
-
surround(ele: Element): void;
|
67
|
-
clone(): SelectionState;
|
68
|
-
}
|
69
|
-
export declare class SelectionRange {
|
70
|
-
startControl: Element;
|
71
|
-
startOffset: number;
|
72
|
-
endControl: Element;
|
73
|
-
endOffset: number;
|
74
|
-
editable: boolean;
|
75
|
-
setStart(control: Element, offset: number): void;
|
76
|
-
setEnd(control: Element, offset: number): void;
|
77
|
-
private calcStart;
|
78
|
-
private calcEnd;
|
79
|
-
calcRange(): void;
|
80
|
-
private setInfo;
|
81
|
-
clone(): SelectionRange;
|
82
|
-
}
|
83
|
-
export declare class DocumentCursor {
|
84
|
-
static getElementCursorPos(ele: LeafElement, offset: number, hitRegion: HitRegion | undefined, docNum: number): {
|
85
|
-
render: RenderObject;
|
86
|
-
rect: Rect;
|
87
|
-
};
|
88
|
-
private static getElementRenderPos;
|
89
|
-
}
|