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

1144 lines
37 KiB
JSON

{
"type": "Script",
"span": {
"start": 80,
"end": 489,
"ctxt": 0
},
"body": [
{
"type": "VariableDeclaration",
"span": {
"start": 80,
"end": 232,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 84,
"end": 231,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 84,
"end": 85,
"ctxt": 0
},
"value": "c",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 85,
"end": 231,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeLiteral",
"span": {
"start": 87,
"end": 231,
"ctxt": 0
},
"members": [
{
"type": "TsMethodSignature",
"span": {
"start": 93,
"end": 119,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 93,
"end": 98,
"ctxt": 0
},
"value": "func4",
"optional": false
},
"computed": false,
"optional": true,
"params": [
{
"type": "Identifier",
"span": {
"start": 100,
"end": 109,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 101,
"end": 109,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 103,
"end": 109,
"ctxt": 0
},
"kind": "number"
}
}
}
],
"typeAnn": {
"type": "TsTypeAnnotation",
"span": {
"start": 110,
"end": 118,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 112,
"end": 118,
"ctxt": 0
},
"kind": "number"
}
},
"typeParams": null
},
{
"type": "TsMethodSignature",
"span": {
"start": 124,
"end": 150,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 124,
"end": 129,
"ctxt": 0
},
"value": "func4",
"optional": false
},
"computed": false,
"optional": true,
"params": [
{
"type": "Identifier",
"span": {
"start": 131,
"end": 140,
"ctxt": 0
},
"value": "s",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 132,
"end": 140,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 134,
"end": 140,
"ctxt": 0
},
"kind": "string"
}
}
}
],
"typeAnn": {
"type": "TsTypeAnnotation",
"span": {
"start": 141,
"end": 149,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 143,
"end": 149,
"ctxt": 0
},
"kind": "string"
}
},
"typeParams": null
},
{
"type": "TsPropertySignature",
"span": {
"start": 155,
"end": 229,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 155,
"end": 160,
"ctxt": 0
},
"value": "func5",
"optional": false
},
"computed": false,
"optional": true,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 161,
"end": 228,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeLiteral",
"span": {
"start": 163,
"end": 228,
"ctxt": 0
},
"members": [
{
"type": "TsCallSignatureDeclaration",
"span": {
"start": 173,
"end": 193,
"ctxt": 0
},
"params": [
{
"type": "Identifier",
"span": {
"start": 174,
"end": 183,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 175,
"end": 183,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 177,
"end": 183,
"ctxt": 0
},
"kind": "number"
}
}
}
],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 184,
"end": 192,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 186,
"end": 192,
"ctxt": 0
},
"kind": "number"
}
},
"typeParams": null
},
{
"type": "TsCallSignatureDeclaration",
"span": {
"start": 202,
"end": 222,
"ctxt": 0
},
"params": [
{
"type": "Identifier",
"span": {
"start": 203,
"end": 212,
"ctxt": 0
},
"value": "s",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 204,
"end": 212,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 206,
"end": 212,
"ctxt": 0
},
"kind": "string"
}
}
}
],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 213,
"end": 221,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 215,
"end": 221,
"ctxt": 0
},
"kind": "string"
}
},
"typeParams": null
}
]
}
},
"typeParams": null
}
]
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 247,
"end": 265,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 247,
"end": 264,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "MemberExpression",
"span": {
"start": 247,
"end": 254,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 247,
"end": 248,
"ctxt": 0
},
"value": "c",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 249,
"end": 254,
"ctxt": 0
},
"value": "func4",
"optional": false
}
},
"right": {
"type": "MemberExpression",
"span": {
"start": 257,
"end": 264,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 257,
"end": 258,
"ctxt": 0
},
"value": "c",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 259,
"end": 264,
"ctxt": 0
},
"value": "func5",
"optional": false
}
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 266,
"end": 284,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 266,
"end": 283,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "MemberExpression",
"span": {
"start": 266,
"end": 273,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 266,
"end": 267,
"ctxt": 0
},
"value": "c",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 268,
"end": 273,
"ctxt": 0
},
"value": "func5",
"optional": false
}
},
"right": {
"type": "MemberExpression",
"span": {
"start": 276,
"end": 283,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 276,
"end": 277,
"ctxt": 0
},
"value": "c",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 278,
"end": 283,
"ctxt": 0
},
"value": "func4",
"optional": false
}
}
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 287,
"end": 433,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 291,
"end": 432,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 291,
"end": 293,
"ctxt": 0
},
"value": "c2",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 293,
"end": 432,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeLiteral",
"span": {
"start": 295,
"end": 432,
"ctxt": 0
},
"members": [
{
"type": "TsMethodSignature",
"span": {
"start": 301,
"end": 325,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 301,
"end": 306,
"ctxt": 0
},
"value": "func4",
"optional": false
},
"computed": false,
"optional": true,
"params": [
{
"type": "Identifier",
"span": {
"start": 311,
"end": 315,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 312,
"end": 315,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 314,
"end": 315,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 314,
"end": 315,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
}
}
}
],
"typeAnn": {
"type": "TsTypeAnnotation",
"span": {
"start": 316,
"end": 324,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 318,
"end": 324,
"ctxt": 0
},
"kind": "number"
}
},
"typeParams": {
"type": "TsTypeParameterDeclaration",
"span": {
"start": 307,
"end": 310,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
"start": 308,
"end": 309,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 308,
"end": 309,
"ctxt": 0
},
"value": "T",
"optional": false
},
"in": false,
"out": false,
"constraint": null,
"default": null
}
]
}
},
{
"type": "TsMethodSignature",
"span": {
"start": 330,
"end": 355,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 330,
"end": 335,
"ctxt": 0
},
"value": "func4",
"optional": false
},
"computed": false,
"optional": true,
"params": [
{
"type": "Identifier",
"span": {
"start": 341,
"end": 345,
"ctxt": 0
},
"value": "s",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 342,
"end": 345,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 344,
"end": 345,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 344,
"end": 345,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
}
}
}
],
"typeAnn": {
"type": "TsTypeAnnotation",
"span": {
"start": 346,
"end": 354,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 348,
"end": 354,
"ctxt": 0
},
"kind": "string"
}
},
"typeParams": {
"type": "TsTypeParameterDeclaration",
"span": {
"start": 337,
"end": 340,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
"start": 338,
"end": 339,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 338,
"end": 339,
"ctxt": 0
},
"value": "T",
"optional": false
},
"in": false,
"out": false,
"constraint": null,
"default": null
}
]
}
},
{
"type": "TsPropertySignature",
"span": {
"start": 360,
"end": 430,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 360,
"end": 365,
"ctxt": 0
},
"value": "func5",
"optional": false
},
"computed": false,
"optional": true,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 366,
"end": 429,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeLiteral",
"span": {
"start": 368,
"end": 429,
"ctxt": 0
},
"members": [
{
"type": "TsCallSignatureDeclaration",
"span": {
"start": 378,
"end": 396,
"ctxt": 0
},
"params": [
{
"type": "Identifier",
"span": {
"start": 382,
"end": 386,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 383,
"end": 386,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 385,
"end": 386,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 385,
"end": 386,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
}
}
}
],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 387,
"end": 395,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 389,
"end": 395,
"ctxt": 0
},
"kind": "number"
}
},
"typeParams": {
"type": "TsTypeParameterDeclaration",
"span": {
"start": 378,
"end": 381,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
"start": 379,
"end": 380,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 379,
"end": 380,
"ctxt": 0
},
"value": "T",
"optional": false
},
"in": false,
"out": false,
"constraint": null,
"default": null
}
]
}
},
{
"type": "TsCallSignatureDeclaration",
"span": {
"start": 405,
"end": 423,
"ctxt": 0
},
"params": [
{
"type": "Identifier",
"span": {
"start": 409,
"end": 413,
"ctxt": 0
},
"value": "s",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 410,
"end": 413,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 412,
"end": 413,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 412,
"end": 413,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
}
}
}
],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 414,
"end": 422,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 416,
"end": 422,
"ctxt": 0
},
"kind": "string"
}
},
"typeParams": {
"type": "TsTypeParameterDeclaration",
"span": {
"start": 405,
"end": 408,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
"start": 406,
"end": 407,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 406,
"end": 407,
"ctxt": 0
},
"value": "T",
"optional": false
},
"in": false,
"out": false,
"constraint": null,
"default": null
}
]
}
}
]
}
},
"typeParams": null
}
]
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 448,
"end": 468,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 448,
"end": 467,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "MemberExpression",
"span": {
"start": 448,
"end": 456,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 448,
"end": 450,
"ctxt": 0
},
"value": "c2",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 451,
"end": 456,
"ctxt": 0
},
"value": "func4",
"optional": false
}
},
"right": {
"type": "MemberExpression",
"span": {
"start": 459,
"end": 467,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 459,
"end": 461,
"ctxt": 0
},
"value": "c2",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 462,
"end": 467,
"ctxt": 0
},
"value": "func5",
"optional": false
}
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 469,
"end": 489,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 469,
"end": 488,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "MemberExpression",
"span": {
"start": 469,
"end": 477,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 469,
"end": 471,
"ctxt": 0
},
"value": "c2",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 472,
"end": 477,
"ctxt": 0
},
"value": "func5",
"optional": false
}
},
"right": {
"type": "MemberExpression",
"span": {
"start": 480,
"end": 488,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 480,
"end": 482,
"ctxt": 0
},
"value": "c2",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 483,
"end": 488,
"ctxt": 0
},
"value": "func4",
"optional": false
}
}
}
}
],
"interpreter": null
}