swc/crates/swc_ecma_parser/tests/tsc/unionAndIntersectionInference3.json

6138 lines
180 KiB
JSON
Raw Normal View History

{
"type": "Module",
"span": {
"start": 60,
"end": 2282,
"ctxt": 0
},
"body": [
{
"type": "TsTypeAliasDeclaration",
"span": {
"start": 60,
"end": 90,
"ctxt": 0
},
"declare": false,
"id": {
"type": "Identifier",
"span": {
"start": 65,
"end": 70,
"ctxt": 0
},
"value": "Maybe",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterDeclaration",
"span": {
"start": 70,
"end": 73,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
"start": 71,
"end": 72,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 71,
"end": 72,
"ctxt": 0
},
"value": "T",
"optional": false
},
"in": false,
"out": false,
"const": false,
"constraint": null,
"default": null
}
]
},
"typeAnnotation": {
"type": "TsUnionType",
"span": {
"start": 76,
"end": 89,
"ctxt": 0
},
"types": [
{
"type": "TsTypeReference",
"span": {
"start": 76,
"end": 77,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 76,
"end": 77,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
},
{
"type": "TsKeywordType",
"span": {
"start": 80,
"end": 89,
"ctxt": 0
},
"kind": "undefined"
}
]
}
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 108,
"end": 119,
"ctxt": 0
},
"value": "concatMaybe",
"optional": false
},
"declare": true,
"params": [
{
"type": "Parameter",
"span": {
"start": 123,
"end": 157,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "RestElement",
"span": {
"start": 123,
"end": 157,
"ctxt": 0
},
"rest": {
"start": 123,
"end": 126,
"ctxt": 0
},
"argument": {
"type": "Identifier",
"span": {
"start": 126,
"end": 130,
"ctxt": 0
},
"value": "args",
"optional": false,
"typeAnnotation": null
},
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 130,
"end": 157,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsArrayType",
"span": {
"start": 132,
"end": 157,
"ctxt": 0
},
"elemType": {
"type": "TsParenthesizedType",
"span": {
"start": 132,
"end": 155,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsUnionType",
"span": {
"start": 133,
"end": 154,
"ctxt": 0
},
"types": [
{
"type": "TsTypeReference",
"span": {
"start": 133,
"end": 141,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 133,
"end": 138,
"ctxt": 0
},
"value": "Maybe",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 138,
"end": 141,
"ctxt": 0
},
"params": [
{
"type": "TsTypeReference",
"span": {
"start": 139,
"end": 140,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 139,
"end": 140,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
}
]
}
},
{
"type": "TsArrayType",
"span": {
"start": 144,
"end": 154,
"ctxt": 0
},
"elemType": {
"type": "TsTypeReference",
"span": {
"start": 144,
"end": 152,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 144,
"end": 149,
"ctxt": 0
},
"value": "Maybe",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 149,
"end": 152,
"ctxt": 0
},
"params": [
{
"type": "TsTypeReference",
"span": {
"start": 150,
"end": 151,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 150,
"end": 151,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
}
]
}
}
}
]
}
}
}
}
}
}
],
"decorators": [],
"span": {
"start": 91,
"end": 164,
"ctxt": 0
},
"body": null,
"generator": false,
"async": false,
"typeParameters": {
"type": "TsTypeParameterDeclaration",
"span": {
"start": 119,
"end": 122,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
"start": 120,
"end": 121,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 120,
"end": 121,
"ctxt": 0
},
"value": "T",
"optional": false
},
"in": false,
"out": false,
"const": false,
"constraint": null,
"default": null
}
]
},
"returnType": {
"type": "TsTypeAnnotation",
"span": {
"start": 158,
"end": 163,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsArrayType",
"span": {
"start": 160,
"end": 163,
"ctxt": 0
},
"elemType": {
"type": "TsTypeReference",
"span": {
"start": 160,
"end": 161,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 160,
"end": 161,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
}
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 165,
"end": 191,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 165,
"end": 190,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 165,
"end": 176,
"ctxt": 0
},
"value": "concatMaybe",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "ArrayExpression",
"span": {
"start": 177,
"end": 186,
"ctxt": 0
},
"elements": [
{
"spread": null,
"expression": {
"type": "NumericLiteral",
"span": {
"start": 178,
"end": 179,
"ctxt": 0
},
"value": 1.0,
"raw": "1"
}
},
{
"spread": null,
"expression": {
"type": "NumericLiteral",
"span": {
"start": 181,
"end": 182,
"ctxt": 0
},
"value": 2.0,
"raw": "2"
}
},
{
"spread": null,
"expression": {
"type": "NumericLiteral",
"span": {
"start": 184,
"end": 185,
"ctxt": 0
},
"value": 3.0,
"raw": "3"
}
}
]
}
},
{
"spread": null,
"expression": {
"type": "NumericLiteral",
"span": {
"start": 188,
"end": 189,
"ctxt": 0
},
"value": 4.0,
"raw": "4"
}
}
],
"typeArguments": null
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 216,
"end": 409,
"ctxt": 0
},
"kind": "const",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 222,
"end": 408,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 222,
"end": 223,
"ctxt": 0
},
"value": "g",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 223,
"end": 303,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsFunctionType",
"span": {
"start": 225,
"end": 303,
"ctxt": 0
},
"params": [
{
"type": "Identifier",
"span": {
"start": 235,
"end": 288,
"ctxt": 0
},
"value": "com",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 238,
"end": 288,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsFunctionType",
"span": {
"start": 240,
"end": 288,
"ctxt": 0
},
"params": [],
"typeParams": null,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 243,
"end": 288,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsUnionType",
"span": {
"start": 246,
"end": 288,
"ctxt": 0
},
"types": [
{
"type": "TsTypeReference",
"span": {
"start": 246,
"end": 263,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 246,
"end": 254,
"ctxt": 0
},
"value": "Iterator",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 254,
"end": 263,
"ctxt": 0
},
"params": [
{
"type": "TsTypeReference",
"span": {
"start": 255,
"end": 256,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 255,
"end": 256,
"ctxt": 0
},
"value": "S",
"optional": false
},
"typeParams": null
},
{
"type": "TsTypeReference",
"span": {
"start": 258,
"end": 259,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 258,
"end": 259,
"ctxt": 0
},
"value": "U",
"optional": false
},
"typeParams": null
},
{
"type": "TsTypeReference",
"span": {
"start": 261,
"end": 262,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 261,
"end": 262,
"ctxt": 0
},
"value": "R",
"optional": false
},
"typeParams": null
}
]
}
},
{
"type": "TsTypeReference",
"span": {
"start": 266,
"end": 288,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 266,
"end": 279,
"ctxt": 0
},
"value": "AsyncIterator",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 279,
"end": 288,
"ctxt": 0
},
"params": [
{
"type": "TsTypeReference",
"span": {
"start": 280,
"end": 281,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 280,
"end": 281,
"ctxt": 0
},
"value": "S",
"optional": false
},
"typeParams": null
},
{
"type": "TsTypeReference",
"span": {
"start": 283,
"end": 284,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 283,
"end": 284,
"ctxt": 0
},
"value": "U",
"optional": false
},
"typeParams": null
},
{
"type": "TsTypeReference",
"span": {
"start": 286,
"end": 287,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 286,
"end": 287,
"ctxt": 0
},
"value": "R",
"optional": false
},
"typeParams": null
}
]
}
}
]
}
}
}
}
}
],
"typeParams": {
"type": "TsTypeParameterDeclaration",
"span": {
"start": 225,
"end": 234,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
"start": 226,
"end": 227,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 226,
"end": 227,
"ctxt": 0
},
"value": "U",
"optional": false
},
"in": false,
"out": false,
"const": false,
"constraint": null,
"default": null
},
{
"type": "TsTypeParameter",
"span": {
"start": 229,
"end": 230,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 229,
"end": 230,
"ctxt": 0
},
"value": "R",
"optional": false
},
"in": false,
"out": false,
"const": false,
"constraint": null,
"default": null
},
{
"type": "TsTypeParameter",
"span": {
"start": 232,
"end": 233,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 232,
"end": 233,
"ctxt": 0
},
"value": "S",
"optional": false
},
"in": false,
"out": false,
"const": false,
"constraint": null,
"default": null
}
]
},
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 290,
"end": 303,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 293,
"end": 303,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 293,
"end": 300,
"ctxt": 0
},
"value": "Promise",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 300,
"end": 303,
"ctxt": 0
},
"params": [
{
"type": "TsTypeReference",
"span": {
"start": 301,
"end": 302,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 301,
"end": 302,
"ctxt": 0
},
"value": "U",
"optional": false
},
"typeParams": null
}
]
}
}
}
}
}
},
"init": {
"type": "ArrowFunctionExpression",
"span": {
"start": 306,
"end": 408,
"ctxt": 0
},
"params": [
{
"type": "Identifier",
"span": {
"start": 322,
"end": 375,
"ctxt": 0
},
"value": "com",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 325,
"end": 375,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsFunctionType",
"span": {
"start": 327,
"end": 375,
"ctxt": 0
},
"params": [],
"typeParams": null,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 330,
"end": 375,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsUnionType",
"span": {
"start": 333,
"end": 375,
"ctxt": 0
},
"types": [
{
"type": "TsTypeReference",
"span": {
"start": 333,
"end": 350,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 333,
"end": 341,
"ctxt": 0
},
"value": "Iterator",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 341,
"end": 350,
"ctxt": 0
},
"params": [
{
"type": "TsTypeReference",
"span": {
"start": 342,
"end": 343,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 342,
"end": 343,
"ctxt": 0
},
"value": "S",
"optional": false
},
"typeParams": null
},
{
"type": "TsTypeReference",
"span": {
"start": 345,
"end": 346,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 345,
"end": 346,
"ctxt": 0
},
"value": "U",
"optional": false
},
"typeParams": null
},
{
"type": "TsTypeReference",
"span": {
"start": 348,
"end": 349,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 348,
"end": 349,
"ctxt": 0
},
"value": "R",
"optional": false
},
"typeParams": null
}
]
}
},
{
"type": "TsTypeReference",
"span": {
"start": 353,
"end": 375,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 353,
"end": 366,
"ctxt": 0
},
"value": "AsyncIterator",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 366,
"end": 375,
"ctxt": 0
},
"params": [
{
"type": "TsTypeReference",
"span": {
"start": 367,
"end": 368,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 367,
"end": 368,
"ctxt": 0
},
"value": "S",
"optional": false
},
"typeParams": null
},
{
"type": "TsTypeReference",
"span": {
"start": 370,
"end": 371,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 370,
"end": 371,
"ctxt": 0
},
"value": "U",
"optional": false
},
"typeParams": null
},
{
"type": "TsTypeReference",
"span": {
"start": 373,
"end": 374,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 373,
"end": 374,
"ctxt": 0
},
"value": "R",
"optional": false
},
"typeParams": null
}
]
}
}
]
}
}
}
}
}
],
"body": {
"type": "BlockStatement",
"span": {
"start": 392,
"end": 408,
"ctxt": 0
},
"stmts": [
{
"type": "ThrowStatement",
"span": {
"start": 396,
"end": 406,
"ctxt": 0
},
"argument": {
"type": "Identifier",
"span": {
"start": 402,
"end": 405,
"ctxt": 0
},
"value": "com",
"optional": false
}
}
]
},
"async": true,
"generator": false,
"typeParameters": {
"type": "TsTypeParameterDeclaration",
"span": {
"start": 312,
"end": 321,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
"start": 313,
"end": 314,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 313,
"end": 314,
"ctxt": 0
},
"value": "U",
"optional": false
},
"in": false,
"out": false,
"const": false,
"constraint": null,
"default": null
},
{
"type": "TsTypeParameter",
"span": {
"start": 316,
"end": 317,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 316,
"end": 317,
"ctxt": 0
},
"value": "R",
"optional": false
},
"in": false,
"out": false,
"const": false,
"constraint": null,
"default": null
},
{
"type": "TsTypeParameter",
"span": {
"start": 319,
"end": 320,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 319,
"end": 320,
"ctxt": 0
},
"value": "S",
"optional": false
},
"in": false,
"out": false,
"const": false,
"constraint": null,
"default": null
}
]
},
"returnType": {
"type": "TsTypeAnnotation",
"span": {
"start": 376,
"end": 388,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 378,
"end": 388,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 378,
"end": 385,
"ctxt": 0
},
"value": "Promise",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 385,
"end": 388,
"ctxt": 0
},
"params": [
{
"type": "TsTypeReference",
"span": {
"start": 386,
"end": 387,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 386,
"end": 387,
"ctxt": 0
},
"value": "U",
"optional": false
},
"typeParams": null
}
]
}
}
}
},
"definite": false
}
]
},
{
"type": "TsInterfaceDeclaration",
"span": {
"start": 411,
"end": 458,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 421,
"end": 425,
"ctxt": 0
},
"value": "Foo1",
"optional": false
},
"declare": false,
"typeParams": {
"type": "TsTypeParameterDeclaration",
"span": {
"start": 425,
"end": 428,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
"start": 426,
"end": 427,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 426,
"end": 427,
"ctxt": 0
},
"value": "T",
"optional": false
},
"in": false,
"out": false,
"const": false,
"constraint": null,
"default": null
}
]
},
"extends": [],
"body": {
"type": "TsInterfaceBody",
"span": {
"start": 429,
"end": 458,
"ctxt": 0
},
"body": [
{
"type": "TsMethodSignature",
"span": {
"start": 435,
"end": 456,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 435,
"end": 439,
"ctxt": 0
},
"value": "test",
"optional": false
},
"computed": false,
"optional": false,
"params": [
{
"type": "Identifier",
"span": {
"start": 440,
"end": 448,
"ctxt": 0
},
"value": "value",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 445,
"end": 448,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 447,
"end": 448,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 447,
"end": 448,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
}
}
}
],
"typeAnn": {
"type": "TsTypeAnnotation",
"span": {
"start": 449,
"end": 455,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 451,
"end": 455,
"ctxt": 0
},
"kind": "void"
}
},
"typeParams": null
}
]
}
},
{
"type": "TsInterfaceDeclaration",
"span": {
"start": 460,
"end": 524,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 470,
"end": 474,
"ctxt": 0
},
"value": "Bar1",
"optional": false
},
"declare": false,
"typeParams": {
"type": "TsTypeParameterDeclaration",
"span": {
"start": 474,
"end": 477,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
"start": 475,
"end": 476,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 475,
"end": 476,
"ctxt": 0
},
"value": "T",
"optional": false
},
"in": false,
"out": false,
"const": false,
"constraint": null,
"default": null
}
]
},
"extends": [],
"body": {
"type": "TsInterfaceBody",
"span": {
"start": 478,
"end": 524,
"ctxt": 0
},
"body": [
{
"type": "TsMethodSignature",
"span": {
"start": 484,
"end": 522,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 484,
"end": 488,
"ctxt": 0
},
"value": "test",
"optional": false
},
"computed": false,
"optional": false,
"params": [
{
"type": "Identifier",
"span": {
"start": 489,
"end": 514,
"ctxt": 0
},
"value": "value",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 494,
"end": 514,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsUnionType",
"span": {
"start": 496,
"end": 514,
"ctxt": 0
},
"types": [
{
"type": "TsTypeReference",
"span": {
"start": 496,
"end": 497,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 496,
"end": 497,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
},
{
"type": "TsTypeReference",
"span": {
"start": 500,
"end": 514,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 500,
"end": 511,
"ctxt": 0
},
"value": "PromiseLike",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 511,
"end": 514,
"ctxt": 0
},
"params": [
{
"type": "TsTypeReference",
"span": {
"start": 512,
"end": 513,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 512,
"end": 513,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
}
]
}
}
]
}
}
}
],
"typeAnn": {
"type": "TsTypeAnnotation",
"span": {
"start": 515,
"end": 521,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 517,
"end": 521,
"ctxt": 0
},
"kind": "void"
}
},
"typeParams": null
}
]
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 526,
"end": 582,
"ctxt": 0
},
"kind": "let",
"declare": true,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 538,
"end": 581,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 538,
"end": 540,
"ctxt": 0
},
"value": "f1",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 540,
"end": 581,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsFunctionType",
"span": {
"start": 542,
"end": 581,
"ctxt": 0
},
"params": [
{
"type": "Identifier",
"span": {
"start": 546,
"end": 566,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 547,
"end": 566,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsUnionType",
"span": {
"start": 549,
"end": 566,
"ctxt": 0
},
"types": [
{
"type": "TsTypeReference",
"span": {
"start": 549,
"end": 556,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 549,
"end": 553,
"ctxt": 0
},
"value": "Foo1",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 553,
"end": 556,
"ctxt": 0
},
"params": [
{
"type": "TsTypeReference",
"span": {
"start": 554,
"end": 555,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 554,
"end": 555,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
}
]
}
},
{
"type": "TsTypeReference",
"span": {
"start": 559,
"end": 566,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 559,
"end": 563,
"ctxt": 0
},
"value": "Bar1",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 563,
"end": 566,
"ctxt": 0
},
"params": [
{
"type": "TsTypeReference",
"span": {
"start": 564,
"end": 565,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 564,
"end": 565,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
}
]
}
}
]
}
}
}
],
"typeParams": {
"type": "TsTypeParameterDeclaration",
"span": {
"start": 542,
"end": 545,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
"start": 543,
"end": 544,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 543,
"end": 544,
"ctxt": 0
},
"value": "T",
"optional": false
},
"in": false,
"out": false,
"const": false,
"constraint": null,
"default": null
}
]
},
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 568,
"end": 581,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 571,
"end": 581,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 571,
"end": 578,
"ctxt": 0
},
"value": "Promise",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 578,
"end": 581,
"ctxt": 0
},
"params": [
{
"type": "TsTypeReference",
"span": {
"start": 579,
"end": 580,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 579,
"end": 580,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
}
]
}
}
}
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 583,
"end": 639,
"ctxt": 0
},
"kind": "let",
"declare": true,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 595,
"end": 638,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 595,
"end": 597,
"ctxt": 0
},
"value": "f2",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 597,
"end": 638,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsFunctionType",
"span": {
"start": 599,
"end": 638,
"ctxt": 0
},
"params": [
{
"type": "Identifier",
"span": {
"start": 603,
"end": 623,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 604,
"end": 623,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsUnionType",
"span": {
"start": 606,
"end": 623,
"ctxt": 0
},
"types": [
{
"type": "TsTypeReference",
"span": {
"start": 606,
"end": 613,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 606,
"end": 610,
"ctxt": 0
},
"value": "Foo1",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 610,
"end": 613,
"ctxt": 0
},
"params": [
{
"type": "TsTypeReference",
"span": {
"start": 611,
"end": 612,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 611,
"end": 612,
"ctxt": 0
},
"value": "U",
"optional": false
},
"typeParams": null
}
]
}
},
{
"type": "TsTypeReference",
"span": {
"start": 616,
"end": 623,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 616,
"end": 620,
"ctxt": 0
},
"value": "Bar1",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 620,
"end": 623,
"ctxt": 0
},
"params": [
{
"type": "TsTypeReference",
"span": {
"start": 621,
"end": 622,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 621,
"end": 622,
"ctxt": 0
},
"value": "U",
"optional": false
},
"typeParams": null
}
]
}
}
]
}
}
}
],
"typeParams": {
"type": "TsTypeParameterDeclaration",
"span": {
"start": 599,
"end": 602,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
"start": 600,
"end": 601,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 600,
"end": 601,
"ctxt": 0
},
"value": "U",
"optional": false
},
"in": false,
"out": false,
"const": false,
"constraint": null,
"default": null
}
]
},
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 625,
"end": 638,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 628,
"end": 638,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 628,
"end": 635,
"ctxt": 0
},
"value": "Promise",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 635,
"end": 638,
"ctxt": 0
},
"params": [
{
"type": "TsTypeReference",
"span": {
"start": 636,
"end": 637,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 636,
"end": 637,
"ctxt": 0
},
"value": "U",
"optional": false
},
"typeParams": null
}
]
}
}
}
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 641,
"end": 649,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 641,
"end": 648,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "Identifier",
"span": {
"start": 641,
"end": 643,
"ctxt": 0
},
"value": "f1",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "Identifier",
"span": {
"start": 646,
"end": 648,
"ctxt": 0
},
"value": "f2",
"optional": false
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 650,
"end": 658,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 650,
"end": 657,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "Identifier",
"span": {
"start": 650,
"end": 652,
"ctxt": 0
},
"value": "f2",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "Identifier",
"span": {
"start": 655,
"end": 657,
"ctxt": 0
},
"value": "f1",
"optional": false
}
}
},
{
"type": "TsTypeAliasDeclaration",
"span": {
"start": 660,
"end": 704,
"ctxt": 0
},
"declare": false,
"id": {
"type": "Identifier",
"span": {
"start": 665,
"end": 669,
"ctxt": 0
},
"value": "Foo2",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterDeclaration",
"span": {
"start": 669,
"end": 672,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
"start": 670,
"end": 671,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 670,
"end": 671,
"ctxt": 0
},
"value": "T",
"optional": false
},
"in": false,
"out": false,
"const": false,
"constraint": null,
"default": null
}
]
},
"typeAnnotation": {
"type": "TsTypeLiteral",
"span": {
"start": 675,
"end": 704,
"ctxt": 0
},
"members": [
{
"type": "TsMethodSignature",
"span": {
"start": 681,
"end": 702,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 681,
"end": 685,
"ctxt": 0
},
"value": "test",
"optional": false
},
"computed": false,
"optional": false,
"params": [
{
"type": "Identifier",
"span": {
"start": 686,
"end": 694,
"ctxt": 0
},
"value": "value",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 691,
"end": 694,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 693,
"end": 694,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 693,
"end": 694,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
}
}
}
],
"typeAnn": {
"type": "TsTypeAnnotation",
"span": {
"start": 695,
"end": 701,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 697,
"end": 701,
"ctxt": 0
},
"kind": "void"
}
},
"typeParams": null
}
]
}
},
{
"type": "TsTypeAliasDeclaration",
"span": {
"start": 706,
"end": 767,
"ctxt": 0
},
"declare": false,
"id": {
"type": "Identifier",
"span": {
"start": 711,
"end": 715,
"ctxt": 0
},
"value": "Bar2",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterDeclaration",
"span": {
"start": 715,
"end": 718,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
"start": 716,
"end": 717,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 716,
"end": 717,
"ctxt": 0
},
"value": "T",
"optional": false
},
"in": false,
"out": false,
"const": false,
"constraint": null,
"default": null
}
]
},
"typeAnnotation": {
"type": "TsTypeLiteral",
"span": {
"start": 721,
"end": 767,
"ctxt": 0
},
"members": [
{
"type": "TsMethodSignature",
"span": {
"start": 727,
"end": 765,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 727,
"end": 731,
"ctxt": 0
},
"value": "test",
"optional": false
},
"computed": false,
"optional": false,
"params": [
{
"type": "Identifier",
"span": {
"start": 732,
"end": 757,
"ctxt": 0
},
"value": "value",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 737,
"end": 757,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsUnionType",
"span": {
"start": 739,
"end": 757,
"ctxt": 0
},
"types": [
{
"type": "TsTypeReference",
"span": {
"start": 739,
"end": 740,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 739,
"end": 740,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
},
{
"type": "TsTypeReference",
"span": {
"start": 743,
"end": 757,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 743,
"end": 754,
"ctxt": 0
},
"value": "PromiseLike",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 754,
"end": 757,
"ctxt": 0
},
"params": [
{
"type": "TsTypeReference",
"span": {
"start": 755,
"end": 756,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 755,
"end": 756,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
}
]
}
}
]
}
}
}
],
"typeAnn": {
"type": "TsTypeAnnotation",
"span": {
"start": 758,
"end": 764,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 760,
"end": 764,
"ctxt": 0
},
"kind": "void"
}
},
"typeParams": null
}
]
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 769,
"end": 825,
"ctxt": 0
},
"kind": "let",
"declare": true,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 781,
"end": 824,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 781,
"end": 783,
"ctxt": 0
},
"value": "g1",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 783,
"end": 824,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsFunctionType",
"span": {
"start": 785,
"end": 824,
"ctxt": 0
},
"params": [
{
"type": "Identifier",
"span": {
"start": 789,
"end": 809,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 790,
"end": 809,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsUnionType",
"span": {
"start": 792,
"end": 809,
"ctxt": 0
},
"types": [
{
"type": "TsTypeReference",
"span": {
"start": 792,
"end": 799,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 792,
"end": 796,
"ctxt": 0
},
"value": "Foo2",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 796,
"end": 799,
"ctxt": 0
},
"params": [
{
"type": "TsTypeReference",
"span": {
"start": 797,
"end": 798,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 797,
"end": 798,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
}
]
}
},
{
"type": "TsTypeReference",
"span": {
"start": 802,
"end": 809,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 802,
"end": 806,
"ctxt": 0
},
"value": "Bar2",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 806,
"end": 809,
"ctxt": 0
},
"params": [
{
"type": "TsTypeReference",
"span": {
"start": 807,
"end": 808,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 807,
"end": 808,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
}
]
}
}
]
}
}
}
],
"typeParams": {
"type": "TsTypeParameterDeclaration",
"span": {
"start": 785,
"end": 788,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
"start": 786,
"end": 787,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 786,
"end": 787,
"ctxt": 0
},
"value": "T",
"optional": false
},
"in": false,
"out": false,
"const": false,
"constraint": null,
"default": null
}
]
},
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 811,
"end": 824,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 814,
"end": 824,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 814,
"end": 821,
"ctxt": 0
},
"value": "Promise",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 821,
"end": 824,
"ctxt": 0
},
"params": [
{
"type": "TsTypeReference",
"span": {
"start": 822,
"end": 823,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 822,
"end": 823,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
}
]
}
}
}
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 826,
"end": 882,
"ctxt": 0
},
"kind": "let",
"declare": true,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 838,
"end": 881,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 838,
"end": 840,
"ctxt": 0
},
"value": "g2",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 840,
"end": 881,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsFunctionType",
"span": {
"start": 842,
"end": 881,
"ctxt": 0
},
"params": [
{
"type": "Identifier",
"span": {
"start": 846,
"end": 866,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 847,
"end": 866,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsUnionType",
"span": {
"start": 849,
"end": 866,
"ctxt": 0
},
"types": [
{
"type": "TsTypeReference",
"span": {
"start": 849,
"end": 856,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 849,
"end": 853,
"ctxt": 0
},
"value": "Foo2",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 853,
"end": 856,
"ctxt": 0
},
"params": [
{
"type": "TsTypeReference",
"span": {
"start": 854,
"end": 855,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 854,
"end": 855,
"ctxt": 0
},
"value": "U",
"optional": false
},
"typeParams": null
}
]
}
},
{
"type": "TsTypeReference",
"span": {
"start": 859,
"end": 866,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 859,
"end": 863,
"ctxt": 0
},
"value": "Bar2",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 863,
"end": 866,
"ctxt": 0
},
"params": [
{
"type": "TsTypeReference",
"span": {
"start": 864,
"end": 865,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 864,
"end": 865,
"ctxt": 0
},
"value": "U",
"optional": false
},
"typeParams": null
}
]
}
}
]
}
}
}
],
"typeParams": {
"type": "TsTypeParameterDeclaration",
"span": {
"start": 842,
"end": 845,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
"start": 843,
"end": 844,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 843,
"end": 844,
"ctxt": 0
},
"value": "U",
"optional": false
},
"in": false,
"out": false,
"const": false,
"constraint": null,
"default": null
}
]
},
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 868,
"end": 881,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 871,
"end": 881,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 871,
"end": 878,
"ctxt": 0
},
"value": "Promise",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 878,
"end": 881,
"ctxt": 0
},
"params": [
{
"type": "TsTypeReference",
"span": {
"start": 879,
"end": 880,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 879,
"end": 880,
"ctxt": 0
},
"value": "U",
"optional": false
},
"typeParams": null
}
]
}
}
}
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 884,
"end": 892,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 884,
"end": 891,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "Identifier",
"span": {
"start": 884,
"end": 886,
"ctxt": 0
},
"value": "g1",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "Identifier",
"span": {
"start": 889,
"end": 891,
"ctxt": 0
},
"value": "g2",
"optional": false
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 893,
"end": 901,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 893,
"end": 900,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "Identifier",
"span": {
"start": 893,
"end": 895,
"ctxt": 0
},
"value": "g2",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "Identifier",
"span": {
"start": 898,
"end": 900,
"ctxt": 0
},
"value": "g1",
"optional": false
}
}
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 942,
"end": 946,
"ctxt": 0
},
"value": "foo1",
"optional": false
},
"declare": true,
"params": [
{
"type": "Parameter",
"span": {
"start": 950,
"end": 977,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 950,
"end": 977,
"ctxt": 0
},
"value": "obj",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 953,
"end": 977,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsIntersectionType",
"span": {
"start": 955,
"end": 977,
"ctxt": 0
},
"types": [
{
"type": "TsArrayType",
"span": {
"start": 955,
"end": 963,
"ctxt": 0
},
"elemType": {
"type": "TsKeywordType",
"span": {
"start": 955,
"end": 961,
"ctxt": 0
},
"kind": "string"
}
},
{
"type": "TsTypeReference",
"span": {
"start": 966,
"end": 977,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 966,
"end": 974,
"ctxt": 0
},
"value": "Iterable",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 974,
"end": 977,
"ctxt": 0
},
"params": [
{
"type": "TsTypeReference",
"span": {
"start": 975,
"end": 976,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 975,
"end": 976,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
}
]
}
}
]
}
}
}
}
],
"decorators": [],
"span": {
"start": 925,
"end": 982,
"ctxt": 0
},
"body": null,
"generator": false,
"async": false,
"typeParameters": {
"type": "TsTypeParameterDeclaration",
"span": {
"start": 946,
"end": 949,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
"start": 947,
"end": 948,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 947,
"end": 948,
"ctxt": 0
},
"value": "T",
"optional": false
},
"in": false,
"out": false,
"const": false,
"constraint": null,
"default": null
}
]
},
"returnType": {
"type": "TsTypeAnnotation",
"span": {
"start": 978,
"end": 981,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 980,
"end": 981,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 980,
"end": 981,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
}
}
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 1000,
"end": 1004,
"ctxt": 0
},
"value": "foo2",
"optional": false
},
"declare": true,
"params": [
{
"type": "Parameter",
"span": {
"start": 1008,
"end": 1025,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 1008,
"end": 1025,
"ctxt": 0
},
"value": "obj",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 1011,
"end": 1025,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsIntersectionType",
"span": {
"start": 1013,
"end": 1025,
"ctxt": 0
},
"types": [
{
"type": "TsArrayType",
"span": {
"start": 1013,
"end": 1021,
"ctxt": 0
},
"elemType": {
"type": "TsKeywordType",
"span": {
"start": 1013,
"end": 1019,
"ctxt": 0
},
"kind": "string"
}
},
{
"type": "TsTypeReference",
"span": {
"start": 1024,
"end": 1025,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 1024,
"end": 1025,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
}
]
}
}
}
}
],
"decorators": [],
"span": {
"start": 983,
"end": 1030,
"ctxt": 0
},
"body": null,
"generator": false,
"async": false,
"typeParameters": {
"type": "TsTypeParameterDeclaration",
"span": {
"start": 1004,
"end": 1007,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
"start": 1005,
"end": 1006,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 1005,
"end": 1006,
"ctxt": 0
},
"value": "T",
"optional": false
},
"in": false,
"out": false,
"const": false,
"constraint": null,
"default": null
}
]
},
"returnType": {
"type": "TsTypeAnnotation",
"span": {
"start": 1026,
"end": 1029,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 1028,
"end": 1029,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 1028,
"end": 1029,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
}
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 1032,
"end": 1057,
"ctxt": 0
},
"kind": "let",
"declare": true,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 1044,
"end": 1056,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 1044,
"end": 1046,
"ctxt": 0
},
"value": "sa",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 1046,
"end": 1056,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsArrayType",
"span": {
"start": 1048,
"end": 1056,
"ctxt": 0
},
"elemType": {
"type": "TsKeywordType",
"span": {
"start": 1048,
"end": 1054,
"ctxt": 0
},
"kind": "string"
}
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 1058,
"end": 1103,
"ctxt": 0
},
"kind": "let",
"declare": true,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 1070,
"end": 1102,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 1070,
"end": 1072,
"ctxt": 0
},
"value": "sx",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 1072,
"end": 1102,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsIntersectionType",
"span": {
"start": 1074,
"end": 1102,
"ctxt": 0
},
"types": [
{
"type": "TsArrayType",
"span": {
"start": 1074,
"end": 1082,
"ctxt": 0
},
"elemType": {
"type": "TsKeywordType",
"span": {
"start": 1074,
"end": 1080,
"ctxt": 0
},
"kind": "string"
}
},
{
"type": "TsTypeLiteral",
"span": {
"start": 1085,
"end": 1102,
"ctxt": 0
},
"members": [
{
"type": "TsPropertySignature",
"span": {
"start": 1087,
"end": 1100,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 1087,
"end": 1092,
"ctxt": 0
},
"value": "extra",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 1092,
"end": 1100,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 1094,
"end": 1100,
"ctxt": 0
},
"kind": "number"
}
},
"typeParams": null
}
]
}
]
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 1105,
"end": 1123,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 1109,
"end": 1122,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 1109,
"end": 1111,
"ctxt": 0
},
"value": "x1",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "CallExpression",
"span": {
"start": 1114,
"end": 1122,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 1114,
"end": 1118,
"ctxt": 0
},
"value": "foo1",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "Identifier",
"span": {
"start": 1119,
"end": 1121,
"ctxt": 0
},
"value": "sa",
"optional": false
}
}
],
"typeArguments": null
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 1135,
"end": 1153,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 1139,
"end": 1152,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 1139,
"end": 1141,
"ctxt": 0
},
"value": "y1",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "CallExpression",
"span": {
"start": 1144,
"end": 1152,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 1144,
"end": 1148,
"ctxt": 0
},
"value": "foo1",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "Identifier",
"span": {
"start": 1149,
"end": 1151,
"ctxt": 0
},
"value": "sx",
"optional": false
}
}
],
"typeArguments": null
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 1166,
"end": 1184,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 1170,
"end": 1183,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 1170,
"end": 1172,
"ctxt": 0
},
"value": "x2",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "CallExpression",
"span": {
"start": 1175,
"end": 1183,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 1175,
"end": 1179,
"ctxt": 0
},
"value": "foo2",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "Identifier",
"span": {
"start": 1180,
"end": 1182,
"ctxt": 0
},
"value": "sa",
"optional": false
}
}
],
"typeArguments": null
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 1197,
"end": 1215,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 1201,
"end": 1214,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 1201,
"end": 1203,
"ctxt": 0
},
"value": "y2",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "CallExpression",
"span": {
"start": 1206,
"end": 1214,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 1206,
"end": 1210,
"ctxt": 0
},
"value": "foo2",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "Identifier",
"span": {
"start": 1211,
"end": 1213,
"ctxt": 0
},
"value": "sx",
"optional": false
}
}
],
"typeArguments": null
},
"definite": false
}
]
},
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 1275,
"end": 1284,
"ctxt": 0
},
"value": "Component",
"optional": false
},
"declare": true,
"span": {
"start": 1261,
"end": 1300,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassProperty",
"span": {
"start": 1290,
"end": 1298,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 1290,
"end": 1295,
"ctxt": 0
},
"value": "props",
"optional": false
},
"value": null,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 1295,
"end": 1298,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 1297,
"end": 1298,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 1297,
"end": 1298,
"ctxt": 0
},
"value": "P",
"optional": false
},
"typeParams": null
}
},
"isStatic": false,
"decorators": [],
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false,
"readonly": false,
"declare": false,
"definite": false
}
],
"superClass": null,
"isAbstract": false,
"typeParams": {
"type": "TsTypeParameterDeclaration",
"span": {
"start": 1284,
"end": 1287,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
"start": 1285,
"end": 1286,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 1285,
"end": 1286,
"ctxt": 0
},
"value": "P",
"optional": false
},
"in": false,
"out": false,
"const": false,
"constraint": null,
"default": null
}
]
},
"superTypeParams": null,
"implements": []
},
{
"type": "ExportDeclaration",
"span": {
"start": 1302,
"end": 1365,
"ctxt": 0
},
"declaration": {
"type": "TsTypeAliasDeclaration",
"span": {
"start": 1309,
"end": 1365,
"ctxt": 0
},
"declare": false,
"id": {
"type": "Identifier",
"span": {
"start": 1314,
"end": 1328,
"ctxt": 0
},
"value": "ComponentClass",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterDeclaration",
"span": {
"start": 1328,
"end": 1331,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
"start": 1329,
"end": 1330,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 1329,
"end": 1330,
"ctxt": 0
},
"value": "P",
"optional": false
},
"in": false,
"out": false,
"const": false,
"constraint": null,
"default": null
}
]
},
"typeAnnotation": {
"type": "TsConstructorType",
"span": {
"start": 1334,
"end": 1364,
"ctxt": 0
},
"params": [
{
"type": "Identifier",
"span": {
"start": 1339,
"end": 1347,
"ctxt": 0
},
"value": "props",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 1344,
"end": 1347,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 1346,
"end": 1347,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 1346,
"end": 1347,
"ctxt": 0
},
"value": "P",
"optional": false
},
"typeParams": null
}
}
}
],
"typeParams": null,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 1349,
"end": 1364,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 1352,
"end": 1364,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 1352,
"end": 1361,
"ctxt": 0
},
"value": "Component",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 1361,
"end": 1364,
"ctxt": 0
},
"params": [
{
"type": "TsTypeReference",
"span": {
"start": 1362,
"end": 1363,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 1362,
"end": 1363,
"ctxt": 0
},
"value": "P",
"optional": false
},
"typeParams": null
}
]
}
}
},
"isAbstract": false
}
}
},
{
"type": "ExportDeclaration",
"span": {
"start": 1366,
"end": 1420,
"ctxt": 0
},
"declaration": {
"type": "TsTypeAliasDeclaration",
"span": {
"start": 1373,
"end": 1420,
"ctxt": 0
},
"declare": false,
"id": {
"type": "Identifier",
"span": {
"start": 1378,
"end": 1395,
"ctxt": 0
},
"value": "FunctionComponent",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterDeclaration",
"span": {
"start": 1395,
"end": 1398,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
"start": 1396,
"end": 1397,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 1396,
"end": 1397,
"ctxt": 0
},
"value": "P",
"optional": false
},
"in": false,
"out": false,
"const": false,
"constraint": null,
"default": null
}
]
},
"typeAnnotation": {
"type": "TsFunctionType",
"span": {
"start": 1401,
"end": 1419,
"ctxt": 0
},
"params": [
{
"type": "Identifier",
"span": {
"start": 1402,
"end": 1410,
"ctxt": 0
},
"value": "props",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 1407,
"end": 1410,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 1409,
"end": 1410,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 1409,
"end": 1410,
"ctxt": 0
},
"value": "P",
"optional": false
},
"typeParams": null
}
}
}
],
"typeParams": null,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 1412,
"end": 1419,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 1415,
"end": 1419,
"ctxt": 0
},
"kind": "null"
}
}
}
}
},
{
"type": "ExportDeclaration",
"span": {
"start": 1422,
"end": 1494,
"ctxt": 0
},
"declaration": {
"type": "TsTypeAliasDeclaration",
"span": {
"start": 1429,
"end": 1494,
"ctxt": 0
},
"declare": false,
"id": {
"type": "Identifier",
"span": {
"start": 1434,
"end": 1447,
"ctxt": 0
},
"value": "ComponentType",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterDeclaration",
"span": {
"start": 1447,
"end": 1450,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
"start": 1448,
"end": 1449,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 1448,
"end": 1449,
"ctxt": 0
},
"value": "P",
"optional": false
},
"in": false,
"out": false,
"const": false,
"constraint": null,
"default": null
}
]
},
"typeAnnotation": {
"type": "TsUnionType",
"span": {
"start": 1453,
"end": 1493,
"ctxt": 0
},
"types": [
{
"type": "TsTypeReference",
"span": {
"start": 1453,
"end": 1473,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 1453,
"end": 1470,
"ctxt": 0
},
"value": "FunctionComponent",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 1470,
"end": 1473,
"ctxt": 0
},
"params": [
{
"type": "TsTypeReference",
"span": {
"start": 1471,
"end": 1472,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 1471,
"end": 1472,
"ctxt": 0
},
"value": "P",
"optional": false
},
"typeParams": null
}
]
}
},
{
"type": "TsTypeReference",
"span": {
"start": 1476,
"end": 1493,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 1476,
"end": 1490,
"ctxt": 0
},
"value": "ComponentClass",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 1490,
"end": 1493,
"ctxt": 0
},
"params": [
{
"type": "TsTypeReference",
"span": {
"start": 1491,
"end": 1492,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 1491,
"end": 1492,
"ctxt": 0
},
"value": "P",
"optional": false
},
"typeParams": null
}
]
}
}
]
}
}
},
{
"type": "ExportDeclaration",
"span": {
"start": 1496,
"end": 1550,
"ctxt": 0
},
"declaration": {
"type": "TsInterfaceDeclaration",
"span": {
"start": 1503,
"end": 1550,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 1513,
"end": 1532,
"ctxt": 0
},
"value": "RouteComponentProps",
"optional": false
},
"declare": false,
"typeParams": null,
"extends": [],
"body": {
"type": "TsInterfaceBody",
"span": {
"start": 1533,
"end": 1550,
"ctxt": 0
},
"body": [
{
"type": "TsPropertySignature",
"span": {
"start": 1535,
"end": 1548,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 1535,
"end": 1540,
"ctxt": 0
},
"value": "route",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 1540,
"end": 1548,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 1542,
"end": 1548,
"ctxt": 0
},
"kind": "string"
}
},
"typeParams": null
}
]
}
}
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 1569,
"end": 1579,
"ctxt": 0
},
"value": "withRouter",
"optional": false
},
"declare": true,
"params": [
{
"type": "Parameter",
"span": {
"start": 1648,
"end": 1679,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 1648,
"end": 1679,
"ctxt": 0
},
"value": "component",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 1657,
"end": 1679,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsIntersectionType",
"span": {
"start": 1659,
"end": 1679,
"ctxt": 0
},
"types": [
{
"type": "TsTypeReference",
"span": {
"start": 1659,
"end": 1660,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 1659,
"end": 1660,
"ctxt": 0
},
"value": "C",
"optional": false
},
"typeParams": null
},
{
"type": "TsTypeReference",
"span": {
"start": 1663,
"end": 1679,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 1663,
"end": 1676,
"ctxt": 0
},
"value": "ComponentType",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 1676,
"end": 1679,
"ctxt": 0
},
"params": [
{
"type": "TsTypeReference",
"span": {
"start": 1677,
"end": 1678,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 1677,
"end": 1678,
"ctxt": 0
},
"value": "P",
"optional": false
},
"typeParams": null
}
]
}
}
]
}
}
}
}
],
"decorators": [],
"span": {
"start": 1552,
"end": 1734,
"ctxt": 0
},
"body": null,
"generator": false,
"async": false,
"typeParameters": {
"type": "TsTypeParameterDeclaration",
"span": {
"start": 1579,
"end": 1644,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
"start": 1583,
"end": 1612,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 1583,
"end": 1584,
"ctxt": 0
},
"value": "P",
"optional": false
},
"in": false,
"out": false,
"const": false,
"constraint": {
"type": "TsTypeReference",
"span": {
"start": 1593,
"end": 1612,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 1593,
"end": 1612,
"ctxt": 0
},
"value": "RouteComponentProps",
"optional": false
},
"typeParams": null
},
"default": null
},
{
"type": "TsTypeParameter",
"span": {
"start": 1616,
"end": 1642,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 1616,
"end": 1617,
"ctxt": 0
},
"value": "C",
"optional": false
},
"in": false,
"out": false,
"const": false,
"constraint": {
"type": "TsTypeReference",
"span": {
"start": 1626,
"end": 1642,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 1626,
"end": 1639,
"ctxt": 0
},
"value": "ComponentType",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 1639,
"end": 1642,
"ctxt": 0
},
"params": [
{
"type": "TsTypeReference",
"span": {
"start": 1640,
"end": 1641,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 1640,
"end": 1641,
"ctxt": 0
},
"value": "P",
"optional": false
},
"typeParams": null
}
]
}
},
"default": null
}
]
},
"returnType": {
"type": "TsTypeAnnotation",
"span": {
"start": 1681,
"end": 1733,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 1683,
"end": 1733,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 1683,
"end": 1697,
"ctxt": 0
},
"value": "ComponentClass",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 1697,
"end": 1733,
"ctxt": 0
},
"params": [
{
"type": "TsTypeReference",
"span": {
"start": 1698,
"end": 1732,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 1698,
"end": 1702,
"ctxt": 0
},
"value": "Omit",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 1702,
"end": 1732,
"ctxt": 0
},
"params": [
{
"type": "TsTypeReference",
"span": {
"start": 1703,
"end": 1704,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 1703,
"end": 1704,
"ctxt": 0
},
"value": "P",
"optional": false
},
"typeParams": null
},
{
"type": "TsTypeOperator",
"span": {
"start": 1706,
"end": 1731,
"ctxt": 0
},
"op": "keyof",
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 1712,
"end": 1731,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 1712,
"end": 1731,
"ctxt": 0
},
"value": "RouteComponentProps",
"optional": false
},
"typeParams": null
}
}
]
}
}
]
}
}
}
},
{
"type": "TsInterfaceDeclaration",
"span": {
"start": 1736,
"end": 1800,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 1746,
"end": 1751,
"ctxt": 0
},
"value": "Props",
"optional": false
},
"declare": false,
"typeParams": null,
"extends": [
{
"type": "TsExpressionWithTypeArguments",
"span": {
"start": 1760,
"end": 1779,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 1760,
"end": 1779,
"ctxt": 0
},
"value": "RouteComponentProps",
"optional": false
},
"typeArguments": null
}
],
"body": {
"type": "TsInterfaceBody",
"span": {
"start": 1780,
"end": 1800,
"ctxt": 0
},
"body": [
{
"type": "TsPropertySignature",
"span": {
"start": 1782,
"end": 1798,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 1782,
"end": 1790,
"ctxt": 0
},
"value": "username",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 1790,
"end": 1798,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 1792,
"end": 1798,
"ctxt": 0
},
"kind": "string"
}
},
"typeParams": null
}
]
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 1802,
"end": 1850,
"ctxt": 0
},
"kind": "const",
"declare": true,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 1816,
"end": 1849,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 1816,
"end": 1827,
"ctxt": 0
},
"value": "MyComponent",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 1827,
"end": 1849,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 1829,
"end": 1849,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 1829,
"end": 1842,
"ctxt": 0
},
"value": "ComponentType",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 1842,
"end": 1849,
"ctxt": 0
},
"params": [
{
"type": "TsTypeReference",
"span": {
"start": 1843,
"end": 1848,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 1843,
"end": 1848,
"ctxt": 0
},
"value": "Props",
"optional": false
},
"typeParams": null
}
]
}
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 1852,
"end": 1876,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 1852,
"end": 1875,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 1852,
"end": 1862,
"ctxt": 0
},
"value": "withRouter",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "Identifier",
"span": {
"start": 1863,
"end": 1874,
"ctxt": 0
},
"value": "MyComponent",
"optional": false
}
}
],
"typeArguments": null
}
},
{
"type": "TsTypeAliasDeclaration",
"span": {
"start": 1900,
"end": 1933,
"ctxt": 0
},
"declare": false,
"id": {
"type": "Identifier",
"span": {
"start": 1905,
"end": 1907,
"ctxt": 0
},
"value": "AB",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterDeclaration",
"span": {
"start": 1907,
"end": 1910,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
"start": 1908,
"end": 1909,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 1908,
"end": 1909,
"ctxt": 0
},
"value": "T",
"optional": false
},
"in": false,
"out": false,
"const": false,
"constraint": null,
"default": null
}
]
},
"typeAnnotation": {
"type": "TsUnionType",
"span": {
"start": 1913,
"end": 1932,
"ctxt": 0
},
"types": [
{
"type": "TsTypeLiteral",
"span": {
"start": 1913,
"end": 1921,
"ctxt": 0
},
"members": [
{
"type": "TsPropertySignature",
"span": {
"start": 1915,
"end": 1919,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 1915,
"end": 1916,
"ctxt": 0
},
"value": "a",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 1916,
"end": 1919,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 1918,
"end": 1919,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 1918,
"end": 1919,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
}
},
"typeParams": null
}
]
},
{
"type": "TsTypeLiteral",
"span": {
"start": 1924,
"end": 1932,
"ctxt": 0
},
"members": [
{
"type": "TsPropertySignature",
"span": {
"start": 1926,
"end": 1930,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 1926,
"end": 1927,
"ctxt": 0
},
"value": "b",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 1927,
"end": 1930,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 1929,
"end": 1930,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 1929,
"end": 1930,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
}
},
"typeParams": null
}
]
}
]
}
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 2013,
"end": 2016,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"declare": true,
"params": [
{
"type": "Parameter",
"span": {
"start": 2023,
"end": 2037,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 2023,
"end": 2037,
"ctxt": 0
},
"value": "obj",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 2026,
"end": 2037,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsIntersectionType",
"span": {
"start": 2028,
"end": 2037,
"ctxt": 0
},
"types": [
{
"type": "TsTypeReference",
"span": {
"start": 2028,
"end": 2029,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 2028,
"end": 2029,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
},
{
"type": "TsTypeReference",
"span": {
"start": 2032,
"end": 2037,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 2032,
"end": 2034,
"ctxt": 0
},
"value": "AB",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 2034,
"end": 2037,
"ctxt": 0
},
"params": [
{
"type": "TsTypeReference",
"span": {
"start": 2035,
"end": 2036,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 2035,
"end": 2036,
"ctxt": 0
},
"value": "U",
"optional": false
},
"typeParams": null
}
]
}
}
]
}
}
}
}
],
"decorators": [],
"span": {
"start": 1996,
"end": 2047,
"ctxt": 0
},
"body": null,
"generator": false,
"async": false,
"typeParameters": {
"type": "TsTypeParameterDeclaration",
"span": {
"start": 2016,
"end": 2022,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
"start": 2017,
"end": 2018,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 2017,
"end": 2018,
"ctxt": 0
},
"value": "T",
"optional": false
},
"in": false,
"out": false,
"const": false,
"constraint": null,
"default": null
},
{
"type": "TsTypeParameter",
"span": {
"start": 2020,
"end": 2021,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 2020,
"end": 2021,
"ctxt": 0
},
"value": "U",
"optional": false
},
"in": false,
"out": false,
"const": false,
"constraint": null,
"default": null
}
]
},
"returnType": {
"type": "TsTypeAnnotation",
"span": {
"start": 2038,
"end": 2046,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTupleType",
"span": {
"start": 2040,
"end": 2046,
"ctxt": 0
},
"elemTypes": [
{
"type": "TsTupleElement",
"span": {
"start": 2041,
"end": 2042,
"ctxt": 0
},
"label": null,
"ty": {
"type": "TsTypeReference",
"span": {
"start": 2041,
"end": 2042,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 2041,
"end": 2042,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
}
},
{
"type": "TsTupleElement",
"span": {
"start": 2044,
"end": 2045,
"ctxt": 0
},
"label": null,
"ty": {
"type": "TsTypeReference",
"span": {
"start": 2044,
"end": 2045,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 2044,
"end": 2045,
"ctxt": 0
},
"value": "U",
"optional": false
},
"typeParams": null
}
}
]
}
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 2048,
"end": 2075,
"ctxt": 0
},
"kind": "let",
"declare": true,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 2060,
"end": 2074,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 2060,
"end": 2062,
"ctxt": 0
},
"value": "ab",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 2062,
"end": 2074,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 2064,
"end": 2074,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 2064,
"end": 2066,
"ctxt": 0
},
"value": "AB",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 2066,
"end": 2074,
"ctxt": 0
},
"params": [
{
"type": "TsKeywordType",
"span": {
"start": 2067,
"end": 2073,
"ctxt": 0
},
"kind": "string"
}
]
}
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 2077,
"end": 2093,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 2081,
"end": 2092,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 2081,
"end": 2082,
"ctxt": 0
},
"value": "z",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "CallExpression",
"span": {
"start": 2085,
"end": 2092,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 2085,
"end": 2088,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "Identifier",
"span": {
"start": 2089,
"end": 2091,
"ctxt": 0
},
"value": "ab",
"optional": false
}
}
],
"typeArguments": null
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 2142,
"end": 2208,
"ctxt": 0
},
"kind": "let",
"declare": true,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 2154,
"end": 2207,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 2154,
"end": 2155,
"ctxt": 0
},
"value": "a",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 2155,
"end": 2207,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsFunctionType",
"span": {
"start": 2157,
"end": 2207,
"ctxt": 0
},
"params": [],
"typeParams": {
"type": "TsTypeParameterDeclaration",
"span": {
"start": 2157,
"end": 2160,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
"start": 2158,
"end": 2159,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 2158,
"end": 2159,
"ctxt": 0
},
"value": "T",
"optional": false
},
"in": false,
"out": false,
"const": false,
"constraint": null,
"default": null
}
]
},
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 2163,
"end": 2207,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsIntersectionType",
"span": {
"start": 2166,
"end": 2207,
"ctxt": 0
},
"types": [
{
"type": "TsParenthesizedType",
"span": {
"start": 2166,
"end": 2197,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsConditionalType",
"span": {
"start": 2167,
"end": 2196,
"ctxt": 0
},
"checkType": {
"type": "TsTypeReference",
"span": {
"start": 2167,
"end": 2168,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 2167,
"end": 2168,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
},
"extendsType": {
"type": "TsLiteralType",
"span": {
"start": 2177,
"end": 2181,
"ctxt": 0
},
"literal": {
"type": "BooleanLiteral",
"span": {
"start": 2177,
"end": 2181,
"ctxt": 0
},
"value": true
}
},
"trueType": {
"type": "TsLiteralType",
"span": {
"start": 2184,
"end": 2188,
"ctxt": 0
},
"literal": {
"type": "BooleanLiteral",
"span": {
"start": 2184,
"end": 2188,
"ctxt": 0
},
"value": true
}
},
"falseType": {
"type": "TsLiteralType",
"span": {
"start": 2191,
"end": 2196,
"ctxt": 0
},
"literal": {
"type": "BooleanLiteral",
"span": {
"start": 2191,
"end": 2196,
"ctxt": 0
},
"value": false
}
}
}
},
{
"type": "TsKeywordType",
"span": {
"start": 2200,
"end": 2207,
"ctxt": 0
},
"kind": "boolean"
}
]
}
}
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 2209,
"end": 2275,
"ctxt": 0
},
"kind": "let",
"declare": true,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 2221,
"end": 2274,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 2221,
"end": 2222,
"ctxt": 0
},
"value": "b",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 2222,
"end": 2274,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsFunctionType",
"span": {
"start": 2224,
"end": 2274,
"ctxt": 0
},
"params": [],
"typeParams": {
"type": "TsTypeParameterDeclaration",
"span": {
"start": 2224,
"end": 2227,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
"start": 2225,
"end": 2226,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 2225,
"end": 2226,
"ctxt": 0
},
"value": "T",
"optional": false
},
"in": false,
"out": false,
"const": false,
"constraint": null,
"default": null
}
]
},
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 2230,
"end": 2274,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsIntersectionType",
"span": {
"start": 2233,
"end": 2274,
"ctxt": 0
},
"types": [
{
"type": "TsParenthesizedType",
"span": {
"start": 2233,
"end": 2264,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsConditionalType",
"span": {
"start": 2234,
"end": 2263,
"ctxt": 0
},
"checkType": {
"type": "TsTypeReference",
"span": {
"start": 2234,
"end": 2235,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 2234,
"end": 2235,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
},
"extendsType": {
"type": "TsLiteralType",
"span": {
"start": 2244,
"end": 2248,
"ctxt": 0
},
"literal": {
"type": "BooleanLiteral",
"span": {
"start": 2244,
"end": 2248,
"ctxt": 0
},
"value": true
}
},
"trueType": {
"type": "TsLiteralType",
"span": {
"start": 2251,
"end": 2255,
"ctxt": 0
},
"literal": {
"type": "BooleanLiteral",
"span": {
"start": 2251,
"end": 2255,
"ctxt": 0
},
"value": true
}
},
"falseType": {
"type": "TsLiteralType",
"span": {
"start": 2258,
"end": 2263,
"ctxt": 0
},
"literal": {
"type": "BooleanLiteral",
"span": {
"start": 2258,
"end": 2263,
"ctxt": 0
},
"value": false
}
}
}
},
{
"type": "TsKeywordType",
"span": {
"start": 2267,
"end": 2274,
"ctxt": 0
},
"kind": "boolean"
}
]
}
}
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 2276,
"end": 2282,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 2276,
"end": 2281,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "Identifier",
"span": {
"start": 2276,
"end": 2277,
"ctxt": 0
},
"value": "a",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "Identifier",
"span": {
"start": 2280,
"end": 2281,
"ctxt": 0
},
"value": "b",
"optional": false
}
}
}
],
"interpreter": null
}