1{ 2 "type": "Program", 3 "statements": [ 4 { 5 "type": "TSInterfaceDeclaration", 6 "body": { 7 "type": "TSInterfaceBody", 8 "body": [ 9 { 10 "type": "MethodDefinition", 11 "key": { 12 "type": "Identifier", 13 "name": "foo", 14 "decorators": [], 15 "loc": { 16 "start": { 17 "line": 17, 18 "column": 5 19 }, 20 "end": { 21 "line": 17, 22 "column": 8 23 } 24 } 25 }, 26 "kind": "method", 27 "accessibility": "public", 28 "static": false, 29 "optional": false, 30 "computed": false, 31 "value": { 32 "type": "FunctionExpression", 33 "function": { 34 "type": "ScriptFunction", 35 "id": { 36 "type": "Identifier", 37 "name": "foo", 38 "decorators": [], 39 "loc": { 40 "start": { 41 "line": 17, 42 "column": 5 43 }, 44 "end": { 45 "line": 17, 46 "column": 8 47 } 48 } 49 }, 50 "generator": false, 51 "async": false, 52 "expression": false, 53 "params": [ 54 { 55 "type": "ETSParameterExpression", 56 "name": { 57 "type": "Identifier", 58 "name": "i", 59 "typeAnnotation": { 60 "type": "ETSTypeReference", 61 "part": { 62 "type": "ETSTypeReferencePart", 63 "name": { 64 "type": "Identifier", 65 "name": "I", 66 "decorators": [], 67 "loc": { 68 "start": { 69 "line": 17, 70 "column": 13 71 }, 72 "end": { 73 "line": 17, 74 "column": 14 75 } 76 } 77 }, 78 "loc": { 79 "start": { 80 "line": 17, 81 "column": 13 82 }, 83 "end": { 84 "line": 17, 85 "column": 15 86 } 87 } 88 }, 89 "loc": { 90 "start": { 91 "line": 17, 92 "column": 13 93 }, 94 "end": { 95 "line": 17, 96 "column": 15 97 } 98 } 99 }, 100 "decorators": [], 101 "loc": { 102 "start": { 103 "line": 17, 104 "column": 9 105 }, 106 "end": { 107 "line": 17, 108 "column": 15 109 } 110 } 111 }, 112 "loc": { 113 "start": { 114 "line": 17, 115 "column": 9 116 }, 117 "end": { 118 "line": 17, 119 "column": 15 120 } 121 } 122 } 123 ], 124 "returnType": { 125 "type": "ETSPrimitiveType", 126 "loc": { 127 "start": { 128 "line": 17, 129 "column": 18 130 }, 131 "end": { 132 "line": 17, 133 "column": 22 134 } 135 } 136 }, 137 "declare": true, 138 "loc": { 139 "start": { 140 "line": 17, 141 "column": 8 142 }, 143 "end": { 144 "line": 17, 145 "column": 22 146 } 147 } 148 }, 149 "loc": { 150 "start": { 151 "line": 17, 152 "column": 8 153 }, 154 "end": { 155 "line": 17, 156 "column": 22 157 } 158 } 159 }, 160 "overloads": [], 161 "decorators": [], 162 "loc": { 163 "start": { 164 "line": 17, 165 "column": 5 166 }, 167 "end": { 168 "line": 17, 169 "column": 23 170 } 171 } 172 } 173 ], 174 "loc": { 175 "start": { 176 "line": 16, 177 "column": 13 178 }, 179 "end": { 180 "line": 18, 181 "column": 2 182 } 183 } 184 }, 185 "id": { 186 "type": "Identifier", 187 "name": "I", 188 "decorators": [], 189 "loc": { 190 "start": { 191 "line": 16, 192 "column": 11 193 }, 194 "end": { 195 "line": 16, 196 "column": 12 197 } 198 } 199 }, 200 "extends": [], 201 "loc": { 202 "start": { 203 "line": 16, 204 "column": 1 205 }, 206 "end": { 207 "line": 20, 208 "column": 6 209 } 210 } 211 }, 212 { 213 "type": "ClassDeclaration", 214 "definition": { 215 "id": { 216 "type": "Identifier", 217 "name": "A", 218 "decorators": [], 219 "loc": { 220 "start": { 221 "line": 20, 222 "column": 7 223 }, 224 "end": { 225 "line": 20, 226 "column": 8 227 } 228 } 229 }, 230 "superClass": null, 231 "implements": [ 232 { 233 "type": "TSClassImplements", 234 "expression": { 235 "type": "ETSTypeReference", 236 "part": { 237 "type": "ETSTypeReferencePart", 238 "name": { 239 "type": "Identifier", 240 "name": "I", 241 "decorators": [], 242 "loc": { 243 "start": { 244 "line": 20, 245 "column": 20 246 }, 247 "end": { 248 "line": 20, 249 "column": 21 250 } 251 } 252 }, 253 "loc": { 254 "start": { 255 "line": 20, 256 "column": 20 257 }, 258 "end": { 259 "line": 20, 260 "column": 23 261 } 262 } 263 }, 264 "loc": { 265 "start": { 266 "line": 20, 267 "column": 20 268 }, 269 "end": { 270 "line": 20, 271 "column": 23 272 } 273 } 274 }, 275 "loc": { 276 "start": { 277 "line": 20, 278 "column": 20 279 }, 280 "end": { 281 "line": 20, 282 "column": 23 283 } 284 } 285 } 286 ], 287 "body": [ 288 { 289 "type": "MethodDefinition", 290 "key": { 291 "type": "Identifier", 292 "name": "foo", 293 "decorators": [], 294 "loc": { 295 "start": { 296 "line": 21, 297 "column": 5 298 }, 299 "end": { 300 "line": 21, 301 "column": 8 302 } 303 } 304 }, 305 "kind": "method", 306 "accessibility": "public", 307 "static": false, 308 "optional": false, 309 "computed": false, 310 "value": { 311 "type": "FunctionExpression", 312 "function": { 313 "type": "ScriptFunction", 314 "id": { 315 "type": "Identifier", 316 "name": "foo", 317 "decorators": [], 318 "loc": { 319 "start": { 320 "line": 21, 321 "column": 5 322 }, 323 "end": { 324 "line": 21, 325 "column": 8 326 } 327 } 328 }, 329 "generator": false, 330 "async": false, 331 "expression": false, 332 "params": [ 333 { 334 "type": "ETSParameterExpression", 335 "name": { 336 "type": "Identifier", 337 "name": "i", 338 "typeAnnotation": { 339 "type": "ETSTypeReference", 340 "part": { 341 "type": "ETSTypeReferencePart", 342 "name": { 343 "type": "Identifier", 344 "name": "I", 345 "decorators": [], 346 "loc": { 347 "start": { 348 "line": 21, 349 "column": 13 350 }, 351 "end": { 352 "line": 21, 353 "column": 14 354 } 355 } 356 }, 357 "loc": { 358 "start": { 359 "line": 21, 360 "column": 13 361 }, 362 "end": { 363 "line": 21, 364 "column": 15 365 } 366 } 367 }, 368 "loc": { 369 "start": { 370 "line": 21, 371 "column": 13 372 }, 373 "end": { 374 "line": 21, 375 "column": 15 376 } 377 } 378 }, 379 "decorators": [], 380 "loc": { 381 "start": { 382 "line": 21, 383 "column": 9 384 }, 385 "end": { 386 "line": 21, 387 "column": 15 388 } 389 } 390 }, 391 "loc": { 392 "start": { 393 "line": 21, 394 "column": 9 395 }, 396 "end": { 397 "line": 21, 398 "column": 15 399 } 400 } 401 } 402 ], 403 "returnType": { 404 "type": "ETSPrimitiveType", 405 "loc": { 406 "start": { 407 "line": 21, 408 "column": 18 409 }, 410 "end": { 411 "line": 21, 412 "column": 22 413 } 414 } 415 }, 416 "body": { 417 "type": "BlockStatement", 418 "statements": [], 419 "loc": { 420 "start": { 421 "line": 21, 422 "column": 23 423 }, 424 "end": { 425 "line": 21, 426 "column": 25 427 } 428 } 429 }, 430 "loc": { 431 "start": { 432 "line": 21, 433 "column": 8 434 }, 435 "end": { 436 "line": 21, 437 "column": 25 438 } 439 } 440 }, 441 "loc": { 442 "start": { 443 "line": 21, 444 "column": 8 445 }, 446 "end": { 447 "line": 21, 448 "column": 25 449 } 450 } 451 }, 452 "overloads": [], 453 "decorators": [], 454 "loc": { 455 "start": { 456 "line": 21, 457 "column": 5 458 }, 459 "end": { 460 "line": 21, 461 "column": 25 462 } 463 } 464 }, 465 { 466 "type": "MethodDefinition", 467 "key": { 468 "type": "Identifier", 469 "name": "constructor", 470 "decorators": [], 471 "loc": { 472 "start": { 473 "line": 1, 474 "column": 1 475 }, 476 "end": { 477 "line": 1, 478 "column": 1 479 } 480 } 481 }, 482 "kind": "constructor", 483 "static": false, 484 "optional": false, 485 "computed": false, 486 "value": { 487 "type": "FunctionExpression", 488 "function": { 489 "type": "ScriptFunction", 490 "id": { 491 "type": "Identifier", 492 "name": "constructor", 493 "decorators": [], 494 "loc": { 495 "start": { 496 "line": 1, 497 "column": 1 498 }, 499 "end": { 500 "line": 1, 501 "column": 1 502 } 503 } 504 }, 505 "generator": false, 506 "async": false, 507 "expression": false, 508 "params": [], 509 "body": { 510 "type": "BlockStatement", 511 "statements": [], 512 "loc": { 513 "start": { 514 "line": 1, 515 "column": 1 516 }, 517 "end": { 518 "line": 1, 519 "column": 1 520 } 521 } 522 }, 523 "loc": { 524 "start": { 525 "line": 1, 526 "column": 1 527 }, 528 "end": { 529 "line": 1, 530 "column": 1 531 } 532 } 533 }, 534 "loc": { 535 "start": { 536 "line": 1, 537 "column": 1 538 }, 539 "end": { 540 "line": 1, 541 "column": 1 542 } 543 } 544 }, 545 "overloads": [], 546 "decorators": [], 547 "loc": { 548 "start": { 549 "line": 22, 550 "column": 2 551 }, 552 "end": { 553 "line": 22, 554 "column": 2 555 } 556 } 557 } 558 ], 559 "loc": { 560 "start": { 561 "line": 20, 562 "column": 22 563 }, 564 "end": { 565 "line": 22, 566 "column": 2 567 } 568 } 569 }, 570 "loc": { 571 "start": { 572 "line": 20, 573 "column": 1 574 }, 575 "end": { 576 "line": 22, 577 "column": 2 578 } 579 } 580 }, 581 { 582 "type": "ClassDeclaration", 583 "definition": { 584 "id": { 585 "type": "Identifier", 586 "name": "ETSGLOBAL", 587 "decorators": [], 588 "loc": { 589 "start": { 590 "line": 1, 591 "column": 1 592 }, 593 "end": { 594 "line": 1, 595 "column": 1 596 } 597 } 598 }, 599 "superClass": null, 600 "implements": [], 601 "body": [ 602 { 603 "type": "MethodDefinition", 604 "key": { 605 "type": "Identifier", 606 "name": "_$init$_", 607 "decorators": [], 608 "loc": { 609 "start": { 610 "line": 1, 611 "column": 1 612 }, 613 "end": { 614 "line": 1, 615 "column": 1 616 } 617 } 618 }, 619 "kind": "method", 620 "accessibility": "public", 621 "static": true, 622 "optional": false, 623 "computed": false, 624 "value": { 625 "type": "FunctionExpression", 626 "function": { 627 "type": "ScriptFunction", 628 "id": { 629 "type": "Identifier", 630 "name": "_$init$_", 631 "decorators": [], 632 "loc": { 633 "start": { 634 "line": 1, 635 "column": 1 636 }, 637 "end": { 638 "line": 1, 639 "column": 1 640 } 641 } 642 }, 643 "generator": false, 644 "async": false, 645 "expression": false, 646 "params": [], 647 "body": { 648 "type": "BlockStatement", 649 "statements": [], 650 "loc": { 651 "start": { 652 "line": 1, 653 "column": 1 654 }, 655 "end": { 656 "line": 1, 657 "column": 1 658 } 659 } 660 }, 661 "loc": { 662 "start": { 663 "line": 1, 664 "column": 1 665 }, 666 "end": { 667 "line": 1, 668 "column": 1 669 } 670 } 671 }, 672 "loc": { 673 "start": { 674 "line": 1, 675 "column": 1 676 }, 677 "end": { 678 "line": 1, 679 "column": 1 680 } 681 } 682 }, 683 "overloads": [], 684 "decorators": [], 685 "loc": { 686 "start": { 687 "line": 1, 688 "column": 1 689 }, 690 "end": { 691 "line": 1, 692 "column": 1 693 } 694 } 695 }, 696 { 697 "type": "MethodDefinition", 698 "key": { 699 "type": "Identifier", 700 "name": "main", 701 "decorators": [], 702 "loc": { 703 "start": { 704 "line": 24, 705 "column": 10 706 }, 707 "end": { 708 "line": 24, 709 "column": 14 710 } 711 } 712 }, 713 "kind": "method", 714 "accessibility": "public", 715 "static": true, 716 "optional": false, 717 "computed": false, 718 "value": { 719 "type": "FunctionExpression", 720 "function": { 721 "type": "ScriptFunction", 722 "id": { 723 "type": "Identifier", 724 "name": "main", 725 "decorators": [], 726 "loc": { 727 "start": { 728 "line": 24, 729 "column": 10 730 }, 731 "end": { 732 "line": 24, 733 "column": 14 734 } 735 } 736 }, 737 "generator": false, 738 "async": false, 739 "expression": false, 740 "params": [], 741 "returnType": { 742 "type": "ETSPrimitiveType", 743 "loc": { 744 "start": { 745 "line": 24, 746 "column": 18 747 }, 748 "end": { 749 "line": 24, 750 "column": 22 751 } 752 } 753 }, 754 "body": { 755 "type": "BlockStatement", 756 "statements": [ 757 { 758 "type": "VariableDeclaration", 759 "declarations": [ 760 { 761 "type": "VariableDeclarator", 762 "id": { 763 "type": "Identifier", 764 "name": "an", 765 "typeAnnotation": { 766 "type": "ETSUnionType", 767 "types": [ 768 { 769 "type": "ETSTypeReference", 770 "part": { 771 "type": "ETSTypeReferencePart", 772 "name": { 773 "type": "Identifier", 774 "name": "I", 775 "decorators": [], 776 "loc": { 777 "start": { 778 "line": 25, 779 "column": 14 780 }, 781 "end": { 782 "line": 25, 783 "column": 15 784 } 785 } 786 }, 787 "loc": { 788 "start": { 789 "line": 25, 790 "column": 14 791 }, 792 "end": { 793 "line": 25, 794 "column": 17 795 } 796 } 797 }, 798 "loc": { 799 "start": { 800 "line": 25, 801 "column": 14 802 }, 803 "end": { 804 "line": 25, 805 "column": 17 806 } 807 } 808 }, 809 { 810 "type": "ETSNullType", 811 "loc": { 812 "start": { 813 "line": 25, 814 "column": 18 815 }, 816 "end": { 817 "line": 25, 818 "column": 22 819 } 820 } 821 } 822 ], 823 "loc": { 824 "start": { 825 "line": 25, 826 "column": 14 827 }, 828 "end": { 829 "line": 25, 830 "column": 22 831 } 832 } 833 }, 834 "decorators": [], 835 "loc": { 836 "start": { 837 "line": 25, 838 "column": 9 839 }, 840 "end": { 841 "line": 25, 842 "column": 11 843 } 844 } 845 }, 846 "init": { 847 "type": "ETSNewClassInstanceExpression", 848 "typeReference": { 849 "type": "ETSTypeReference", 850 "part": { 851 "type": "ETSTypeReferencePart", 852 "name": { 853 "type": "Identifier", 854 "name": "A", 855 "decorators": [], 856 "loc": { 857 "start": { 858 "line": 25, 859 "column": 29 860 }, 861 "end": { 862 "line": 25, 863 "column": 30 864 } 865 } 866 }, 867 "loc": { 868 "start": { 869 "line": 25, 870 "column": 29 871 }, 872 "end": { 873 "line": 25, 874 "column": 31 875 } 876 } 877 }, 878 "loc": { 879 "start": { 880 "line": 25, 881 "column": 29 882 }, 883 "end": { 884 "line": 25, 885 "column": 31 886 } 887 } 888 }, 889 "arguments": [], 890 "loc": { 891 "start": { 892 "line": 25, 893 "column": 25 894 }, 895 "end": { 896 "line": 25, 897 "column": 33 898 } 899 } 900 }, 901 "loc": { 902 "start": { 903 "line": 25, 904 "column": 9 905 }, 906 "end": { 907 "line": 25, 908 "column": 33 909 } 910 } 911 } 912 ], 913 "kind": "let", 914 "loc": { 915 "start": { 916 "line": 25, 917 "column": 5 918 }, 919 "end": { 920 "line": 25, 921 "column": 33 922 } 923 } 924 }, 925 { 926 "type": "ExpressionStatement", 927 "expression": { 928 "type": "CallExpression", 929 "callee": { 930 "type": "MemberExpression", 931 "object": { 932 "type": "ETSNewClassInstanceExpression", 933 "typeReference": { 934 "type": "ETSTypeReference", 935 "part": { 936 "type": "ETSTypeReferencePart", 937 "name": { 938 "type": "Identifier", 939 "name": "A", 940 "decorators": [], 941 "loc": { 942 "start": { 943 "line": 27, 944 "column": 9 945 }, 946 "end": { 947 "line": 27, 948 "column": 10 949 } 950 } 951 }, 952 "loc": { 953 "start": { 954 "line": 27, 955 "column": 9 956 }, 957 "end": { 958 "line": 27, 959 "column": 11 960 } 961 } 962 }, 963 "loc": { 964 "start": { 965 "line": 27, 966 "column": 9 967 }, 968 "end": { 969 "line": 27, 970 "column": 11 971 } 972 } 973 }, 974 "arguments": [], 975 "loc": { 976 "start": { 977 "line": 27, 978 "column": 5 979 }, 980 "end": { 981 "line": 27, 982 "column": 13 983 } 984 } 985 }, 986 "property": { 987 "type": "Identifier", 988 "name": "foo", 989 "decorators": [], 990 "loc": { 991 "start": { 992 "line": 27, 993 "column": 13 994 }, 995 "end": { 996 "line": 27, 997 "column": 16 998 } 999 } 1000 }, 1001 "computed": false, 1002 "optional": false, 1003 "loc": { 1004 "start": { 1005 "line": 27, 1006 "column": 5 1007 }, 1008 "end": { 1009 "line": 27, 1010 "column": 16 1011 } 1012 } 1013 }, 1014 "arguments": [ 1015 { 1016 "type": "Identifier", 1017 "name": "an", 1018 "decorators": [], 1019 "loc": { 1020 "start": { 1021 "line": 27, 1022 "column": 17 1023 }, 1024 "end": { 1025 "line": 27, 1026 "column": 19 1027 } 1028 } 1029 } 1030 ], 1031 "optional": false, 1032 "loc": { 1033 "start": { 1034 "line": 27, 1035 "column": 5 1036 }, 1037 "end": { 1038 "line": 27, 1039 "column": 20 1040 } 1041 } 1042 }, 1043 "loc": { 1044 "start": { 1045 "line": 27, 1046 "column": 5 1047 }, 1048 "end": { 1049 "line": 27, 1050 "column": 21 1051 } 1052 } 1053 } 1054 ], 1055 "loc": { 1056 "start": { 1057 "line": 24, 1058 "column": 23 1059 }, 1060 "end": { 1061 "line": 28, 1062 "column": 2 1063 } 1064 } 1065 }, 1066 "loc": { 1067 "start": { 1068 "line": 24, 1069 "column": 14 1070 }, 1071 "end": { 1072 "line": 28, 1073 "column": 2 1074 } 1075 } 1076 }, 1077 "loc": { 1078 "start": { 1079 "line": 24, 1080 "column": 14 1081 }, 1082 "end": { 1083 "line": 28, 1084 "column": 2 1085 } 1086 } 1087 }, 1088 "overloads": [], 1089 "decorators": [], 1090 "loc": { 1091 "start": { 1092 "line": 24, 1093 "column": 1 1094 }, 1095 "end": { 1096 "line": 28, 1097 "column": 2 1098 } 1099 } 1100 } 1101 ], 1102 "loc": { 1103 "start": { 1104 "line": 1, 1105 "column": 1 1106 }, 1107 "end": { 1108 "line": 1, 1109 "column": 1 1110 } 1111 } 1112 }, 1113 "loc": { 1114 "start": { 1115 "line": 1, 1116 "column": 1 1117 }, 1118 "end": { 1119 "line": 1, 1120 "column": 1 1121 } 1122 } 1123 } 1124 ], 1125 "loc": { 1126 "start": { 1127 "line": 1, 1128 "column": 1 1129 }, 1130 "end": { 1131 "line": 29, 1132 "column": 1 1133 } 1134 } 1135} 1136