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