1{ 2 "type": "Program", 3 "statements": [ 4 { 5 "type": "TSTypeAliasDeclaration", 6 "id": { 7 "type": "Identifier", 8 "name": "GetName", 9 "loc": { 10 "start": { 11 "line": 17, 12 "column": 6 13 }, 14 "end": { 15 "line": 17, 16 "column": 13 17 } 18 } 19 }, 20 "typeAnnotation": { 21 "type": "TSMappedType", 22 "typeParameter": { 23 "type": "TSTypeParameter", 24 "name": { 25 "type": "Identifier", 26 "name": "p", 27 "loc": { 28 "start": { 29 "line": 18, 30 "column": 6 31 }, 32 "end": { 33 "line": 18, 34 "column": 7 35 } 36 } 37 }, 38 "constraint": { 39 "type": "TSTypeReference", 40 "typeName": { 41 "type": "Identifier", 42 "name": "Type", 43 "loc": { 44 "start": { 45 "line": 18, 46 "column": 11 47 }, 48 "end": { 49 "line": 18, 50 "column": 15 51 } 52 } 53 }, 54 "loc": { 55 "start": { 56 "line": 18, 57 "column": 11 58 }, 59 "end": { 60 "line": 18, 61 "column": 15 62 } 63 } 64 }, 65 "loc": { 66 "start": { 67 "line": 18, 68 "column": 6 69 }, 70 "end": { 71 "line": 18, 72 "column": 15 73 } 74 } 75 }, 76 "nameKeyType": { 77 "type": "TSIndexedAccessType", 78 "objectType": { 79 "type": "TSTypeReference", 80 "typeName": { 81 "type": "Identifier", 82 "name": "p", 83 "loc": { 84 "start": { 85 "line": 18, 86 "column": 19 87 }, 88 "end": { 89 "line": 18, 90 "column": 20 91 } 92 } 93 }, 94 "loc": { 95 "start": { 96 "line": 18, 97 "column": 19 98 }, 99 "end": { 100 "line": 18, 101 "column": 21 102 } 103 } 104 }, 105 "indexType": { 106 "type": "TSLiteralType", 107 "literal": { 108 "type": "StringLiteral", 109 "value": "name", 110 "loc": { 111 "start": { 112 "line": 18, 113 "column": 21 114 }, 115 "end": { 116 "line": 18, 117 "column": 27 118 } 119 } 120 }, 121 "loc": { 122 "start": { 123 "line": 18, 124 "column": 21 125 }, 126 "end": { 127 "line": 18, 128 "column": 27 129 } 130 } 131 }, 132 "loc": { 133 "start": { 134 "line": 18, 135 "column": 19 136 }, 137 "end": { 138 "line": 18, 139 "column": 29 140 } 141 } 142 }, 143 "typeAnnotation": { 144 "type": "TSNumberKeyword", 145 "loc": { 146 "start": { 147 "line": 18, 148 "column": 32 149 }, 150 "end": { 151 "line": 18, 152 "column": 38 153 } 154 } 155 }, 156 "loc": { 157 "start": { 158 "line": 17, 159 "column": 45 160 }, 161 "end": { 162 "line": 19, 163 "column": 2 164 } 165 } 166 }, 167 "typeParameters": { 168 "type": "TSTypeParameterDeclaration", 169 "params": [ 170 { 171 "type": "TSTypeParameter", 172 "name": { 173 "type": "Identifier", 174 "name": "Type", 175 "loc": { 176 "start": { 177 "line": 17, 178 "column": 14 179 }, 180 "end": { 181 "line": 17, 182 "column": 18 183 } 184 } 185 }, 186 "constraint": { 187 "type": "TSTypeLiteral", 188 "members": [ 189 { 190 "type": "TSPropertySignature", 191 "computed": false, 192 "optional": false, 193 "readonly": false, 194 "key": { 195 "type": "Identifier", 196 "name": "name", 197 "loc": { 198 "start": { 199 "line": 17, 200 "column": 28 201 }, 202 "end": { 203 "line": 17, 204 "column": 32 205 } 206 } 207 }, 208 "typeAnnotation": { 209 "type": "TSStringKeyword", 210 "loc": { 211 "start": { 212 "line": 17, 213 "column": 34 214 }, 215 "end": { 216 "line": 17, 217 "column": 40 218 } 219 } 220 }, 221 "loc": { 222 "start": { 223 "line": 17, 224 "column": 28 225 }, 226 "end": { 227 "line": 17, 228 "column": 41 229 } 230 } 231 } 232 ], 233 "loc": { 234 "start": { 235 "line": 17, 236 "column": 27 237 }, 238 "end": { 239 "line": 17, 240 "column": 41 241 } 242 } 243 }, 244 "loc": { 245 "start": { 246 "line": 17, 247 "column": 14 248 }, 249 "end": { 250 "line": 17, 251 "column": 42 252 } 253 } 254 } 255 ], 256 "loc": { 257 "start": { 258 "line": 17, 259 "column": 13 260 }, 261 "end": { 262 "line": 17, 263 "column": 42 264 } 265 } 266 }, 267 "loc": { 268 "start": { 269 "line": 17, 270 "column": 1 271 }, 272 "end": { 273 "line": 20, 274 "column": 5 275 } 276 } 277 }, 278 { 279 "type": "TSTypeAliasDeclaration", 280 "id": { 281 "type": "Identifier", 282 "name": "NameA", 283 "loc": { 284 "start": { 285 "line": 20, 286 "column": 6 287 }, 288 "end": { 289 "line": 20, 290 "column": 11 291 } 292 } 293 }, 294 "typeAnnotation": { 295 "type": "TSTypeLiteral", 296 "members": [ 297 { 298 "type": "TSPropertySignature", 299 "computed": false, 300 "optional": false, 301 "readonly": false, 302 "key": { 303 "type": "Identifier", 304 "name": "name", 305 "loc": { 306 "start": { 307 "line": 20, 308 "column": 15 309 }, 310 "end": { 311 "line": 20, 312 "column": 19 313 } 314 } 315 }, 316 "typeAnnotation": { 317 "type": "TSLiteralType", 318 "literal": { 319 "type": "StringLiteral", 320 "value": "A", 321 "loc": { 322 "start": { 323 "line": 20, 324 "column": 21 325 }, 326 "end": { 327 "line": 20, 328 "column": 24 329 } 330 } 331 }, 332 "loc": { 333 "start": { 334 "line": 20, 335 "column": 21 336 }, 337 "end": { 338 "line": 20, 339 "column": 24 340 } 341 } 342 }, 343 "loc": { 344 "start": { 345 "line": 20, 346 "column": 15 347 }, 348 "end": { 349 "line": 20, 350 "column": 25 351 } 352 } 353 }, 354 { 355 "type": "TSPropertySignature", 356 "computed": false, 357 "optional": false, 358 "readonly": false, 359 "key": { 360 "type": "Identifier", 361 "name": "kind", 362 "loc": { 363 "start": { 364 "line": 20, 365 "column": 26 366 }, 367 "end": { 368 "line": 20, 369 "column": 30 370 } 371 } 372 }, 373 "typeAnnotation": { 374 "type": "TSStringKeyword", 375 "loc": { 376 "start": { 377 "line": 20, 378 "column": 32 379 }, 380 "end": { 381 "line": 20, 382 "column": 38 383 } 384 } 385 }, 386 "loc": { 387 "start": { 388 "line": 20, 389 "column": 26 390 }, 391 "end": { 392 "line": 20, 393 "column": 39 394 } 395 } 396 } 397 ], 398 "loc": { 399 "start": { 400 "line": 20, 401 "column": 14 402 }, 403 "end": { 404 "line": 20, 405 "column": 39 406 } 407 } 408 }, 409 "loc": { 410 "start": { 411 "line": 20, 412 "column": 1 413 }, 414 "end": { 415 "line": 21, 416 "column": 5 417 } 418 } 419 }, 420 { 421 "type": "TSTypeAliasDeclaration", 422 "id": { 423 "type": "Identifier", 424 "name": "NameB", 425 "loc": { 426 "start": { 427 "line": 21, 428 "column": 6 429 }, 430 "end": { 431 "line": 21, 432 "column": 11 433 } 434 } 435 }, 436 "typeAnnotation": { 437 "type": "TSTypeLiteral", 438 "members": [ 439 { 440 "type": "TSPropertySignature", 441 "computed": false, 442 "optional": false, 443 "readonly": false, 444 "key": { 445 "type": "Identifier", 446 "name": "name", 447 "loc": { 448 "start": { 449 "line": 21, 450 "column": 15 451 }, 452 "end": { 453 "line": 21, 454 "column": 19 455 } 456 } 457 }, 458 "typeAnnotation": { 459 "type": "TSLiteralType", 460 "literal": { 461 "type": "StringLiteral", 462 "value": "B", 463 "loc": { 464 "start": { 465 "line": 21, 466 "column": 21 467 }, 468 "end": { 469 "line": 21, 470 "column": 24 471 } 472 } 473 }, 474 "loc": { 475 "start": { 476 "line": 21, 477 "column": 21 478 }, 479 "end": { 480 "line": 21, 481 "column": 24 482 } 483 } 484 }, 485 "loc": { 486 "start": { 487 "line": 21, 488 "column": 15 489 }, 490 "end": { 491 "line": 21, 492 "column": 25 493 } 494 } 495 }, 496 { 497 "type": "TSPropertySignature", 498 "computed": false, 499 "optional": false, 500 "readonly": false, 501 "key": { 502 "type": "Identifier", 503 "name": "kind", 504 "loc": { 505 "start": { 506 "line": 21, 507 "column": 26 508 }, 509 "end": { 510 "line": 21, 511 "column": 30 512 } 513 } 514 }, 515 "typeAnnotation": { 516 "type": "TSStringKeyword", 517 "loc": { 518 "start": { 519 "line": 21, 520 "column": 32 521 }, 522 "end": { 523 "line": 21, 524 "column": 38 525 } 526 } 527 }, 528 "loc": { 529 "start": { 530 "line": 21, 531 "column": 26 532 }, 533 "end": { 534 "line": 21, 535 "column": 39 536 } 537 } 538 } 539 ], 540 "loc": { 541 "start": { 542 "line": 21, 543 "column": 14 544 }, 545 "end": { 546 "line": 21, 547 "column": 39 548 } 549 } 550 }, 551 "loc": { 552 "start": { 553 "line": 21, 554 "column": 1 555 }, 556 "end": { 557 "line": 22, 558 "column": 5 559 } 560 } 561 }, 562 { 563 "type": "TSTypeAliasDeclaration", 564 "id": { 565 "type": "Identifier", 566 "name": "NameC", 567 "loc": { 568 "start": { 569 "line": 22, 570 "column": 6 571 }, 572 "end": { 573 "line": 22, 574 "column": 11 575 } 576 } 577 }, 578 "typeAnnotation": { 579 "type": "TSTypeLiteral", 580 "members": [ 581 { 582 "type": "TSPropertySignature", 583 "computed": false, 584 "optional": false, 585 "readonly": false, 586 "key": { 587 "type": "Identifier", 588 "name": "name", 589 "loc": { 590 "start": { 591 "line": 22, 592 "column": 15 593 }, 594 "end": { 595 "line": 22, 596 "column": 19 597 } 598 } 599 }, 600 "typeAnnotation": { 601 "type": "TSLiteralType", 602 "literal": { 603 "type": "StringLiteral", 604 "value": "C", 605 "loc": { 606 "start": { 607 "line": 22, 608 "column": 21 609 }, 610 "end": { 611 "line": 22, 612 "column": 24 613 } 614 } 615 }, 616 "loc": { 617 "start": { 618 "line": 22, 619 "column": 21 620 }, 621 "end": { 622 "line": 22, 623 "column": 24 624 } 625 } 626 }, 627 "loc": { 628 "start": { 629 "line": 22, 630 "column": 15 631 }, 632 "end": { 633 "line": 22, 634 "column": 25 635 } 636 } 637 }, 638 { 639 "type": "TSPropertySignature", 640 "computed": false, 641 "optional": false, 642 "readonly": false, 643 "key": { 644 "type": "Identifier", 645 "name": "kind", 646 "loc": { 647 "start": { 648 "line": 22, 649 "column": 26 650 }, 651 "end": { 652 "line": 22, 653 "column": 30 654 } 655 } 656 }, 657 "typeAnnotation": { 658 "type": "TSStringKeyword", 659 "loc": { 660 "start": { 661 "line": 22, 662 "column": 32 663 }, 664 "end": { 665 "line": 22, 666 "column": 38 667 } 668 } 669 }, 670 "loc": { 671 "start": { 672 "line": 22, 673 "column": 26 674 }, 675 "end": { 676 "line": 22, 677 "column": 39 678 } 679 } 680 } 681 ], 682 "loc": { 683 "start": { 684 "line": 22, 685 "column": 14 686 }, 687 "end": { 688 "line": 22, 689 "column": 39 690 } 691 } 692 }, 693 "loc": { 694 "start": { 695 "line": 22, 696 "column": 1 697 }, 698 "end": { 699 "line": 23, 700 "column": 5 701 } 702 } 703 }, 704 { 705 "type": "TSTypeAliasDeclaration", 706 "id": { 707 "type": "Identifier", 708 "name": "Name", 709 "loc": { 710 "start": { 711 "line": 23, 712 "column": 6 713 }, 714 "end": { 715 "line": 23, 716 "column": 10 717 } 718 } 719 }, 720 "typeAnnotation": { 721 "type": "TSTypeReference", 722 "typeName": { 723 "type": "Identifier", 724 "name": "GetName", 725 "loc": { 726 "start": { 727 "line": 23, 728 "column": 13 729 }, 730 "end": { 731 "line": 23, 732 "column": 20 733 } 734 } 735 }, 736 "typeParameters": { 737 "type": "TSTypeParameterInstantiation", 738 "params": [ 739 { 740 "type": "TSUnionType", 741 "types": [ 742 { 743 "type": "TSTypeReference", 744 "typeName": { 745 "type": "Identifier", 746 "name": "NameA", 747 "loc": { 748 "start": { 749 "line": 23, 750 "column": 21 751 }, 752 "end": { 753 "line": 23, 754 "column": 26 755 } 756 } 757 }, 758 "loc": { 759 "start": { 760 "line": 23, 761 "column": 21 762 }, 763 "end": { 764 "line": 23, 765 "column": 26 766 } 767 } 768 }, 769 { 770 "type": "TSTypeReference", 771 "typeName": { 772 "type": "Identifier", 773 "name": "NameB", 774 "loc": { 775 "start": { 776 "line": 23, 777 "column": 29 778 }, 779 "end": { 780 "line": 23, 781 "column": 34 782 } 783 } 784 }, 785 "loc": { 786 "start": { 787 "line": 23, 788 "column": 29 789 }, 790 "end": { 791 "line": 23, 792 "column": 34 793 } 794 } 795 }, 796 { 797 "type": "TSTypeReference", 798 "typeName": { 799 "type": "Identifier", 800 "name": "NameC", 801 "loc": { 802 "start": { 803 "line": 23, 804 "column": 37 805 }, 806 "end": { 807 "line": 23, 808 "column": 42 809 } 810 } 811 }, 812 "loc": { 813 "start": { 814 "line": 23, 815 "column": 37 816 }, 817 "end": { 818 "line": 23, 819 "column": 42 820 } 821 } 822 } 823 ], 824 "loc": { 825 "start": { 826 "line": 23, 827 "column": 21 828 }, 829 "end": { 830 "line": 23, 831 "column": 42 832 } 833 } 834 } 835 ], 836 "loc": { 837 "start": { 838 "line": 23, 839 "column": 13 840 }, 841 "end": { 842 "line": 23, 843 "column": 43 844 } 845 } 846 }, 847 "loc": { 848 "start": { 849 "line": 23, 850 "column": 13 851 }, 852 "end": { 853 "line": 23, 854 "column": 20 855 } 856 } 857 }, 858 "loc": { 859 "start": { 860 "line": 23, 861 "column": 1 862 }, 863 "end": { 864 "line": 23, 865 "column": 43 866 } 867 } 868 } 869 ], 870 "loc": { 871 "start": { 872 "line": 1, 873 "column": 1 874 }, 875 "end": { 876 "line": 23, 877 "column": 43 878 } 879 } 880} 881