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

224 lines
5.2 KiB
JSON

{
"type": "Module",
"span": {
"start": 44,
"end": 197,
"ctxt": 0
},
"body": [
{
"type": "TsModuleDeclaration",
"span": {
"start": 44,
"end": 91,
"ctxt": 0
},
"declare": true,
"global": false,
"id": {
"type": "StringLiteral",
"span": {
"start": 59,
"end": 64,
"ctxt": 0
},
"value": "foo",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
},
"body": {
"type": "TsModuleBlock",
"span": {
"start": 65,
"end": 91,
"ctxt": 0
},
"body": [
{
"type": "ExportDeclaration",
"span": {
"start": 68,
"end": 89,
"ctxt": 0
},
"declaration": {
"type": "VariableDeclaration",
"span": {
"start": 75,
"end": 89,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 79,
"end": 88,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 79,
"end": 80,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 80,
"end": 88,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 82,
"end": 88,
"ctxt": 0
},
"kind": "number"
}
}
},
"init": null,
"definite": false
}
]
}
}
]
}
},
{
"type": "TsImportEqualsDeclaration",
"span": {
"start": 149,
"end": 177,
"ctxt": 0
},
"declare": false,
"isExport": false,
"isTypeOnly": false,
"id": {
"type": "Identifier",
"span": {
"start": 156,
"end": 159,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"moduleRef": {
"type": "TsExternalModuleReference",
"span": {
"start": 162,
"end": 176,
"ctxt": 0
},
"expression": {
"type": "StringLiteral",
"span": {
"start": 170,
"end": 175,
"ctxt": 0
},
"value": "foo",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
}
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 178,
"end": 197,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 182,
"end": 196,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 182,
"end": 183,
"ctxt": 0
},
"value": "z",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "BinaryExpression",
"span": {
"start": 186,
"end": 196,
"ctxt": 0
},
"operator": "+",
"left": {
"type": "MemberExpression",
"span": {
"start": 186,
"end": 191,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 186,
"end": 189,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 190,
"end": 191,
"ctxt": 0
},
"value": "x",
"optional": false
}
},
"right": {
"type": "NumericLiteral",
"span": {
"start": 194,
"end": 196,
"ctxt": 0
},
"value": 10.0
}
},
"definite": false
}
]
}
],
"interpreter": null
}