@nasl/types 0.1.13 → 0.1.15
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.io.d.ts +12 -0
- package/nasl.ui.ast.d.ts +53 -16
- package/nasl.ui.ast.schema.json +56 -25
- package/nasl.ui.options.d.ts +29 -2
- package/package.json +1 -1
package/nasl.io.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/* eslint-disable lines-between-class-members */
|
|
2
|
+
declare namespace nasl.io {
|
|
3
|
+
export class FileInfo {
|
|
4
|
+
status: nasl.core.String;
|
|
5
|
+
url: nasl.core.String;
|
|
6
|
+
name: nasl.core.String;
|
|
7
|
+
size: nasl.core.Integer;
|
|
8
|
+
type: nasl.core.String;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export class File {}
|
|
12
|
+
}
|
package/nasl.ui.ast.d.ts
CHANGED
|
@@ -6,7 +6,26 @@
|
|
|
6
6
|
/**
|
|
7
7
|
* 设置器基类
|
|
8
8
|
*/
|
|
9
|
-
export type BaseSetter = InputSetter | SwitchSetter | EnumSelectSetter | CapsulesSetter | NumberInputSetter | IconSetter | ImageSetter | PropertySelectSetter | PropertyTransformSetter | AnonymousFunctionSetter;
|
|
9
|
+
export type BaseSetter = CustomSetter | InputSetter | SwitchSetter | EnumSelectSetter | CapsulesSetter | NumberInputSetter | IconSetter | ImageSetter | PropertySelectSetter | PropertyTransformSetter | AnonymousFunctionSetter;
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* 自定义属性设置器
|
|
13
|
+
*/
|
|
14
|
+
export interface CustomSetter {
|
|
15
|
+
concept: 'CustomSetter';
|
|
16
|
+
/**
|
|
17
|
+
* 节点变更时间
|
|
18
|
+
*/
|
|
19
|
+
changedTime?: number;
|
|
20
|
+
/**
|
|
21
|
+
* 自定义属性设置器名称
|
|
22
|
+
*/
|
|
23
|
+
name: string;
|
|
24
|
+
/**
|
|
25
|
+
* 参数映射
|
|
26
|
+
*/
|
|
27
|
+
argumentMap: Record<string, string>;
|
|
28
|
+
}
|
|
10
29
|
|
|
11
30
|
/**
|
|
12
31
|
* 输入框设置器
|
|
@@ -21,6 +40,10 @@ export interface InputSetter {
|
|
|
21
40
|
* 占位文本
|
|
22
41
|
*/
|
|
23
42
|
placeholder?: string;
|
|
43
|
+
/**
|
|
44
|
+
* 空值自动删除
|
|
45
|
+
*/
|
|
46
|
+
autoClear?: boolean;
|
|
24
47
|
}
|
|
25
48
|
|
|
26
49
|
/**
|
|
@@ -51,6 +74,10 @@ export interface EnumSelectSetter {
|
|
|
51
74
|
* 是否多选
|
|
52
75
|
*/
|
|
53
76
|
multiple?: boolean;
|
|
77
|
+
/**
|
|
78
|
+
* 是否可清空
|
|
79
|
+
*/
|
|
80
|
+
clearable?: boolean;
|
|
54
81
|
}
|
|
55
82
|
|
|
56
83
|
/**
|
|
@@ -225,7 +252,7 @@ export interface ViewComponentDeclaration {
|
|
|
225
252
|
/**
|
|
226
253
|
* 页面组件中划线名称
|
|
227
254
|
*/
|
|
228
|
-
kebabName
|
|
255
|
+
kebabName?: string;
|
|
229
256
|
/**
|
|
230
257
|
* 页面组件标题
|
|
231
258
|
*/
|
|
@@ -233,11 +260,11 @@ export interface ViewComponentDeclaration {
|
|
|
233
260
|
/**
|
|
234
261
|
* 所在分组
|
|
235
262
|
*/
|
|
236
|
-
group
|
|
263
|
+
group?: string;
|
|
237
264
|
/**
|
|
238
265
|
* 页面组件图标
|
|
239
266
|
*/
|
|
240
|
-
icon
|
|
267
|
+
icon?: string;
|
|
241
268
|
/**
|
|
242
269
|
* 页面组件描述
|
|
243
270
|
*/
|
|
@@ -281,7 +308,7 @@ export interface ViewComponentDeclaration {
|
|
|
281
308
|
/**
|
|
282
309
|
* 国际化配置列表
|
|
283
310
|
*/
|
|
284
|
-
i18nMap?:
|
|
311
|
+
i18nMap?: Record<string, Record<string, string>>;
|
|
285
312
|
}
|
|
286
313
|
|
|
287
314
|
/**
|
|
@@ -304,7 +331,7 @@ export interface PropDeclaration {
|
|
|
304
331
|
/**
|
|
305
332
|
* 组件属性分组
|
|
306
333
|
*/
|
|
307
|
-
group
|
|
334
|
+
group?: '基础信息' | '数据属性' | '主要属性' | '交互属性' | '状态属性' | '样式属性' | '工具属性' | '高级属性';
|
|
308
335
|
/**
|
|
309
336
|
* 组件属性图标
|
|
310
337
|
*/
|
|
@@ -322,7 +349,7 @@ export interface PropDeclaration {
|
|
|
322
349
|
/**
|
|
323
350
|
* 是否支持双向绑定
|
|
324
351
|
*/
|
|
325
|
-
sync
|
|
352
|
+
sync?: boolean;
|
|
326
353
|
/**
|
|
327
354
|
* 是否将任意类型隐式转换成String
|
|
328
355
|
*
|
|
@@ -348,25 +375,25 @@ export interface PropDeclaration {
|
|
|
348
375
|
/**
|
|
349
376
|
* 隐藏绑定属性按钮
|
|
350
377
|
*/
|
|
351
|
-
bindHide
|
|
378
|
+
bindHide?: boolean;
|
|
352
379
|
/**
|
|
353
380
|
* 绑定属性并打开弹窗
|
|
354
381
|
*/
|
|
355
|
-
bindOpen
|
|
382
|
+
bindOpen?: boolean;
|
|
356
383
|
/**
|
|
357
384
|
* 所在的 tab 页
|
|
358
385
|
*/
|
|
359
|
-
tabKind
|
|
386
|
+
tabKind?: 'property' | 'style';
|
|
360
387
|
/**
|
|
361
388
|
* 属性设置器
|
|
362
389
|
*/
|
|
363
|
-
setter
|
|
390
|
+
setter?: BaseSetter;
|
|
364
391
|
/**
|
|
365
392
|
* 属性在面板中的布局方式
|
|
366
393
|
*
|
|
367
394
|
* block 表示标题与设置器分行展示;inline 表示同一行展示
|
|
368
395
|
*/
|
|
369
|
-
layout
|
|
396
|
+
layout?: 'block' | 'inline';
|
|
370
397
|
/**
|
|
371
398
|
* 默认值
|
|
372
399
|
*/
|
|
@@ -455,7 +482,13 @@ export interface TypeAnnotation {
|
|
|
455
482
|
/**
|
|
456
483
|
* 规则对象
|
|
457
484
|
*/
|
|
458
|
-
ruleMap?:
|
|
485
|
+
ruleMap?: Record<string, number>;
|
|
486
|
+
/**
|
|
487
|
+
* 是否同步
|
|
488
|
+
*
|
|
489
|
+
* 仅在kind=function时生效,值不是true时表示返回类型视为Promise<...>
|
|
490
|
+
*/
|
|
491
|
+
sync?: boolean;
|
|
459
492
|
}
|
|
460
493
|
|
|
461
494
|
/**
|
|
@@ -564,7 +597,7 @@ export interface SlotDeclaration {
|
|
|
564
597
|
/**
|
|
565
598
|
* 插槽代码块
|
|
566
599
|
*/
|
|
567
|
-
snippets
|
|
600
|
+
snippets?: Array<ViewBlockWithImage>;
|
|
568
601
|
}
|
|
569
602
|
|
|
570
603
|
/**
|
|
@@ -645,11 +678,11 @@ export interface ViewBlockWithImage {
|
|
|
645
678
|
/**
|
|
646
679
|
* 截图
|
|
647
680
|
*/
|
|
648
|
-
screenshot
|
|
681
|
+
screenshot?: string;
|
|
649
682
|
/**
|
|
650
683
|
* 手绘
|
|
651
684
|
*/
|
|
652
|
-
drawing
|
|
685
|
+
drawing?: string;
|
|
653
686
|
}
|
|
654
687
|
|
|
655
688
|
/**
|
|
@@ -685,6 +718,10 @@ export interface LogicDeclaration {
|
|
|
685
718
|
* 输出参数列表
|
|
686
719
|
*/
|
|
687
720
|
returns: Array<Return>;
|
|
721
|
+
/**
|
|
722
|
+
* 是否同步执行
|
|
723
|
+
*/
|
|
724
|
+
sync?: boolean;
|
|
688
725
|
}
|
|
689
726
|
|
|
690
727
|
/**
|
package/nasl.ui.ast.schema.json
CHANGED
|
@@ -107,15 +107,9 @@
|
|
|
107
107
|
"type": "object",
|
|
108
108
|
"additionalProperties": {
|
|
109
109
|
"type": "object",
|
|
110
|
-
"
|
|
111
|
-
"
|
|
112
|
-
|
|
113
|
-
}
|
|
114
|
-
},
|
|
115
|
-
"required": [
|
|
116
|
-
"size"
|
|
117
|
-
],
|
|
118
|
-
"additionalProperties": false
|
|
110
|
+
"additionalProperties": {
|
|
111
|
+
"type": "string"
|
|
112
|
+
}
|
|
119
113
|
},
|
|
120
114
|
"description": "国际化配置列表"
|
|
121
115
|
}
|
|
@@ -123,10 +117,7 @@
|
|
|
123
117
|
"required": [
|
|
124
118
|
"concept",
|
|
125
119
|
"name",
|
|
126
|
-
"kebabName",
|
|
127
120
|
"title",
|
|
128
|
-
"group",
|
|
129
|
-
"icon",
|
|
130
121
|
"props",
|
|
131
122
|
"readableProps",
|
|
132
123
|
"events",
|
|
@@ -261,20 +252,16 @@
|
|
|
261
252
|
"concept",
|
|
262
253
|
"name",
|
|
263
254
|
"title",
|
|
264
|
-
"
|
|
265
|
-
"tsType",
|
|
266
|
-
"sync",
|
|
267
|
-
"bindHide",
|
|
268
|
-
"bindOpen",
|
|
269
|
-
"tabKind",
|
|
270
|
-
"setter",
|
|
271
|
-
"layout"
|
|
255
|
+
"tsType"
|
|
272
256
|
],
|
|
273
257
|
"additionalProperties": false,
|
|
274
258
|
"description": "组件属性"
|
|
275
259
|
},
|
|
276
260
|
"BaseSetter": {
|
|
277
261
|
"anyOf": [
|
|
262
|
+
{
|
|
263
|
+
"$ref": "#/definitions/CustomSetter"
|
|
264
|
+
},
|
|
278
265
|
{
|
|
279
266
|
"$ref": "#/definitions/InputSetter"
|
|
280
267
|
},
|
|
@@ -308,6 +295,37 @@
|
|
|
308
295
|
],
|
|
309
296
|
"description": "设置器基类"
|
|
310
297
|
},
|
|
298
|
+
"CustomSetter": {
|
|
299
|
+
"type": "object",
|
|
300
|
+
"properties": {
|
|
301
|
+
"concept": {
|
|
302
|
+
"type": "string",
|
|
303
|
+
"const": "CustomSetter"
|
|
304
|
+
},
|
|
305
|
+
"changedTime": {
|
|
306
|
+
"type": "number",
|
|
307
|
+
"description": "节点变更时间"
|
|
308
|
+
},
|
|
309
|
+
"name": {
|
|
310
|
+
"type": "string",
|
|
311
|
+
"description": "自定义属性设置器名称"
|
|
312
|
+
},
|
|
313
|
+
"argumentMap": {
|
|
314
|
+
"type": "object",
|
|
315
|
+
"additionalProperties": {
|
|
316
|
+
"type": "string"
|
|
317
|
+
},
|
|
318
|
+
"description": "参数映射"
|
|
319
|
+
}
|
|
320
|
+
},
|
|
321
|
+
"required": [
|
|
322
|
+
"concept",
|
|
323
|
+
"name",
|
|
324
|
+
"argumentMap"
|
|
325
|
+
],
|
|
326
|
+
"additionalProperties": false,
|
|
327
|
+
"description": "自定义属性设置器"
|
|
328
|
+
},
|
|
311
329
|
"InputSetter": {
|
|
312
330
|
"type": "object",
|
|
313
331
|
"properties": {
|
|
@@ -322,6 +340,10 @@
|
|
|
322
340
|
"placeholder": {
|
|
323
341
|
"type": "string",
|
|
324
342
|
"description": "占位文本"
|
|
343
|
+
},
|
|
344
|
+
"autoClear": {
|
|
345
|
+
"type": "boolean",
|
|
346
|
+
"description": "空值自动删除"
|
|
325
347
|
}
|
|
326
348
|
},
|
|
327
349
|
"required": [
|
|
@@ -369,6 +391,10 @@
|
|
|
369
391
|
"multiple": {
|
|
370
392
|
"type": "boolean",
|
|
371
393
|
"description": "是否多选"
|
|
394
|
+
},
|
|
395
|
+
"clearable": {
|
|
396
|
+
"type": "boolean",
|
|
397
|
+
"description": "是否可清空"
|
|
372
398
|
}
|
|
373
399
|
},
|
|
374
400
|
"required": [
|
|
@@ -743,6 +769,10 @@
|
|
|
743
769
|
"type": "number"
|
|
744
770
|
},
|
|
745
771
|
"description": "规则对象"
|
|
772
|
+
},
|
|
773
|
+
"sync": {
|
|
774
|
+
"type": "boolean",
|
|
775
|
+
"description": "是否同步\n\n仅在kind=function时生效,值不是true时表示返回类型视为Promise<...>"
|
|
746
776
|
}
|
|
747
777
|
},
|
|
748
778
|
"required": [
|
|
@@ -1078,8 +1108,7 @@
|
|
|
1078
1108
|
"name",
|
|
1079
1109
|
"title",
|
|
1080
1110
|
"tsType",
|
|
1081
|
-
"params"
|
|
1082
|
-
"snippets"
|
|
1111
|
+
"params"
|
|
1083
1112
|
],
|
|
1084
1113
|
"additionalProperties": false,
|
|
1085
1114
|
"description": "插槽"
|
|
@@ -1158,9 +1187,7 @@
|
|
|
1158
1187
|
"required": [
|
|
1159
1188
|
"concept",
|
|
1160
1189
|
"title",
|
|
1161
|
-
"code"
|
|
1162
|
-
"screenshot",
|
|
1163
|
-
"drawing"
|
|
1190
|
+
"code"
|
|
1164
1191
|
],
|
|
1165
1192
|
"additionalProperties": false,
|
|
1166
1193
|
"description": "带截图的代码块"
|
|
@@ -1208,6 +1235,10 @@
|
|
|
1208
1235
|
"$ref": "#/definitions/Return"
|
|
1209
1236
|
},
|
|
1210
1237
|
"description": "输出参数列表"
|
|
1238
|
+
},
|
|
1239
|
+
"sync": {
|
|
1240
|
+
"type": "boolean",
|
|
1241
|
+
"description": "是否同步执行"
|
|
1211
1242
|
}
|
|
1212
1243
|
},
|
|
1213
1244
|
"required": [
|
package/nasl.ui.options.d.ts
CHANGED
|
@@ -4,7 +4,22 @@ declare namespace nasl.ui {
|
|
|
4
4
|
/**
|
|
5
5
|
* 设置器基类
|
|
6
6
|
*/
|
|
7
|
-
export type BaseSetter<T extends object, K extends keyof T> = InputSetter | SwitchSetter | EnumSelectSetter<T, K> | CapsulesSetter<T, K> | NumberInputSetter | IconSetter | ImageSetter | PropertySelectSetter | PropertyTransformSetter | AnonymousFunctionSetter;
|
|
7
|
+
export type BaseSetter<T extends object, K extends keyof T> = CustomSetter | InputSetter | SwitchSetter | EnumSelectSetter<T, K> | CapsulesSetter<T, K> | NumberInputSetter | IconSetter | ImageSetter | PropertySelectSetter | PropertyTransformSetter | AnonymousFunctionSetter;
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* 自定义属性设置器
|
|
11
|
+
*/
|
|
12
|
+
export interface CustomSetter {
|
|
13
|
+
concept: 'CustomSetter';
|
|
14
|
+
/**
|
|
15
|
+
* 自定义属性设置器名称
|
|
16
|
+
*/
|
|
17
|
+
name: string;
|
|
18
|
+
/**
|
|
19
|
+
* 参数映射
|
|
20
|
+
*/
|
|
21
|
+
argumentMap: Record<string, string>;
|
|
22
|
+
}
|
|
8
23
|
|
|
9
24
|
/**
|
|
10
25
|
* 输入框设置器
|
|
@@ -15,6 +30,10 @@ declare namespace nasl.ui {
|
|
|
15
30
|
* 占位文本
|
|
16
31
|
*/
|
|
17
32
|
placeholder?: string;
|
|
33
|
+
/**
|
|
34
|
+
* 空值自动删除
|
|
35
|
+
*/
|
|
36
|
+
autoClear?: boolean;
|
|
18
37
|
}
|
|
19
38
|
|
|
20
39
|
/**
|
|
@@ -38,6 +57,10 @@ declare namespace nasl.ui {
|
|
|
38
57
|
* 是否多选
|
|
39
58
|
*/
|
|
40
59
|
multiple?: boolean;
|
|
60
|
+
/**
|
|
61
|
+
* 是否可清空
|
|
62
|
+
*/
|
|
63
|
+
clearable?: boolean;
|
|
41
64
|
}
|
|
42
65
|
|
|
43
66
|
/**
|
|
@@ -164,7 +187,7 @@ declare namespace nasl.ui {
|
|
|
164
187
|
/**
|
|
165
188
|
* 国际化配置列表
|
|
166
189
|
*/
|
|
167
|
-
i18nMap?:
|
|
190
|
+
i18nMap?: Record<string, Record<string, string>>;
|
|
168
191
|
}
|
|
169
192
|
|
|
170
193
|
/**
|
|
@@ -313,6 +336,10 @@ declare namespace nasl.ui {
|
|
|
313
336
|
* 逻辑描述
|
|
314
337
|
*/
|
|
315
338
|
description: string;
|
|
339
|
+
/**
|
|
340
|
+
* 是否同步执行
|
|
341
|
+
*/
|
|
342
|
+
sync?: boolean;
|
|
316
343
|
}
|
|
317
344
|
|
|
318
345
|
/**
|