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

341 lines
7.8 KiB
JSON

{
"type": "Module",
"span": {
"start": 47,
"end": 271,
"ctxt": 0
},
"body": [
{
"type": "ExportDeclaration",
"span": {
"start": 47,
"end": 73,
"ctxt": 0
},
"declaration": {
"type": "VariableDeclaration",
"span": {
"start": 54,
"end": 73,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 58,
"end": 72,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 58,
"end": 59,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 59,
"end": 67,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 61,
"end": 67,
"ctxt": 0
},
"kind": "number"
}
}
},
"init": {
"type": "NumericLiteral",
"span": {
"start": 70,
"end": 72,
"ctxt": 0
},
"value": 42.0,
"raw": "42"
},
"definite": false
}
]
}
},
{
"type": "ExportDeclaration",
"span": {
"start": 98,
"end": 124,
"ctxt": 0
},
"declaration": {
"type": "VariableDeclaration",
"span": {
"start": 105,
"end": 124,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 109,
"end": 123,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 109,
"end": 110,
"ctxt": 0
},
"value": "y",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 110,
"end": 118,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 112,
"end": 118,
"ctxt": 0
},
"kind": "number"
}
}
},
"init": {
"type": "NumericLiteral",
"span": {
"start": 121,
"end": 123,
"ctxt": 0
},
"value": 42.0,
"raw": "42"
},
"definite": false
}
]
}
},
{
"type": "TsImportEqualsDeclaration",
"span": {
"start": 150,
"end": 182,
"ctxt": 0
},
"declare": false,
"isExport": false,
"isTypeOnly": false,
"id": {
"type": "Identifier",
"span": {
"start": 157,
"end": 160,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"moduleRef": {
"type": "TsExternalModuleReference",
"span": {
"start": 163,
"end": 181,
"ctxt": 0
},
"expression": {
"type": "StringLiteral",
"span": {
"start": 171,
"end": 180,
"ctxt": 0
},
"value": "./foo_0",
"raw": "\"./foo_0\""
}
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 183,
"end": 203,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 187,
"end": 202,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 187,
"end": 189,
"ctxt": 0
},
"value": "z1",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "BinaryExpression",
"span": {
"start": 192,
"end": 202,
"ctxt": 0
},
"operator": "+",
"left": {
"type": "MemberExpression",
"span": {
"start": 192,
"end": 197,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 192,
"end": 195,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 196,
"end": 197,
"ctxt": 0
},
"value": "x",
"optional": false
}
},
"right": {
"type": "NumericLiteral",
"span": {
"start": 200,
"end": 202,
"ctxt": 0
},
"value": 10.0,
"raw": "10"
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 251,
"end": 271,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 255,
"end": 270,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 255,
"end": 257,
"ctxt": 0
},
"value": "z2",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "BinaryExpression",
"span": {
"start": 260,
"end": 270,
"ctxt": 0
},
"operator": "+",
"left": {
"type": "MemberExpression",
"span": {
"start": 260,
"end": 265,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 260,
"end": 263,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 264,
"end": 265,
"ctxt": 0
},
"value": "y",
"optional": false
}
},
"right": {
"type": "NumericLiteral",
"span": {
"start": 268,
"end": 270,
"ctxt": 0
},
"value": 10.0,
"raw": "10"
}
},
"definite": false
}
]
}
],
"interpreter": null
}