@nasl/types 0.1.1 → 0.1.2
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 +15 -14
- package/nasl.ui.ast.schema.json +178 -175
- package/package.json +4 -2
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;
|
|
@@ -242,6 +243,20 @@ export interface ThemeVariable {
|
|
|
242
243
|
name: string;
|
|
243
244
|
}
|
|
244
245
|
|
|
246
|
+
/**
|
|
247
|
+
* 默认值
|
|
248
|
+
*/
|
|
249
|
+
export interface DefaultValue {
|
|
250
|
+
concept: 'DefaultValue';
|
|
251
|
+
expression: LogicItem;
|
|
252
|
+
playground: Array<LogicItem>;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
/**
|
|
256
|
+
* 设置器基类
|
|
257
|
+
*/
|
|
258
|
+
export type LogicItem = NullLiteral | BooleanLiteral | StringLiteral | NumericLiteral | NewList;
|
|
259
|
+
|
|
245
260
|
/**
|
|
246
261
|
* 类型参数
|
|
247
262
|
*/
|
|
@@ -289,20 +304,6 @@ export interface StructureProperty {
|
|
|
289
304
|
jsonName: string;
|
|
290
305
|
}
|
|
291
306
|
|
|
292
|
-
/**
|
|
293
|
-
* 默认值
|
|
294
|
-
*/
|
|
295
|
-
export interface DefaultValue {
|
|
296
|
-
concept: 'DefaultValue';
|
|
297
|
-
expression: LogicItem;
|
|
298
|
-
playground: Array<LogicItem>;
|
|
299
|
-
}
|
|
300
|
-
|
|
301
|
-
/**
|
|
302
|
-
* 设置器基类
|
|
303
|
-
*/
|
|
304
|
-
export type LogicItem = NullLiteral | BooleanLiteral | StringLiteral | NumericLiteral | NewList;
|
|
305
|
-
|
|
306
307
|
/**
|
|
307
308
|
* 输出参数
|
|
308
309
|
*/
|
package/nasl.ui.ast.schema.json
CHANGED
|
@@ -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
|
-
"
|
|
407
|
+
"DefaultValue": {
|
|
405
408
|
"type": "object",
|
|
406
409
|
"properties": {
|
|
407
410
|
"concept": {
|
|
408
411
|
"type": "string",
|
|
409
|
-
"const": "
|
|
410
|
-
},
|
|
411
|
-
"name": {
|
|
412
|
-
"type": "string"
|
|
413
|
-
},
|
|
414
|
-
"title": {
|
|
415
|
-
"type": "string"
|
|
412
|
+
"const": "DefaultValue"
|
|
416
413
|
},
|
|
417
|
-
"
|
|
418
|
-
"
|
|
414
|
+
"expression": {
|
|
415
|
+
"$ref": "#/definitions/LogicItem"
|
|
419
416
|
},
|
|
420
|
-
"
|
|
421
|
-
"type": "
|
|
417
|
+
"playground": {
|
|
418
|
+
"type": "array",
|
|
419
|
+
"items": {
|
|
420
|
+
"$ref": "#/definitions/LogicItem"
|
|
421
|
+
}
|
|
422
422
|
}
|
|
423
423
|
},
|
|
424
424
|
"required": [
|
|
425
425
|
"concept",
|
|
426
|
-
"
|
|
427
|
-
"
|
|
428
|
-
"tsType"
|
|
426
|
+
"expression",
|
|
427
|
+
"playground"
|
|
429
428
|
],
|
|
430
429
|
"additionalProperties": false,
|
|
431
|
-
"description": "
|
|
430
|
+
"description": "默认值"
|
|
432
431
|
},
|
|
433
|
-
"
|
|
434
|
-
"
|
|
435
|
-
|
|
436
|
-
|
|
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
|
-
|
|
447
|
-
"
|
|
437
|
+
{
|
|
438
|
+
"$ref": "#/definitions/BooleanLiteral"
|
|
448
439
|
},
|
|
449
|
-
|
|
450
|
-
"
|
|
440
|
+
{
|
|
441
|
+
"$ref": "#/definitions/StringLiteral"
|
|
451
442
|
},
|
|
452
|
-
|
|
453
|
-
"
|
|
443
|
+
{
|
|
444
|
+
"$ref": "#/definitions/NumericLiteral"
|
|
454
445
|
},
|
|
455
|
-
|
|
456
|
-
"
|
|
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
|
-
"
|
|
470
|
-
"description": "插槽"
|
|
450
|
+
"description": "设置器基类"
|
|
471
451
|
},
|
|
472
|
-
"
|
|
452
|
+
"NullLiteral": {
|
|
473
453
|
"type": "object",
|
|
474
454
|
"properties": {
|
|
475
455
|
"concept": {
|
|
476
456
|
"type": "string",
|
|
477
|
-
"const": "
|
|
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
|
-
"
|
|
466
|
+
"BooleanLiteral": {
|
|
506
467
|
"type": "object",
|
|
507
468
|
"properties": {
|
|
508
469
|
"concept": {
|
|
509
470
|
"type": "string",
|
|
510
|
-
"const": "
|
|
511
|
-
},
|
|
512
|
-
"name": {
|
|
513
|
-
"type": "string"
|
|
514
|
-
},
|
|
515
|
-
"title": {
|
|
516
|
-
"type": "string"
|
|
471
|
+
"const": "BooleanLiteral"
|
|
517
472
|
},
|
|
518
|
-
"
|
|
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
|
-
"
|
|
543
|
-
"title",
|
|
544
|
-
"description",
|
|
545
|
-
"params",
|
|
546
|
-
"returns"
|
|
479
|
+
"value"
|
|
547
480
|
],
|
|
548
481
|
"additionalProperties": false,
|
|
549
|
-
"description": "
|
|
482
|
+
"description": "布尔型字面量"
|
|
550
483
|
},
|
|
551
|
-
"
|
|
484
|
+
"StringLiteral": {
|
|
552
485
|
"type": "object",
|
|
553
486
|
"properties": {
|
|
554
487
|
"concept": {
|
|
555
488
|
"type": "string",
|
|
556
|
-
"const": "
|
|
489
|
+
"const": "StringLiteral"
|
|
557
490
|
},
|
|
558
|
-
"
|
|
491
|
+
"value": {
|
|
559
492
|
"type": "string"
|
|
560
493
|
}
|
|
561
494
|
},
|
|
562
495
|
"required": [
|
|
563
496
|
"concept",
|
|
564
|
-
"
|
|
497
|
+
"value"
|
|
565
498
|
],
|
|
566
499
|
"additionalProperties": false,
|
|
567
|
-
"description": "
|
|
500
|
+
"description": "字符串字面量"
|
|
568
501
|
},
|
|
569
|
-
"
|
|
502
|
+
"NumericLiteral": {
|
|
570
503
|
"type": "object",
|
|
571
504
|
"properties": {
|
|
572
505
|
"concept": {
|
|
573
506
|
"type": "string",
|
|
574
|
-
"const": "
|
|
575
|
-
},
|
|
576
|
-
"name": {
|
|
577
|
-
"type": "string"
|
|
507
|
+
"const": "NumericLiteral"
|
|
578
508
|
},
|
|
579
|
-
"
|
|
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
|
-
"
|
|
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
|
-
"
|
|
632
|
+
"NewList": {
|
|
707
633
|
"type": "object",
|
|
708
634
|
"properties": {
|
|
709
635
|
"concept": {
|
|
710
636
|
"type": "string",
|
|
711
|
-
"const": "
|
|
637
|
+
"const": "NewList"
|
|
712
638
|
},
|
|
713
|
-
"
|
|
714
|
-
"$ref": "#/definitions/
|
|
639
|
+
"typeAnnotation": {
|
|
640
|
+
"$ref": "#/definitions/TypeAnnotation"
|
|
715
641
|
},
|
|
716
|
-
"
|
|
642
|
+
"items": {
|
|
717
643
|
"type": "array",
|
|
718
644
|
"items": {
|
|
719
645
|
"$ref": "#/definitions/LogicItem"
|
|
@@ -722,128 +648,205 @@
|
|
|
722
648
|
},
|
|
723
649
|
"required": [
|
|
724
650
|
"concept",
|
|
725
|
-
"
|
|
726
|
-
"
|
|
651
|
+
"typeAnnotation",
|
|
652
|
+
"items"
|
|
727
653
|
],
|
|
728
654
|
"additionalProperties": false,
|
|
729
|
-
"description": "
|
|
655
|
+
"description": "列表构造器"
|
|
730
656
|
},
|
|
731
|
-
"
|
|
732
|
-
"
|
|
733
|
-
|
|
734
|
-
|
|
657
|
+
"EventDeclaration": {
|
|
658
|
+
"type": "object",
|
|
659
|
+
"properties": {
|
|
660
|
+
"concept": {
|
|
661
|
+
"type": "string",
|
|
662
|
+
"const": "EventDeclaration"
|
|
735
663
|
},
|
|
736
|
-
{
|
|
737
|
-
"
|
|
664
|
+
"name": {
|
|
665
|
+
"type": "string"
|
|
738
666
|
},
|
|
739
|
-
{
|
|
740
|
-
"
|
|
667
|
+
"title": {
|
|
668
|
+
"type": "string"
|
|
741
669
|
},
|
|
742
|
-
{
|
|
743
|
-
"
|
|
670
|
+
"description": {
|
|
671
|
+
"type": "string"
|
|
744
672
|
},
|
|
745
|
-
{
|
|
746
|
-
"
|
|
673
|
+
"tsType": {
|
|
674
|
+
"type": "string"
|
|
747
675
|
}
|
|
676
|
+
},
|
|
677
|
+
"required": [
|
|
678
|
+
"concept",
|
|
679
|
+
"name",
|
|
680
|
+
"title",
|
|
681
|
+
"tsType"
|
|
748
682
|
],
|
|
749
|
-
"
|
|
683
|
+
"additionalProperties": false,
|
|
684
|
+
"description": "组件事件"
|
|
750
685
|
},
|
|
751
|
-
"
|
|
686
|
+
"SlotDeclaration": {
|
|
752
687
|
"type": "object",
|
|
753
688
|
"properties": {
|
|
754
689
|
"concept": {
|
|
755
690
|
"type": "string",
|
|
756
|
-
"const": "
|
|
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
|
+
"emptyBackground": {
|
|
706
|
+
"type": "string"
|
|
707
|
+
},
|
|
708
|
+
"snippets": {
|
|
709
|
+
"type": "array",
|
|
710
|
+
"items": {
|
|
711
|
+
"$ref": "#/definitions/ViewBlockWithImage"
|
|
712
|
+
}
|
|
757
713
|
}
|
|
758
714
|
},
|
|
759
715
|
"required": [
|
|
760
|
-
"concept"
|
|
716
|
+
"concept",
|
|
717
|
+
"name",
|
|
718
|
+
"title",
|
|
719
|
+
"tsType",
|
|
720
|
+
"snippets"
|
|
761
721
|
],
|
|
762
722
|
"additionalProperties": false,
|
|
763
|
-
"description": "
|
|
723
|
+
"description": "插槽"
|
|
764
724
|
},
|
|
765
|
-
"
|
|
725
|
+
"ViewBlockWithImage": {
|
|
766
726
|
"type": "object",
|
|
767
727
|
"properties": {
|
|
768
728
|
"concept": {
|
|
769
729
|
"type": "string",
|
|
770
|
-
"const": "
|
|
730
|
+
"const": "ViewBlockWithImage"
|
|
771
731
|
},
|
|
772
|
-
"
|
|
732
|
+
"title": {
|
|
733
|
+
"type": "string"
|
|
734
|
+
},
|
|
735
|
+
"code": {
|
|
736
|
+
"type": "string"
|
|
737
|
+
},
|
|
738
|
+
"description": {
|
|
739
|
+
"type": "string"
|
|
740
|
+
},
|
|
741
|
+
"screenshot": {
|
|
742
|
+
"type": "string"
|
|
743
|
+
},
|
|
744
|
+
"drawing": {
|
|
773
745
|
"type": "string"
|
|
774
746
|
}
|
|
775
747
|
},
|
|
776
748
|
"required": [
|
|
777
749
|
"concept",
|
|
778
|
-
"
|
|
750
|
+
"title",
|
|
751
|
+
"code",
|
|
752
|
+
"screenshot",
|
|
753
|
+
"drawing"
|
|
779
754
|
],
|
|
780
755
|
"additionalProperties": false,
|
|
781
|
-
"description": "
|
|
756
|
+
"description": "带截图的代码块"
|
|
782
757
|
},
|
|
783
|
-
"
|
|
758
|
+
"LogicDeclaration": {
|
|
784
759
|
"type": "object",
|
|
785
760
|
"properties": {
|
|
786
761
|
"concept": {
|
|
787
762
|
"type": "string",
|
|
788
|
-
"const": "
|
|
763
|
+
"const": "LogicDeclaration"
|
|
789
764
|
},
|
|
790
|
-
"
|
|
765
|
+
"name": {
|
|
766
|
+
"type": "string"
|
|
767
|
+
},
|
|
768
|
+
"title": {
|
|
769
|
+
"type": "string"
|
|
770
|
+
},
|
|
771
|
+
"description": {
|
|
791
772
|
"type": "string"
|
|
773
|
+
},
|
|
774
|
+
"typeParams": {
|
|
775
|
+
"type": "array",
|
|
776
|
+
"items": {
|
|
777
|
+
"$ref": "#/definitions/TypeParam"
|
|
778
|
+
}
|
|
779
|
+
},
|
|
780
|
+
"params": {
|
|
781
|
+
"type": "array",
|
|
782
|
+
"items": {
|
|
783
|
+
"$ref": "#/definitions/Param"
|
|
784
|
+
}
|
|
785
|
+
},
|
|
786
|
+
"returns": {
|
|
787
|
+
"type": "array",
|
|
788
|
+
"items": {
|
|
789
|
+
"$ref": "#/definitions/Return"
|
|
790
|
+
}
|
|
792
791
|
}
|
|
793
792
|
},
|
|
794
793
|
"required": [
|
|
795
794
|
"concept",
|
|
796
|
-
"
|
|
795
|
+
"name",
|
|
796
|
+
"title",
|
|
797
|
+
"description",
|
|
798
|
+
"params",
|
|
799
|
+
"returns"
|
|
797
800
|
],
|
|
798
801
|
"additionalProperties": false,
|
|
799
|
-
"description": "
|
|
802
|
+
"description": "逻辑声明"
|
|
800
803
|
},
|
|
801
|
-
"
|
|
804
|
+
"TypeParam": {
|
|
802
805
|
"type": "object",
|
|
803
806
|
"properties": {
|
|
804
807
|
"concept": {
|
|
805
808
|
"type": "string",
|
|
806
|
-
"const": "
|
|
809
|
+
"const": "TypeParam"
|
|
807
810
|
},
|
|
808
|
-
"
|
|
811
|
+
"name": {
|
|
809
812
|
"type": "string"
|
|
810
|
-
},
|
|
811
|
-
"typeAnnotation": {
|
|
812
|
-
"$ref": "#/definitions/TypeAnnotation"
|
|
813
813
|
}
|
|
814
814
|
},
|
|
815
815
|
"required": [
|
|
816
816
|
"concept",
|
|
817
|
-
"
|
|
818
|
-
"typeAnnotation"
|
|
817
|
+
"name"
|
|
819
818
|
],
|
|
820
819
|
"additionalProperties": false,
|
|
821
|
-
"description": "
|
|
820
|
+
"description": "类型参数"
|
|
822
821
|
},
|
|
823
|
-
"
|
|
822
|
+
"Param": {
|
|
824
823
|
"type": "object",
|
|
825
824
|
"properties": {
|
|
826
825
|
"concept": {
|
|
827
826
|
"type": "string",
|
|
828
|
-
"const": "
|
|
827
|
+
"const": "Param"
|
|
828
|
+
},
|
|
829
|
+
"name": {
|
|
830
|
+
"type": "string"
|
|
831
|
+
},
|
|
832
|
+
"description": {
|
|
833
|
+
"type": "string"
|
|
829
834
|
},
|
|
830
835
|
"typeAnnotation": {
|
|
831
836
|
"$ref": "#/definitions/TypeAnnotation"
|
|
832
837
|
},
|
|
833
|
-
"
|
|
834
|
-
"
|
|
835
|
-
"items": {
|
|
836
|
-
"$ref": "#/definitions/LogicItem"
|
|
837
|
-
}
|
|
838
|
+
"defaultValue": {
|
|
839
|
+
"$ref": "#/definitions/DefaultValue"
|
|
838
840
|
}
|
|
839
841
|
},
|
|
840
842
|
"required": [
|
|
841
843
|
"concept",
|
|
842
|
-
"
|
|
843
|
-
"
|
|
844
|
+
"name",
|
|
845
|
+
"description",
|
|
846
|
+
"typeAnnotation"
|
|
844
847
|
],
|
|
845
848
|
"additionalProperties": false,
|
|
846
|
-
"description": "
|
|
849
|
+
"description": "输入参数"
|
|
847
850
|
},
|
|
848
851
|
"Return": {
|
|
849
852
|
"type": "object",
|
package/package.json
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nasl/types",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
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": [],
|