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

1391 lines
30 KiB
JSON

{
"type": "Module",
"span": {
"start": 42,
"end": 488,
"ctxt": 0
},
"body": [
{
"type": "VariableDeclaration",
"span": {
"start": 42,
"end": 52,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 46,
"end": 51,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 46,
"end": 47,
"ctxt": 0
},
"value": "v",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "NumericLiteral",
"span": {
"start": 50,
"end": 51,
"ctxt": 0
},
"value": 1.0
},
"definite": false
}
]
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 62,
"end": 63,
"ctxt": 0
},
"value": "f",
"optional": false
},
"declare": false,
"params": [],
"decorators": [],
"span": {
"start": 53,
"end": 69,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 66,
"end": 69,
"ctxt": 0
},
"stmts": []
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 76,
"end": 77,
"ctxt": 0
},
"value": "C",
"optional": false
},
"declare": false,
"span": {
"start": 70,
"end": 81,
"ctxt": 0
},
"decorators": [],
"body": [],
"superClass": null,
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
},
{
"type": "TsInterfaceDeclaration",
"span": {
"start": 82,
"end": 97,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 92,
"end": 93,
"ctxt": 0
},
"value": "I",
"optional": false
},
"declare": false,
"typeParams": null,
"extends": [],
"body": {
"type": "TsInterfaceBody",
"span": {
"start": 94,
"end": 97,
"ctxt": 0
},
"body": []
}
},
{
"type": "TsEnumDeclaration",
"span": {
"start": 98,
"end": 120,
"ctxt": 0
},
"declare": false,
"isConst": false,
"id": {
"type": "Identifier",
"span": {
"start": 103,
"end": 104,
"ctxt": 0
},
"value": "E",
"optional": false
},
"members": [
{
"type": "TsEnumMember",
"span": {
"start": 111,
"end": 112,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 111,
"end": 112,
"ctxt": 0
},
"value": "A",
"optional": false
},
"init": null
},
{
"type": "TsEnumMember",
"span": {
"start": 114,
"end": 115,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 114,
"end": 115,
"ctxt": 0
},
"value": "B",
"optional": false
},
"init": null
},
{
"type": "TsEnumMember",
"span": {
"start": 117,
"end": 118,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 117,
"end": 118,
"ctxt": 0
},
"value": "C",
"optional": false
},
"init": null
}
]
},
{
"type": "TsEnumDeclaration",
"span": {
"start": 121,
"end": 149,
"ctxt": 0
},
"declare": false,
"isConst": true,
"id": {
"type": "Identifier",
"span": {
"start": 132,
"end": 133,
"ctxt": 0
},
"value": "D",
"optional": false
},
"members": [
{
"type": "TsEnumMember",
"span": {
"start": 140,
"end": 141,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 140,
"end": 141,
"ctxt": 0
},
"value": "A",
"optional": false
},
"init": null
},
{
"type": "TsEnumMember",
"span": {
"start": 143,
"end": 144,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 143,
"end": 144,
"ctxt": 0
},
"value": "B",
"optional": false
},
"init": null
},
{
"type": "TsEnumMember",
"span": {
"start": 146,
"end": 147,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 146,
"end": 147,
"ctxt": 0
},
"value": "C",
"optional": false
},
"init": null
}
]
},
{
"type": "TsModuleDeclaration",
"span": {
"start": 150,
"end": 180,
"ctxt": 0
},
"declare": false,
"global": false,
"id": {
"type": "Identifier",
"span": {
"start": 157,
"end": 158,
"ctxt": 0
},
"value": "M",
"optional": false
},
"body": {
"type": "TsModuleBlock",
"span": {
"start": 159,
"end": 180,
"ctxt": 0
},
"body": [
{
"type": "ExportDeclaration",
"span": {
"start": 165,
"end": 178,
"ctxt": 0
},
"declaration": {
"type": "VariableDeclaration",
"span": {
"start": 172,
"end": 178,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 176,
"end": 177,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 176,
"end": 177,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": null
},
"init": null,
"definite": false
}
]
}
}
]
}
},
{
"type": "TsModuleDeclaration",
"span": {
"start": 181,
"end": 224,
"ctxt": 0
},
"declare": false,
"global": false,
"id": {
"type": "Identifier",
"span": {
"start": 188,
"end": 189,
"ctxt": 0
},
"value": "N",
"optional": false
},
"body": {
"type": "TsModuleBlock",
"span": {
"start": 190,
"end": 224,
"ctxt": 0
},
"body": [
{
"type": "ExportDeclaration",
"span": {
"start": 196,
"end": 222,
"ctxt": 0
},
"declaration": {
"type": "TsInterfaceDeclaration",
"span": {
"start": 203,
"end": 222,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 213,
"end": 214,
"ctxt": 0
},
"value": "I",
"optional": false
},
"declare": false,
"typeParams": null,
"extends": [],
"body": {
"type": "TsInterfaceBody",
"span": {
"start": 215,
"end": 222,
"ctxt": 0
},
"body": []
}
}
}
]
}
},
{
"type": "TsTypeAliasDeclaration",
"span": {
"start": 225,
"end": 241,
"ctxt": 0
},
"declare": false,
"id": {
"type": "Identifier",
"span": {
"start": 230,
"end": 231,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null,
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 234,
"end": 240,
"ctxt": 0
},
"kind": "number"
}
},
{
"type": "TsImportEqualsDeclaration",
"span": {
"start": 242,
"end": 257,
"ctxt": 0
},
"declare": false,
"isExport": false,
"isTypeOnly": false,
"id": {
"type": "Identifier",
"span": {
"start": 249,
"end": 250,
"ctxt": 0
},
"value": "a",
"optional": false
},
"moduleRef": {
"type": "TsQualifiedName",
"left": {
"type": "Identifier",
"span": {
"start": 253,
"end": 254,
"ctxt": 0
},
"value": "M",
"optional": false
},
"right": {
"type": "Identifier",
"span": {
"start": 255,
"end": 256,
"ctxt": 0
},
"value": "x",
"optional": false
}
}
},
{
"type": "ExportNamedDeclaration",
"span": {
"start": 259,
"end": 299,
"ctxt": 0
},
"specifiers": [
{
"type": "ExportSpecifier",
"span": {
"start": 268,
"end": 269,
"ctxt": 0
},
"orig": {
"type": "Identifier",
"span": {
"start": 268,
"end": 269,
"ctxt": 0
},
"value": "v",
"optional": false
},
"exported": null,
"isTypeOnly": false
},
{
"type": "ExportSpecifier",
"span": {
"start": 271,
"end": 272,
"ctxt": 0
},
"orig": {
"type": "Identifier",
"span": {
"start": 271,
"end": 272,
"ctxt": 0
},
"value": "f",
"optional": false
},
"exported": null,
"isTypeOnly": false
},
{
"type": "ExportSpecifier",
"span": {
"start": 274,
"end": 275,
"ctxt": 0
},
"orig": {
"type": "Identifier",
"span": {
"start": 274,
"end": 275,
"ctxt": 0
},
"value": "C",
"optional": false
},
"exported": null,
"isTypeOnly": false
},
{
"type": "ExportSpecifier",
"span": {
"start": 277,
"end": 278,
"ctxt": 0
},
"orig": {
"type": "Identifier",
"span": {
"start": 277,
"end": 278,
"ctxt": 0
},
"value": "I",
"optional": false
},
"exported": null,
"isTypeOnly": false
},
{
"type": "ExportSpecifier",
"span": {
"start": 280,
"end": 281,
"ctxt": 0
},
"orig": {
"type": "Identifier",
"span": {
"start": 280,
"end": 281,
"ctxt": 0
},
"value": "E",
"optional": false
},
"exported": null,
"isTypeOnly": false
},
{
"type": "ExportSpecifier",
"span": {
"start": 283,
"end": 284,
"ctxt": 0
},
"orig": {
"type": "Identifier",
"span": {
"start": 283,
"end": 284,
"ctxt": 0
},
"value": "D",
"optional": false
},
"exported": null,
"isTypeOnly": false
},
{
"type": "ExportSpecifier",
"span": {
"start": 286,
"end": 287,
"ctxt": 0
},
"orig": {
"type": "Identifier",
"span": {
"start": 286,
"end": 287,
"ctxt": 0
},
"value": "M",
"optional": false
},
"exported": null,
"isTypeOnly": false
},
{
"type": "ExportSpecifier",
"span": {
"start": 289,
"end": 290,
"ctxt": 0
},
"orig": {
"type": "Identifier",
"span": {
"start": 289,
"end": 290,
"ctxt": 0
},
"value": "N",
"optional": false
},
"exported": null,
"isTypeOnly": false
},
{
"type": "ExportSpecifier",
"span": {
"start": 292,
"end": 293,
"ctxt": 0
},
"orig": {
"type": "Identifier",
"span": {
"start": 292,
"end": 293,
"ctxt": 0
},
"value": "T",
"optional": false
},
"exported": null,
"isTypeOnly": false
},
{
"type": "ExportSpecifier",
"span": {
"start": 295,
"end": 296,
"ctxt": 0
},
"orig": {
"type": "Identifier",
"span": {
"start": 295,
"end": 296,
"ctxt": 0
},
"value": "a",
"optional": false
},
"exported": null,
"isTypeOnly": false
}
],
"source": null,
"typeOnly": false,
"asserts": null
},
{
"type": "ExportNamedDeclaration",
"span": {
"start": 321,
"end": 373,
"ctxt": 0
},
"specifiers": [
{
"type": "ExportSpecifier",
"span": {
"start": 330,
"end": 331,
"ctxt": 0
},
"orig": {
"type": "Identifier",
"span": {
"start": 330,
"end": 331,
"ctxt": 0
},
"value": "v",
"optional": false
},
"exported": null,
"isTypeOnly": false
},
{
"type": "ExportSpecifier",
"span": {
"start": 333,
"end": 334,
"ctxt": 0
},
"orig": {
"type": "Identifier",
"span": {
"start": 333,
"end": 334,
"ctxt": 0
},
"value": "f",
"optional": false
},
"exported": null,
"isTypeOnly": false
},
{
"type": "ExportSpecifier",
"span": {
"start": 336,
"end": 337,
"ctxt": 0
},
"orig": {
"type": "Identifier",
"span": {
"start": 336,
"end": 337,
"ctxt": 0
},
"value": "C",
"optional": false
},
"exported": null,
"isTypeOnly": false
},
{
"type": "ExportSpecifier",
"span": {
"start": 339,
"end": 340,
"ctxt": 0
},
"orig": {
"type": "Identifier",
"span": {
"start": 339,
"end": 340,
"ctxt": 0
},
"value": "I",
"optional": false
},
"exported": null,
"isTypeOnly": false
},
{
"type": "ExportSpecifier",
"span": {
"start": 342,
"end": 343,
"ctxt": 0
},
"orig": {
"type": "Identifier",
"span": {
"start": 342,
"end": 343,
"ctxt": 0
},
"value": "E",
"optional": false
},
"exported": null,
"isTypeOnly": false
},
{
"type": "ExportSpecifier",
"span": {
"start": 345,
"end": 346,
"ctxt": 0
},
"orig": {
"type": "Identifier",
"span": {
"start": 345,
"end": 346,
"ctxt": 0
},
"value": "D",
"optional": false
},
"exported": null,
"isTypeOnly": false
},
{
"type": "ExportSpecifier",
"span": {
"start": 348,
"end": 349,
"ctxt": 0
},
"orig": {
"type": "Identifier",
"span": {
"start": 348,
"end": 349,
"ctxt": 0
},
"value": "M",
"optional": false
},
"exported": null,
"isTypeOnly": false
},
{
"type": "ExportSpecifier",
"span": {
"start": 351,
"end": 352,
"ctxt": 0
},
"orig": {
"type": "Identifier",
"span": {
"start": 351,
"end": 352,
"ctxt": 0
},
"value": "N",
"optional": false
},
"exported": null,
"isTypeOnly": false
},
{
"type": "ExportSpecifier",
"span": {
"start": 354,
"end": 355,
"ctxt": 0
},
"orig": {
"type": "Identifier",
"span": {
"start": 354,
"end": 355,
"ctxt": 0
},
"value": "T",
"optional": false
},
"exported": null,
"isTypeOnly": false
},
{
"type": "ExportSpecifier",
"span": {
"start": 357,
"end": 358,
"ctxt": 0
},
"orig": {
"type": "Identifier",
"span": {
"start": 357,
"end": 358,
"ctxt": 0
},
"value": "a",
"optional": false
},
"exported": null,
"isTypeOnly": false
}
],
"source": {
"type": "StringLiteral",
"span": {
"start": 366,
"end": 372,
"ctxt": 0
},
"value": "./t1",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
},
"typeOnly": false,
"asserts": null
},
{
"type": "ImportDeclaration",
"span": {
"start": 395,
"end": 447,
"ctxt": 0
},
"specifiers": [
{
"type": "ImportSpecifier",
"span": {
"start": 404,
"end": 405,
"ctxt": 0
},
"local": {
"type": "Identifier",
"span": {
"start": 404,
"end": 405,
"ctxt": 0
},
"value": "v",
"optional": false
},
"imported": null,
"isTypeOnly": false
},
{
"type": "ImportSpecifier",
"span": {
"start": 407,
"end": 408,
"ctxt": 0
},
"local": {
"type": "Identifier",
"span": {
"start": 407,
"end": 408,
"ctxt": 0
},
"value": "f",
"optional": false
},
"imported": null,
"isTypeOnly": false
},
{
"type": "ImportSpecifier",
"span": {
"start": 410,
"end": 411,
"ctxt": 0
},
"local": {
"type": "Identifier",
"span": {
"start": 410,
"end": 411,
"ctxt": 0
},
"value": "C",
"optional": false
},
"imported": null,
"isTypeOnly": false
},
{
"type": "ImportSpecifier",
"span": {
"start": 413,
"end": 414,
"ctxt": 0
},
"local": {
"type": "Identifier",
"span": {
"start": 413,
"end": 414,
"ctxt": 0
},
"value": "I",
"optional": false
},
"imported": null,
"isTypeOnly": false
},
{
"type": "ImportSpecifier",
"span": {
"start": 416,
"end": 417,
"ctxt": 0
},
"local": {
"type": "Identifier",
"span": {
"start": 416,
"end": 417,
"ctxt": 0
},
"value": "E",
"optional": false
},
"imported": null,
"isTypeOnly": false
},
{
"type": "ImportSpecifier",
"span": {
"start": 419,
"end": 420,
"ctxt": 0
},
"local": {
"type": "Identifier",
"span": {
"start": 419,
"end": 420,
"ctxt": 0
},
"value": "D",
"optional": false
},
"imported": null,
"isTypeOnly": false
},
{
"type": "ImportSpecifier",
"span": {
"start": 422,
"end": 423,
"ctxt": 0
},
"local": {
"type": "Identifier",
"span": {
"start": 422,
"end": 423,
"ctxt": 0
},
"value": "M",
"optional": false
},
"imported": null,
"isTypeOnly": false
},
{
"type": "ImportSpecifier",
"span": {
"start": 425,
"end": 426,
"ctxt": 0
},
"local": {
"type": "Identifier",
"span": {
"start": 425,
"end": 426,
"ctxt": 0
},
"value": "N",
"optional": false
},
"imported": null,
"isTypeOnly": false
},
{
"type": "ImportSpecifier",
"span": {
"start": 428,
"end": 429,
"ctxt": 0
},
"local": {
"type": "Identifier",
"span": {
"start": 428,
"end": 429,
"ctxt": 0
},
"value": "T",
"optional": false
},
"imported": null,
"isTypeOnly": false
},
{
"type": "ImportSpecifier",
"span": {
"start": 431,
"end": 432,
"ctxt": 0
},
"local": {
"type": "Identifier",
"span": {
"start": 431,
"end": 432,
"ctxt": 0
},
"value": "a",
"optional": false
},
"imported": null,
"isTypeOnly": false
}
],
"source": {
"type": "StringLiteral",
"span": {
"start": 440,
"end": 446,
"ctxt": 0
},
"value": "./t1",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
},
"typeOnly": false,
"asserts": null
},
{
"type": "ExportNamedDeclaration",
"span": {
"start": 448,
"end": 488,
"ctxt": 0
},
"specifiers": [
{
"type": "ExportSpecifier",
"span": {
"start": 457,
"end": 458,
"ctxt": 0
},
"orig": {
"type": "Identifier",
"span": {
"start": 457,
"end": 458,
"ctxt": 0
},
"value": "v",
"optional": false
},
"exported": null,
"isTypeOnly": false
},
{
"type": "ExportSpecifier",
"span": {
"start": 460,
"end": 461,
"ctxt": 0
},
"orig": {
"type": "Identifier",
"span": {
"start": 460,
"end": 461,
"ctxt": 0
},
"value": "f",
"optional": false
},
"exported": null,
"isTypeOnly": false
},
{
"type": "ExportSpecifier",
"span": {
"start": 463,
"end": 464,
"ctxt": 0
},
"orig": {
"type": "Identifier",
"span": {
"start": 463,
"end": 464,
"ctxt": 0
},
"value": "C",
"optional": false
},
"exported": null,
"isTypeOnly": false
},
{
"type": "ExportSpecifier",
"span": {
"start": 466,
"end": 467,
"ctxt": 0
},
"orig": {
"type": "Identifier",
"span": {
"start": 466,
"end": 467,
"ctxt": 0
},
"value": "I",
"optional": false
},
"exported": null,
"isTypeOnly": false
},
{
"type": "ExportSpecifier",
"span": {
"start": 469,
"end": 470,
"ctxt": 0
},
"orig": {
"type": "Identifier",
"span": {
"start": 469,
"end": 470,
"ctxt": 0
},
"value": "E",
"optional": false
},
"exported": null,
"isTypeOnly": false
},
{
"type": "ExportSpecifier",
"span": {
"start": 472,
"end": 473,
"ctxt": 0
},
"orig": {
"type": "Identifier",
"span": {
"start": 472,
"end": 473,
"ctxt": 0
},
"value": "D",
"optional": false
},
"exported": null,
"isTypeOnly": false
},
{
"type": "ExportSpecifier",
"span": {
"start": 475,
"end": 476,
"ctxt": 0
},
"orig": {
"type": "Identifier",
"span": {
"start": 475,
"end": 476,
"ctxt": 0
},
"value": "M",
"optional": false
},
"exported": null,
"isTypeOnly": false
},
{
"type": "ExportSpecifier",
"span": {
"start": 478,
"end": 479,
"ctxt": 0
},
"orig": {
"type": "Identifier",
"span": {
"start": 478,
"end": 479,
"ctxt": 0
},
"value": "N",
"optional": false
},
"exported": null,
"isTypeOnly": false
},
{
"type": "ExportSpecifier",
"span": {
"start": 481,
"end": 482,
"ctxt": 0
},
"orig": {
"type": "Identifier",
"span": {
"start": 481,
"end": 482,
"ctxt": 0
},
"value": "T",
"optional": false
},
"exported": null,
"isTypeOnly": false
},
{
"type": "ExportSpecifier",
"span": {
"start": 484,
"end": 485,
"ctxt": 0
},
"orig": {
"type": "Identifier",
"span": {
"start": 484,
"end": 485,
"ctxt": 0
},
"value": "a",
"optional": false
},
"exported": null,
"isTypeOnly": false
}
],
"source": null,
"typeOnly": false,
"asserts": null
}
],
"interpreter": null
}