swc/crates/swc_ecma_parser/tests/tsc/extendBooleanInterface.json
2022-02-04 20:17:42 +09:00

645 lines
16 KiB
JSON

{
"type": "Script",
"span": {
"start": 0,
"end": 229,
"ctxt": 0
},
"body": [
{
"type": "TsInterfaceDeclaration",
"span": {
"start": 0,
"end": 74,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 10,
"end": 17,
"ctxt": 0
},
"value": "Boolean",
"optional": false
},
"declare": false,
"typeParams": null,
"extends": [],
"body": {
"type": "TsInterfaceBody",
"span": {
"start": 18,
"end": 74,
"ctxt": 0
},
"body": [
{
"type": "TsMethodSignature",
"span": {
"start": 24,
"end": 42,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 24,
"end": 31,
"ctxt": 0
},
"value": "doStuff",
"optional": false
},
"computed": false,
"optional": false,
"params": [],
"typeAnn": {
"type": "TsTypeAnnotation",
"span": {
"start": 33,
"end": 41,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 35,
"end": 41,
"ctxt": 0
},
"kind": "string"
}
},
"typeParams": null
},
{
"type": "TsMethodSignature",
"span": {
"start": 47,
"end": 72,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 47,
"end": 59,
"ctxt": 0
},
"value": "doOtherStuff",
"optional": false
},
"computed": false,
"optional": false,
"params": [
{
"type": "Identifier",
"span": {
"start": 63,
"end": 67,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 64,
"end": 67,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 66,
"end": 67,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 66,
"end": 67,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
}
}
}
],
"typeAnn": {
"type": "TsTypeAnnotation",
"span": {
"start": 68,
"end": 71,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 70,
"end": 71,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 70,
"end": 71,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
}
},
"typeParams": {
"type": "TsTypeParameterDeclaration",
"span": {
"start": 59,
"end": 62,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
"start": 60,
"end": 61,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 60,
"end": 61,
"ctxt": 0
},
"value": "T",
"optional": false
},
"constraint": null,
"default": null
}
]
}
}
]
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 76,
"end": 89,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 80,
"end": 88,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 80,
"end": 81,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "BooleanLiteral",
"span": {
"start": 84,
"end": 88,
"ctxt": 0
},
"value": true
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 90,
"end": 118,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 94,
"end": 117,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 94,
"end": 95,
"ctxt": 0
},
"value": "a",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 95,
"end": 103,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 97,
"end": 103,
"ctxt": 0
},
"kind": "string"
}
}
},
"init": {
"type": "CallExpression",
"span": {
"start": 106,
"end": 117,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 106,
"end": 115,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 106,
"end": 107,
"ctxt": 0
},
"value": "x",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 108,
"end": 115,
"ctxt": 0
},
"value": "doStuff",
"optional": false
}
},
"arguments": [],
"typeArguments": null
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 119,
"end": 156,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 123,
"end": 155,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 123,
"end": 124,
"ctxt": 0
},
"value": "b",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 124,
"end": 132,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 126,
"end": 132,
"ctxt": 0
},
"kind": "string"
}
}
},
"init": {
"type": "CallExpression",
"span": {
"start": 135,
"end": 155,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 135,
"end": 149,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 135,
"end": 136,
"ctxt": 0
},
"value": "x",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 137,
"end": 149,
"ctxt": 0
},
"value": "doOtherStuff",
"optional": false
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "StringLiteral",
"span": {
"start": 150,
"end": 154,
"ctxt": 0
},
"value": "hm",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
}
}
],
"typeArguments": null
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 157,
"end": 188,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 161,
"end": 187,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 161,
"end": 162,
"ctxt": 0
},
"value": "c",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 162,
"end": 170,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 164,
"end": 170,
"ctxt": 0
},
"kind": "string"
}
}
},
"init": {
"type": "CallExpression",
"span": {
"start": 173,
"end": 187,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 173,
"end": 185,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 173,
"end": 174,
"ctxt": 0
},
"value": "x",
"optional": false
},
"property": {
"type": "Computed",
"span": {
"start": 174,
"end": 185,
"ctxt": 0
},
"expression": {
"type": "StringLiteral",
"span": {
"start": 175,
"end": 184,
"ctxt": 0
},
"value": "doStuff",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
}
}
},
"arguments": [],
"typeArguments": null
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 189,
"end": 229,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 193,
"end": 228,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 193,
"end": 194,
"ctxt": 0
},
"value": "d",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 194,
"end": 202,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 196,
"end": 202,
"ctxt": 0
},
"kind": "string"
}
}
},
"init": {
"type": "CallExpression",
"span": {
"start": 205,
"end": 228,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 205,
"end": 222,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 205,
"end": 206,
"ctxt": 0
},
"value": "x",
"optional": false
},
"property": {
"type": "Computed",
"span": {
"start": 206,
"end": 222,
"ctxt": 0
},
"expression": {
"type": "StringLiteral",
"span": {
"start": 207,
"end": 221,
"ctxt": 0
},
"value": "doOtherStuff",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
}
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "StringLiteral",
"span": {
"start": 223,
"end": 227,
"ctxt": 0
},
"value": "hm",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
}
}
],
"typeArguments": null
},
"definite": false
}
]
}
],
"interpreter": null
}