-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathglobal.d.ts
56 lines (48 loc) · 1.02 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
import type { BaseEditor } from "slate";
import type { ReactEditor } from "slate-react";
import type { HistoryEditor } from "slate-history";
type ElementType = "paragraph" | "heading" | "image" | "code" | "quote";
type CustomText = {
text: string;
bold?: true;
italic?: true;
underline?: true;
};
type ParagraphElement = {
type: "paragraph";
children: CustomText[];
className?: string;
};
type HeadingElement = {
type: "heading";
children: CustomText[];
className?: string;
};
type ImageElement = {
type: "image";
children: CustomText[];
className?: string;
image?: string;
};
type CodeElement = {
type: "code";
children: CustomText[];
className?: string;
};
type QuoteElement = {
type: "quote";
children: CustomText[];
className?: string;
};
declare module "slate" {
interface CustomTypes {
Editor: BaseEditor & ReactEditor & HistoryEditor;
Element:
| ParagraphElement
| HeadingElement
| ImageElement
| CodeElement
| QuoteElement;
Text: CustomText;
}
}