@nasl/types 0.1.1 → 0.1.3

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.ui.ast.d.ts CHANGED
@@ -114,6 +114,7 @@ export interface PropDeclaration {
114
114
  bindOpen: boolean;
115
115
  tabKind: 'property' | 'style';
116
116
  setter: BaseSetter;
117
+ defaultValue?: DefaultValue;
117
118
  tsDesignerValue?: string;
118
119
  tsIf?: string;
119
120
  tsDisabledIf?: string;
@@ -140,6 +141,7 @@ export interface SlotDeclaration {
140
141
  title: string;
141
142
  description?: string;
142
143
  tsType: string;
144
+ params: Array<Param>;
143
145
  emptyBackground?: string;
144
146
  snippets: Array<ViewBlockWithImage>;
145
147
  }
@@ -243,13 +245,19 @@ export interface ThemeVariable {
243
245
  }
244
246
 
245
247
  /**
246
- * 类型参数
248
+ * 默认值
247
249
  */
248
- export interface TypeParam {
249
- concept: 'TypeParam';
250
- name: string;
250
+ export interface DefaultValue {
251
+ concept: 'DefaultValue';
252
+ expression: LogicItem;
253
+ playground: Array<LogicItem>;
251
254
  }
252
255
 
256
+ /**
257
+ * 设置器基类
258
+ */
259
+ export type LogicItem = NullLiteral | BooleanLiteral | StringLiteral | NumericLiteral | NewList;
260
+
253
261
  /**
254
262
  * 输入参数
255
263
  */
@@ -290,19 +298,13 @@ export interface StructureProperty {
290
298
  }
291
299
 
292
300
  /**
293
- * 默认值
301
+ * 类型参数
294
302
  */
295
- export interface DefaultValue {
296
- concept: 'DefaultValue';
297
- expression: LogicItem;
298
- playground: Array<LogicItem>;
303
+ export interface TypeParam {
304
+ concept: 'TypeParam';
305
+ name: string;
299
306
  }
300
307
 
301
- /**
302
- * 设置器基类
303
- */
304
- export type LogicItem = NullLiteral | BooleanLiteral | StringLiteral | NumericLiteral | NewList;
305
-
306
308
  /**
307
309
  * 输出参数
308
310
  */
@@ -163,6 +163,9 @@
163
163
  "setter": {
164
164
  "$ref": "#/definitions/BaseSetter"
165
165
  },
166
+ "defaultValue": {
167
+ "$ref": "#/definitions/DefaultValue"
168
+ },
166
169
  "tsDesignerValue": {
167
170
  "type": "string"
168
171
  },
@@ -401,199 +404,122 @@
401
404
  "additionalProperties": false,
402
405
  "description": "属性选择设置器"
403
406
  },
404
- "EventDeclaration": {
407
+ "DefaultValue": {
405
408
  "type": "object",
406
409
  "properties": {
407
410
  "concept": {
408
411
  "type": "string",
409
- "const": "EventDeclaration"
410
- },
411
- "name": {
412
- "type": "string"
413
- },
414
- "title": {
415
- "type": "string"
412
+ "const": "DefaultValue"
416
413
  },
417
- "description": {
418
- "type": "string"
414
+ "expression": {
415
+ "$ref": "#/definitions/LogicItem"
419
416
  },
420
- "tsType": {
421
- "type": "string"
417
+ "playground": {
418
+ "type": "array",
419
+ "items": {
420
+ "$ref": "#/definitions/LogicItem"
421
+ }
422
422
  }
423
423
  },
424
424
  "required": [
425
425
  "concept",
426
- "name",
427
- "title",
428
- "tsType"
426
+ "expression",
427
+ "playground"
429
428
  ],
430
429
  "additionalProperties": false,
431
- "description": "组件事件"
430
+ "description": "默认值"
432
431
  },
433
- "SlotDeclaration": {
434
- "type": "object",
435
- "properties": {
436
- "concept": {
437
- "type": "string",
438
- "const": "SlotDeclaration"
439
- },
440
- "name": {
441
- "type": "string"
442
- },
443
- "title": {
444
- "type": "string"
432
+ "LogicItem": {
433
+ "anyOf": [
434
+ {
435
+ "$ref": "#/definitions/NullLiteral"
445
436
  },
446
- "description": {
447
- "type": "string"
437
+ {
438
+ "$ref": "#/definitions/BooleanLiteral"
448
439
  },
449
- "tsType": {
450
- "type": "string"
440
+ {
441
+ "$ref": "#/definitions/StringLiteral"
451
442
  },
452
- "emptyBackground": {
453
- "type": "string"
443
+ {
444
+ "$ref": "#/definitions/NumericLiteral"
454
445
  },
455
- "snippets": {
456
- "type": "array",
457
- "items": {
458
- "$ref": "#/definitions/ViewBlockWithImage"
459
- }
446
+ {
447
+ "$ref": "#/definitions/NewList"
460
448
  }
461
- },
462
- "required": [
463
- "concept",
464
- "name",
465
- "title",
466
- "tsType",
467
- "snippets"
468
449
  ],
469
- "additionalProperties": false,
470
- "description": "插槽"
450
+ "description": "设置器基类"
471
451
  },
472
- "ViewBlockWithImage": {
452
+ "NullLiteral": {
473
453
  "type": "object",
474
454
  "properties": {
475
455
  "concept": {
476
456
  "type": "string",
477
- "const": "ViewBlockWithImage"
478
- },
479
- "title": {
480
- "type": "string"
481
- },
482
- "code": {
483
- "type": "string"
484
- },
485
- "description": {
486
- "type": "string"
487
- },
488
- "screenshot": {
489
- "type": "string"
490
- },
491
- "drawing": {
492
- "type": "string"
457
+ "const": "NullLiteral"
493
458
  }
494
459
  },
495
460
  "required": [
496
- "concept",
497
- "title",
498
- "code",
499
- "screenshot",
500
- "drawing"
461
+ "concept"
501
462
  ],
502
463
  "additionalProperties": false,
503
- "description": "带截图的代码块"
464
+ "description": "空字面量"
504
465
  },
505
- "LogicDeclaration": {
466
+ "BooleanLiteral": {
506
467
  "type": "object",
507
468
  "properties": {
508
469
  "concept": {
509
470
  "type": "string",
510
- "const": "LogicDeclaration"
511
- },
512
- "name": {
513
- "type": "string"
514
- },
515
- "title": {
516
- "type": "string"
471
+ "const": "BooleanLiteral"
517
472
  },
518
- "description": {
473
+ "value": {
519
474
  "type": "string"
520
- },
521
- "typeParams": {
522
- "type": "array",
523
- "items": {
524
- "$ref": "#/definitions/TypeParam"
525
- }
526
- },
527
- "params": {
528
- "type": "array",
529
- "items": {
530
- "$ref": "#/definitions/Param"
531
- }
532
- },
533
- "returns": {
534
- "type": "array",
535
- "items": {
536
- "$ref": "#/definitions/Return"
537
- }
538
475
  }
539
476
  },
540
477
  "required": [
541
478
  "concept",
542
- "name",
543
- "title",
544
- "description",
545
- "params",
546
- "returns"
479
+ "value"
547
480
  ],
548
481
  "additionalProperties": false,
549
- "description": "逻辑声明"
482
+ "description": "布尔型字面量"
550
483
  },
551
- "TypeParam": {
484
+ "StringLiteral": {
552
485
  "type": "object",
553
486
  "properties": {
554
487
  "concept": {
555
488
  "type": "string",
556
- "const": "TypeParam"
489
+ "const": "StringLiteral"
557
490
  },
558
- "name": {
491
+ "value": {
559
492
  "type": "string"
560
493
  }
561
494
  },
562
495
  "required": [
563
496
  "concept",
564
- "name"
497
+ "value"
565
498
  ],
566
499
  "additionalProperties": false,
567
- "description": "类型参数"
500
+ "description": "字符串字面量"
568
501
  },
569
- "Param": {
502
+ "NumericLiteral": {
570
503
  "type": "object",
571
504
  "properties": {
572
505
  "concept": {
573
506
  "type": "string",
574
- "const": "Param"
575
- },
576
- "name": {
577
- "type": "string"
507
+ "const": "NumericLiteral"
578
508
  },
579
- "description": {
509
+ "value": {
580
510
  "type": "string"
581
511
  },
582
512
  "typeAnnotation": {
583
513
  "$ref": "#/definitions/TypeAnnotation"
584
- },
585
- "defaultValue": {
586
- "$ref": "#/definitions/DefaultValue"
587
514
  }
588
515
  },
589
516
  "required": [
590
517
  "concept",
591
- "name",
592
- "description",
518
+ "value",
593
519
  "typeAnnotation"
594
520
  ],
595
521
  "additionalProperties": false,
596
- "description": "输入参数"
522
+ "description": "数字字面量"
597
523
  },
598
524
  "TypeAnnotation": {
599
525
  "type": "object",
@@ -703,17 +629,17 @@
703
629
  "additionalProperties": false,
704
630
  "description": "数据结构属性"
705
631
  },
706
- "DefaultValue": {
632
+ "NewList": {
707
633
  "type": "object",
708
634
  "properties": {
709
635
  "concept": {
710
636
  "type": "string",
711
- "const": "DefaultValue"
637
+ "const": "NewList"
712
638
  },
713
- "expression": {
714
- "$ref": "#/definitions/LogicItem"
639
+ "typeAnnotation": {
640
+ "$ref": "#/definitions/TypeAnnotation"
715
641
  },
716
- "playground": {
642
+ "items": {
717
643
  "type": "array",
718
644
  "items": {
719
645
  "$ref": "#/definitions/LogicItem"
@@ -722,128 +648,212 @@
722
648
  },
723
649
  "required": [
724
650
  "concept",
725
- "expression",
726
- "playground"
651
+ "typeAnnotation",
652
+ "items"
727
653
  ],
728
654
  "additionalProperties": false,
729
- "description": "默认值"
655
+ "description": "列表构造器"
730
656
  },
731
- "LogicItem": {
732
- "anyOf": [
733
- {
734
- "$ref": "#/definitions/NullLiteral"
657
+ "EventDeclaration": {
658
+ "type": "object",
659
+ "properties": {
660
+ "concept": {
661
+ "type": "string",
662
+ "const": "EventDeclaration"
735
663
  },
736
- {
737
- "$ref": "#/definitions/BooleanLiteral"
664
+ "name": {
665
+ "type": "string"
738
666
  },
739
- {
740
- "$ref": "#/definitions/StringLiteral"
667
+ "title": {
668
+ "type": "string"
741
669
  },
742
- {
743
- "$ref": "#/definitions/NumericLiteral"
670
+ "description": {
671
+ "type": "string"
744
672
  },
745
- {
746
- "$ref": "#/definitions/NewList"
673
+ "tsType": {
674
+ "type": "string"
747
675
  }
676
+ },
677
+ "required": [
678
+ "concept",
679
+ "name",
680
+ "title",
681
+ "tsType"
748
682
  ],
749
- "description": "设置器基类"
683
+ "additionalProperties": false,
684
+ "description": "组件事件"
750
685
  },
751
- "NullLiteral": {
686
+ "SlotDeclaration": {
752
687
  "type": "object",
753
688
  "properties": {
754
689
  "concept": {
755
690
  "type": "string",
756
- "const": "NullLiteral"
691
+ "const": "SlotDeclaration"
692
+ },
693
+ "name": {
694
+ "type": "string"
695
+ },
696
+ "title": {
697
+ "type": "string"
698
+ },
699
+ "description": {
700
+ "type": "string"
701
+ },
702
+ "tsType": {
703
+ "type": "string"
704
+ },
705
+ "params": {
706
+ "type": "array",
707
+ "items": {
708
+ "$ref": "#/definitions/Param"
709
+ }
710
+ },
711
+ "emptyBackground": {
712
+ "type": "string"
713
+ },
714
+ "snippets": {
715
+ "type": "array",
716
+ "items": {
717
+ "$ref": "#/definitions/ViewBlockWithImage"
718
+ }
757
719
  }
758
720
  },
759
721
  "required": [
760
- "concept"
722
+ "concept",
723
+ "name",
724
+ "title",
725
+ "tsType",
726
+ "params",
727
+ "snippets"
761
728
  ],
762
729
  "additionalProperties": false,
763
- "description": "空字面量"
730
+ "description": "插槽"
764
731
  },
765
- "BooleanLiteral": {
732
+ "Param": {
766
733
  "type": "object",
767
734
  "properties": {
768
735
  "concept": {
769
736
  "type": "string",
770
- "const": "BooleanLiteral"
737
+ "const": "Param"
771
738
  },
772
- "value": {
739
+ "name": {
740
+ "type": "string"
741
+ },
742
+ "description": {
773
743
  "type": "string"
744
+ },
745
+ "typeAnnotation": {
746
+ "$ref": "#/definitions/TypeAnnotation"
747
+ },
748
+ "defaultValue": {
749
+ "$ref": "#/definitions/DefaultValue"
774
750
  }
775
751
  },
776
752
  "required": [
777
753
  "concept",
778
- "value"
754
+ "name",
755
+ "description",
756
+ "typeAnnotation"
779
757
  ],
780
758
  "additionalProperties": false,
781
- "description": "布尔型字面量"
759
+ "description": "输入参数"
782
760
  },
783
- "StringLiteral": {
761
+ "ViewBlockWithImage": {
784
762
  "type": "object",
785
763
  "properties": {
786
764
  "concept": {
787
765
  "type": "string",
788
- "const": "StringLiteral"
766
+ "const": "ViewBlockWithImage"
789
767
  },
790
- "value": {
768
+ "title": {
769
+ "type": "string"
770
+ },
771
+ "code": {
772
+ "type": "string"
773
+ },
774
+ "description": {
775
+ "type": "string"
776
+ },
777
+ "screenshot": {
778
+ "type": "string"
779
+ },
780
+ "drawing": {
791
781
  "type": "string"
792
782
  }
793
783
  },
794
784
  "required": [
795
785
  "concept",
796
- "value"
786
+ "title",
787
+ "code",
788
+ "screenshot",
789
+ "drawing"
797
790
  ],
798
791
  "additionalProperties": false,
799
- "description": "字符串字面量"
792
+ "description": "带截图的代码块"
800
793
  },
801
- "NumericLiteral": {
794
+ "LogicDeclaration": {
802
795
  "type": "object",
803
796
  "properties": {
804
797
  "concept": {
805
798
  "type": "string",
806
- "const": "NumericLiteral"
799
+ "const": "LogicDeclaration"
807
800
  },
808
- "value": {
801
+ "name": {
809
802
  "type": "string"
810
803
  },
811
- "typeAnnotation": {
812
- "$ref": "#/definitions/TypeAnnotation"
804
+ "title": {
805
+ "type": "string"
806
+ },
807
+ "description": {
808
+ "type": "string"
809
+ },
810
+ "typeParams": {
811
+ "type": "array",
812
+ "items": {
813
+ "$ref": "#/definitions/TypeParam"
814
+ }
815
+ },
816
+ "params": {
817
+ "type": "array",
818
+ "items": {
819
+ "$ref": "#/definitions/Param"
820
+ }
821
+ },
822
+ "returns": {
823
+ "type": "array",
824
+ "items": {
825
+ "$ref": "#/definitions/Return"
826
+ }
813
827
  }
814
828
  },
815
829
  "required": [
816
830
  "concept",
817
- "value",
818
- "typeAnnotation"
831
+ "name",
832
+ "title",
833
+ "description",
834
+ "params",
835
+ "returns"
819
836
  ],
820
837
  "additionalProperties": false,
821
- "description": "数字字面量"
838
+ "description": "逻辑声明"
822
839
  },
823
- "NewList": {
840
+ "TypeParam": {
824
841
  "type": "object",
825
842
  "properties": {
826
843
  "concept": {
827
844
  "type": "string",
828
- "const": "NewList"
829
- },
830
- "typeAnnotation": {
831
- "$ref": "#/definitions/TypeAnnotation"
845
+ "const": "TypeParam"
832
846
  },
833
- "items": {
834
- "type": "array",
835
- "items": {
836
- "$ref": "#/definitions/LogicItem"
837
- }
847
+ "name": {
848
+ "type": "string"
838
849
  }
839
850
  },
840
851
  "required": [
841
852
  "concept",
842
- "typeAnnotation",
843
- "items"
853
+ "name"
844
854
  ],
845
855
  "additionalProperties": false,
846
- "description": "列表构造器"
856
+ "description": "类型参数"
847
857
  },
848
858
  "Return": {
849
859
  "type": "object",
package/package.json CHANGED
@@ -1,9 +1,11 @@
1
1
  {
2
2
  "name": "@nasl/types",
3
- "version": "0.1.1",
3
+ "version": "0.1.3",
4
4
  "description": "NASL types for TypeScript Declaration",
5
5
  "main": "index.d.ts",
6
- "scripts": {},
6
+ "scripts": {
7
+ "build": "node ../../out/bin/genUIOptionsForTS.js && node ../../out/bin/genUIAstForTS.js"
8
+ },
7
9
  "author": "Forrest <rainforest92@126.com>",
8
10
  "license": "MIT",
9
11
  "contributors": [],