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