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