@nasl/types 0.1.14 → 0.2.0
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 +39 -18
- package/nasl.ui.ast.schema.json +36 -20
- package/nasl.ui.options.d.ts +16 -5
- 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,7 @@
|
|
|
6
6
|
/**
|
|
7
7
|
* 设置器基类
|
|
8
8
|
*/
|
|
9
|
-
export type BaseSetter = CustomSetter | 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 | DataSourceSetter;
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
12
|
* 自定义属性设置器
|
|
@@ -236,6 +236,21 @@ export interface AnonymousFunctionSetter {
|
|
|
236
236
|
changedTime?: number;
|
|
237
237
|
}
|
|
238
238
|
|
|
239
|
+
/**
|
|
240
|
+
* 数据源设置器
|
|
241
|
+
*/
|
|
242
|
+
export interface DataSourceSetter {
|
|
243
|
+
concept: 'DataSourceSetter';
|
|
244
|
+
/**
|
|
245
|
+
* 节点变更时间
|
|
246
|
+
*/
|
|
247
|
+
changedTime?: number;
|
|
248
|
+
/**
|
|
249
|
+
* 占位文本
|
|
250
|
+
*/
|
|
251
|
+
placeholder?: string;
|
|
252
|
+
}
|
|
253
|
+
|
|
239
254
|
/**
|
|
240
255
|
* 页面组件
|
|
241
256
|
*/
|
|
@@ -252,7 +267,7 @@ export interface ViewComponentDeclaration {
|
|
|
252
267
|
/**
|
|
253
268
|
* 页面组件中划线名称
|
|
254
269
|
*/
|
|
255
|
-
kebabName
|
|
270
|
+
kebabName?: string;
|
|
256
271
|
/**
|
|
257
272
|
* 页面组件标题
|
|
258
273
|
*/
|
|
@@ -260,11 +275,11 @@ export interface ViewComponentDeclaration {
|
|
|
260
275
|
/**
|
|
261
276
|
* 所在分组
|
|
262
277
|
*/
|
|
263
|
-
group
|
|
278
|
+
group?: string;
|
|
264
279
|
/**
|
|
265
280
|
* 页面组件图标
|
|
266
281
|
*/
|
|
267
|
-
icon
|
|
282
|
+
icon?: string;
|
|
268
283
|
/**
|
|
269
284
|
* 页面组件描述
|
|
270
285
|
*/
|
|
@@ -331,7 +346,7 @@ export interface PropDeclaration {
|
|
|
331
346
|
/**
|
|
332
347
|
* 组件属性分组
|
|
333
348
|
*/
|
|
334
|
-
group
|
|
349
|
+
group?: '基础信息' | '数据属性' | '主要属性' | '交互属性' | '状态属性' | '样式属性' | '工具属性' | '高级属性';
|
|
335
350
|
/**
|
|
336
351
|
* 组件属性图标
|
|
337
352
|
*/
|
|
@@ -349,7 +364,7 @@ export interface PropDeclaration {
|
|
|
349
364
|
/**
|
|
350
365
|
* 是否支持双向绑定
|
|
351
366
|
*/
|
|
352
|
-
sync
|
|
367
|
+
sync?: boolean;
|
|
353
368
|
/**
|
|
354
369
|
* 是否将任意类型隐式转换成String
|
|
355
370
|
*
|
|
@@ -360,10 +375,6 @@ export interface PropDeclaration {
|
|
|
360
375
|
* 允许该组件在逻辑中设置
|
|
361
376
|
*/
|
|
362
377
|
settable?: boolean;
|
|
363
|
-
/**
|
|
364
|
-
* 该属性是否为数据源
|
|
365
|
-
*/
|
|
366
|
-
isDataSource?: boolean;
|
|
367
378
|
/**
|
|
368
379
|
* 工具提示链接
|
|
369
380
|
*/
|
|
@@ -375,25 +386,25 @@ export interface PropDeclaration {
|
|
|
375
386
|
/**
|
|
376
387
|
* 隐藏绑定属性按钮
|
|
377
388
|
*/
|
|
378
|
-
bindHide
|
|
389
|
+
bindHide?: boolean;
|
|
379
390
|
/**
|
|
380
391
|
* 绑定属性并打开弹窗
|
|
381
392
|
*/
|
|
382
|
-
bindOpen
|
|
393
|
+
bindOpen?: boolean;
|
|
383
394
|
/**
|
|
384
395
|
* 所在的 tab 页
|
|
385
396
|
*/
|
|
386
|
-
tabKind
|
|
397
|
+
tabKind?: 'property' | 'style';
|
|
387
398
|
/**
|
|
388
399
|
* 属性设置器
|
|
389
400
|
*/
|
|
390
|
-
setter
|
|
401
|
+
setter?: BaseSetter;
|
|
391
402
|
/**
|
|
392
403
|
* 属性在面板中的布局方式
|
|
393
404
|
*
|
|
394
405
|
* block 表示标题与设置器分行展示;inline 表示同一行展示
|
|
395
406
|
*/
|
|
396
|
-
layout
|
|
407
|
+
layout?: 'block' | 'inline';
|
|
397
408
|
/**
|
|
398
409
|
* 默认值
|
|
399
410
|
*/
|
|
@@ -483,6 +494,12 @@ export interface TypeAnnotation {
|
|
|
483
494
|
* 规则对象
|
|
484
495
|
*/
|
|
485
496
|
ruleMap?: Record<string, number>;
|
|
497
|
+
/**
|
|
498
|
+
* 是否同步
|
|
499
|
+
*
|
|
500
|
+
* 仅在kind=function时生效,值不是true时表示返回类型视为Promise<...>
|
|
501
|
+
*/
|
|
502
|
+
sync?: boolean;
|
|
486
503
|
}
|
|
487
504
|
|
|
488
505
|
/**
|
|
@@ -591,7 +608,7 @@ export interface SlotDeclaration {
|
|
|
591
608
|
/**
|
|
592
609
|
* 插槽代码块
|
|
593
610
|
*/
|
|
594
|
-
snippets
|
|
611
|
+
snippets?: Array<ViewBlockWithImage>;
|
|
595
612
|
}
|
|
596
613
|
|
|
597
614
|
/**
|
|
@@ -672,11 +689,11 @@ export interface ViewBlockWithImage {
|
|
|
672
689
|
/**
|
|
673
690
|
* 截图
|
|
674
691
|
*/
|
|
675
|
-
screenshot
|
|
692
|
+
screenshot?: string;
|
|
676
693
|
/**
|
|
677
694
|
* 手绘
|
|
678
695
|
*/
|
|
679
|
-
drawing
|
|
696
|
+
drawing?: string;
|
|
680
697
|
}
|
|
681
698
|
|
|
682
699
|
/**
|
|
@@ -712,6 +729,10 @@ export interface LogicDeclaration {
|
|
|
712
729
|
* 输出参数列表
|
|
713
730
|
*/
|
|
714
731
|
returns: Array<Return>;
|
|
732
|
+
/**
|
|
733
|
+
* 是否同步执行
|
|
734
|
+
*/
|
|
735
|
+
sync?: boolean;
|
|
715
736
|
}
|
|
716
737
|
|
|
717
738
|
/**
|
package/nasl.ui.ast.schema.json
CHANGED
|
@@ -117,10 +117,7 @@
|
|
|
117
117
|
"required": [
|
|
118
118
|
"concept",
|
|
119
119
|
"name",
|
|
120
|
-
"kebabName",
|
|
121
120
|
"title",
|
|
122
|
-
"group",
|
|
123
|
-
"icon",
|
|
124
121
|
"props",
|
|
125
122
|
"readableProps",
|
|
126
123
|
"events",
|
|
@@ -190,10 +187,6 @@
|
|
|
190
187
|
"type": "boolean",
|
|
191
188
|
"description": "允许该组件在逻辑中设置"
|
|
192
189
|
},
|
|
193
|
-
"isDataSource": {
|
|
194
|
-
"type": "boolean",
|
|
195
|
-
"description": "该属性是否为数据源"
|
|
196
|
-
},
|
|
197
190
|
"tooltipLink": {
|
|
198
191
|
"type": "string",
|
|
199
192
|
"description": "工具提示链接"
|
|
@@ -255,14 +248,7 @@
|
|
|
255
248
|
"concept",
|
|
256
249
|
"name",
|
|
257
250
|
"title",
|
|
258
|
-
"
|
|
259
|
-
"tsType",
|
|
260
|
-
"sync",
|
|
261
|
-
"bindHide",
|
|
262
|
-
"bindOpen",
|
|
263
|
-
"tabKind",
|
|
264
|
-
"setter",
|
|
265
|
-
"layout"
|
|
251
|
+
"tsType"
|
|
266
252
|
],
|
|
267
253
|
"additionalProperties": false,
|
|
268
254
|
"description": "组件属性"
|
|
@@ -301,6 +287,9 @@
|
|
|
301
287
|
},
|
|
302
288
|
{
|
|
303
289
|
"$ref": "#/definitions/AnonymousFunctionSetter"
|
|
290
|
+
},
|
|
291
|
+
{
|
|
292
|
+
"$ref": "#/definitions/DataSourceSetter"
|
|
304
293
|
}
|
|
305
294
|
],
|
|
306
295
|
"description": "设置器基类"
|
|
@@ -628,6 +617,28 @@
|
|
|
628
617
|
"additionalProperties": false,
|
|
629
618
|
"description": "匿名函数设置器"
|
|
630
619
|
},
|
|
620
|
+
"DataSourceSetter": {
|
|
621
|
+
"type": "object",
|
|
622
|
+
"properties": {
|
|
623
|
+
"concept": {
|
|
624
|
+
"type": "string",
|
|
625
|
+
"const": "DataSourceSetter"
|
|
626
|
+
},
|
|
627
|
+
"changedTime": {
|
|
628
|
+
"type": "number",
|
|
629
|
+
"description": "节点变更时间"
|
|
630
|
+
},
|
|
631
|
+
"placeholder": {
|
|
632
|
+
"type": "string",
|
|
633
|
+
"description": "占位文本"
|
|
634
|
+
}
|
|
635
|
+
},
|
|
636
|
+
"required": [
|
|
637
|
+
"concept"
|
|
638
|
+
],
|
|
639
|
+
"additionalProperties": false,
|
|
640
|
+
"description": "数据源设置器"
|
|
641
|
+
},
|
|
631
642
|
"DefaultValue": {
|
|
632
643
|
"type": "object",
|
|
633
644
|
"properties": {
|
|
@@ -779,6 +790,10 @@
|
|
|
779
790
|
"type": "number"
|
|
780
791
|
},
|
|
781
792
|
"description": "规则对象"
|
|
793
|
+
},
|
|
794
|
+
"sync": {
|
|
795
|
+
"type": "boolean",
|
|
796
|
+
"description": "是否同步\n\n仅在kind=function时生效,值不是true时表示返回类型视为Promise<...>"
|
|
782
797
|
}
|
|
783
798
|
},
|
|
784
799
|
"required": [
|
|
@@ -1114,8 +1129,7 @@
|
|
|
1114
1129
|
"name",
|
|
1115
1130
|
"title",
|
|
1116
1131
|
"tsType",
|
|
1117
|
-
"params"
|
|
1118
|
-
"snippets"
|
|
1132
|
+
"params"
|
|
1119
1133
|
],
|
|
1120
1134
|
"additionalProperties": false,
|
|
1121
1135
|
"description": "插槽"
|
|
@@ -1194,9 +1208,7 @@
|
|
|
1194
1208
|
"required": [
|
|
1195
1209
|
"concept",
|
|
1196
1210
|
"title",
|
|
1197
|
-
"code"
|
|
1198
|
-
"screenshot",
|
|
1199
|
-
"drawing"
|
|
1211
|
+
"code"
|
|
1200
1212
|
],
|
|
1201
1213
|
"additionalProperties": false,
|
|
1202
1214
|
"description": "带截图的代码块"
|
|
@@ -1244,6 +1256,10 @@
|
|
|
1244
1256
|
"$ref": "#/definitions/Return"
|
|
1245
1257
|
},
|
|
1246
1258
|
"description": "输出参数列表"
|
|
1259
|
+
},
|
|
1260
|
+
"sync": {
|
|
1261
|
+
"type": "boolean",
|
|
1262
|
+
"description": "是否同步执行"
|
|
1247
1263
|
}
|
|
1248
1264
|
},
|
|
1249
1265
|
"required": [
|
package/nasl.ui.options.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ declare namespace nasl.ui {
|
|
|
4
4
|
/**
|
|
5
5
|
* 设置器基类
|
|
6
6
|
*/
|
|
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;
|
|
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 | DataSourceSetter;
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* 自定义属性设置器
|
|
@@ -156,6 +156,17 @@ declare namespace nasl.ui {
|
|
|
156
156
|
|
|
157
157
|
}
|
|
158
158
|
|
|
159
|
+
/**
|
|
160
|
+
* 数据源设置器
|
|
161
|
+
*/
|
|
162
|
+
export interface DataSourceSetter {
|
|
163
|
+
concept: 'DataSourceSetter';
|
|
164
|
+
/**
|
|
165
|
+
* 占位文本
|
|
166
|
+
*/
|
|
167
|
+
placeholder?: string;
|
|
168
|
+
}
|
|
169
|
+
|
|
159
170
|
/**
|
|
160
171
|
* 页面组件
|
|
161
172
|
*/
|
|
@@ -214,10 +225,6 @@ declare namespace nasl.ui {
|
|
|
214
225
|
* 允许该组件在逻辑中设置
|
|
215
226
|
*/
|
|
216
227
|
settable?: boolean;
|
|
217
|
-
/**
|
|
218
|
-
* 该属性是否为数据源
|
|
219
|
-
*/
|
|
220
|
-
isDataSource?: boolean;
|
|
221
228
|
/**
|
|
222
229
|
* 工具提示链接
|
|
223
230
|
*/
|
|
@@ -336,6 +343,10 @@ declare namespace nasl.ui {
|
|
|
336
343
|
* 逻辑描述
|
|
337
344
|
*/
|
|
338
345
|
description: string;
|
|
346
|
+
/**
|
|
347
|
+
* 是否同步执行
|
|
348
|
+
*/
|
|
349
|
+
sync?: boolean;
|
|
339
350
|
}
|
|
340
351
|
|
|
341
352
|
/**
|