forked from alibaba/lowcode-engine
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtypes.ts
More file actions
163 lines (161 loc) · 3.39 KB
/
types.ts
File metadata and controls
163 lines (161 loc) · 3.39 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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
/**
* This file was automatically generated by json-schema-to-typescript.
* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
* and run json-schema-to-typescript to regenerate this file.
*/
/**
* json schema for low code component protocol
*/
export type ComponentMeta = BasicSection & PropsSection & ConfigureSection;
export type PropType = BasicType | RequiredType | ComplexType;
export type BasicType = 'array' | 'bool' | 'func' | 'number' | 'object' | 'string' | 'node' | 'element' | 'any';
export type ComplexType = OneOf | OneOfType | ArrayOf | ObjectOf | Shape | Exact;
export type ConfigureProp = {
title?: string;
extraProps?: {
[k: string]: any;
};
[k: string]: any;
} & (ConfigureFieldProp | ConfigureGroupProp);
export interface BasicSection {
componentName: string;
title: string;
description?: string;
docUrl?: string;
screenshot?: string;
icon?: string;
tags?: string[];
devMode?: 'proCode' | 'lowCode';
npm: Npm;
[k: string]: any;
}
export interface Npm {
package: string;
exportName: string;
subName: string;
main: string;
destructuring: boolean;
version: string;
[k: string]: any;
}
export interface PropsSection {
props: Array<{
name: string;
propType: PropType;
description?: string;
defaultValue?: any;
[k: string]: any;
}>;
[k: string]: any;
}
export interface RequiredType {
type: BasicType;
isRequired?: boolean;
}
export interface OneOf {
type: 'oneOf';
value: Array<string | number | boolean>;
isRequired?: boolean;
[k: string]: any;
}
export interface OneOfType {
type: 'oneOfType';
value: PropType[];
isRequired?: boolean;
[k: string]: any;
}
export interface ArrayOf {
type: 'arrayOf';
value: PropType;
isRequired?: boolean;
[k: string]: any;
}
export interface ObjectOf {
type: 'objectOf';
value: PropType;
isRequired?: boolean;
[k: string]: any;
}
export interface Shape {
type: 'shape';
value: Array<{
name?: string;
propType?: PropType;
}>;
isRequired?: boolean;
[k: string]: any;
}
export interface Exact {
type: 'exact';
value: Array<{
name?: string;
propType?: PropType;
}>;
isRequired?: boolean;
[k: string]: any;
}
export interface ConfigureSection {
configure?: {
props?: ConfigureProp[];
styles?: {
[k: string]: any;
};
events?: {
[k: string]: any;
};
component?: ConfigureComponent;
[k: string]: any;
};
[k: string]: any;
}
export interface ConfigureFieldProp {
type: 'field';
name?: string;
setter?: ConfigureFieldSetter;
[k: string]: any;
}
export interface ConfigureFieldSetter {
componentName:
| 'List'
| 'Object'
| 'Function'
| 'Node'
| 'Mixin'
| 'Expression'
| 'Switch'
| 'Number'
| 'Input'
| 'TextArea'
| 'Date'
| 'DateYear'
| 'DateMonth'
| 'DateRange'
| 'ColorPicker'
| 'CodeEditor'
| 'Select'
| 'RadioGroup';
props?: {
[k: string]: any;
};
[k: string]: any;
}
export interface ConfigureGroupProp {
type: 'group';
items: ConfigureProp[];
[k: string]: any;
}
export interface ConfigureComponent {
isContainer?: boolean;
isModal?: boolean;
descriptor?: string;
nestingRule?: {
childWhitelist?: string[];
parentWhitelist?: string[];
descendantBlacklist?: string[];
ancestorWhitelist?: string[];
[k: string]: any;
};
isNullNode?: boolean;
isLayout?: boolean;
[k: string]: any;
}