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

713 lines
18 KiB
JSON

{
"type": "Module",
"span": {
"start": 115,
"end": 612,
"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",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
}
}
},
{
"type": "TsInterfaceDeclaration",
"span": {
"start": 149,
"end": 223,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 159,
"end": 173,
"ctxt": 0
},
"value": "ComponentProps",
"optional": false
},
"declare": false,
"typeParams": null,
"extends": [],
"body": {
"type": "TsInterfaceBody",
"span": {
"start": 174,
"end": 223,
"ctxt": 0
},
"body": [
{
"type": "TsPropertySignature",
"span": {
"start": 180,
"end": 198,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 180,
"end": 189,
"ctxt": 0
},
"value": "property1",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 189,
"end": 197,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 191,
"end": 197,
"ctxt": 0
},
"kind": "string"
}
},
"typeParams": null
},
{
"type": "TsPropertySignature",
"span": {
"start": 203,
"end": 221,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 203,
"end": 212,
"ctxt": 0
},
"value": "property2",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 212,
"end": 220,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 214,
"end": 220,
"ctxt": 0
},
"kind": "number"
}
},
"typeParams": null
}
]
}
},
{
"type": "ExportDefaultDeclaration",
"span": {
"start": 225,
"end": 376,
"ctxt": 0
},
"decl": {
"type": "FunctionExpression",
"identifier": {
"type": "Identifier",
"span": {
"start": 249,
"end": 258,
"ctxt": 0
},
"value": "Component",
"optional": false
},
"params": [
{
"type": "Parameter",
"span": {
"start": 259,
"end": 280,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 259,
"end": 280,
"ctxt": 0
},
"value": "props",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 264,
"end": 280,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 266,
"end": 280,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 266,
"end": 280,
"ctxt": 0
},
"value": "ComponentProps",
"optional": false
},
"typeParams": null
}
}
}
}
],
"decorators": [],
"span": {
"start": 240,
"end": 376,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 282,
"end": 376,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 288,
"end": 374,
"ctxt": 0
},
"argument": {
"type": "ParenthesisExpression",
"span": {
"start": 295,
"end": 373,
"ctxt": 0
},
"expression": {
"type": "JSXElement",
"span": {
"start": 305,
"end": 367,
"ctxt": 0
},
"opening": {
"type": "JSXOpeningElement",
"name": {
"type": "Identifier",
"span": {
"start": 306,
"end": 322,
"ctxt": 0
},
"value": "AnotherComponent",
"optional": false
},
"span": {
"start": 305,
"end": 367,
"ctxt": 0
},
"attributes": [
{
"type": "SpreadElement",
"spread": {
"start": 324,
"end": 327,
"ctxt": 0
},
"arguments": {
"type": "Identifier",
"span": {
"start": 327,
"end": 332,
"ctxt": 0
},
"value": "props",
"optional": false
}
},
{
"type": "JSXAttribute",
"span": {
"start": 334,
"end": 343,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 334,
"end": 343,
"ctxt": 0
},
"value": "property2",
"optional": false
},
"value": null
},
{
"type": "JSXAttribute",
"span": {
"start": 344,
"end": 365,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 344,
"end": 360,
"ctxt": 0
},
"value": "AnotherProperty1",
"optional": false
},
"value": {
"type": "StringLiteral",
"span": {
"start": 361,
"end": 365,
"ctxt": 0
},
"value": "hi",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
}
}
],
"selfClosing": true,
"typeArguments": null
},
"children": [],
"closing": null
}
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
}
},
{
"type": "TsInterfaceDeclaration",
"span": {
"start": 378,
"end": 490,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 388,
"end": 409,
"ctxt": 0
},
"value": "AnotherComponentProps",
"optional": false
},
"declare": false,
"typeParams": null,
"extends": [],
"body": {
"type": "TsInterfaceBody",
"span": {
"start": 410,
"end": 490,
"ctxt": 0
},
"body": [
{
"type": "TsPropertySignature",
"span": {
"start": 416,
"end": 434,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 416,
"end": 425,
"ctxt": 0
},
"value": "property1",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 425,
"end": 433,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 427,
"end": 433,
"ctxt": 0
},
"kind": "string"
}
},
"typeParams": null
},
{
"type": "TsPropertySignature",
"span": {
"start": 439,
"end": 464,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 439,
"end": 455,
"ctxt": 0
},
"value": "AnotherProperty1",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 455,
"end": 463,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 457,
"end": 463,
"ctxt": 0
},
"kind": "string"
}
},
"typeParams": null
},
{
"type": "TsPropertySignature",
"span": {
"start": 469,
"end": 488,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 469,
"end": 478,
"ctxt": 0
},
"value": "property2",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 478,
"end": 487,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 480,
"end": 487,
"ctxt": 0
},
"kind": "boolean"
}
},
"typeParams": null
}
]
}
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 501,
"end": 517,
"ctxt": 0
},
"value": "AnotherComponent",
"optional": false
},
"declare": false,
"params": [
{
"type": "Parameter",
"span": {
"start": 518,
"end": 554,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "ObjectPattern",
"span": {
"start": 518,
"end": 554,
"ctxt": 0
},
"properties": [
{
"type": "AssignmentPatternProperty",
"span": {
"start": 520,
"end": 529,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 520,
"end": 529,
"ctxt": 0
},
"value": "property1",
"optional": false
},
"value": null
}
],
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 531,
"end": 554,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 533,
"end": 554,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 533,
"end": 554,
"ctxt": 0
},
"value": "AnotherComponentProps",
"optional": false
},
"typeParams": null
}
}
}
}
],
"decorators": [],
"span": {
"start": 492,
"end": 612,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 556,
"end": 612,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 562,
"end": 610,
"ctxt": 0
},
"argument": {
"type": "ParenthesisExpression",
"span": {
"start": 569,
"end": 609,
"ctxt": 0
},
"expression": {
"type": "JSXElement",
"span": {
"start": 579,
"end": 603,
"ctxt": 0
},
"opening": {
"type": "JSXOpeningElement",
"name": {
"type": "Identifier",
"span": {
"start": 580,
"end": 584,
"ctxt": 0
},
"value": "span",
"optional": false
},
"span": {
"start": 579,
"end": 585,
"ctxt": 0
},
"attributes": [],
"selfClosing": false,
"typeArguments": null
},
"children": [
{
"type": "JSXExpressionContainer",
"span": {
"start": 585,
"end": 596,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 586,
"end": 595,
"ctxt": 0
},
"value": "property1",
"optional": false
}
}
],
"closing": {
"type": "JSXClosingElement",
"span": {
"start": 596,
"end": 603,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 598,
"end": 602,
"ctxt": 0
},
"value": "span",
"optional": false
}
}
}
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
}
],
"interpreter": null
}