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

736 lines
20 KiB
JSON

{
"type": "Module",
"span": {
"start": 131,
"end": 461,
"ctxt": 0
},
"body": [
{
"type": "TsImportEqualsDeclaration",
"span": {
"start": 131,
"end": 163,
"ctxt": 0
},
"declare": false,
"isExport": false,
"isTypeOnly": false,
"id": {
"type": "Identifier",
"span": {
"start": 138,
"end": 143,
"ctxt": 0
},
"value": "React",
"optional": false
},
"moduleRef": {
"type": "TsExternalModuleReference",
"span": {
"start": 146,
"end": 162,
"ctxt": 0
},
"expression": {
"type": "StringLiteral",
"span": {
"start": 154,
"end": 161,
"ctxt": 0
},
"value": "react",
"raw": "'react'"
}
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 165,
"end": 200,
"ctxt": 0
},
"kind": "const",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 171,
"end": 199,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 171,
"end": 174,
"ctxt": 0
},
"value": "Foo",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "ArrowFunctionExpression",
"span": {
"start": 177,
"end": 199,
"ctxt": 0
},
"params": [
{
"type": "Identifier",
"span": {
"start": 178,
"end": 188,
"ctxt": 0
},
"value": "props",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 183,
"end": 188,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 185,
"end": 188,
"ctxt": 0
},
"kind": "any"
}
}
}
],
"body": {
"type": "JSXElement",
"span": {
"start": 193,
"end": 199,
"ctxt": 0
},
"opening": {
"type": "JSXOpeningElement",
"name": {
"type": "Identifier",
"span": {
"start": 194,
"end": 197,
"ctxt": 0
},
"value": "div",
"optional": false
},
"span": {
"start": 193,
"end": 199,
"ctxt": 0
},
"attributes": [],
"selfClosing": true,
"typeArguments": null
},
"children": [],
"closing": null
},
"async": false,
"generator": false,
"typeParameters": null,
"returnType": null
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 217,
"end": 237,
"ctxt": 0
},
"kind": "const",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 223,
"end": 236,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 223,
"end": 226,
"ctxt": 0
},
"value": "foo",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "JSXElement",
"span": {
"start": 229,
"end": 236,
"ctxt": 0
},
"opening": {
"type": "JSXOpeningElement",
"name": {
"type": "Identifier",
"span": {
"start": 230,
"end": 233,
"ctxt": 0
},
"value": "Foo",
"optional": false
},
"span": {
"start": 229,
"end": 236,
"ctxt": 0
},
"attributes": [],
"selfClosing": true,
"typeArguments": null
},
"children": [],
"closing": null
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 256,
"end": 350,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 260,
"end": 349,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 260,
"end": 268,
"ctxt": 0
},
"value": "MainMenu",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 268,
"end": 298,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 270,
"end": 298,
"ctxt": 0
},
"typeName": {
"type": "TsQualifiedName",
"left": {
"type": "Identifier",
"span": {
"start": 270,
"end": 275,
"ctxt": 0
},
"value": "React",
"optional": false
},
"right": {
"type": "Identifier",
"span": {
"start": 276,
"end": 294,
"ctxt": 0
},
"value": "StatelessComponent",
"optional": false
}
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 294,
"end": 298,
"ctxt": 0
},
"params": [
{
"type": "TsTypeLiteral",
"span": {
"start": 295,
"end": 297,
"ctxt": 0
},
"members": []
}
]
}
}
}
},
"init": {
"type": "ArrowFunctionExpression",
"span": {
"start": 301,
"end": 349,
"ctxt": 0
},
"params": [
{
"type": "Identifier",
"span": {
"start": 302,
"end": 307,
"ctxt": 0
},
"value": "props",
"optional": false,
"typeAnnotation": null
}
],
"body": {
"type": "ParenthesisExpression",
"span": {
"start": 312,
"end": 349,
"ctxt": 0
},
"expression": {
"type": "JSXElement",
"span": {
"start": 313,
"end": 348,
"ctxt": 0
},
"opening": {
"type": "JSXOpeningElement",
"name": {
"type": "Identifier",
"span": {
"start": 314,
"end": 317,
"ctxt": 0
},
"value": "div",
"optional": false
},
"span": {
"start": 313,
"end": 318,
"ctxt": 0
},
"attributes": [],
"selfClosing": false,
"typeArguments": null
},
"children": [
{
"type": "JSXText",
"span": {
"start": 318,
"end": 323,
"ctxt": 0
},
"value": "\n\n ",
"raw": "\n\n "
},
{
"type": "JSXElement",
"span": {
"start": 323,
"end": 341,
"ctxt": 0
},
"opening": {
"type": "JSXOpeningElement",
"name": {
"type": "Identifier",
"span": {
"start": 324,
"end": 326,
"ctxt": 0
},
"value": "h3",
"optional": false
},
"span": {
"start": 323,
"end": 327,
"ctxt": 0
},
"attributes": [],
"selfClosing": false,
"typeArguments": null
},
"children": [
{
"type": "JSXText",
"span": {
"start": 327,
"end": 336,
"ctxt": 0
},
"value": "Main Menu",
"raw": "Main Menu"
}
],
"closing": {
"type": "JSXClosingElement",
"span": {
"start": 336,
"end": 341,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 338,
"end": 340,
"ctxt": 0
},
"value": "h3",
"optional": false
}
}
},
{
"type": "JSXText",
"span": {
"start": 341,
"end": 342,
"ctxt": 0
},
"value": "\n\n",
"raw": "\n\n"
}
],
"closing": {
"type": "JSXClosingElement",
"span": {
"start": 342,
"end": 348,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 344,
"end": 347,
"ctxt": 0
},
"value": "div",
"optional": false
}
}
}
},
"async": false,
"generator": false,
"typeParameters": null,
"returnType": null
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 352,
"end": 461,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 356,
"end": 460,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 356,
"end": 359,
"ctxt": 0
},
"value": "App",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 359,
"end": 399,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 361,
"end": 399,
"ctxt": 0
},
"typeName": {
"type": "TsQualifiedName",
"left": {
"type": "Identifier",
"span": {
"start": 361,
"end": 366,
"ctxt": 0
},
"value": "React",
"optional": false
},
"right": {
"type": "Identifier",
"span": {
"start": 367,
"end": 385,
"ctxt": 0
},
"value": "StatelessComponent",
"optional": false
}
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 385,
"end": 399,
"ctxt": 0
},
"params": [
{
"type": "TsTypeLiteral",
"span": {
"start": 386,
"end": 398,
"ctxt": 0
},
"members": [
{
"type": "TsPropertySignature",
"span": {
"start": 388,
"end": 396,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 388,
"end": 396,
"ctxt": 0
},
"value": "children",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": null,
"typeParams": null
}
]
}
]
}
}
}
},
"init": {
"type": "ArrowFunctionExpression",
"span": {
"start": 402,
"end": 460,
"ctxt": 0
},
"params": [
{
"type": "ObjectPattern",
"span": {
"start": 403,
"end": 413,
"ctxt": 0
},
"properties": [
{
"type": "AssignmentPatternProperty",
"span": {
"start": 404,
"end": 412,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 404,
"end": 412,
"ctxt": 0
},
"value": "children",
"optional": false
},
"value": null
}
],
"optional": false,
"typeAnnotation": null
}
],
"body": {
"type": "ParenthesisExpression",
"span": {
"start": 418,
"end": 460,
"ctxt": 0
},
"expression": {
"type": "JSXElement",
"span": {
"start": 424,
"end": 458,
"ctxt": 0
},
"opening": {
"type": "JSXOpeningElement",
"name": {
"type": "Identifier",
"span": {
"start": 425,
"end": 428,
"ctxt": 0
},
"value": "div",
"optional": false
},
"span": {
"start": 424,
"end": 430,
"ctxt": 0
},
"attributes": [],
"selfClosing": false,
"typeArguments": null
},
"children": [
{
"type": "JSXText",
"span": {
"start": 430,
"end": 439,
"ctxt": 0
},
"value": "\n\n ",
"raw": "\n\n "
},
{
"type": "JSXElement",
"span": {
"start": 439,
"end": 450,
"ctxt": 0
},
"opening": {
"type": "JSXOpeningElement",
"name": {
"type": "Identifier",
"span": {
"start": 440,
"end": 448,
"ctxt": 0
},
"value": "MainMenu",
"optional": false
},
"span": {
"start": 439,
"end": 450,
"ctxt": 0
},
"attributes": [],
"selfClosing": true,
"typeArguments": null
},
"children": [],
"closing": null
},
{
"type": "JSXText",
"span": {
"start": 450,
"end": 452,
"ctxt": 0
},
"value": "\n\n\t",
"raw": "\n\n\t"
}
],
"closing": {
"type": "JSXClosingElement",
"span": {
"start": 452,
"end": 458,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 454,
"end": 457,
"ctxt": 0
},
"value": "div",
"optional": false
}
}
}
},
"async": false,
"generator": false,
"typeParameters": null,
"returnType": null
},
"definite": false
}
]
}
],
"interpreter": null
}