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

512 lines
11 KiB
JSON

{
"type": "Module",
"span": {
"start": 20,
"end": 308,
"ctxt": 0
},
"body": [
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 26,
"end": 27,
"ctxt": 0
},
"value": "A",
"optional": false
},
"declare": false,
"span": {
"start": 20,
"end": 42,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassProperty",
"span": {
"start": 30,
"end": 40,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 30,
"end": 31,
"ctxt": 0
},
"value": "a",
"optional": false
},
"value": null,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 32,
"end": 40,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 34,
"end": 40,
"ctxt": 0
},
"kind": "string"
}
},
"isStatic": false,
"decorators": [],
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false,
"readonly": false,
"declare": false,
"definite": true
}
],
"superClass": null,
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
},
{
"type": "ExportNamedDeclaration",
"span": {
"start": 43,
"end": 66,
"ctxt": 0
},
"specifiers": [
{
"type": "ExportSpecifier",
"span": {
"start": 57,
"end": 63,
"ctxt": 0
},
"orig": {
"type": "Identifier",
"span": {
"start": 57,
"end": 58,
"ctxt": 0
},
"value": "A",
"optional": false
},
"exported": {
"type": "Identifier",
"span": {
"start": 62,
"end": 63,
"ctxt": 0
},
"value": "B",
"optional": false
},
"isTypeOnly": false
}
],
"source": null,
"typeOnly": true,
"asserts": null
},
{
"type": "ExportDeclaration",
"span": {
"start": 67,
"end": 85,
"ctxt": 0
},
"declaration": {
"type": "TsTypeAliasDeclaration",
"span": {
"start": 74,
"end": 85,
"ctxt": 0
},
"declare": false,
"id": {
"type": "Identifier",
"span": {
"start": 79,
"end": 80,
"ctxt": 0
},
"value": "Z",
"optional": false
},
"typeParams": null,
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 83,
"end": 84,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 83,
"end": 84,
"ctxt": 0
},
"value": "A",
"optional": false
},
"typeParams": null
}
}
},
{
"type": "ImportDeclaration",
"span": {
"start": 107,
"end": 136,
"ctxt": 0
},
"specifiers": [
{
"type": "ImportSpecifier",
"span": {
"start": 116,
"end": 122,
"ctxt": 0
},
"local": {
"type": "Identifier",
"span": {
"start": 121,
"end": 122,
"ctxt": 0
},
"value": "Y",
"optional": false
},
"imported": {
"type": "Identifier",
"span": {
"start": 116,
"end": 117,
"ctxt": 0
},
"value": "Z",
"optional": false
},
"isTypeOnly": false
}
],
"source": {
"type": "StringLiteral",
"span": {
"start": 130,
"end": 135,
"ctxt": 0
},
"value": "./a",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
},
"typeOnly": false,
"asserts": null
},
{
"type": "ExportNamedDeclaration",
"span": {
"start": 137,
"end": 166,
"ctxt": 0
},
"specifiers": [
{
"type": "ExportSpecifier",
"span": {
"start": 146,
"end": 152,
"ctxt": 0
},
"orig": {
"type": "Identifier",
"span": {
"start": 146,
"end": 147,
"ctxt": 0
},
"value": "B",
"optional": false
},
"exported": {
"type": "Identifier",
"span": {
"start": 151,
"end": 152,
"ctxt": 0
},
"value": "C",
"optional": false
},
"isTypeOnly": false
}
],
"source": {
"type": "StringLiteral",
"span": {
"start": 160,
"end": 165,
"ctxt": 0
},
"value": "./a",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
},
"typeOnly": false,
"asserts": null
},
{
"type": "ImportDeclaration",
"span": {
"start": 188,
"end": 217,
"ctxt": 0
},
"specifiers": [
{
"type": "ImportSpecifier",
"span": {
"start": 202,
"end": 203,
"ctxt": 0
},
"local": {
"type": "Identifier",
"span": {
"start": 202,
"end": 203,
"ctxt": 0
},
"value": "C",
"optional": false
},
"imported": null,
"isTypeOnly": false
}
],
"source": {
"type": "StringLiteral",
"span": {
"start": 211,
"end": 216,
"ctxt": 0
},
"value": "./b",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
},
"typeOnly": true,
"asserts": null
},
{
"type": "ExportNamedDeclaration",
"span": {
"start": 218,
"end": 236,
"ctxt": 0
},
"specifiers": [
{
"type": "ExportSpecifier",
"span": {
"start": 227,
"end": 233,
"ctxt": 0
},
"orig": {
"type": "Identifier",
"span": {
"start": 227,
"end": 228,
"ctxt": 0
},
"value": "C",
"optional": false
},
"exported": {
"type": "Identifier",
"span": {
"start": 232,
"end": 233,
"ctxt": 0
},
"value": "D",
"optional": false
},
"isTypeOnly": false
}
],
"source": null,
"typeOnly": false,
"asserts": null
},
{
"type": "ImportDeclaration",
"span": {
"start": 258,
"end": 282,
"ctxt": 0
},
"specifiers": [
{
"type": "ImportSpecifier",
"span": {
"start": 267,
"end": 268,
"ctxt": 0
},
"local": {
"type": "Identifier",
"span": {
"start": 267,
"end": 268,
"ctxt": 0
},
"value": "D",
"optional": false
},
"imported": null,
"isTypeOnly": false
}
],
"source": {
"type": "StringLiteral",
"span": {
"start": 276,
"end": 281,
"ctxt": 0
},
"value": "./c",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
},
"typeOnly": false,
"asserts": null
},
{
"type": "ExpressionStatement",
"span": {
"start": 283,
"end": 291,
"ctxt": 0
},
"expression": {
"type": "NewExpression",
"span": {
"start": 283,
"end": 290,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 287,
"end": 288,
"ctxt": 0
},
"value": "D",
"optional": false
},
"arguments": [],
"typeArguments": null
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 292,
"end": 308,
"ctxt": 0
},
"kind": "const",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 298,
"end": 307,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 298,
"end": 299,
"ctxt": 0
},
"value": "d",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 299,
"end": 302,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 301,
"end": 302,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 301,
"end": 302,
"ctxt": 0
},
"value": "D",
"optional": false
},
"typeParams": null
}
}
},
"init": {
"type": "ObjectExpression",
"span": {
"start": 305,
"end": 307,
"ctxt": 0
},
"properties": []
},
"definite": false
}
]
}
],
"interpreter": null
}