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

279 lines
6.7 KiB
JSON

{
"type": "Script",
"span": {
"start": 0,
"end": 117,
"ctxt": 0
},
"body": [
{
"type": "TsModuleDeclaration",
"span": {
"start": 0,
"end": 81,
"ctxt": 0
},
"declare": true,
"global": false,
"id": {
"type": "Identifier",
"span": {
"start": 15,
"end": 21,
"ctxt": 0
},
"value": "string",
"optional": false
},
"body": {
"type": "TsModuleBlock",
"span": {
"start": 22,
"end": 81,
"ctxt": 0
},
"body": [
{
"type": "TsInterfaceDeclaration",
"span": {
"start": 28,
"end": 43,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 38,
"end": 39,
"ctxt": 0
},
"value": "X",
"optional": false
},
"declare": false,
"typeParams": null,
"extends": [],
"body": {
"type": "TsInterfaceBody",
"span": {
"start": 40,
"end": 43,
"ctxt": 0
},
"body": []
}
},
{
"type": "ExportDeclaration",
"span": {
"start": 48,
"end": 79,
"ctxt": 0
},
"declaration": {
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 64,
"end": 67,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"declare": false,
"params": [
{
"type": "Parameter",
"span": {
"start": 68,
"end": 77,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 68,
"end": 77,
"ctxt": 0
},
"value": "s",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 69,
"end": 77,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 71,
"end": 77,
"ctxt": 0
},
"kind": "string"
}
}
}
}
],
"decorators": [],
"span": {
"start": 55,
"end": 79,
"ctxt": 0
},
"body": null,
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
}
}
]
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 82,
"end": 100,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 82,
"end": 99,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 82,
"end": 92,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 82,
"end": 88,
"ctxt": 0
},
"value": "string",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 89,
"end": 92,
"ctxt": 0
},
"value": "foo",
"optional": false
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "StringLiteral",
"span": {
"start": 93,
"end": 98,
"ctxt": 0
},
"value": "abc",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
}
}
],
"typeArguments": null
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 101,
"end": 117,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 105,
"end": 116,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 105,
"end": 106,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 106,
"end": 116,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 108,
"end": 116,
"ctxt": 0
},
"typeName": {
"type": "TsQualifiedName",
"left": {
"type": "Identifier",
"span": {
"start": 108,
"end": 114,
"ctxt": 0
},
"value": "string",
"optional": false
},
"right": {
"type": "Identifier",
"span": {
"start": 115,
"end": 116,
"ctxt": 0
},
"value": "X",
"optional": false
}
},
"typeParams": null
}
}
},
"init": null,
"definite": false
}
]
}
],
"interpreter": null
}