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

441 lines
11 KiB
JSON

{
"type": "Module",
"span": {
"start": 57,
"end": 382,
"ctxt": 0
},
"body": [
{
"type": "TsModuleDeclaration",
"span": {
"start": 57,
"end": 156,
"ctxt": 0
},
"declare": true,
"global": false,
"id": {
"type": "Identifier",
"span": {
"start": 72,
"end": 75,
"ctxt": 0
},
"value": "JSX",
"optional": false
},
"body": {
"type": "TsModuleBlock",
"span": {
"start": 76,
"end": 156,
"ctxt": 0
},
"body": [
{
"type": "TsInterfaceDeclaration",
"span": {
"start": 79,
"end": 100,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 89,
"end": 96,
"ctxt": 0
},
"value": "Element",
"optional": false
},
"declare": false,
"typeParams": null,
"extends": [],
"body": {
"type": "TsInterfaceBody",
"span": {
"start": 97,
"end": 100,
"ctxt": 0
},
"body": []
}
},
{
"type": "TsInterfaceDeclaration",
"span": {
"start": 102,
"end": 154,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 112,
"end": 129,
"ctxt": 0
},
"value": "IntrinsicElements",
"optional": false
},
"declare": false,
"typeParams": null,
"extends": [],
"body": {
"type": "TsInterfaceBody",
"span": {
"start": 130,
"end": 154,
"ctxt": 0
},
"body": [
{
"type": "TsIndexSignature",
"params": [
{
"type": "Identifier",
"span": {
"start": 135,
"end": 144,
"ctxt": 0
},
"value": "s",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 136,
"end": 144,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 138,
"end": 144,
"ctxt": 0
},
"kind": "string"
}
}
}
],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 145,
"end": 150,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 147,
"end": 150,
"ctxt": 0
},
"kind": "any"
}
},
"readonly": false,
"static": false,
"span": {
"start": 134,
"end": 151,
"ctxt": 0
}
}
]
}
}
]
}
},
{
"type": "ExportDeclaration",
"span": {
"start": 181,
"end": 198,
"ctxt": 0
},
"declaration": {
"type": "VariableDeclaration",
"span": {
"start": 188,
"end": 198,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 192,
"end": 197,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 192,
"end": 197,
"ctxt": 0
},
"value": "React",
"optional": false,
"typeAnnotation": null
},
"init": null,
"definite": false
}
]
}
},
{
"type": "ImportDeclaration",
"span": {
"start": 232,
"end": 261,
"ctxt": 0
},
"specifiers": [
{
"type": "ImportSpecifier",
"span": {
"start": 240,
"end": 245,
"ctxt": 0
},
"local": {
"type": "Identifier",
"span": {
"start": 240,
"end": 245,
"ctxt": 0
},
"value": "React",
"optional": false
},
"imported": null,
"isTypeOnly": false
}
],
"source": {
"type": "StringLiteral",
"span": {
"start": 252,
"end": 260,
"ctxt": 0
},
"value": "./test",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
},
"typeOnly": false,
"asserts": null
},
{
"type": "VariableDeclaration",
"span": {
"start": 327,
"end": 340,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 331,
"end": 339,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 331,
"end": 334,
"ctxt": 0
},
"value": "foo",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 334,
"end": 339,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 336,
"end": 339,
"ctxt": 0
},
"kind": "any"
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 341,
"end": 382,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 345,
"end": 381,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 345,
"end": 352,
"ctxt": 0
},
"value": "spread1",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "JSXElement",
"span": {
"start": 355,
"end": 381,
"ctxt": 0
},
"opening": {
"type": "JSXOpeningElement",
"name": {
"type": "Identifier",
"span": {
"start": 356,
"end": 359,
"ctxt": 0
},
"value": "div",
"optional": false
},
"span": {
"start": 355,
"end": 381,
"ctxt": 0
},
"attributes": [
{
"type": "JSXAttribute",
"span": {
"start": 360,
"end": 364,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 360,
"end": 361,
"ctxt": 0
},
"value": "x",
"optional": false
},
"value": {
"type": "StringLiteral",
"span": {
"start": 362,
"end": 364,
"ctxt": 0
},
"value": "",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
}
},
{
"type": "SpreadElement",
"spread": {
"start": 366,
"end": 369,
"ctxt": 0
},
"arguments": {
"type": "Identifier",
"span": {
"start": 369,
"end": 372,
"ctxt": 0
},
"value": "foo",
"optional": false
}
},
{
"type": "JSXAttribute",
"span": {
"start": 374,
"end": 378,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 374,
"end": 375,
"ctxt": 0
},
"value": "y",
"optional": false
},
"value": {
"type": "StringLiteral",
"span": {
"start": 376,
"end": 378,
"ctxt": 0
},
"value": "",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
}
}
],
"selfClosing": true,
"typeArguments": null
},
"children": [],
"closing": null
},
"definite": false
}
]
}
],
"interpreter": null
}