-
Notifications
You must be signed in to change notification settings - Fork 0
/
global.d.ts
127 lines (104 loc) · 2.46 KB
/
global.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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
import {
Text,
createEditor,
Node,
Element,
Editor,
Descendant,
BaseEditor,
} from 'slate'
import { ReactEditor } from 'slate-react'
import { HistoryEditor } from 'slate-history'
export type BlockQuoteElement = {
type: 'block-quote'
align?: string
children: Descendant[]
}
export type BulletedListElement = {
type: 'bulleted-list'
align?: string
children: Descendant[]
}
export type CheckListItemElement = {
type: 'check-list-item'
checked: boolean
children: Descendant[]
}
export type EditableVoidElement = {
type: 'editable-void'
children: EmptyText[]
}
export type HeadingElement = {
type: 'heading'
align?: string
children: Descendant[]
}
export type HeadingTwoElement = {
type: 'heading-two'
align?: string
children: Descendant[]
}
export type HeadingThreeElement = {
type: 'heading-three'
align?: string
children: Descendant[]
}
export type ImageElement = {
type: 'image'
url: string
children: EmptyText[]
}
export type LinkElement = { type: 'link'; url: string; children: Descendant[] }
export type ButtonElement = { type: 'button'; children: Descendant[] }
export type ListItemElement = { type: 'list-item'; children: Descendant[] }
export type MentionElement = {
type: 'mention'
character: string
children: CustomText[]
}
export type ParagraphElement = {
type: 'paragraph'
align?: string
children: Descendant[]
}
export type TableElement = { type: 'table'; children: TableRow[] }
export type TableCellElement = { type: 'table-cell'; children: CustomText[] }
export type TableRowElement = { type: 'table-row'; children: TableCell[] }
export type TitleElement = { type: 'title'; children: Descendant[] }
export type VideoElement = { type: 'video'; url: string; children: EmptyText[] }
type CustomElement =
| BlockQuoteElement
| BulletedListElement
| CheckListItemElement
| EditableVoidElement
| HeadingElement
| HeadingTwoElement
| HeadingThreeElement
| ImageElement
| LinkElement
| ButtonElement
| ListItemElement
| MentionElement
| ParagraphElement
| TableElement
| TableRowElement
| TableCellElement
| TitleElement
| VideoElement
export type CustomText = {
bold?: boolean
italic?: boolean
code?: boolean
text: string
}
export type EmptyText = {
text: string
}
export type CustomEditor = BaseEditor & ReactEditor & HistoryEditor
declare module 'slate' {
interface CustomTypes {
Editor: CustomEditor
Element: CustomElement
Text: CustomText | EmptyText
}
}