-
Notifications
You must be signed in to change notification settings - Fork 148
/
ModelToDomFormatContext.ts
43 lines (38 loc) · 1.2 KB
/
ModelToDomFormatContext.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
import type { ContentModelBlockFormat } from '../contentModel/format/ContentModelBlockFormat';
import type { ContentModelListLevel } from '../contentModel/decorator/ContentModelListLevel';
import type { ContentModelSegmentFormat } from '../contentModel/format/ContentModelSegmentFormat';
/**
* Represents a list stack item used by Content Model to DOM conversion
*/
export interface ModelToDomListStackItem extends Partial<ContentModelListLevel> {
/**
* DOM node of this list stack
*/
node: Node;
}
/**
* Represents context for list handling
*/
export interface ModelToDomListContext {
/**
* Current number of each level of current thread
*/
threadItemCounts: number[];
/**
* A stack of current list element chain, start from the parent node of top level list
*/
nodeStack: ModelToDomListStackItem[];
}
/**
* Represents format context used by Content Model to DOM conversion
*/
export interface ModelToDomFormatContext {
/**
* Context for list handling
*/
listFormat: ModelToDomListContext;
/**
* Existing format implicitly applied from parent element
*/
implicitFormat: ContentModelSegmentFormat & ContentModelBlockFormat;
}