-
Notifications
You must be signed in to change notification settings - Fork 0
/
elements.d.ts
77 lines (61 loc) · 1.45 KB
/
elements.d.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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
import type { BaseEditor, BaseElement, BaseText } from "slate"
import type { ReactEditor } from "slate-react"
export interface H1Element extends BaseElement {
type: "h1"
}
export interface H2ELement extends BaseElement {
type: "h2"
}
export interface H3Element extends BaseElement {
type: "h3"
}
export interface DividerElement extends BaseElement {
type: "hr"
}
export interface BlockquoteElement extends BaseElement {
type: "blockquote"
}
export interface ListElement extends BaseElement {
type: "ul"
}
export interface ListItemElement extends BaseElement {
type: "li"
}
export interface CheckListElement extends BaseElement {
type: "cl"
}
export interface CheckListItemElement extends BaseElement {
type: "ci"
checked: boolean
}
export interface DefinitionListElement extends BaseElement {
type: "dl"
}
export interface DefinitionListItemElement extends BaseElement {
type: "di"
}
export interface ParagraphElement extends BaseElement {
type: "p"
}
export type DocumentElement =
| H1Element
| H2ELement
| H3Element
| DividerElement
| BlockquoteElement
| ListElement
| ListItemElement
| CheckListElement
| CheckListItemElement
| DefinitionListElement
| DefinitionListItemElement
| ParagraphElement
export interface DocumentText extends BaseText {}
export type DocumentNode = DocumentElement | DocumentText
declare module "slate" {
interface CustomTypes {
Editor: BaseEditor & ReactEditor
Element: DocumentElement
Text: DocumentText
}
}