@nasl/types 0.1.14 → 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 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
@@ -252,7 +252,7 @@ export interface ViewComponentDeclaration {
252
252
  /**
253
253
  * 页面组件中划线名称
254
254
  */
255
- kebabName: string;
255
+ kebabName?: string;
256
256
  /**
257
257
  * 页面组件标题
258
258
  */
@@ -260,11 +260,11 @@ export interface ViewComponentDeclaration {
260
260
  /**
261
261
  * 所在分组
262
262
  */
263
- group: string;
263
+ group?: string;
264
264
  /**
265
265
  * 页面组件图标
266
266
  */
267
- icon: string;
267
+ icon?: string;
268
268
  /**
269
269
  * 页面组件描述
270
270
  */
@@ -331,7 +331,7 @@ export interface PropDeclaration {
331
331
  /**
332
332
  * 组件属性分组
333
333
  */
334
- group: '基础信息' | '数据属性' | '主要属性' | '交互属性' | '状态属性' | '样式属性' | '工具属性' | '高级属性';
334
+ group?: '基础信息' | '数据属性' | '主要属性' | '交互属性' | '状态属性' | '样式属性' | '工具属性' | '高级属性';
335
335
  /**
336
336
  * 组件属性图标
337
337
  */
@@ -349,7 +349,7 @@ export interface PropDeclaration {
349
349
  /**
350
350
  * 是否支持双向绑定
351
351
  */
352
- sync: boolean;
352
+ sync?: boolean;
353
353
  /**
354
354
  * 是否将任意类型隐式转换成String
355
355
  *
@@ -375,25 +375,25 @@ export interface PropDeclaration {
375
375
  /**
376
376
  * 隐藏绑定属性按钮
377
377
  */
378
- bindHide: boolean;
378
+ bindHide?: boolean;
379
379
  /**
380
380
  * 绑定属性并打开弹窗
381
381
  */
382
- bindOpen: boolean;
382
+ bindOpen?: boolean;
383
383
  /**
384
384
  * 所在的 tab 页
385
385
  */
386
- tabKind: 'property' | 'style';
386
+ tabKind?: 'property' | 'style';
387
387
  /**
388
388
  * 属性设置器
389
389
  */
390
- setter: BaseSetter;
390
+ setter?: BaseSetter;
391
391
  /**
392
392
  * 属性在面板中的布局方式
393
393
  *
394
394
  * block 表示标题与设置器分行展示;inline 表示同一行展示
395
395
  */
396
- layout: 'block' | 'inline';
396
+ layout?: 'block' | 'inline';
397
397
  /**
398
398
  * 默认值
399
399
  */
@@ -483,6 +483,12 @@ export interface TypeAnnotation {
483
483
  * 规则对象
484
484
  */
485
485
  ruleMap?: Record<string, number>;
486
+ /**
487
+ * 是否同步
488
+ *
489
+ * 仅在kind=function时生效,值不是true时表示返回类型视为Promise<...>
490
+ */
491
+ sync?: boolean;
486
492
  }
487
493
 
488
494
  /**
@@ -591,7 +597,7 @@ export interface SlotDeclaration {
591
597
  /**
592
598
  * 插槽代码块
593
599
  */
594
- snippets: Array<ViewBlockWithImage>;
600
+ snippets?: Array<ViewBlockWithImage>;
595
601
  }
596
602
 
597
603
  /**
@@ -672,11 +678,11 @@ export interface ViewBlockWithImage {
672
678
  /**
673
679
  * 截图
674
680
  */
675
- screenshot: string;
681
+ screenshot?: string;
676
682
  /**
677
683
  * 手绘
678
684
  */
679
- drawing: string;
685
+ drawing?: string;
680
686
  }
681
687
 
682
688
  /**
@@ -712,6 +718,10 @@ export interface LogicDeclaration {
712
718
  * 输出参数列表
713
719
  */
714
720
  returns: Array<Return>;
721
+ /**
722
+ * 是否同步执行
723
+ */
724
+ sync?: boolean;
715
725
  }
716
726
 
717
727
  /**
@@ -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",
@@ -255,14 +252,7 @@
255
252
  "concept",
256
253
  "name",
257
254
  "title",
258
- "group",
259
- "tsType",
260
- "sync",
261
- "bindHide",
262
- "bindOpen",
263
- "tabKind",
264
- "setter",
265
- "layout"
255
+ "tsType"
266
256
  ],
267
257
  "additionalProperties": false,
268
258
  "description": "组件属性"
@@ -779,6 +769,10 @@
779
769
  "type": "number"
780
770
  },
781
771
  "description": "规则对象"
772
+ },
773
+ "sync": {
774
+ "type": "boolean",
775
+ "description": "是否同步\n\n仅在kind=function时生效,值不是true时表示返回类型视为Promise<...>"
782
776
  }
783
777
  },
784
778
  "required": [
@@ -1114,8 +1108,7 @@
1114
1108
  "name",
1115
1109
  "title",
1116
1110
  "tsType",
1117
- "params",
1118
- "snippets"
1111
+ "params"
1119
1112
  ],
1120
1113
  "additionalProperties": false,
1121
1114
  "description": "插槽"
@@ -1194,9 +1187,7 @@
1194
1187
  "required": [
1195
1188
  "concept",
1196
1189
  "title",
1197
- "code",
1198
- "screenshot",
1199
- "drawing"
1190
+ "code"
1200
1191
  ],
1201
1192
  "additionalProperties": false,
1202
1193
  "description": "带截图的代码块"
@@ -1244,6 +1235,10 @@
1244
1235
  "$ref": "#/definitions/Return"
1245
1236
  },
1246
1237
  "description": "输出参数列表"
1238
+ },
1239
+ "sync": {
1240
+ "type": "boolean",
1241
+ "description": "是否同步执行"
1247
1242
  }
1248
1243
  },
1249
1244
  "required": [
@@ -336,6 +336,10 @@ declare namespace nasl.ui {
336
336
  * 逻辑描述
337
337
  */
338
338
  description: string;
339
+ /**
340
+ * 是否同步执行
341
+ */
342
+ sync?: boolean;
339
343
  }
340
344
 
341
345
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nasl/types",
3
- "version": "0.1.14",
3
+ "version": "0.1.15",
4
4
  "description": "NASL types for TypeScript Declaration",
5
5
  "main": "index.d.ts",
6
6
  "scripts": {