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

447 lines
11 KiB
JSON

{
"type": "Script",
"span": {
"start": 0,
"end": 157,
"ctxt": 0
},
"body": [
{
"type": "TsInterfaceDeclaration",
"span": {
"start": 0,
"end": 32,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 10,
"end": 11,
"ctxt": 0
},
"value": "A",
"optional": false
},
"declare": false,
"typeParams": null,
"extends": [],
"body": {
"type": "TsInterfaceBody",
"span": {
"start": 12,
"end": 32,
"ctxt": 0
},
"body": [
{
"type": "TsMethodSignature",
"span": {
"start": 18,
"end": 30,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 18,
"end": 21,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"computed": false,
"optional": false,
"params": [],
"typeAnn": {
"type": "TsTypeAnnotation",
"span": {
"start": 23,
"end": 29,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsThisType",
"span": {
"start": 25,
"end": 29,
"ctxt": 0
}
}
},
"typeParams": null
}
]
}
},
{
"type": "TsInterfaceDeclaration",
"span": {
"start": 33,
"end": 75,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 43,
"end": 44,
"ctxt": 0
},
"value": "B",
"optional": false
},
"declare": false,
"typeParams": null,
"extends": [
{
"type": "TsExpressionWithTypeArguments",
"span": {
"start": 53,
"end": 54,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 53,
"end": 54,
"ctxt": 0
},
"value": "A",
"optional": false
},
"typeArguments": null
}
],
"body": {
"type": "TsInterfaceBody",
"span": {
"start": 55,
"end": 75,
"ctxt": 0
},
"body": [
{
"type": "TsMethodSignature",
"span": {
"start": 61,
"end": 73,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 61,
"end": 64,
"ctxt": 0
},
"value": "bar",
"optional": false
},
"computed": false,
"optional": false,
"params": [],
"typeAnn": {
"type": "TsTypeAnnotation",
"span": {
"start": 66,
"end": 72,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsThisType",
"span": {
"start": 68,
"end": 72,
"ctxt": 0
}
}
},
"typeParams": null
}
]
}
},
{
"type": "TsInterfaceDeclaration",
"span": {
"start": 76,
"end": 118,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 86,
"end": 87,
"ctxt": 0
},
"value": "C",
"optional": false
},
"declare": false,
"typeParams": null,
"extends": [
{
"type": "TsExpressionWithTypeArguments",
"span": {
"start": 96,
"end": 97,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 96,
"end": 97,
"ctxt": 0
},
"value": "B",
"optional": false
},
"typeArguments": null
}
],
"body": {
"type": "TsInterfaceBody",
"span": {
"start": 98,
"end": 118,
"ctxt": 0
},
"body": [
{
"type": "TsMethodSignature",
"span": {
"start": 104,
"end": 116,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 104,
"end": 107,
"ctxt": 0
},
"value": "baz",
"optional": false
},
"computed": false,
"optional": false,
"params": [],
"typeAnn": {
"type": "TsTypeAnnotation",
"span": {
"start": 109,
"end": 115,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsThisType",
"span": {
"start": 111,
"end": 115,
"ctxt": 0
}
}
},
"typeParams": null
}
]
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 119,
"end": 128,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 123,
"end": 127,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 123,
"end": 124,
"ctxt": 0
},
"value": "c",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 124,
"end": 127,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 126,
"end": 127,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 126,
"end": 127,
"ctxt": 0
},
"value": "C",
"optional": false
},
"typeParams": null
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 129,
"end": 157,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 133,
"end": 156,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 133,
"end": 134,
"ctxt": 0
},
"value": "z",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "CallExpression",
"span": {
"start": 137,
"end": 156,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 137,
"end": 154,
"ctxt": 0
},
"object": {
"type": "CallExpression",
"span": {
"start": 137,
"end": 150,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 137,
"end": 148,
"ctxt": 0
},
"object": {
"type": "CallExpression",
"span": {
"start": 137,
"end": 144,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 137,
"end": 142,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 137,
"end": 138,
"ctxt": 0
},
"value": "c",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 139,
"end": 142,
"ctxt": 0
},
"value": "foo",
"optional": false
}
},
"arguments": [],
"typeArguments": null
},
"property": {
"type": "Identifier",
"span": {
"start": 145,
"end": 148,
"ctxt": 0
},
"value": "bar",
"optional": false
}
},
"arguments": [],
"typeArguments": null
},
"property": {
"type": "Identifier",
"span": {
"start": 151,
"end": 154,
"ctxt": 0
},
"value": "baz",
"optional": false
}
},
"arguments": [],
"typeArguments": null
},
"definite": false
}
]
}
],
"interpreter": null
}