-
Notifications
You must be signed in to change notification settings - Fork 147
/
ModelToDomSelectionContext.ts
57 lines (49 loc) · 1.4 KB
/
ModelToDomSelectionContext.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
import type { ImageSelection, TableSelection } from '../selection/DOMSelection';
/**
* Represents internal data structure for a selection position, combined by block and segment node
*/
export interface ModelToDomBlockAndSegmentNode {
/**
* The block element of the selection. When segment is null, it represents the start position of this block element,
* otherwise block element will be ignored and we can always retrieve position from segment node
*/
block: Node | null;
/**
* Segment node of this position. When provided, it represents the position right after this node
*/
segment: Node | null;
}
/**
* Represents internal data structure for regular selection
*/
export interface ModelToDomRegularSelection {
/**
* Start position of selection
*/
start?: ModelToDomBlockAndSegmentNode;
/**
* End position of selection
*/
end?: ModelToDomBlockAndSegmentNode;
/**
* Current navigating position
*/
current: ModelToDomBlockAndSegmentNode;
}
/**
* Represents selection info used by Content Model to DOM conversion
*/
export interface ModelToDomSelectionContext {
/**
* Regular selection info
*/
regularSelection: ModelToDomRegularSelection;
/**
* Table selection info
*/
tableSelection?: TableSelection;
/**
* Image selection info
*/
imageSelection?: ImageSelection;
}