@nasl/types 0.1.7-beta → 0.1.7-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/nasl.core.d.ts +0 -1
- package/nasl.ui.ast.d.ts +358 -3
- package/nasl.ui.ast.schema.json +217 -108
- package/nasl.ui.options.d.ts +199 -4
- package/package.json +1 -1
package/nasl.ui.options.d.ts
CHANGED
|
@@ -11,6 +11,9 @@ declare namespace nasl.ui {
|
|
|
11
11
|
*/
|
|
12
12
|
export interface InputSetter {
|
|
13
13
|
concept: 'InputSetter';
|
|
14
|
+
/**
|
|
15
|
+
* 占位文本
|
|
16
|
+
*/
|
|
14
17
|
placeholder?: string;
|
|
15
18
|
}
|
|
16
19
|
|
|
@@ -27,6 +30,9 @@ declare namespace nasl.ui {
|
|
|
27
30
|
*/
|
|
28
31
|
export interface EnumSelectSetter<T extends object, K extends keyof T> {
|
|
29
32
|
concept: 'EnumSelectSetter';
|
|
33
|
+
/**
|
|
34
|
+
* 枚举选项列表
|
|
35
|
+
*/
|
|
30
36
|
options: Array<SetterOption<T, K>>;
|
|
31
37
|
}
|
|
32
38
|
|
|
@@ -35,6 +41,9 @@ declare namespace nasl.ui {
|
|
|
35
41
|
*/
|
|
36
42
|
export interface CapsulesSetter<T extends object, K extends keyof T> {
|
|
37
43
|
concept: 'CapsulesSetter';
|
|
44
|
+
/**
|
|
45
|
+
* 枚举选项列表
|
|
46
|
+
*/
|
|
38
47
|
options: Array<SetterOption<T, K>>;
|
|
39
48
|
}
|
|
40
49
|
|
|
@@ -43,10 +52,25 @@ declare namespace nasl.ui {
|
|
|
43
52
|
*/
|
|
44
53
|
export interface NumberInputSetter {
|
|
45
54
|
concept: 'NumberInputSetter';
|
|
55
|
+
/**
|
|
56
|
+
* 按钮位置
|
|
57
|
+
*/
|
|
46
58
|
placement?: string;
|
|
59
|
+
/**
|
|
60
|
+
* 最小值
|
|
61
|
+
*/
|
|
47
62
|
min?: number;
|
|
63
|
+
/**
|
|
64
|
+
* 最大值
|
|
65
|
+
*/
|
|
48
66
|
max?: number;
|
|
67
|
+
/**
|
|
68
|
+
* 精度
|
|
69
|
+
*/
|
|
49
70
|
precision?: number;
|
|
71
|
+
/**
|
|
72
|
+
* 占位文本
|
|
73
|
+
*/
|
|
50
74
|
placeholder?: string;
|
|
51
75
|
}
|
|
52
76
|
|
|
@@ -55,6 +79,9 @@ declare namespace nasl.ui {
|
|
|
55
79
|
*/
|
|
56
80
|
export interface IconSetter {
|
|
57
81
|
concept: 'IconSetter';
|
|
82
|
+
/**
|
|
83
|
+
* 图标标题
|
|
84
|
+
*/
|
|
58
85
|
title?: string;
|
|
59
86
|
}
|
|
60
87
|
|
|
@@ -78,42 +105,137 @@ declare namespace nasl.ui {
|
|
|
78
105
|
* 页面组件
|
|
79
106
|
*/
|
|
80
107
|
export interface ViewComponentOpts {
|
|
108
|
+
/**
|
|
109
|
+
* 页面组件中划线名称
|
|
110
|
+
*/
|
|
81
111
|
kebabName?: string;
|
|
112
|
+
/**
|
|
113
|
+
* 页面组件标题
|
|
114
|
+
*/
|
|
82
115
|
title: string;
|
|
116
|
+
/**
|
|
117
|
+
* 所在分组
|
|
118
|
+
*/
|
|
83
119
|
group?: string;
|
|
120
|
+
/**
|
|
121
|
+
* 页面组件图标
|
|
122
|
+
*/
|
|
84
123
|
icon?: string;
|
|
124
|
+
/**
|
|
125
|
+
* 页面组件描述
|
|
126
|
+
*/
|
|
85
127
|
description?: string;
|
|
128
|
+
/**
|
|
129
|
+
* 关于 TS 的 typeParams
|
|
130
|
+
*/
|
|
86
131
|
typeParams?: string;
|
|
87
|
-
|
|
132
|
+
/**
|
|
133
|
+
* 国际化配置列表
|
|
134
|
+
*/
|
|
135
|
+
i18nMap?: Map<string, Map<string, string>>;
|
|
88
136
|
}
|
|
89
137
|
|
|
90
138
|
/**
|
|
91
139
|
* 组件属性
|
|
92
140
|
*/
|
|
93
|
-
export
|
|
141
|
+
export type PropOpts<T extends object, K extends keyof T> = {
|
|
142
|
+
/**
|
|
143
|
+
* 组件属性标题
|
|
144
|
+
*/
|
|
94
145
|
title: string;
|
|
146
|
+
/**
|
|
147
|
+
* 组件属性分组
|
|
148
|
+
*/
|
|
95
149
|
group?: '基础信息' | '数据属性' | '主要属性' | '交互属性' | '状态属性' | '样式属性' | '工具属性';
|
|
150
|
+
/**
|
|
151
|
+
* 组件属性图标
|
|
152
|
+
*/
|
|
96
153
|
icon?: string;
|
|
154
|
+
/**
|
|
155
|
+
* 组件属性描述
|
|
156
|
+
*/
|
|
97
157
|
description?: string;
|
|
98
|
-
|
|
158
|
+
/**
|
|
159
|
+
* 工具提示链接
|
|
160
|
+
*/
|
|
99
161
|
tooltipLink?: string;
|
|
162
|
+
/**
|
|
163
|
+
* 文档描述
|
|
164
|
+
*/
|
|
100
165
|
docDescription?: string;
|
|
166
|
+
/**
|
|
167
|
+
* 隐藏绑定属性按钮
|
|
168
|
+
*/
|
|
101
169
|
bindHide?: boolean;
|
|
170
|
+
/**
|
|
171
|
+
* 绑定属性并打开弹窗
|
|
172
|
+
*/
|
|
102
173
|
bindOpen?: boolean;
|
|
174
|
+
/**
|
|
175
|
+
* 所在的 tab 页
|
|
176
|
+
*/
|
|
103
177
|
tabKind?: 'property' | 'style';
|
|
178
|
+
/**
|
|
179
|
+
* 属性设置器
|
|
180
|
+
*/
|
|
104
181
|
setter?: BaseSetter<T, K>;
|
|
182
|
+
/**
|
|
183
|
+
* 属性在面板中的布局方式
|
|
184
|
+
*
|
|
185
|
+
* block 表示标题与设置器分行展示;inline 表示同一行展示
|
|
186
|
+
*/
|
|
105
187
|
layout?: 'block' | 'inline';
|
|
188
|
+
/**
|
|
189
|
+
* 渲染时的设计值
|
|
190
|
+
*/
|
|
106
191
|
designerValue?: any;
|
|
192
|
+
/**
|
|
193
|
+
* 是否显隐
|
|
194
|
+
*
|
|
195
|
+
* 用 TS 写表达式,在 IDE 中直接 eval
|
|
196
|
+
*/
|
|
107
197
|
if?: (target: T) => boolean;
|
|
198
|
+
/**
|
|
199
|
+
* 是否禁用
|
|
200
|
+
*
|
|
201
|
+
* 用 TS 写表达式,在 IDE 中直接 eval
|
|
202
|
+
*/
|
|
108
203
|
disabledIf?: (target: T) => boolean;
|
|
204
|
+
/**
|
|
205
|
+
* 在属性切换时发生的事件
|
|
206
|
+
*
|
|
207
|
+
* 用 TS 写表达式,在 IDE 中直接 eval
|
|
208
|
+
*/
|
|
109
209
|
onChange?: Array<{ update: any; if?: (value: T[K]) => boolean } | { clear: Array<string>; if?: (value: T[K]) => boolean }>;
|
|
110
|
-
}
|
|
210
|
+
} & ({
|
|
211
|
+
/**
|
|
212
|
+
* 是否支持双向绑定
|
|
213
|
+
*/
|
|
214
|
+
sync?: true;
|
|
215
|
+
} | {
|
|
216
|
+
/**
|
|
217
|
+
* 是否支持双向绑定
|
|
218
|
+
*/
|
|
219
|
+
sync?: false;
|
|
220
|
+
/**
|
|
221
|
+
* 是否将任意类型隐式转换成String
|
|
222
|
+
*
|
|
223
|
+
* 仅在属性类型为 string(不包括字符串枚举)的情况下,且 sync 为 falsy 时可配置
|
|
224
|
+
*/
|
|
225
|
+
implicitToString?: T[K] extends string ? (string extends T[K] ? boolean : never) : never;
|
|
226
|
+
})
|
|
111
227
|
|
|
112
228
|
/**
|
|
113
229
|
* 组件事件
|
|
114
230
|
*/
|
|
115
231
|
export interface EventOpts {
|
|
232
|
+
/**
|
|
233
|
+
* 组件事件标题
|
|
234
|
+
*/
|
|
116
235
|
title: string;
|
|
236
|
+
/**
|
|
237
|
+
* 组件事件描述
|
|
238
|
+
*/
|
|
117
239
|
description?: string;
|
|
118
240
|
}
|
|
119
241
|
|
|
@@ -121,9 +243,21 @@ declare namespace nasl.ui {
|
|
|
121
243
|
* 插槽
|
|
122
244
|
*/
|
|
123
245
|
export interface SlotOpts {
|
|
246
|
+
/**
|
|
247
|
+
* 插槽标题
|
|
248
|
+
*/
|
|
124
249
|
title: string;
|
|
250
|
+
/**
|
|
251
|
+
* 插槽描述
|
|
252
|
+
*/
|
|
125
253
|
description?: string;
|
|
254
|
+
/**
|
|
255
|
+
* 空的占位图
|
|
256
|
+
*/
|
|
126
257
|
emptyBackground?: string;
|
|
258
|
+
/**
|
|
259
|
+
* 插槽代码块
|
|
260
|
+
*/
|
|
127
261
|
snippets?: Array<ViewBlockWithImage>;
|
|
128
262
|
}
|
|
129
263
|
|
|
@@ -131,7 +265,13 @@ declare namespace nasl.ui {
|
|
|
131
265
|
* 逻辑声明
|
|
132
266
|
*/
|
|
133
267
|
export interface LogicOpts {
|
|
268
|
+
/**
|
|
269
|
+
* 逻辑标题
|
|
270
|
+
*/
|
|
134
271
|
title: string;
|
|
272
|
+
/**
|
|
273
|
+
* 逻辑描述
|
|
274
|
+
*/
|
|
135
275
|
description: string;
|
|
136
276
|
}
|
|
137
277
|
|
|
@@ -139,9 +279,21 @@ declare namespace nasl.ui {
|
|
|
139
279
|
* 带分组的参数
|
|
140
280
|
*/
|
|
141
281
|
export interface ParamOpts {
|
|
282
|
+
/**
|
|
283
|
+
* 输入参数描述
|
|
284
|
+
*/
|
|
142
285
|
description?: string;
|
|
286
|
+
/**
|
|
287
|
+
* 是否为展开参数
|
|
288
|
+
*/
|
|
143
289
|
spread?: boolean;
|
|
290
|
+
/**
|
|
291
|
+
* 标题
|
|
292
|
+
*/
|
|
144
293
|
title: string;
|
|
294
|
+
/**
|
|
295
|
+
* 分组
|
|
296
|
+
*/
|
|
145
297
|
group?: string;
|
|
146
298
|
}
|
|
147
299
|
|
|
@@ -149,10 +301,29 @@ declare namespace nasl.ui {
|
|
|
149
301
|
* 设置器枚举选项
|
|
150
302
|
*/
|
|
151
303
|
export interface SetterOption<T extends object = never, K extends keyof T = never> {
|
|
304
|
+
/**
|
|
305
|
+
* 选项标题
|
|
306
|
+
*/
|
|
152
307
|
title: string;
|
|
308
|
+
/**
|
|
309
|
+
* 选项图标
|
|
310
|
+
*/
|
|
153
311
|
icon?: string;
|
|
312
|
+
/**
|
|
313
|
+
* 选项工具提示
|
|
314
|
+
*/
|
|
154
315
|
tooltip?: string;
|
|
316
|
+
/**
|
|
317
|
+
* 是否显隐
|
|
318
|
+
*
|
|
319
|
+
* 用 TS 写表达式,在 IDE 中直接 eval
|
|
320
|
+
*/
|
|
155
321
|
if?: (target: T) => boolean;
|
|
322
|
+
/**
|
|
323
|
+
* 是否禁用
|
|
324
|
+
*
|
|
325
|
+
* 用 TS 写表达式,在 IDE 中直接 eval
|
|
326
|
+
*/
|
|
156
327
|
disabledIf?: (target: T) => boolean;
|
|
157
328
|
}
|
|
158
329
|
|
|
@@ -160,10 +331,25 @@ declare namespace nasl.ui {
|
|
|
160
331
|
* 带截图的代码块
|
|
161
332
|
*/
|
|
162
333
|
export interface ViewBlockWithImage {
|
|
334
|
+
/**
|
|
335
|
+
* 标题
|
|
336
|
+
*/
|
|
163
337
|
title: string;
|
|
338
|
+
/**
|
|
339
|
+
* 代码
|
|
340
|
+
*/
|
|
164
341
|
code: string;
|
|
342
|
+
/**
|
|
343
|
+
* 描述
|
|
344
|
+
*/
|
|
165
345
|
description?: string;
|
|
346
|
+
/**
|
|
347
|
+
* 截图
|
|
348
|
+
*/
|
|
166
349
|
screenshot?: string;
|
|
350
|
+
/**
|
|
351
|
+
* 手绘
|
|
352
|
+
*/
|
|
167
353
|
drawing?: string;
|
|
168
354
|
}
|
|
169
355
|
|
|
@@ -171,8 +357,17 @@ declare namespace nasl.ui {
|
|
|
171
357
|
* 页面组件的代码块
|
|
172
358
|
*/
|
|
173
359
|
export interface ViewBlock {
|
|
360
|
+
/**
|
|
361
|
+
* 标题
|
|
362
|
+
*/
|
|
174
363
|
title: string;
|
|
364
|
+
/**
|
|
365
|
+
* 代码
|
|
366
|
+
*/
|
|
175
367
|
code: string;
|
|
368
|
+
/**
|
|
369
|
+
* 描述
|
|
370
|
+
*/
|
|
176
371
|
description?: string;
|
|
177
372
|
}
|
|
178
373
|
}
|