-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathtypes.js
55 lines (49 loc) · 1.26 KB
/
types.js
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
// @flow
export type $ContentBlocks = $ContentBlock[];
export type $ContentBlock = {|
id: string,
attrs: Object,
content: $ContentBlocks,
type: string,
|};
export type $Component = {
Render?: any,
Form?: any,
generateContent?: ({ parent?: $ContentBlock }) => $ContentBlocks,
type: string,
label?: string,
description?: string,
defaultAttrs?: (Object) => Object,
};
export type $Components = $Component[];
export type $Internals = {|
isEditor: boolean,
key?: number | string,
editingContentId: null | string,
showSidebar: (e: Event, id: string) => void,
addChildToContent: Function,
editingContentFormAttrs: null | Object,
components: $Components,
deleteContent: Function,
previewPlaceholders?: boolean,
updateComponentAttrs?: Function,
placeholders?: { [string]: string },
replacements?: { [string]: string },
|};
export type $RenderReactProps = {
content: $ContentBlocks,
components?: $Components,
previewPlaceholders?: boolean,
};
export type $SidebarProps = {
cancelEdit: Function,
UPLOADCARE_API_KEY: string,
editingContentId: string,
placeholders?: { [string]: string },
replacements?: { [string]: string },
};
export type $ExportOptions = {
inlineCss: boolean,
content: $ContentBlocks,
components: $Components,
};