mirror of
https://github.com/swc-project/swc.git
synced 2024-11-24 10:12:42 +03:00
658 lines
17 KiB
JSON
658 lines
17 KiB
JSON
{
|
|
"type": "Module",
|
|
"span": {
|
|
"start": 115,
|
|
"end": 616,
|
|
"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": "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": 380,
|
|
"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": 380,
|
|
"ctxt": 0
|
|
},
|
|
"body": {
|
|
"type": "BlockStatement",
|
|
"span": {
|
|
"start": 282,
|
|
"end": 380,
|
|
"ctxt": 0
|
|
},
|
|
"stmts": [
|
|
{
|
|
"type": "ReturnStatement",
|
|
"span": {
|
|
"start": 288,
|
|
"end": 378,
|
|
"ctxt": 0
|
|
},
|
|
"argument": {
|
|
"type": "ParenthesisExpression",
|
|
"span": {
|
|
"start": 295,
|
|
"end": 377,
|
|
"ctxt": 0
|
|
},
|
|
"expression": {
|
|
"type": "JSXElement",
|
|
"span": {
|
|
"start": 340,
|
|
"end": 371,
|
|
"ctxt": 0
|
|
},
|
|
"opening": {
|
|
"type": "JSXOpeningElement",
|
|
"name": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 341,
|
|
"end": 357,
|
|
"ctxt": 0
|
|
},
|
|
"value": "AnotherComponent",
|
|
"optional": false
|
|
},
|
|
"span": {
|
|
"start": 340,
|
|
"end": 371,
|
|
"ctxt": 0
|
|
},
|
|
"attributes": [
|
|
{
|
|
"type": "SpreadElement",
|
|
"spread": {
|
|
"start": 359,
|
|
"end": 362,
|
|
"ctxt": 0
|
|
},
|
|
"arguments": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 362,
|
|
"end": 367,
|
|
"ctxt": 0
|
|
},
|
|
"value": "props",
|
|
"optional": false
|
|
}
|
|
}
|
|
],
|
|
"selfClosing": true,
|
|
"typeArguments": null
|
|
},
|
|
"children": [],
|
|
"closing": null
|
|
}
|
|
}
|
|
}
|
|
]
|
|
},
|
|
"generator": false,
|
|
"async": false,
|
|
"typeParameters": null,
|
|
"returnType": null
|
|
}
|
|
},
|
|
{
|
|
"type": "TsInterfaceDeclaration",
|
|
"span": {
|
|
"start": 382,
|
|
"end": 494,
|
|
"ctxt": 0
|
|
},
|
|
"id": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 392,
|
|
"end": 413,
|
|
"ctxt": 0
|
|
},
|
|
"value": "AnotherComponentProps",
|
|
"optional": false
|
|
},
|
|
"declare": false,
|
|
"typeParams": null,
|
|
"extends": [],
|
|
"body": {
|
|
"type": "TsInterfaceBody",
|
|
"span": {
|
|
"start": 414,
|
|
"end": 494,
|
|
"ctxt": 0
|
|
},
|
|
"body": [
|
|
{
|
|
"type": "TsPropertySignature",
|
|
"span": {
|
|
"start": 420,
|
|
"end": 438,
|
|
"ctxt": 0
|
|
},
|
|
"readonly": false,
|
|
"key": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 420,
|
|
"end": 429,
|
|
"ctxt": 0
|
|
},
|
|
"value": "property1",
|
|
"optional": false
|
|
},
|
|
"computed": false,
|
|
"optional": false,
|
|
"init": null,
|
|
"params": [],
|
|
"typeAnnotation": {
|
|
"type": "TsTypeAnnotation",
|
|
"span": {
|
|
"start": 429,
|
|
"end": 437,
|
|
"ctxt": 0
|
|
},
|
|
"typeAnnotation": {
|
|
"type": "TsKeywordType",
|
|
"span": {
|
|
"start": 431,
|
|
"end": 437,
|
|
"ctxt": 0
|
|
},
|
|
"kind": "string"
|
|
}
|
|
},
|
|
"typeParams": null
|
|
},
|
|
{
|
|
"type": "TsPropertySignature",
|
|
"span": {
|
|
"start": 443,
|
|
"end": 468,
|
|
"ctxt": 0
|
|
},
|
|
"readonly": false,
|
|
"key": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 443,
|
|
"end": 459,
|
|
"ctxt": 0
|
|
},
|
|
"value": "AnotherProperty1",
|
|
"optional": false
|
|
},
|
|
"computed": false,
|
|
"optional": false,
|
|
"init": null,
|
|
"params": [],
|
|
"typeAnnotation": {
|
|
"type": "TsTypeAnnotation",
|
|
"span": {
|
|
"start": 459,
|
|
"end": 467,
|
|
"ctxt": 0
|
|
},
|
|
"typeAnnotation": {
|
|
"type": "TsKeywordType",
|
|
"span": {
|
|
"start": 461,
|
|
"end": 467,
|
|
"ctxt": 0
|
|
},
|
|
"kind": "string"
|
|
}
|
|
},
|
|
"typeParams": null
|
|
},
|
|
{
|
|
"type": "TsPropertySignature",
|
|
"span": {
|
|
"start": 473,
|
|
"end": 492,
|
|
"ctxt": 0
|
|
},
|
|
"readonly": false,
|
|
"key": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 473,
|
|
"end": 482,
|
|
"ctxt": 0
|
|
},
|
|
"value": "property2",
|
|
"optional": false
|
|
},
|
|
"computed": false,
|
|
"optional": false,
|
|
"init": null,
|
|
"params": [],
|
|
"typeAnnotation": {
|
|
"type": "TsTypeAnnotation",
|
|
"span": {
|
|
"start": 482,
|
|
"end": 491,
|
|
"ctxt": 0
|
|
},
|
|
"typeAnnotation": {
|
|
"type": "TsKeywordType",
|
|
"span": {
|
|
"start": 484,
|
|
"end": 491,
|
|
"ctxt": 0
|
|
},
|
|
"kind": "boolean"
|
|
}
|
|
},
|
|
"typeParams": null
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "FunctionDeclaration",
|
|
"identifier": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 505,
|
|
"end": 521,
|
|
"ctxt": 0
|
|
},
|
|
"value": "AnotherComponent",
|
|
"optional": false
|
|
},
|
|
"declare": false,
|
|
"params": [
|
|
{
|
|
"type": "Parameter",
|
|
"span": {
|
|
"start": 522,
|
|
"end": 558,
|
|
"ctxt": 0
|
|
},
|
|
"decorators": [],
|
|
"pat": {
|
|
"type": "ObjectPattern",
|
|
"span": {
|
|
"start": 522,
|
|
"end": 558,
|
|
"ctxt": 0
|
|
},
|
|
"properties": [
|
|
{
|
|
"type": "AssignmentPatternProperty",
|
|
"span": {
|
|
"start": 524,
|
|
"end": 533,
|
|
"ctxt": 0
|
|
},
|
|
"key": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 524,
|
|
"end": 533,
|
|
"ctxt": 0
|
|
},
|
|
"value": "property1",
|
|
"optional": false
|
|
},
|
|
"value": null
|
|
}
|
|
],
|
|
"optional": false,
|
|
"typeAnnotation": {
|
|
"type": "TsTypeAnnotation",
|
|
"span": {
|
|
"start": 535,
|
|
"end": 558,
|
|
"ctxt": 0
|
|
},
|
|
"typeAnnotation": {
|
|
"type": "TsTypeReference",
|
|
"span": {
|
|
"start": 537,
|
|
"end": 558,
|
|
"ctxt": 0
|
|
},
|
|
"typeName": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 537,
|
|
"end": 558,
|
|
"ctxt": 0
|
|
},
|
|
"value": "AnotherComponentProps",
|
|
"optional": false
|
|
},
|
|
"typeParams": null
|
|
}
|
|
}
|
|
}
|
|
}
|
|
],
|
|
"decorators": [],
|
|
"span": {
|
|
"start": 496,
|
|
"end": 616,
|
|
"ctxt": 0
|
|
},
|
|
"body": {
|
|
"type": "BlockStatement",
|
|
"span": {
|
|
"start": 560,
|
|
"end": 616,
|
|
"ctxt": 0
|
|
},
|
|
"stmts": [
|
|
{
|
|
"type": "ReturnStatement",
|
|
"span": {
|
|
"start": 566,
|
|
"end": 614,
|
|
"ctxt": 0
|
|
},
|
|
"argument": {
|
|
"type": "ParenthesisExpression",
|
|
"span": {
|
|
"start": 573,
|
|
"end": 613,
|
|
"ctxt": 0
|
|
},
|
|
"expression": {
|
|
"type": "JSXElement",
|
|
"span": {
|
|
"start": 583,
|
|
"end": 607,
|
|
"ctxt": 0
|
|
},
|
|
"opening": {
|
|
"type": "JSXOpeningElement",
|
|
"name": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 584,
|
|
"end": 588,
|
|
"ctxt": 0
|
|
},
|
|
"value": "span",
|
|
"optional": false
|
|
},
|
|
"span": {
|
|
"start": 583,
|
|
"end": 589,
|
|
"ctxt": 0
|
|
},
|
|
"attributes": [],
|
|
"selfClosing": false,
|
|
"typeArguments": null
|
|
},
|
|
"children": [
|
|
{
|
|
"type": "JSXExpressionContainer",
|
|
"span": {
|
|
"start": 589,
|
|
"end": 600,
|
|
"ctxt": 0
|
|
},
|
|
"expression": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 590,
|
|
"end": 599,
|
|
"ctxt": 0
|
|
},
|
|
"value": "property1",
|
|
"optional": false
|
|
}
|
|
}
|
|
],
|
|
"closing": {
|
|
"type": "JSXClosingElement",
|
|
"span": {
|
|
"start": 600,
|
|
"end": 607,
|
|
"ctxt": 0
|
|
},
|
|
"name": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 602,
|
|
"end": 606,
|
|
"ctxt": 0
|
|
},
|
|
"value": "span",
|
|
"optional": false
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
]
|
|
},
|
|
"generator": false,
|
|
"async": false,
|
|
"typeParameters": null,
|
|
"returnType": null
|
|
}
|
|
],
|
|
"interpreter": null
|
|
}
|