swc/crates/swc_ecma_parser/tests/tsc/exportDeclaredModule.json
2022-03-22 07:54:08 +00:00

292 lines
6.9 KiB
JSON

{
"type": "Module",
"span": {
"start": 23,
"end": 193,
"ctxt": 0
},
"body": [
{
"type": "TsModuleDeclaration",
"span": {
"start": 23,
"end": 98,
"ctxt": 0
},
"declare": true,
"global": false,
"id": {
"type": "Identifier",
"span": {
"start": 38,
"end": 40,
"ctxt": 0
},
"value": "M1",
"optional": false
},
"body": {
"type": "TsModuleBlock",
"span": {
"start": 41,
"end": 98,
"ctxt": 0
},
"body": [
{
"type": "ExportDeclaration",
"span": {
"start": 44,
"end": 65,
"ctxt": 0
},
"declaration": {
"type": "VariableDeclaration",
"span": {
"start": 51,
"end": 65,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 55,
"end": 64,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 55,
"end": 56,
"ctxt": 0
},
"value": "a",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 56,
"end": 64,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 58,
"end": 64,
"ctxt": 0
},
"kind": "string"
}
}
},
"init": null,
"definite": false
}
]
}
},
{
"type": "ExportDeclaration",
"span": {
"start": 68,
"end": 96,
"ctxt": 0
},
"declaration": {
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 84,
"end": 85,
"ctxt": 0
},
"value": "b",
"optional": false
},
"declare": false,
"params": [],
"decorators": [],
"span": {
"start": 75,
"end": 96,
"ctxt": 0
},
"body": null,
"generator": false,
"async": false,
"typeParameters": null,
"returnType": {
"type": "TsTypeAnnotation",
"span": {
"start": 87,
"end": 95,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 89,
"end": 95,
"ctxt": 0
},
"kind": "number"
}
}
}
}
]
}
},
{
"type": "TsExportAssignment",
"span": {
"start": 99,
"end": 111,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 108,
"end": 110,
"ctxt": 0
},
"value": "M1",
"optional": false
}
},
{
"type": "TsImportEqualsDeclaration",
"span": {
"start": 135,
"end": 167,
"ctxt": 0
},
"declare": false,
"isExport": false,
"isTypeOnly": false,
"id": {
"type": "Identifier",
"span": {
"start": 142,
"end": 146,
"ctxt": 0
},
"value": "foo1",
"optional": false
},
"moduleRef": {
"type": "TsExternalModuleReference",
"span": {
"start": 149,
"end": 166,
"ctxt": 0
},
"expression": {
"type": "StringLiteral",
"span": {
"start": 157,
"end": 165,
"ctxt": 0
},
"value": "./foo1",
"raw": "'./foo1'"
}
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 168,
"end": 193,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 172,
"end": 192,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 172,
"end": 173,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 173,
"end": 181,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 175,
"end": 181,
"ctxt": 0
},
"kind": "number"
}
}
},
"init": {
"type": "CallExpression",
"span": {
"start": 184,
"end": 192,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 184,
"end": 190,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 184,
"end": 188,
"ctxt": 0
},
"value": "foo1",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 189,
"end": 190,
"ctxt": 0
},
"value": "b",
"optional": false
}
},
"arguments": [],
"typeArguments": null
},
"definite": false
}
]
}
],
"interpreter": null
}