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

664 lines
16 KiB
JSON

{
"type": "Module",
"span": {
"start": 72,
"end": 591,
"ctxt": 0
},
"body": [
{
"type": "TsModuleDeclaration",
"span": {
"start": 72,
"end": 124,
"ctxt": 0
},
"declare": true,
"global": false,
"id": {
"type": "StringLiteral",
"span": {
"start": 87,
"end": 94,
"ctxt": 0
},
"value": "react",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
},
"body": {
"type": "TsModuleBlock",
"span": {
"start": 95,
"end": 124,
"ctxt": 0
},
"body": [
{
"type": "VariableDeclaration",
"span": {
"start": 98,
"end": 109,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 102,
"end": 108,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 102,
"end": 103,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 103,
"end": 108,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 105,
"end": 108,
"ctxt": 0
},
"kind": "any"
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "TsExportAssignment",
"span": {
"start": 111,
"end": 122,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 120,
"end": 121,
"ctxt": 0
},
"value": "x",
"optional": false
}
}
]
}
},
{
"type": "TsModuleDeclaration",
"span": {
"start": 126,
"end": 194,
"ctxt": 0
},
"declare": true,
"global": false,
"id": {
"type": "Identifier",
"span": {
"start": 141,
"end": 152,
"ctxt": 0
},
"value": "ReactRouter",
"optional": false
},
"body": {
"type": "TsModuleBlock",
"span": {
"start": 153,
"end": 194,
"ctxt": 0
},
"body": [
{
"type": "VariableDeclaration",
"span": {
"start": 156,
"end": 171,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 160,
"end": 170,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 160,
"end": 165,
"ctxt": 0
},
"value": "Route",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 165,
"end": 170,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 167,
"end": 170,
"ctxt": 0
},
"kind": "any"
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "TsInterfaceDeclaration",
"span": {
"start": 173,
"end": 192,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 183,
"end": 188,
"ctxt": 0
},
"value": "Thing",
"optional": false
},
"declare": false,
"typeParams": null,
"extends": [],
"body": {
"type": "TsInterfaceBody",
"span": {
"start": 189,
"end": 192,
"ctxt": 0
},
"body": []
}
}
]
}
},
{
"type": "TsModuleDeclaration",
"span": {
"start": 195,
"end": 251,
"ctxt": 0
},
"declare": true,
"global": false,
"id": {
"type": "StringLiteral",
"span": {
"start": 210,
"end": 224,
"ctxt": 0
},
"value": "react-router",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
},
"body": {
"type": "TsModuleBlock",
"span": {
"start": 225,
"end": 251,
"ctxt": 0
},
"body": [
{
"type": "TsExportAssignment",
"span": {
"start": 228,
"end": 249,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 237,
"end": 248,
"ctxt": 0
},
"value": "ReactRouter",
"optional": false
}
}
]
}
},
{
"type": "TsImportEqualsDeclaration",
"span": {
"start": 332,
"end": 364,
"ctxt": 0
},
"declare": false,
"isExport": false,
"isTypeOnly": false,
"id": {
"type": "Identifier",
"span": {
"start": 339,
"end": 344,
"ctxt": 0
},
"value": "React",
"optional": false
},
"moduleRef": {
"type": "TsExternalModuleReference",
"span": {
"start": 347,
"end": 363,
"ctxt": 0
},
"expression": {
"type": "StringLiteral",
"span": {
"start": 355,
"end": 362,
"ctxt": 0
},
"value": "react",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
}
}
},
{
"type": "TsImportEqualsDeclaration",
"span": {
"start": 365,
"end": 410,
"ctxt": 0
},
"declare": false,
"isExport": false,
"isTypeOnly": false,
"id": {
"type": "Identifier",
"span": {
"start": 372,
"end": 383,
"ctxt": 0
},
"value": "ReactRouter",
"optional": false
},
"moduleRef": {
"type": "TsExternalModuleReference",
"span": {
"start": 386,
"end": 409,
"ctxt": 0
},
"expression": {
"type": "StringLiteral",
"span": {
"start": 394,
"end": 408,
"ctxt": 0
},
"value": "react-router",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
}
}
},
{
"type": "TsImportEqualsDeclaration",
"span": {
"start": 412,
"end": 445,
"ctxt": 0
},
"declare": false,
"isExport": false,
"isTypeOnly": false,
"id": {
"type": "Identifier",
"span": {
"start": 419,
"end": 424,
"ctxt": 0
},
"value": "Route",
"optional": false
},
"moduleRef": {
"type": "TsQualifiedName",
"left": {
"type": "Identifier",
"span": {
"start": 427,
"end": 438,
"ctxt": 0
},
"value": "ReactRouter",
"optional": false
},
"right": {
"type": "Identifier",
"span": {
"start": 439,
"end": 444,
"ctxt": 0
},
"value": "Route",
"optional": false
}
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 447,
"end": 471,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 451,
"end": 470,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 451,
"end": 458,
"ctxt": 0
},
"value": "routes1",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "JSXElement",
"span": {
"start": 461,
"end": 470,
"ctxt": 0
},
"opening": {
"type": "JSXOpeningElement",
"name": {
"type": "Identifier",
"span": {
"start": 462,
"end": 467,
"ctxt": 0
},
"value": "Route",
"optional": false
},
"span": {
"start": 461,
"end": 470,
"ctxt": 0
},
"attributes": [],
"selfClosing": true,
"typeArguments": null
},
"children": [],
"closing": null
},
"definite": false
}
]
},
{
"type": "TsModuleDeclaration",
"span": {
"start": 473,
"end": 505,
"ctxt": 0
},
"declare": false,
"global": false,
"id": {
"type": "Identifier",
"span": {
"start": 480,
"end": 481,
"ctxt": 0
},
"value": "M",
"optional": false
},
"body": {
"type": "TsModuleBlock",
"span": {
"start": 482,
"end": 505,
"ctxt": 0
},
"body": [
{
"type": "ExportDeclaration",
"span": {
"start": 485,
"end": 503,
"ctxt": 0
},
"declaration": {
"type": "VariableDeclaration",
"span": {
"start": 492,
"end": 503,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 496,
"end": 502,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 496,
"end": 497,
"ctxt": 0
},
"value": "X",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 497,
"end": 502,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 499,
"end": 502,
"ctxt": 0
},
"kind": "any"
}
}
},
"init": null,
"definite": false
}
]
}
}
]
}
},
{
"type": "TsModuleDeclaration",
"span": {
"start": 506,
"end": 591,
"ctxt": 0
},
"declare": false,
"global": false,
"id": {
"type": "Identifier",
"span": {
"start": 513,
"end": 514,
"ctxt": 0
},
"value": "M",
"optional": false
},
"body": {
"type": "TsModuleBlock",
"span": {
"start": 515,
"end": 591,
"ctxt": 0
},
"body": [
{
"type": "VariableDeclaration",
"span": {
"start": 573,
"end": 589,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 577,
"end": 588,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 577,
"end": 578,
"ctxt": 0
},
"value": "y",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "JSXElement",
"span": {
"start": 581,
"end": 588,
"ctxt": 0
},
"opening": {
"type": "JSXOpeningElement",
"name": {
"type": "Identifier",
"span": {
"start": 582,
"end": 583,
"ctxt": 0
},
"value": "X",
"optional": false
},
"span": {
"start": 581,
"end": 584,
"ctxt": 0
},
"attributes": [],
"selfClosing": false,
"typeArguments": null
},
"children": [],
"closing": {
"type": "JSXClosingElement",
"span": {
"start": 584,
"end": 588,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 586,
"end": 587,
"ctxt": 0
},
"value": "X",
"optional": false
}
}
},
"definite": false
}
]
}
]
}
}
],
"interpreter": null
}