forked from frappe/builder
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuilder.d.ts
More file actions
114 lines (92 loc) · 2.46 KB
/
builder.d.ts
File metadata and controls
114 lines (92 loc) · 2.46 KB
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
declare type StyleValue = string | number | null | undefined;
declare type styleProperty = keyof CSSProperties | `__${string}`;
declare interface BlockStyleMap {
[key: styleProperty]: StyleValue;
}
declare interface BlockAttributeMap {
[key: string]: string | number | null | undefined;
}
declare interface BlockOptions {
blockId?: string | undefined;
element?: string;
originalElement?: string;
baseStyles?: BlockStyleMap;
mobileStyles?: BlockStyleMap;
tabletStyles?: BlockStyleMap;
attributes?: BlockAttributeMap;
classes?: Array<string>;
children?: Array<Block | BlockOptions>;
dynamicValues?: Array<BlockDataKey>;
draggable?: boolean;
[key: string]: any;
}
declare interface BlockComponent {
name: string;
component_name: string;
component_id: string;
icon: string;
is_dynamic: boolean;
block: BlockOptions;
scale: number;
}
declare interface PageMap {
[key: string]: Page;
}
declare interface BlockStyleObjects {
baseStyles: BlockStyleMap;
mobileStyles?: BlockStyleMap;
tabletStyles?: BlockStyleMap;
}
declare interface StyleCopy {
blockId: string;
style: BlockStyleObjects;
}
declare interface ContextMenuOption {
label: string;
action: CallableFunction;
condition?: () => boolean;
disabled?: () => boolean;
}
declare interface ComponentData {
name: string;
doctype?: string;
isDynamic: boolean;
mappings?: {
[key: string]: string;
};
}
declare type HashString = `#${string}`;
declare type RGBString = `rgb(${number}, ${number}, ${number})`;
declare type LeftSidebarTabOption = "Blocks" | "Layers" | "Assets" | "Code" | "variables";
declare type RightSidebarTabOption = "Properties" | "Script" | "Options";
declare type BuilderMode = "select" | "text" | "container" | "image" | "repeater" | "move";
declare interface Breakpoint {
icon: string;
device: string;
displayName: string;
width: number;
visible: boolean;
}
declare interface CanvasProps {
scale: number;
translateX: number;
translateY: number;
scaling: boolean;
panning: boolean;
background: string;
settingCanvas: boolean;
overlayElement: HTMLElement | null;
breakpoints: Breakpoint[];
}
declare type EditingMode = "page" | "fragment";
declare type UserInfo = { user: string; fullname: string; image: string };
declare type FileDoc = {
file_url: string;
};
declare interface BlockDataKey {
key?: string;
type?: BlockDataKeyType;
property?: string;
}
declare type BlockDataKeyType = "key" | "attribute" | "style";
declare type CSSVariableName = string | `var(--${string})`;