forked from alibaba/lowcode-engine
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprop-config.ts
More file actions
65 lines (62 loc) · 1.19 KB
/
prop-config.ts
File metadata and controls
65 lines (62 loc) · 1.19 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
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 interface RequiredType {
type: BasicType;
isRequired?: boolean;
}
export interface OneOf {
type: 'oneOf';
value: string[];
isRequired?: boolean;
}
export interface OneOfType {
type: 'oneOfType';
value: PropType[];
isRequired?: boolean;
}
export interface ArrayOf {
type: 'arrayOf';
value: PropType;
isRequired?: boolean;
}
export interface ObjectOf {
type: 'objectOf';
value: PropType;
isRequired?: boolean;
}
export interface Shape {
type: 'shape';
value: PropConfig[];
isRequired?: boolean;
}
export interface Exact {
type: 'exact';
value: PropConfig[];
isRequired?: boolean;
}
/**
* 组件属性信息
*/
export interface PropConfig {
/**
* 属性名称
*/
name: string;
/**
* 属性类型
*/
propType: PropType;
/**
* 属性描述
*/
description?: string;
/**
* 属性默认值
*/
defaultValue?: any;
/**
* @deprecated 已被弃用
*/
setter?: any;
}