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

638 lines
16 KiB
JSON

{
"type": "Script",
"span": {
"start": 0,
"end": 202,
"ctxt": 0
},
"body": [
{
"type": "TsInterfaceDeclaration",
"span": {
"start": 0,
"end": 114,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 10,
"end": 13,
"ctxt": 0
},
"value": "Foo",
"optional": false
},
"declare": false,
"typeParams": null,
"extends": [],
"body": {
"type": "TsInterfaceBody",
"span": {
"start": 14,
"end": 114,
"ctxt": 0
},
"body": [
{
"type": "TsCallSignatureDeclaration",
"span": {
"start": 20,
"end": 37,
"ctxt": 0
},
"params": [
{
"type": "Identifier",
"span": {
"start": 21,
"end": 27,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 22,
"end": 27,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsLiteralType",
"span": {
"start": 24,
"end": 27,
"ctxt": 0
},
"literal": {
"type": "StringLiteral",
"span": {
"start": 24,
"end": 27,
"ctxt": 0
},
"value": "a",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
}
}
}
}
],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 28,
"end": 36,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 30,
"end": 36,
"ctxt": 0
},
"kind": "number"
}
},
"typeParams": null
},
{
"type": "TsCallSignatureDeclaration",
"span": {
"start": 42,
"end": 59,
"ctxt": 0
},
"params": [
{
"type": "Identifier",
"span": {
"start": 43,
"end": 52,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 44,
"end": 52,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 46,
"end": 52,
"ctxt": 0
},
"kind": "string"
}
}
}
],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 53,
"end": 58,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 55,
"end": 58,
"ctxt": 0
},
"kind": "any"
}
},
"typeParams": null
},
{
"type": "TsConstructSignatureDeclaration",
"span": {
"start": 65,
"end": 83,
"ctxt": 0
},
"params": [
{
"type": "Identifier",
"span": {
"start": 70,
"end": 76,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 71,
"end": 76,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsLiteralType",
"span": {
"start": 73,
"end": 76,
"ctxt": 0
},
"literal": {
"type": "StringLiteral",
"span": {
"start": 73,
"end": 76,
"ctxt": 0
},
"value": "a",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
}
}
}
}
],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 77,
"end": 82,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 79,
"end": 82,
"ctxt": 0
},
"kind": "any"
}
},
"typeParams": null
},
{
"type": "TsConstructSignatureDeclaration",
"span": {
"start": 88,
"end": 112,
"ctxt": 0
},
"params": [
{
"type": "Identifier",
"span": {
"start": 93,
"end": 102,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 94,
"end": 102,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 96,
"end": 102,
"ctxt": 0
},
"kind": "string"
}
}
}
],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 103,
"end": 111,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 105,
"end": 111,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 105,
"end": 111,
"ctxt": 0
},
"value": "Object",
"optional": false
},
"typeParams": null
}
},
"typeParams": null
}
]
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 116,
"end": 127,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 120,
"end": 126,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 120,
"end": 121,
"ctxt": 0
},
"value": "f",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 121,
"end": 126,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 123,
"end": 126,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 123,
"end": 126,
"ctxt": 0
},
"value": "Foo",
"optional": false
},
"typeParams": null
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 128,
"end": 143,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 132,
"end": 142,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 132,
"end": 133,
"ctxt": 0
},
"value": "r",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "CallExpression",
"span": {
"start": 136,
"end": 142,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 136,
"end": 137,
"ctxt": 0
},
"value": "f",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "StringLiteral",
"span": {
"start": 138,
"end": 141,
"ctxt": 0
},
"value": "a",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
}
}
],
"typeArguments": null
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 144,
"end": 160,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 148,
"end": 159,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 148,
"end": 150,
"ctxt": 0
},
"value": "r2",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "CallExpression",
"span": {
"start": 153,
"end": 159,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 153,
"end": 154,
"ctxt": 0
},
"value": "f",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "StringLiteral",
"span": {
"start": 155,
"end": 158,
"ctxt": 0
},
"value": "A",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
}
}
],
"typeArguments": null
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 161,
"end": 181,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 165,
"end": 180,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 165,
"end": 167,
"ctxt": 0
},
"value": "r3",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "NewExpression",
"span": {
"start": 170,
"end": 180,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 174,
"end": 175,
"ctxt": 0
},
"value": "f",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "StringLiteral",
"span": {
"start": 176,
"end": 179,
"ctxt": 0
},
"value": "a",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
}
}
],
"typeArguments": null
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 182,
"end": 202,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 186,
"end": 201,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 186,
"end": 188,
"ctxt": 0
},
"value": "r4",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "NewExpression",
"span": {
"start": 191,
"end": 201,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 195,
"end": 196,
"ctxt": 0
},
"value": "f",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "StringLiteral",
"span": {
"start": 197,
"end": 200,
"ctxt": 0
},
"value": "A",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
}
}
],
"typeArguments": null
},
"definite": false
}
]
}
],
"interpreter": null
}