swc/crates/swc_ecma_parser/tests/tsc/unionAndIntersectionInference3.json
2022-04-05 12:46:35 +00:00

5683 lines
165 KiB
JSON

{
"type": "Module",
"span": {
"start": 59,
"end": 2092,
"ctxt": 0
},
"body": [
{
"type": "TsTypeAliasDeclaration",
"span": {
"start": 59,
"end": 89,
"ctxt": 0
},
"declare": false,
"id": {
"type": "Identifier",
"span": {
"start": 64,
"end": 69,
"ctxt": 0
},
"value": "Maybe",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterDeclaration",
"span": {
"start": 69,
"end": 72,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
"start": 70,
"end": 71,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 70,
"end": 71,
"ctxt": 0
},
"value": "T",
"optional": false
},
"in": false,
"out": false,
"constraint": null,
"default": null
}
]
},
"typeAnnotation": {
"type": "TsUnionType",
"span": {
"start": 75,
"end": 88,
"ctxt": 0
},
"types": [
{
"type": "TsTypeReference",
"span": {
"start": 75,
"end": 76,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 75,
"end": 76,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
},
{
"type": "TsKeywordType",
"span": {
"start": 79,
"end": 88,
"ctxt": 0
},
"kind": "undefined"
}
]
}
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 107,
"end": 118,
"ctxt": 0
},
"value": "concatMaybe",
"optional": false
},
"declare": true,
"params": [
{
"type": "Parameter",
"span": {
"start": 122,
"end": 156,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "RestElement",
"span": {
"start": 122,
"end": 156,
"ctxt": 0
},
"rest": {
"start": 122,
"end": 125,
"ctxt": 0
},
"argument": {
"type": "Identifier",
"span": {
"start": 125,
"end": 129,
"ctxt": 0
},
"value": "args",
"optional": false,
"typeAnnotation": null
},
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 129,
"end": 156,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsArrayType",
"span": {
"start": 131,
"end": 156,
"ctxt": 0
},
"elemType": {
"type": "TsParenthesizedType",
"span": {
"start": 131,
"end": 154,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsUnionType",
"span": {
"start": 132,
"end": 153,
"ctxt": 0
},
"types": [
{
"type": "TsTypeReference",
"span": {
"start": 132,
"end": 140,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 132,
"end": 137,
"ctxt": 0
},
"value": "Maybe",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 137,
"end": 140,
"ctxt": 0
},
"params": [
{
"type": "TsTypeReference",
"span": {
"start": 138,
"end": 139,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 138,
"end": 139,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
}
]
}
},
{
"type": "TsArrayType",
"span": {
"start": 143,
"end": 153,
"ctxt": 0
},
"elemType": {
"type": "TsTypeReference",
"span": {
"start": 143,
"end": 151,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 143,
"end": 148,
"ctxt": 0
},
"value": "Maybe",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 148,
"end": 151,
"ctxt": 0
},
"params": [
{
"type": "TsTypeReference",
"span": {
"start": 149,
"end": 150,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 149,
"end": 150,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
}
]
}
}
}
]
}
}
}
}
}
}
],
"decorators": [],
"span": {
"start": 90,
"end": 163,
"ctxt": 0
},
"body": null,
"generator": false,
"async": false,
"typeParameters": {
"type": "TsTypeParameterDeclaration",
"span": {
"start": 118,
"end": 121,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
"start": 119,
"end": 120,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 119,
"end": 120,
"ctxt": 0
},
"value": "T",
"optional": false
},
"in": false,
"out": false,
"constraint": null,
"default": null
}
]
},
"returnType": {
"type": "TsTypeAnnotation",
"span": {
"start": 157,
"end": 162,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsArrayType",
"span": {
"start": 159,
"end": 162,
"ctxt": 0
},
"elemType": {
"type": "TsTypeReference",
"span": {
"start": 159,
"end": 160,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 159,
"end": 160,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
}
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 164,
"end": 190,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 164,
"end": 189,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 164,
"end": 175,
"ctxt": 0
},
"value": "concatMaybe",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "ArrayExpression",
"span": {
"start": 176,
"end": 185,
"ctxt": 0
},
"elements": [
{
"spread": null,
"expression": {
"type": "NumericLiteral",
"span": {
"start": 177,
"end": 178,
"ctxt": 0
},
"value": 1.0,
"raw": "1"
}
},
{
"spread": null,
"expression": {
"type": "NumericLiteral",
"span": {
"start": 180,
"end": 181,
"ctxt": 0
},
"value": 2.0,
"raw": "2"
}
},
{
"spread": null,
"expression": {
"type": "NumericLiteral",
"span": {
"start": 183,
"end": 184,
"ctxt": 0
},
"value": 3.0,
"raw": "3"
}
}
]
}
},
{
"spread": null,
"expression": {
"type": "NumericLiteral",
"span": {
"start": 187,
"end": 188,
"ctxt": 0
},
"value": 4.0,
"raw": "4"
}
}
],
"typeArguments": null
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 215,
"end": 408,
"ctxt": 0
},
"kind": "const",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 221,
"end": 407,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 221,
"end": 222,
"ctxt": 0
},
"value": "g",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 222,
"end": 302,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsFunctionType",
"span": {
"start": 224,
"end": 302,
"ctxt": 0
},
"params": [
{
"type": "Identifier",
"span": {
"start": 234,
"end": 287,
"ctxt": 0
},
"value": "com",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 237,
"end": 287,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsFunctionType",
"span": {
"start": 239,
"end": 287,
"ctxt": 0
},
"params": [],
"typeParams": null,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 242,
"end": 287,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsUnionType",
"span": {
"start": 245,
"end": 287,
"ctxt": 0
},
"types": [
{
"type": "TsTypeReference",
"span": {
"start": 245,
"end": 262,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 245,
"end": 253,
"ctxt": 0
},
"value": "Iterator",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 253,
"end": 262,
"ctxt": 0
},
"params": [
{
"type": "TsTypeReference",
"span": {
"start": 254,
"end": 255,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 254,
"end": 255,
"ctxt": 0
},
"value": "S",
"optional": false
},
"typeParams": null
},
{
"type": "TsTypeReference",
"span": {
"start": 257,
"end": 258,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 257,
"end": 258,
"ctxt": 0
},
"value": "U",
"optional": false
},
"typeParams": null
},
{
"type": "TsTypeReference",
"span": {
"start": 260,
"end": 261,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 260,
"end": 261,
"ctxt": 0
},
"value": "R",
"optional": false
},
"typeParams": null
}
]
}
},
{
"type": "TsTypeReference",
"span": {
"start": 265,
"end": 287,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 265,
"end": 278,
"ctxt": 0
},
"value": "AsyncIterator",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 278,
"end": 287,
"ctxt": 0
},
"params": [
{
"type": "TsTypeReference",
"span": {
"start": 279,
"end": 280,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 279,
"end": 280,
"ctxt": 0
},
"value": "S",
"optional": false
},
"typeParams": null
},
{
"type": "TsTypeReference",
"span": {
"start": 282,
"end": 283,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 282,
"end": 283,
"ctxt": 0
},
"value": "U",
"optional": false
},
"typeParams": null
},
{
"type": "TsTypeReference",
"span": {
"start": 285,
"end": 286,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 285,
"end": 286,
"ctxt": 0
},
"value": "R",
"optional": false
},
"typeParams": null
}
]
}
}
]
}
}
}
}
}
],
"typeParams": {
"type": "TsTypeParameterDeclaration",
"span": {
"start": 224,
"end": 233,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
"start": 225,
"end": 226,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 225,
"end": 226,
"ctxt": 0
},
"value": "U",
"optional": false
},
"in": false,
"out": false,
"constraint": null,
"default": null
},
{
"type": "TsTypeParameter",
"span": {
"start": 228,
"end": 229,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 228,
"end": 229,
"ctxt": 0
},
"value": "R",
"optional": false
},
"in": false,
"out": false,
"constraint": null,
"default": null
},
{
"type": "TsTypeParameter",
"span": {
"start": 231,
"end": 232,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 231,
"end": 232,
"ctxt": 0
},
"value": "S",
"optional": false
},
"in": false,
"out": false,
"constraint": null,
"default": null
}
]
},
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 289,
"end": 302,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 292,
"end": 302,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 292,
"end": 299,
"ctxt": 0
},
"value": "Promise",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 299,
"end": 302,
"ctxt": 0
},
"params": [
{
"type": "TsTypeReference",
"span": {
"start": 300,
"end": 301,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 300,
"end": 301,
"ctxt": 0
},
"value": "U",
"optional": false
},
"typeParams": null
}
]
}
}
}
}
}
},
"init": {
"type": "ArrowFunctionExpression",
"span": {
"start": 305,
"end": 407,
"ctxt": 0
},
"params": [
{
"type": "Identifier",
"span": {
"start": 321,
"end": 374,
"ctxt": 0
},
"value": "com",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 324,
"end": 374,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsFunctionType",
"span": {
"start": 326,
"end": 374,
"ctxt": 0
},
"params": [],
"typeParams": null,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 329,
"end": 374,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsUnionType",
"span": {
"start": 332,
"end": 374,
"ctxt": 0
},
"types": [
{
"type": "TsTypeReference",
"span": {
"start": 332,
"end": 349,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 332,
"end": 340,
"ctxt": 0
},
"value": "Iterator",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 340,
"end": 349,
"ctxt": 0
},
"params": [
{
"type": "TsTypeReference",
"span": {
"start": 341,
"end": 342,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 341,
"end": 342,
"ctxt": 0
},
"value": "S",
"optional": false
},
"typeParams": null
},
{
"type": "TsTypeReference",
"span": {
"start": 344,
"end": 345,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 344,
"end": 345,
"ctxt": 0
},
"value": "U",
"optional": false
},
"typeParams": null
},
{
"type": "TsTypeReference",
"span": {
"start": 347,
"end": 348,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 347,
"end": 348,
"ctxt": 0
},
"value": "R",
"optional": false
},
"typeParams": null
}
]
}
},
{
"type": "TsTypeReference",
"span": {
"start": 352,
"end": 374,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 352,
"end": 365,
"ctxt": 0
},
"value": "AsyncIterator",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 365,
"end": 374,
"ctxt": 0
},
"params": [
{
"type": "TsTypeReference",
"span": {
"start": 366,
"end": 367,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 366,
"end": 367,
"ctxt": 0
},
"value": "S",
"optional": false
},
"typeParams": null
},
{
"type": "TsTypeReference",
"span": {
"start": 369,
"end": 370,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 369,
"end": 370,
"ctxt": 0
},
"value": "U",
"optional": false
},
"typeParams": null
},
{
"type": "TsTypeReference",
"span": {
"start": 372,
"end": 373,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 372,
"end": 373,
"ctxt": 0
},
"value": "R",
"optional": false
},
"typeParams": null
}
]
}
}
]
}
}
}
}
}
],
"body": {
"type": "BlockStatement",
"span": {
"start": 391,
"end": 407,
"ctxt": 0
},
"stmts": [
{
"type": "ThrowStatement",
"span": {
"start": 395,
"end": 405,
"ctxt": 0
},
"argument": {
"type": "Identifier",
"span": {
"start": 401,
"end": 404,
"ctxt": 0
},
"value": "com",
"optional": false
}
}
]
},
"async": true,
"generator": false,
"typeParameters": {
"type": "TsTypeParameterDeclaration",
"span": {
"start": 311,
"end": 320,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
"start": 312,
"end": 313,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 312,
"end": 313,
"ctxt": 0
},
"value": "U",
"optional": false
},
"in": false,
"out": false,
"constraint": null,
"default": null
},
{
"type": "TsTypeParameter",
"span": {
"start": 315,
"end": 316,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 315,
"end": 316,
"ctxt": 0
},
"value": "R",
"optional": false
},
"in": false,
"out": false,
"constraint": null,
"default": null
},
{
"type": "TsTypeParameter",
"span": {
"start": 318,
"end": 319,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 318,
"end": 319,
"ctxt": 0
},
"value": "S",
"optional": false
},
"in": false,
"out": false,
"constraint": null,
"default": null
}
]
},
"returnType": {
"type": "TsTypeAnnotation",
"span": {
"start": 375,
"end": 387,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 377,
"end": 387,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 377,
"end": 384,
"ctxt": 0
},
"value": "Promise",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 384,
"end": 387,
"ctxt": 0
},
"params": [
{
"type": "TsTypeReference",
"span": {
"start": 385,
"end": 386,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 385,
"end": 386,
"ctxt": 0
},
"value": "U",
"optional": false
},
"typeParams": null
}
]
}
}
}
},
"definite": false
}
]
},
{
"type": "TsInterfaceDeclaration",
"span": {
"start": 410,
"end": 457,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 420,
"end": 424,
"ctxt": 0
},
"value": "Foo1",
"optional": false
},
"declare": false,
"typeParams": {
"type": "TsTypeParameterDeclaration",
"span": {
"start": 424,
"end": 427,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
"start": 425,
"end": 426,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 425,
"end": 426,
"ctxt": 0
},
"value": "T",
"optional": false
},
"in": false,
"out": false,
"constraint": null,
"default": null
}
]
},
"extends": [],
"body": {
"type": "TsInterfaceBody",
"span": {
"start": 428,
"end": 457,
"ctxt": 0
},
"body": [
{
"type": "TsMethodSignature",
"span": {
"start": 434,
"end": 455,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 434,
"end": 438,
"ctxt": 0
},
"value": "test",
"optional": false
},
"computed": false,
"optional": false,
"params": [
{
"type": "Identifier",
"span": {
"start": 439,
"end": 447,
"ctxt": 0
},
"value": "value",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 444,
"end": 447,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 446,
"end": 447,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 446,
"end": 447,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
}
}
}
],
"typeAnn": {
"type": "TsTypeAnnotation",
"span": {
"start": 448,
"end": 454,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 450,
"end": 454,
"ctxt": 0
},
"kind": "void"
}
},
"typeParams": null
}
]
}
},
{
"type": "TsInterfaceDeclaration",
"span": {
"start": 459,
"end": 523,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 469,
"end": 473,
"ctxt": 0
},
"value": "Bar1",
"optional": false
},
"declare": false,
"typeParams": {
"type": "TsTypeParameterDeclaration",
"span": {
"start": 473,
"end": 476,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
"start": 474,
"end": 475,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 474,
"end": 475,
"ctxt": 0
},
"value": "T",
"optional": false
},
"in": false,
"out": false,
"constraint": null,
"default": null
}
]
},
"extends": [],
"body": {
"type": "TsInterfaceBody",
"span": {
"start": 477,
"end": 523,
"ctxt": 0
},
"body": [
{
"type": "TsMethodSignature",
"span": {
"start": 483,
"end": 521,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 483,
"end": 487,
"ctxt": 0
},
"value": "test",
"optional": false
},
"computed": false,
"optional": false,
"params": [
{
"type": "Identifier",
"span": {
"start": 488,
"end": 513,
"ctxt": 0
},
"value": "value",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 493,
"end": 513,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsUnionType",
"span": {
"start": 495,
"end": 513,
"ctxt": 0
},
"types": [
{
"type": "TsTypeReference",
"span": {
"start": 495,
"end": 496,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 495,
"end": 496,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
},
{
"type": "TsTypeReference",
"span": {
"start": 499,
"end": 513,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 499,
"end": 510,
"ctxt": 0
},
"value": "PromiseLike",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 510,
"end": 513,
"ctxt": 0
},
"params": [
{
"type": "TsTypeReference",
"span": {
"start": 511,
"end": 512,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 511,
"end": 512,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
}
]
}
}
]
}
}
}
],
"typeAnn": {
"type": "TsTypeAnnotation",
"span": {
"start": 514,
"end": 520,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 516,
"end": 520,
"ctxt": 0
},
"kind": "void"
}
},
"typeParams": null
}
]
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 525,
"end": 581,
"ctxt": 0
},
"kind": "let",
"declare": true,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 537,
"end": 580,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 537,
"end": 539,
"ctxt": 0
},
"value": "f1",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 539,
"end": 580,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsFunctionType",
"span": {
"start": 541,
"end": 580,
"ctxt": 0
},
"params": [
{
"type": "Identifier",
"span": {
"start": 545,
"end": 565,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 546,
"end": 565,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsUnionType",
"span": {
"start": 548,
"end": 565,
"ctxt": 0
},
"types": [
{
"type": "TsTypeReference",
"span": {
"start": 548,
"end": 555,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 548,
"end": 552,
"ctxt": 0
},
"value": "Foo1",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 552,
"end": 555,
"ctxt": 0
},
"params": [
{
"type": "TsTypeReference",
"span": {
"start": 553,
"end": 554,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 553,
"end": 554,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
}
]
}
},
{
"type": "TsTypeReference",
"span": {
"start": 558,
"end": 565,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 558,
"end": 562,
"ctxt": 0
},
"value": "Bar1",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 562,
"end": 565,
"ctxt": 0
},
"params": [
{
"type": "TsTypeReference",
"span": {
"start": 563,
"end": 564,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 563,
"end": 564,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
}
]
}
}
]
}
}
}
],
"typeParams": {
"type": "TsTypeParameterDeclaration",
"span": {
"start": 541,
"end": 544,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
"start": 542,
"end": 543,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 542,
"end": 543,
"ctxt": 0
},
"value": "T",
"optional": false
},
"in": false,
"out": false,
"constraint": null,
"default": null
}
]
},
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 567,
"end": 580,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 570,
"end": 580,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 570,
"end": 577,
"ctxt": 0
},
"value": "Promise",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 577,
"end": 580,
"ctxt": 0
},
"params": [
{
"type": "TsTypeReference",
"span": {
"start": 578,
"end": 579,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 578,
"end": 579,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
}
]
}
}
}
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 582,
"end": 638,
"ctxt": 0
},
"kind": "let",
"declare": true,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 594,
"end": 637,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 594,
"end": 596,
"ctxt": 0
},
"value": "f2",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 596,
"end": 637,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsFunctionType",
"span": {
"start": 598,
"end": 637,
"ctxt": 0
},
"params": [
{
"type": "Identifier",
"span": {
"start": 602,
"end": 622,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 603,
"end": 622,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsUnionType",
"span": {
"start": 605,
"end": 622,
"ctxt": 0
},
"types": [
{
"type": "TsTypeReference",
"span": {
"start": 605,
"end": 612,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 605,
"end": 609,
"ctxt": 0
},
"value": "Foo1",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 609,
"end": 612,
"ctxt": 0
},
"params": [
{
"type": "TsTypeReference",
"span": {
"start": 610,
"end": 611,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 610,
"end": 611,
"ctxt": 0
},
"value": "U",
"optional": false
},
"typeParams": null
}
]
}
},
{
"type": "TsTypeReference",
"span": {
"start": 615,
"end": 622,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 615,
"end": 619,
"ctxt": 0
},
"value": "Bar1",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 619,
"end": 622,
"ctxt": 0
},
"params": [
{
"type": "TsTypeReference",
"span": {
"start": 620,
"end": 621,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 620,
"end": 621,
"ctxt": 0
},
"value": "U",
"optional": false
},
"typeParams": null
}
]
}
}
]
}
}
}
],
"typeParams": {
"type": "TsTypeParameterDeclaration",
"span": {
"start": 598,
"end": 601,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
"start": 599,
"end": 600,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 599,
"end": 600,
"ctxt": 0
},
"value": "U",
"optional": false
},
"in": false,
"out": false,
"constraint": null,
"default": null
}
]
},
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 624,
"end": 637,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 627,
"end": 637,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 627,
"end": 634,
"ctxt": 0
},
"value": "Promise",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 634,
"end": 637,
"ctxt": 0
},
"params": [
{
"type": "TsTypeReference",
"span": {
"start": 635,
"end": 636,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 635,
"end": 636,
"ctxt": 0
},
"value": "U",
"optional": false
},
"typeParams": null
}
]
}
}
}
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 640,
"end": 648,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 640,
"end": 647,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "Identifier",
"span": {
"start": 640,
"end": 642,
"ctxt": 0
},
"value": "f1",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "Identifier",
"span": {
"start": 645,
"end": 647,
"ctxt": 0
},
"value": "f2",
"optional": false
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 649,
"end": 657,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 649,
"end": 656,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "Identifier",
"span": {
"start": 649,
"end": 651,
"ctxt": 0
},
"value": "f2",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "Identifier",
"span": {
"start": 654,
"end": 656,
"ctxt": 0
},
"value": "f1",
"optional": false
}
}
},
{
"type": "TsTypeAliasDeclaration",
"span": {
"start": 659,
"end": 703,
"ctxt": 0
},
"declare": false,
"id": {
"type": "Identifier",
"span": {
"start": 664,
"end": 668,
"ctxt": 0
},
"value": "Foo2",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterDeclaration",
"span": {
"start": 668,
"end": 671,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
"start": 669,
"end": 670,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 669,
"end": 670,
"ctxt": 0
},
"value": "T",
"optional": false
},
"in": false,
"out": false,
"constraint": null,
"default": null
}
]
},
"typeAnnotation": {
"type": "TsTypeLiteral",
"span": {
"start": 674,
"end": 703,
"ctxt": 0
},
"members": [
{
"type": "TsMethodSignature",
"span": {
"start": 680,
"end": 701,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 680,
"end": 684,
"ctxt": 0
},
"value": "test",
"optional": false
},
"computed": false,
"optional": false,
"params": [
{
"type": "Identifier",
"span": {
"start": 685,
"end": 693,
"ctxt": 0
},
"value": "value",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 690,
"end": 693,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 692,
"end": 693,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 692,
"end": 693,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
}
}
}
],
"typeAnn": {
"type": "TsTypeAnnotation",
"span": {
"start": 694,
"end": 700,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 696,
"end": 700,
"ctxt": 0
},
"kind": "void"
}
},
"typeParams": null
}
]
}
},
{
"type": "TsTypeAliasDeclaration",
"span": {
"start": 705,
"end": 766,
"ctxt": 0
},
"declare": false,
"id": {
"type": "Identifier",
"span": {
"start": 710,
"end": 714,
"ctxt": 0
},
"value": "Bar2",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterDeclaration",
"span": {
"start": 714,
"end": 717,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
"start": 715,
"end": 716,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 715,
"end": 716,
"ctxt": 0
},
"value": "T",
"optional": false
},
"in": false,
"out": false,
"constraint": null,
"default": null
}
]
},
"typeAnnotation": {
"type": "TsTypeLiteral",
"span": {
"start": 720,
"end": 766,
"ctxt": 0
},
"members": [
{
"type": "TsMethodSignature",
"span": {
"start": 726,
"end": 764,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 726,
"end": 730,
"ctxt": 0
},
"value": "test",
"optional": false
},
"computed": false,
"optional": false,
"params": [
{
"type": "Identifier",
"span": {
"start": 731,
"end": 756,
"ctxt": 0
},
"value": "value",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 736,
"end": 756,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsUnionType",
"span": {
"start": 738,
"end": 756,
"ctxt": 0
},
"types": [
{
"type": "TsTypeReference",
"span": {
"start": 738,
"end": 739,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 738,
"end": 739,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
},
{
"type": "TsTypeReference",
"span": {
"start": 742,
"end": 756,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 742,
"end": 753,
"ctxt": 0
},
"value": "PromiseLike",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 753,
"end": 756,
"ctxt": 0
},
"params": [
{
"type": "TsTypeReference",
"span": {
"start": 754,
"end": 755,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 754,
"end": 755,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
}
]
}
}
]
}
}
}
],
"typeAnn": {
"type": "TsTypeAnnotation",
"span": {
"start": 757,
"end": 763,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 759,
"end": 763,
"ctxt": 0
},
"kind": "void"
}
},
"typeParams": null
}
]
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 768,
"end": 824,
"ctxt": 0
},
"kind": "let",
"declare": true,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 780,
"end": 823,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 780,
"end": 782,
"ctxt": 0
},
"value": "g1",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 782,
"end": 823,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsFunctionType",
"span": {
"start": 784,
"end": 823,
"ctxt": 0
},
"params": [
{
"type": "Identifier",
"span": {
"start": 788,
"end": 808,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 789,
"end": 808,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsUnionType",
"span": {
"start": 791,
"end": 808,
"ctxt": 0
},
"types": [
{
"type": "TsTypeReference",
"span": {
"start": 791,
"end": 798,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 791,
"end": 795,
"ctxt": 0
},
"value": "Foo2",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 795,
"end": 798,
"ctxt": 0
},
"params": [
{
"type": "TsTypeReference",
"span": {
"start": 796,
"end": 797,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 796,
"end": 797,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
}
]
}
},
{
"type": "TsTypeReference",
"span": {
"start": 801,
"end": 808,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 801,
"end": 805,
"ctxt": 0
},
"value": "Bar2",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 805,
"end": 808,
"ctxt": 0
},
"params": [
{
"type": "TsTypeReference",
"span": {
"start": 806,
"end": 807,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 806,
"end": 807,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
}
]
}
}
]
}
}
}
],
"typeParams": {
"type": "TsTypeParameterDeclaration",
"span": {
"start": 784,
"end": 787,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
"start": 785,
"end": 786,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 785,
"end": 786,
"ctxt": 0
},
"value": "T",
"optional": false
},
"in": false,
"out": false,
"constraint": null,
"default": null
}
]
},
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 810,
"end": 823,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 813,
"end": 823,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 813,
"end": 820,
"ctxt": 0
},
"value": "Promise",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 820,
"end": 823,
"ctxt": 0
},
"params": [
{
"type": "TsTypeReference",
"span": {
"start": 821,
"end": 822,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 821,
"end": 822,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
}
]
}
}
}
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 825,
"end": 881,
"ctxt": 0
},
"kind": "let",
"declare": true,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 837,
"end": 880,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 837,
"end": 839,
"ctxt": 0
},
"value": "g2",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 839,
"end": 880,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsFunctionType",
"span": {
"start": 841,
"end": 880,
"ctxt": 0
},
"params": [
{
"type": "Identifier",
"span": {
"start": 845,
"end": 865,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 846,
"end": 865,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsUnionType",
"span": {
"start": 848,
"end": 865,
"ctxt": 0
},
"types": [
{
"type": "TsTypeReference",
"span": {
"start": 848,
"end": 855,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 848,
"end": 852,
"ctxt": 0
},
"value": "Foo2",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 852,
"end": 855,
"ctxt": 0
},
"params": [
{
"type": "TsTypeReference",
"span": {
"start": 853,
"end": 854,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 853,
"end": 854,
"ctxt": 0
},
"value": "U",
"optional": false
},
"typeParams": null
}
]
}
},
{
"type": "TsTypeReference",
"span": {
"start": 858,
"end": 865,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 858,
"end": 862,
"ctxt": 0
},
"value": "Bar2",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 862,
"end": 865,
"ctxt": 0
},
"params": [
{
"type": "TsTypeReference",
"span": {
"start": 863,
"end": 864,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 863,
"end": 864,
"ctxt": 0
},
"value": "U",
"optional": false
},
"typeParams": null
}
]
}
}
]
}
}
}
],
"typeParams": {
"type": "TsTypeParameterDeclaration",
"span": {
"start": 841,
"end": 844,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
"start": 842,
"end": 843,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 842,
"end": 843,
"ctxt": 0
},
"value": "U",
"optional": false
},
"in": false,
"out": false,
"constraint": null,
"default": null
}
]
},
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 867,
"end": 880,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 870,
"end": 880,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 870,
"end": 877,
"ctxt": 0
},
"value": "Promise",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 877,
"end": 880,
"ctxt": 0
},
"params": [
{
"type": "TsTypeReference",
"span": {
"start": 878,
"end": 879,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 878,
"end": 879,
"ctxt": 0
},
"value": "U",
"optional": false
},
"typeParams": null
}
]
}
}
}
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 883,
"end": 891,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 883,
"end": 890,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "Identifier",
"span": {
"start": 883,
"end": 885,
"ctxt": 0
},
"value": "g1",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "Identifier",
"span": {
"start": 888,
"end": 890,
"ctxt": 0
},
"value": "g2",
"optional": false
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 892,
"end": 900,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 892,
"end": 899,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "Identifier",
"span": {
"start": 892,
"end": 894,
"ctxt": 0
},
"value": "g2",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "Identifier",
"span": {
"start": 897,
"end": 899,
"ctxt": 0
},
"value": "g1",
"optional": false
}
}
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 941,
"end": 945,
"ctxt": 0
},
"value": "foo1",
"optional": false
},
"declare": true,
"params": [
{
"type": "Parameter",
"span": {
"start": 949,
"end": 976,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 949,
"end": 976,
"ctxt": 0
},
"value": "obj",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 952,
"end": 976,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsIntersectionType",
"span": {
"start": 954,
"end": 976,
"ctxt": 0
},
"types": [
{
"type": "TsArrayType",
"span": {
"start": 954,
"end": 962,
"ctxt": 0
},
"elemType": {
"type": "TsKeywordType",
"span": {
"start": 954,
"end": 960,
"ctxt": 0
},
"kind": "string"
}
},
{
"type": "TsTypeReference",
"span": {
"start": 965,
"end": 976,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 965,
"end": 973,
"ctxt": 0
},
"value": "Iterable",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 973,
"end": 976,
"ctxt": 0
},
"params": [
{
"type": "TsTypeReference",
"span": {
"start": 974,
"end": 975,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 974,
"end": 975,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
}
]
}
}
]
}
}
}
}
],
"decorators": [],
"span": {
"start": 924,
"end": 981,
"ctxt": 0
},
"body": null,
"generator": false,
"async": false,
"typeParameters": {
"type": "TsTypeParameterDeclaration",
"span": {
"start": 945,
"end": 948,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
"start": 946,
"end": 947,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 946,
"end": 947,
"ctxt": 0
},
"value": "T",
"optional": false
},
"in": false,
"out": false,
"constraint": null,
"default": null
}
]
},
"returnType": {
"type": "TsTypeAnnotation",
"span": {
"start": 977,
"end": 980,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 979,
"end": 980,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 979,
"end": 980,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
}
}
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 999,
"end": 1003,
"ctxt": 0
},
"value": "foo2",
"optional": false
},
"declare": true,
"params": [
{
"type": "Parameter",
"span": {
"start": 1007,
"end": 1024,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 1007,
"end": 1024,
"ctxt": 0
},
"value": "obj",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 1010,
"end": 1024,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsIntersectionType",
"span": {
"start": 1012,
"end": 1024,
"ctxt": 0
},
"types": [
{
"type": "TsArrayType",
"span": {
"start": 1012,
"end": 1020,
"ctxt": 0
},
"elemType": {
"type": "TsKeywordType",
"span": {
"start": 1012,
"end": 1018,
"ctxt": 0
},
"kind": "string"
}
},
{
"type": "TsTypeReference",
"span": {
"start": 1023,
"end": 1024,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 1023,
"end": 1024,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
}
]
}
}
}
}
],
"decorators": [],
"span": {
"start": 982,
"end": 1029,
"ctxt": 0
},
"body": null,
"generator": false,
"async": false,
"typeParameters": {
"type": "TsTypeParameterDeclaration",
"span": {
"start": 1003,
"end": 1006,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
"start": 1004,
"end": 1005,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 1004,
"end": 1005,
"ctxt": 0
},
"value": "T",
"optional": false
},
"in": false,
"out": false,
"constraint": null,
"default": null
}
]
},
"returnType": {
"type": "TsTypeAnnotation",
"span": {
"start": 1025,
"end": 1028,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 1027,
"end": 1028,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 1027,
"end": 1028,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
}
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 1031,
"end": 1056,
"ctxt": 0
},
"kind": "let",
"declare": true,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 1043,
"end": 1055,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 1043,
"end": 1045,
"ctxt": 0
},
"value": "sa",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 1045,
"end": 1055,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsArrayType",
"span": {
"start": 1047,
"end": 1055,
"ctxt": 0
},
"elemType": {
"type": "TsKeywordType",
"span": {
"start": 1047,
"end": 1053,
"ctxt": 0
},
"kind": "string"
}
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 1057,
"end": 1102,
"ctxt": 0
},
"kind": "let",
"declare": true,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 1069,
"end": 1101,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 1069,
"end": 1071,
"ctxt": 0
},
"value": "sx",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 1071,
"end": 1101,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsIntersectionType",
"span": {
"start": 1073,
"end": 1101,
"ctxt": 0
},
"types": [
{
"type": "TsArrayType",
"span": {
"start": 1073,
"end": 1081,
"ctxt": 0
},
"elemType": {
"type": "TsKeywordType",
"span": {
"start": 1073,
"end": 1079,
"ctxt": 0
},
"kind": "string"
}
},
{
"type": "TsTypeLiteral",
"span": {
"start": 1084,
"end": 1101,
"ctxt": 0
},
"members": [
{
"type": "TsPropertySignature",
"span": {
"start": 1086,
"end": 1099,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 1086,
"end": 1091,
"ctxt": 0
},
"value": "extra",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 1091,
"end": 1099,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 1093,
"end": 1099,
"ctxt": 0
},
"kind": "number"
}
},
"typeParams": null
}
]
}
]
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 1104,
"end": 1122,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 1108,
"end": 1121,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 1108,
"end": 1110,
"ctxt": 0
},
"value": "x1",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "CallExpression",
"span": {
"start": 1113,
"end": 1121,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 1113,
"end": 1117,
"ctxt": 0
},
"value": "foo1",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "Identifier",
"span": {
"start": 1118,
"end": 1120,
"ctxt": 0
},
"value": "sa",
"optional": false
}
}
],
"typeArguments": null
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 1134,
"end": 1152,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 1138,
"end": 1151,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 1138,
"end": 1140,
"ctxt": 0
},
"value": "y1",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "CallExpression",
"span": {
"start": 1143,
"end": 1151,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 1143,
"end": 1147,
"ctxt": 0
},
"value": "foo1",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "Identifier",
"span": {
"start": 1148,
"end": 1150,
"ctxt": 0
},
"value": "sx",
"optional": false
}
}
],
"typeArguments": null
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 1165,
"end": 1183,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 1169,
"end": 1182,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 1169,
"end": 1171,
"ctxt": 0
},
"value": "x2",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "CallExpression",
"span": {
"start": 1174,
"end": 1182,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 1174,
"end": 1178,
"ctxt": 0
},
"value": "foo2",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "Identifier",
"span": {
"start": 1179,
"end": 1181,
"ctxt": 0
},
"value": "sa",
"optional": false
}
}
],
"typeArguments": null
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 1196,
"end": 1214,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 1200,
"end": 1213,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 1200,
"end": 1202,
"ctxt": 0
},
"value": "y2",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "CallExpression",
"span": {
"start": 1205,
"end": 1213,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 1205,
"end": 1209,
"ctxt": 0
},
"value": "foo2",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "Identifier",
"span": {
"start": 1210,
"end": 1212,
"ctxt": 0
},
"value": "sx",
"optional": false
}
}
],
"typeArguments": null
},
"definite": false
}
]
},
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 1274,
"end": 1283,
"ctxt": 0
},
"value": "Component",
"optional": false
},
"declare": true,
"span": {
"start": 1260,
"end": 1299,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassProperty",
"span": {
"start": 1289,
"end": 1297,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 1289,
"end": 1294,
"ctxt": 0
},
"value": "props",
"optional": false
},
"value": null,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 1294,
"end": 1297,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 1296,
"end": 1297,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 1296,
"end": 1297,
"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": 1283,
"end": 1286,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
"start": 1284,
"end": 1285,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 1284,
"end": 1285,
"ctxt": 0
},
"value": "P",
"optional": false
},
"in": false,
"out": false,
"constraint": null,
"default": null
}
]
},
"superTypeParams": null,
"implements": []
},
{
"type": "ExportDeclaration",
"span": {
"start": 1301,
"end": 1364,
"ctxt": 0
},
"declaration": {
"type": "TsTypeAliasDeclaration",
"span": {
"start": 1308,
"end": 1364,
"ctxt": 0
},
"declare": false,
"id": {
"type": "Identifier",
"span": {
"start": 1313,
"end": 1327,
"ctxt": 0
},
"value": "ComponentClass",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterDeclaration",
"span": {
"start": 1327,
"end": 1330,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
"start": 1328,
"end": 1329,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 1328,
"end": 1329,
"ctxt": 0
},
"value": "P",
"optional": false
},
"in": false,
"out": false,
"constraint": null,
"default": null
}
]
},
"typeAnnotation": {
"type": "TsConstructorType",
"span": {
"start": 1333,
"end": 1363,
"ctxt": 0
},
"params": [
{
"type": "Identifier",
"span": {
"start": 1338,
"end": 1346,
"ctxt": 0
},
"value": "props",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 1343,
"end": 1346,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 1345,
"end": 1346,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 1345,
"end": 1346,
"ctxt": 0
},
"value": "P",
"optional": false
},
"typeParams": null
}
}
}
],
"typeParams": null,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 1348,
"end": 1363,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 1351,
"end": 1363,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 1351,
"end": 1360,
"ctxt": 0
},
"value": "Component",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 1360,
"end": 1363,
"ctxt": 0
},
"params": [
{
"type": "TsTypeReference",
"span": {
"start": 1361,
"end": 1362,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 1361,
"end": 1362,
"ctxt": 0
},
"value": "P",
"optional": false
},
"typeParams": null
}
]
}
}
},
"isAbstract": false
}
}
},
{
"type": "ExportDeclaration",
"span": {
"start": 1365,
"end": 1419,
"ctxt": 0
},
"declaration": {
"type": "TsTypeAliasDeclaration",
"span": {
"start": 1372,
"end": 1419,
"ctxt": 0
},
"declare": false,
"id": {
"type": "Identifier",
"span": {
"start": 1377,
"end": 1394,
"ctxt": 0
},
"value": "FunctionComponent",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterDeclaration",
"span": {
"start": 1394,
"end": 1397,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
"start": 1395,
"end": 1396,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 1395,
"end": 1396,
"ctxt": 0
},
"value": "P",
"optional": false
},
"in": false,
"out": false,
"constraint": null,
"default": null
}
]
},
"typeAnnotation": {
"type": "TsFunctionType",
"span": {
"start": 1400,
"end": 1418,
"ctxt": 0
},
"params": [
{
"type": "Identifier",
"span": {
"start": 1401,
"end": 1409,
"ctxt": 0
},
"value": "props",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 1406,
"end": 1409,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 1408,
"end": 1409,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 1408,
"end": 1409,
"ctxt": 0
},
"value": "P",
"optional": false
},
"typeParams": null
}
}
}
],
"typeParams": null,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 1411,
"end": 1418,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 1414,
"end": 1418,
"ctxt": 0
},
"kind": "null"
}
}
}
}
},
{
"type": "ExportDeclaration",
"span": {
"start": 1421,
"end": 1493,
"ctxt": 0
},
"declaration": {
"type": "TsTypeAliasDeclaration",
"span": {
"start": 1428,
"end": 1493,
"ctxt": 0
},
"declare": false,
"id": {
"type": "Identifier",
"span": {
"start": 1433,
"end": 1446,
"ctxt": 0
},
"value": "ComponentType",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterDeclaration",
"span": {
"start": 1446,
"end": 1449,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
"start": 1447,
"end": 1448,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 1447,
"end": 1448,
"ctxt": 0
},
"value": "P",
"optional": false
},
"in": false,
"out": false,
"constraint": null,
"default": null
}
]
},
"typeAnnotation": {
"type": "TsUnionType",
"span": {
"start": 1452,
"end": 1492,
"ctxt": 0
},
"types": [
{
"type": "TsTypeReference",
"span": {
"start": 1452,
"end": 1472,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 1452,
"end": 1469,
"ctxt": 0
},
"value": "FunctionComponent",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 1469,
"end": 1472,
"ctxt": 0
},
"params": [
{
"type": "TsTypeReference",
"span": {
"start": 1470,
"end": 1471,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 1470,
"end": 1471,
"ctxt": 0
},
"value": "P",
"optional": false
},
"typeParams": null
}
]
}
},
{
"type": "TsTypeReference",
"span": {
"start": 1475,
"end": 1492,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 1475,
"end": 1489,
"ctxt": 0
},
"value": "ComponentClass",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 1489,
"end": 1492,
"ctxt": 0
},
"params": [
{
"type": "TsTypeReference",
"span": {
"start": 1490,
"end": 1491,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 1490,
"end": 1491,
"ctxt": 0
},
"value": "P",
"optional": false
},
"typeParams": null
}
]
}
}
]
}
}
},
{
"type": "ExportDeclaration",
"span": {
"start": 1495,
"end": 1549,
"ctxt": 0
},
"declaration": {
"type": "TsInterfaceDeclaration",
"span": {
"start": 1502,
"end": 1549,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 1512,
"end": 1531,
"ctxt": 0
},
"value": "RouteComponentProps",
"optional": false
},
"declare": false,
"typeParams": null,
"extends": [],
"body": {
"type": "TsInterfaceBody",
"span": {
"start": 1532,
"end": 1549,
"ctxt": 0
},
"body": [
{
"type": "TsPropertySignature",
"span": {
"start": 1534,
"end": 1547,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 1534,
"end": 1539,
"ctxt": 0
},
"value": "route",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 1539,
"end": 1547,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 1541,
"end": 1547,
"ctxt": 0
},
"kind": "string"
}
},
"typeParams": null
}
]
}
}
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 1568,
"end": 1578,
"ctxt": 0
},
"value": "withRouter",
"optional": false
},
"declare": true,
"params": [
{
"type": "Parameter",
"span": {
"start": 1647,
"end": 1678,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 1647,
"end": 1678,
"ctxt": 0
},
"value": "component",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 1656,
"end": 1678,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsIntersectionType",
"span": {
"start": 1658,
"end": 1678,
"ctxt": 0
},
"types": [
{
"type": "TsTypeReference",
"span": {
"start": 1658,
"end": 1659,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 1658,
"end": 1659,
"ctxt": 0
},
"value": "C",
"optional": false
},
"typeParams": null
},
{
"type": "TsTypeReference",
"span": {
"start": 1662,
"end": 1678,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 1662,
"end": 1675,
"ctxt": 0
},
"value": "ComponentType",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 1675,
"end": 1678,
"ctxt": 0
},
"params": [
{
"type": "TsTypeReference",
"span": {
"start": 1676,
"end": 1677,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 1676,
"end": 1677,
"ctxt": 0
},
"value": "P",
"optional": false
},
"typeParams": null
}
]
}
}
]
}
}
}
}
],
"decorators": [],
"span": {
"start": 1551,
"end": 1733,
"ctxt": 0
},
"body": null,
"generator": false,
"async": false,
"typeParameters": {
"type": "TsTypeParameterDeclaration",
"span": {
"start": 1578,
"end": 1643,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
"start": 1582,
"end": 1611,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 1582,
"end": 1583,
"ctxt": 0
},
"value": "P",
"optional": false
},
"in": false,
"out": false,
"constraint": {
"type": "TsTypeReference",
"span": {
"start": 1592,
"end": 1611,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 1592,
"end": 1611,
"ctxt": 0
},
"value": "RouteComponentProps",
"optional": false
},
"typeParams": null
},
"default": null
},
{
"type": "TsTypeParameter",
"span": {
"start": 1615,
"end": 1641,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 1615,
"end": 1616,
"ctxt": 0
},
"value": "C",
"optional": false
},
"in": false,
"out": false,
"constraint": {
"type": "TsTypeReference",
"span": {
"start": 1625,
"end": 1641,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 1625,
"end": 1638,
"ctxt": 0
},
"value": "ComponentType",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 1638,
"end": 1641,
"ctxt": 0
},
"params": [
{
"type": "TsTypeReference",
"span": {
"start": 1639,
"end": 1640,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 1639,
"end": 1640,
"ctxt": 0
},
"value": "P",
"optional": false
},
"typeParams": null
}
]
}
},
"default": null
}
]
},
"returnType": {
"type": "TsTypeAnnotation",
"span": {
"start": 1680,
"end": 1732,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 1682,
"end": 1732,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 1682,
"end": 1696,
"ctxt": 0
},
"value": "ComponentClass",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 1696,
"end": 1732,
"ctxt": 0
},
"params": [
{
"type": "TsTypeReference",
"span": {
"start": 1697,
"end": 1731,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 1697,
"end": 1701,
"ctxt": 0
},
"value": "Omit",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 1701,
"end": 1731,
"ctxt": 0
},
"params": [
{
"type": "TsTypeReference",
"span": {
"start": 1702,
"end": 1703,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 1702,
"end": 1703,
"ctxt": 0
},
"value": "P",
"optional": false
},
"typeParams": null
},
{
"type": "TsTypeOperator",
"span": {
"start": 1705,
"end": 1730,
"ctxt": 0
},
"op": "keyof",
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 1711,
"end": 1730,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 1711,
"end": 1730,
"ctxt": 0
},
"value": "RouteComponentProps",
"optional": false
},
"typeParams": null
}
}
]
}
}
]
}
}
}
},
{
"type": "TsInterfaceDeclaration",
"span": {
"start": 1735,
"end": 1799,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 1745,
"end": 1750,
"ctxt": 0
},
"value": "Props",
"optional": false
},
"declare": false,
"typeParams": null,
"extends": [
{
"type": "TsExpressionWithTypeArguments",
"span": {
"start": 1759,
"end": 1778,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 1759,
"end": 1778,
"ctxt": 0
},
"value": "RouteComponentProps",
"optional": false
},
"typeArguments": null
}
],
"body": {
"type": "TsInterfaceBody",
"span": {
"start": 1779,
"end": 1799,
"ctxt": 0
},
"body": [
{
"type": "TsPropertySignature",
"span": {
"start": 1781,
"end": 1797,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 1781,
"end": 1789,
"ctxt": 0
},
"value": "username",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 1789,
"end": 1797,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 1791,
"end": 1797,
"ctxt": 0
},
"kind": "string"
}
},
"typeParams": null
}
]
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 1801,
"end": 1849,
"ctxt": 0
},
"kind": "const",
"declare": true,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 1815,
"end": 1848,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 1815,
"end": 1826,
"ctxt": 0
},
"value": "MyComponent",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 1826,
"end": 1848,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 1828,
"end": 1848,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 1828,
"end": 1841,
"ctxt": 0
},
"value": "ComponentType",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 1841,
"end": 1848,
"ctxt": 0
},
"params": [
{
"type": "TsTypeReference",
"span": {
"start": 1842,
"end": 1847,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 1842,
"end": 1847,
"ctxt": 0
},
"value": "Props",
"optional": false
},
"typeParams": null
}
]
}
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 1851,
"end": 1875,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 1851,
"end": 1874,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 1851,
"end": 1861,
"ctxt": 0
},
"value": "withRouter",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "Identifier",
"span": {
"start": 1862,
"end": 1873,
"ctxt": 0
},
"value": "MyComponent",
"optional": false
}
}
],
"typeArguments": null
}
},
{
"type": "TsTypeAliasDeclaration",
"span": {
"start": 1899,
"end": 1932,
"ctxt": 0
},
"declare": false,
"id": {
"type": "Identifier",
"span": {
"start": 1904,
"end": 1906,
"ctxt": 0
},
"value": "AB",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterDeclaration",
"span": {
"start": 1906,
"end": 1909,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
"start": 1907,
"end": 1908,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 1907,
"end": 1908,
"ctxt": 0
},
"value": "T",
"optional": false
},
"in": false,
"out": false,
"constraint": null,
"default": null
}
]
},
"typeAnnotation": {
"type": "TsUnionType",
"span": {
"start": 1912,
"end": 1931,
"ctxt": 0
},
"types": [
{
"type": "TsTypeLiteral",
"span": {
"start": 1912,
"end": 1920,
"ctxt": 0
},
"members": [
{
"type": "TsPropertySignature",
"span": {
"start": 1914,
"end": 1918,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 1914,
"end": 1915,
"ctxt": 0
},
"value": "a",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 1915,
"end": 1918,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 1917,
"end": 1918,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 1917,
"end": 1918,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
}
},
"typeParams": null
}
]
},
{
"type": "TsTypeLiteral",
"span": {
"start": 1923,
"end": 1931,
"ctxt": 0
},
"members": [
{
"type": "TsPropertySignature",
"span": {
"start": 1925,
"end": 1929,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 1925,
"end": 1926,
"ctxt": 0
},
"value": "b",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 1926,
"end": 1929,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 1928,
"end": 1929,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 1928,
"end": 1929,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
}
},
"typeParams": null
}
]
}
]
}
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 2012,
"end": 2015,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"declare": true,
"params": [
{
"type": "Parameter",
"span": {
"start": 2022,
"end": 2036,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 2022,
"end": 2036,
"ctxt": 0
},
"value": "obj",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 2025,
"end": 2036,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsIntersectionType",
"span": {
"start": 2027,
"end": 2036,
"ctxt": 0
},
"types": [
{
"type": "TsTypeReference",
"span": {
"start": 2027,
"end": 2028,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 2027,
"end": 2028,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
},
{
"type": "TsTypeReference",
"span": {
"start": 2031,
"end": 2036,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 2031,
"end": 2033,
"ctxt": 0
},
"value": "AB",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 2033,
"end": 2036,
"ctxt": 0
},
"params": [
{
"type": "TsTypeReference",
"span": {
"start": 2034,
"end": 2035,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 2034,
"end": 2035,
"ctxt": 0
},
"value": "U",
"optional": false
},
"typeParams": null
}
]
}
}
]
}
}
}
}
],
"decorators": [],
"span": {
"start": 1995,
"end": 2046,
"ctxt": 0
},
"body": null,
"generator": false,
"async": false,
"typeParameters": {
"type": "TsTypeParameterDeclaration",
"span": {
"start": 2015,
"end": 2021,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
"start": 2016,
"end": 2017,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 2016,
"end": 2017,
"ctxt": 0
},
"value": "T",
"optional": false
},
"in": false,
"out": false,
"constraint": null,
"default": null
},
{
"type": "TsTypeParameter",
"span": {
"start": 2019,
"end": 2020,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 2019,
"end": 2020,
"ctxt": 0
},
"value": "U",
"optional": false
},
"in": false,
"out": false,
"constraint": null,
"default": null
}
]
},
"returnType": {
"type": "TsTypeAnnotation",
"span": {
"start": 2037,
"end": 2045,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTupleType",
"span": {
"start": 2039,
"end": 2045,
"ctxt": 0
},
"elemTypes": [
{
"type": "TsTupleElement",
"span": {
"start": 2040,
"end": 2041,
"ctxt": 0
},
"label": null,
"ty": {
"type": "TsTypeReference",
"span": {
"start": 2040,
"end": 2041,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 2040,
"end": 2041,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
}
},
{
"type": "TsTupleElement",
"span": {
"start": 2043,
"end": 2044,
"ctxt": 0
},
"label": null,
"ty": {
"type": "TsTypeReference",
"span": {
"start": 2043,
"end": 2044,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 2043,
"end": 2044,
"ctxt": 0
},
"value": "U",
"optional": false
},
"typeParams": null
}
}
]
}
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 2047,
"end": 2074,
"ctxt": 0
},
"kind": "let",
"declare": true,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 2059,
"end": 2073,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 2059,
"end": 2061,
"ctxt": 0
},
"value": "ab",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 2061,
"end": 2073,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 2063,
"end": 2073,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 2063,
"end": 2065,
"ctxt": 0
},
"value": "AB",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 2065,
"end": 2073,
"ctxt": 0
},
"params": [
{
"type": "TsKeywordType",
"span": {
"start": 2066,
"end": 2072,
"ctxt": 0
},
"kind": "string"
}
]
}
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 2076,
"end": 2092,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 2080,
"end": 2091,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 2080,
"end": 2081,
"ctxt": 0
},
"value": "z",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "CallExpression",
"span": {
"start": 2084,
"end": 2091,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 2084,
"end": 2087,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "Identifier",
"span": {
"start": 2088,
"end": 2090,
"ctxt": 0
},
"value": "ab",
"optional": false
}
}
],
"typeArguments": null
},
"definite": false
}
]
}
],
"interpreter": null
}