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

680 lines
18 KiB
JSON

{
"type": "Module",
"span": {
"start": 115,
"end": 490,
"ctxt": 0
},
"body": [
{
"type": "TsImportEqualsDeclaration",
"span": {
"start": 115,
"end": 147,
"ctxt": 0
},
"declare": false,
"isExport": false,
"isTypeOnly": false,
"id": {
"type": "Identifier",
"span": {
"start": 122,
"end": 127,
"ctxt": 0
},
"value": "React",
"optional": false
},
"moduleRef": {
"type": "TsExternalModuleReference",
"span": {
"start": 130,
"end": 146,
"ctxt": 0
},
"expression": {
"type": "StringLiteral",
"span": {
"start": 138,
"end": 145,
"ctxt": 0
},
"value": "react",
"raw": "'react'"
}
}
},
{
"type": "TsTypeAliasDeclaration",
"span": {
"start": 149,
"end": 257,
"ctxt": 0
},
"declare": false,
"id": {
"type": "Identifier",
"span": {
"start": 154,
"end": 163,
"ctxt": 0
},
"value": "TextProps",
"optional": false
},
"typeParams": null,
"typeAnnotation": {
"type": "TsUnionType",
"span": {
"start": 166,
"end": 256,
"ctxt": 0
},
"types": [
{
"type": "TsTypeLiteral",
"span": {
"start": 166,
"end": 185,
"ctxt": 0
},
"members": [
{
"type": "TsPropertySignature",
"span": {
"start": 168,
"end": 183,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 168,
"end": 176,
"ctxt": 0
},
"value": "editable",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 176,
"end": 183,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsLiteralType",
"span": {
"start": 178,
"end": 183,
"ctxt": 0
},
"literal": {
"type": "BooleanLiteral",
"span": {
"start": 178,
"end": 183,
"ctxt": 0
},
"value": false
}
}
},
"typeParams": null
}
]
},
{
"type": "TsTypeLiteral",
"span": {
"start": 203,
"end": 256,
"ctxt": 0
},
"members": [
{
"type": "TsPropertySignature",
"span": {
"start": 205,
"end": 220,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 205,
"end": 213,
"ctxt": 0
},
"value": "editable",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 213,
"end": 219,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsLiteralType",
"span": {
"start": 215,
"end": 219,
"ctxt": 0
},
"literal": {
"type": "BooleanLiteral",
"span": {
"start": 215,
"end": 219,
"ctxt": 0
},
"value": true
}
}
},
"typeParams": null
},
{
"type": "TsPropertySignature",
"span": {
"start": 221,
"end": 254,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 221,
"end": 227,
"ctxt": 0
},
"value": "onEdit",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 227,
"end": 254,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsFunctionType",
"span": {
"start": 229,
"end": 254,
"ctxt": 0
},
"params": [
{
"type": "Identifier",
"span": {
"start": 230,
"end": 245,
"ctxt": 0
},
"value": "newText",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 237,
"end": 245,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 239,
"end": 245,
"ctxt": 0
},
"kind": "string"
}
}
}
],
"typeParams": null,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 247,
"end": 254,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 250,
"end": 254,
"ctxt": 0
},
"kind": "void"
}
}
}
},
"typeParams": null
}
]
}
]
}
},
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 265,
"end": 278,
"ctxt": 0
},
"value": "TextComponent",
"optional": false
},
"declare": false,
"span": {
"start": 259,
"end": 383,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassMethod",
"span": {
"start": 324,
"end": 381,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 324,
"end": 330,
"ctxt": 0
},
"value": "render",
"optional": false
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 324,
"end": 381,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 333,
"end": 381,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 343,
"end": 375,
"ctxt": 0
},
"argument": {
"type": "JSXElement",
"span": {
"start": 350,
"end": 374,
"ctxt": 0
},
"opening": {
"type": "JSXOpeningElement",
"name": {
"type": "Identifier",
"span": {
"start": 351,
"end": 355,
"ctxt": 0
},
"value": "span",
"optional": false
},
"span": {
"start": 350,
"end": 356,
"ctxt": 0
},
"attributes": [],
"selfClosing": false,
"typeArguments": null
},
"children": [
{
"type": "JSXText",
"span": {
"start": 356,
"end": 367,
"ctxt": 0
},
"value": "Some Text..",
"raw": "Some Text.."
}
],
"closing": {
"type": "JSXClosingElement",
"span": {
"start": 367,
"end": 374,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 369,
"end": 373,
"ctxt": 0
},
"value": "span",
"optional": false
}
}
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
"kind": "method",
"isStatic": false,
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false
}
],
"superClass": {
"type": "MemberExpression",
"span": {
"start": 287,
"end": 302,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 287,
"end": 292,
"ctxt": 0
},
"value": "React",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 293,
"end": 302,
"ctxt": 0
},
"value": "Component",
"optional": false
}
},
"isAbstract": false,
"typeParams": null,
"superTypeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 302,
"end": 317,
"ctxt": 0
},
"params": [
{
"type": "TsTypeReference",
"span": {
"start": 303,
"end": 312,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 303,
"end": 312,
"ctxt": 0
},
"value": "TextProps",
"optional": false
},
"typeParams": null
},
{
"type": "TsTypeLiteral",
"span": {
"start": 314,
"end": 316,
"ctxt": 0
},
"members": []
}
]
},
"implements": []
},
{
"type": "VariableDeclaration",
"span": {
"start": 394,
"end": 435,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 398,
"end": 435,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 398,
"end": 399,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "JSXElement",
"span": {
"start": 402,
"end": 435,
"ctxt": 0
},
"opening": {
"type": "JSXOpeningElement",
"name": {
"type": "Identifier",
"span": {
"start": 403,
"end": 416,
"ctxt": 0
},
"value": "TextComponent",
"optional": false
},
"span": {
"start": 402,
"end": 435,
"ctxt": 0
},
"attributes": [
{
"type": "JSXAttribute",
"span": {
"start": 417,
"end": 432,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 417,
"end": 425,
"ctxt": 0
},
"value": "editable",
"optional": false
},
"value": {
"type": "JSXExpressionContainer",
"span": {
"start": 426,
"end": 432,
"ctxt": 0
},
"expression": {
"type": "BooleanLiteral",
"span": {
"start": 427,
"end": 431,
"ctxt": 0
},
"value": true
}
}
}
],
"selfClosing": true,
"typeArguments": null
},
"children": [],
"closing": null
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 437,
"end": 490,
"ctxt": 0
},
"kind": "const",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 443,
"end": 489,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 443,
"end": 452,
"ctxt": 0
},
"value": "textProps",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 452,
"end": 463,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 454,
"end": 463,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 454,
"end": 463,
"ctxt": 0
},
"value": "TextProps",
"optional": false
},
"typeParams": null
}
}
},
"init": {
"type": "ObjectExpression",
"span": {
"start": 466,
"end": 489,
"ctxt": 0
},
"properties": [
{
"type": "KeyValueProperty",
"key": {
"type": "Identifier",
"span": {
"start": 472,
"end": 480,
"ctxt": 0
},
"value": "editable",
"optional": false
},
"value": {
"type": "BooleanLiteral",
"span": {
"start": 482,
"end": 487,
"ctxt": 0
},
"value": false
}
}
]
},
"definite": false
}
]
}
],
"interpreter": null
}