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

435 lines
11 KiB
JSON

{
"type": "Script",
"span": {
"start": 39,
"end": 260,
"ctxt": 0
},
"body": [
{
"type": "TsModuleDeclaration",
"span": {
"start": 39,
"end": 178,
"ctxt": 0
},
"declare": true,
"global": false,
"id": {
"type": "Identifier",
"span": {
"start": 54,
"end": 57,
"ctxt": 0
},
"value": "JSX",
"optional": false
},
"body": {
"type": "TsModuleBlock",
"span": {
"start": 58,
"end": 178,
"ctxt": 0
},
"body": [
{
"type": "TsInterfaceDeclaration",
"span": {
"start": 61,
"end": 82,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 71,
"end": 78,
"ctxt": 0
},
"value": "Element",
"optional": false
},
"declare": false,
"typeParams": null,
"extends": [],
"body": {
"type": "TsInterfaceBody",
"span": {
"start": 79,
"end": 82,
"ctxt": 0
},
"body": []
}
},
{
"type": "TsInterfaceDeclaration",
"span": {
"start": 84,
"end": 143,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 94,
"end": 119,
"ctxt": 0
},
"value": "ElementAttributesProperty",
"optional": false
},
"declare": false,
"typeParams": null,
"extends": [],
"body": {
"type": "TsInterfaceBody",
"span": {
"start": 120,
"end": 143,
"ctxt": 0
},
"body": [
{
"type": "TsPropertySignature",
"span": {
"start": 122,
"end": 131,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 122,
"end": 125,
"ctxt": 0
},
"value": "pr1",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 125,
"end": 130,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 127,
"end": 130,
"ctxt": 0
},
"kind": "any"
}
},
"typeParams": null
},
{
"type": "TsPropertySignature",
"span": {
"start": 132,
"end": 141,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 132,
"end": 135,
"ctxt": 0
},
"value": "pr2",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 135,
"end": 140,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 137,
"end": 140,
"ctxt": 0
},
"kind": "any"
}
},
"typeParams": null
}
]
}
},
{
"type": "TsInterfaceDeclaration",
"span": {
"start": 145,
"end": 176,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 155,
"end": 172,
"ctxt": 0
},
"value": "IntrinsicElements",
"optional": false
},
"declare": false,
"typeParams": null,
"extends": [],
"body": {
"type": "TsInterfaceBody",
"span": {
"start": 173,
"end": 176,
"ctxt": 0
},
"body": []
}
}
]
}
},
{
"type": "TsInterfaceDeclaration",
"span": {
"start": 180,
"end": 223,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 190,
"end": 198,
"ctxt": 0
},
"value": "Obj1type",
"optional": false
},
"declare": false,
"typeParams": null,
"extends": [],
"body": {
"type": "TsInterfaceBody",
"span": {
"start": 199,
"end": 223,
"ctxt": 0
},
"body": [
{
"type": "TsConstructSignatureDeclaration",
"span": {
"start": 202,
"end": 221,
"ctxt": 0
},
"params": [
{
"type": "Identifier",
"span": {
"start": 206,
"end": 215,
"ctxt": 0
},
"value": "n",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 207,
"end": 215,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 209,
"end": 215,
"ctxt": 0
},
"kind": "string"
}
}
}
],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 216,
"end": 220,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeLiteral",
"span": {
"start": 218,
"end": 220,
"ctxt": 0
},
"members": []
}
},
"typeParams": null
}
]
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 224,
"end": 243,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 228,
"end": 242,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 228,
"end": 232,
"ctxt": 0
},
"value": "Obj1",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 232,
"end": 242,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 234,
"end": 242,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 234,
"end": 242,
"ctxt": 0
},
"value": "Obj1type",
"optional": false
},
"typeParams": null
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 244,
"end": 260,
"ctxt": 0
},
"expression": {
"type": "JSXElement",
"span": {
"start": 244,
"end": 259,
"ctxt": 0
},
"opening": {
"type": "JSXOpeningElement",
"name": {
"type": "Identifier",
"span": {
"start": 245,
"end": 249,
"ctxt": 0
},
"value": "Obj1",
"optional": false
},
"span": {
"start": 244,
"end": 259,
"ctxt": 0
},
"attributes": [
{
"type": "JSXAttribute",
"span": {
"start": 250,
"end": 256,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 250,
"end": 251,
"ctxt": 0
},
"value": "x",
"optional": false
},
"value": {
"type": "JSXExpressionContainer",
"span": {
"start": 252,
"end": 256,
"ctxt": 0
},
"expression": {
"type": "NumericLiteral",
"span": {
"start": 253,
"end": 255,
"ctxt": 0
},
"value": 10.0
}
}
}
],
"selfClosing": true,
"typeArguments": null
},
"children": [],
"closing": null
}
}
],
"interpreter": null
}