forked from alibaba/lowcode-engine
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvalue-type.ts
More file actions
136 lines (117 loc) · 2.39 KB
/
value-type.ts
File metadata and controls
136 lines (117 loc) · 2.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
import { IPublicTypeNodeData, IPublicTypeCompositeValue, IPublicTypeNodeSchema } from './';
/**
* 变量表达式
*
* 表达式内通过 this 对象获取上下文
*/
export interface IPublicTypeJSExpression {
type: 'JSExpression';
/**
* 表达式字符串
*/
value: string;
/**
* 模拟值
*
* @todo 待标准描述
*/
mock?: any;
/**
* 源码
*
* @todo 待标准描述
*/
compiled?: string;
}
/**
* 事件函数类型
* @see https://lowcode-engine.cn/lowcode
*
* 保留与原组件属性、生命周期 ( React / 小程序) 一致的输入参数,并给所有事件函数 binding 统一一致的上下文(当前组件所在容器结构的 this 对象)
*/
export interface IPublicTypeJSFunction {
type: 'JSFunction';
/**
* 函数定义,或直接函数表达式
*/
value: string;
/**
* 源码
*
* @todo 待标准描述
*/
compiled?: string;
/**
* 模拟值
*
* @todo 待标准描述
*/
mock?: any;
/**
* 额外扩展属性,如 extType、events
*
* @todo 待标准描述
*/
[key: string]: any;
}
/**
* Slot 函数类型
*
* 通常用于描述组件的某一个属性为 ReactNode 或 Function return ReactNode 的场景。
*/
export interface IPublicTypeJSSlot {
/**
* type
*/
type: 'JSSlot';
/**
* @todo 待标准描述
*/
title?: string;
/**
* @todo 待标准描述
*/
id?: string;
/**
* 组件的某一个属性为 Function return ReactNode 时,函数的入参
*
* 其子节点可以通过 this[参数名] 来获取对应的参数。
*/
params?: string[];
/**
* 具体的值。
*/
value?: IPublicTypeNodeData[] | IPublicTypeNodeData;
/**
* @todo 待标准描述
*/
name?: string;
}
/**
* @deprecated
*
* @todo 待文档描述
*/
export interface IPublicTypeJSBlock {
type: 'JSBlock';
value: IPublicTypeNodeSchema;
}
/**
* JSON 基本类型
*/
export type IPublicTypeJSONValue =
| boolean
| string
| number
| null
| undefined
| IPublicTypeJSONArray
| IPublicTypeJSONObject;
export type IPublicTypeJSONArray = IPublicTypeJSONValue[];
export interface IPublicTypeJSONObject {
[key: string]: IPublicTypeJSONValue;
}
export type IPublicTypeCompositeArray = IPublicTypeCompositeValue[];
export interface IPublicTypeCompositeObject<T = IPublicTypeCompositeValue> {
[key: string]: IPublicTypeCompositeValue | T;
}