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

599 lines
15 KiB
JSON

{
"type": "Module",
"span": {
"start": 115,
"end": 568,
"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": 386,
"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": 386,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 282,
"end": 386,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 288,
"end": 384,
"ctxt": 0
},
"argument": {
"type": "ParenthesisExpression",
"span": {
"start": 295,
"end": 383,
"ctxt": 0
},
"expression": {
"type": "JSXElement",
"span": {
"start": 337,
"end": 377,
"ctxt": 0
},
"opening": {
"type": "JSXOpeningElement",
"name": {
"type": "Identifier",
"span": {
"start": 338,
"end": 354,
"ctxt": 0
},
"value": "AnotherComponent",
"optional": false
},
"span": {
"start": 337,
"end": 377,
"ctxt": 0
},
"attributes": [
{
"type": "SpreadElement",
"spread": {
"start": 356,
"end": 359,
"ctxt": 0
},
"arguments": {
"type": "Identifier",
"span": {
"start": 359,
"end": 364,
"ctxt": 0
},
"value": "props",
"optional": false
}
},
{
"type": "JSXAttribute",
"span": {
"start": 366,
"end": 375,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 366,
"end": 375,
"ctxt": 0
},
"value": "Property1",
"optional": false
},
"value": null
}
],
"selfClosing": true,
"typeArguments": null
},
"children": [],
"closing": null
}
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
}
},
{
"type": "TsInterfaceDeclaration",
"span": {
"start": 388,
"end": 446,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 398,
"end": 419,
"ctxt": 0
},
"value": "AnotherComponentProps",
"optional": false
},
"declare": false,
"typeParams": null,
"extends": [],
"body": {
"type": "TsInterfaceBody",
"span": {
"start": 420,
"end": 446,
"ctxt": 0
},
"body": [
{
"type": "TsPropertySignature",
"span": {
"start": 426,
"end": 444,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 426,
"end": 435,
"ctxt": 0
},
"value": "property1",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 435,
"end": 443,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 437,
"end": 443,
"ctxt": 0
},
"kind": "string"
}
},
"typeParams": null
}
]
}
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 457,
"end": 473,
"ctxt": 0
},
"value": "AnotherComponent",
"optional": false
},
"declare": false,
"params": [
{
"type": "Parameter",
"span": {
"start": 474,
"end": 510,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "ObjectPattern",
"span": {
"start": 474,
"end": 510,
"ctxt": 0
},
"properties": [
{
"type": "AssignmentPatternProperty",
"span": {
"start": 476,
"end": 485,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 476,
"end": 485,
"ctxt": 0
},
"value": "property1",
"optional": false
},
"value": null
}
],
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 487,
"end": 510,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 489,
"end": 510,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 489,
"end": 510,
"ctxt": 0
},
"value": "AnotherComponentProps",
"optional": false
},
"typeParams": null
}
}
}
}
],
"decorators": [],
"span": {
"start": 448,
"end": 568,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 512,
"end": 568,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 518,
"end": 566,
"ctxt": 0
},
"argument": {
"type": "ParenthesisExpression",
"span": {
"start": 525,
"end": 565,
"ctxt": 0
},
"expression": {
"type": "JSXElement",
"span": {
"start": 535,
"end": 559,
"ctxt": 0
},
"opening": {
"type": "JSXOpeningElement",
"name": {
"type": "Identifier",
"span": {
"start": 536,
"end": 540,
"ctxt": 0
},
"value": "span",
"optional": false
},
"span": {
"start": 535,
"end": 541,
"ctxt": 0
},
"attributes": [],
"selfClosing": false,
"typeArguments": null
},
"children": [
{
"type": "JSXExpressionContainer",
"span": {
"start": 541,
"end": 552,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 542,
"end": 551,
"ctxt": 0
},
"value": "property1",
"optional": false
}
}
],
"closing": {
"type": "JSXClosingElement",
"span": {
"start": 552,
"end": 559,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 554,
"end": 558,
"ctxt": 0
},
"value": "span",
"optional": false
}
}
}
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
}
],
"interpreter": null
}