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

1384 lines
30 KiB
JSON

{
"type": "Module",
"span": {
"start": 43,
"end": 489,
"ctxt": 0
},
"body": [
{
"type": "VariableDeclaration",
"span": {
"start": 43,
"end": 53,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 47,
"end": 52,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 47,
"end": 48,
"ctxt": 0
},
"value": "v",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "NumericLiteral",
"span": {
"start": 51,
"end": 52,
"ctxt": 0
},
"value": 1.0,
"raw": "1"
},
"definite": false
}
]
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 63,
"end": 64,
"ctxt": 0
},
"value": "f",
"optional": false
},
"declare": false,
"params": [],
"decorators": [],
"span": {
"start": 54,
"end": 70,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 67,
"end": 70,
"ctxt": 0
},
"stmts": []
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 77,
"end": 78,
"ctxt": 0
},
"value": "C",
"optional": false
},
"declare": false,
"span": {
"start": 71,
"end": 82,
"ctxt": 0
},
"decorators": [],
"body": [],
"superClass": null,
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
},
{
"type": "TsInterfaceDeclaration",
"span": {
"start": 83,
"end": 98,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 93,
"end": 94,
"ctxt": 0
},
"value": "I",
"optional": false
},
"declare": false,
"typeParams": null,
"extends": [],
"body": {
"type": "TsInterfaceBody",
"span": {
"start": 95,
"end": 98,
"ctxt": 0
},
"body": []
}
},
{
"type": "TsEnumDeclaration",
"span": {
"start": 99,
"end": 121,
"ctxt": 0
},
"declare": false,
"isConst": false,
"id": {
"type": "Identifier",
"span": {
"start": 104,
"end": 105,
"ctxt": 0
},
"value": "E",
"optional": false
},
"members": [
{
"type": "TsEnumMember",
"span": {
"start": 112,
"end": 113,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 112,
"end": 113,
"ctxt": 0
},
"value": "A",
"optional": false
},
"init": null
},
{
"type": "TsEnumMember",
"span": {
"start": 115,
"end": 116,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 115,
"end": 116,
"ctxt": 0
},
"value": "B",
"optional": false
},
"init": null
},
{
"type": "TsEnumMember",
"span": {
"start": 118,
"end": 119,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 118,
"end": 119,
"ctxt": 0
},
"value": "C",
"optional": false
},
"init": null
}
]
},
{
"type": "TsEnumDeclaration",
"span": {
"start": 122,
"end": 150,
"ctxt": 0
},
"declare": false,
"isConst": true,
"id": {
"type": "Identifier",
"span": {
"start": 133,
"end": 134,
"ctxt": 0
},
"value": "D",
"optional": false
},
"members": [
{
"type": "TsEnumMember",
"span": {
"start": 141,
"end": 142,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 141,
"end": 142,
"ctxt": 0
},
"value": "A",
"optional": false
},
"init": null
},
{
"type": "TsEnumMember",
"span": {
"start": 144,
"end": 145,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 144,
"end": 145,
"ctxt": 0
},
"value": "B",
"optional": false
},
"init": null
},
{
"type": "TsEnumMember",
"span": {
"start": 147,
"end": 148,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 147,
"end": 148,
"ctxt": 0
},
"value": "C",
"optional": false
},
"init": null
}
]
},
{
"type": "TsModuleDeclaration",
"span": {
"start": 151,
"end": 181,
"ctxt": 0
},
"declare": false,
"global": false,
"id": {
"type": "Identifier",
"span": {
"start": 158,
"end": 159,
"ctxt": 0
},
"value": "M",
"optional": false
},
"body": {
"type": "TsModuleBlock",
"span": {
"start": 160,
"end": 181,
"ctxt": 0
},
"body": [
{
"type": "ExportDeclaration",
"span": {
"start": 166,
"end": 179,
"ctxt": 0
},
"declaration": {
"type": "VariableDeclaration",
"span": {
"start": 173,
"end": 179,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 177,
"end": 178,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 177,
"end": 178,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": null
},
"init": null,
"definite": false
}
]
}
}
]
}
},
{
"type": "TsModuleDeclaration",
"span": {
"start": 182,
"end": 225,
"ctxt": 0
},
"declare": false,
"global": false,
"id": {
"type": "Identifier",
"span": {
"start": 189,
"end": 190,
"ctxt": 0
},
"value": "N",
"optional": false
},
"body": {
"type": "TsModuleBlock",
"span": {
"start": 191,
"end": 225,
"ctxt": 0
},
"body": [
{
"type": "ExportDeclaration",
"span": {
"start": 197,
"end": 223,
"ctxt": 0
},
"declaration": {
"type": "TsInterfaceDeclaration",
"span": {
"start": 204,
"end": 223,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 214,
"end": 215,
"ctxt": 0
},
"value": "I",
"optional": false
},
"declare": false,
"typeParams": null,
"extends": [],
"body": {
"type": "TsInterfaceBody",
"span": {
"start": 216,
"end": 223,
"ctxt": 0
},
"body": []
}
}
}
]
}
},
{
"type": "TsTypeAliasDeclaration",
"span": {
"start": 226,
"end": 242,
"ctxt": 0
},
"declare": false,
"id": {
"type": "Identifier",
"span": {
"start": 231,
"end": 232,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null,
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 235,
"end": 241,
"ctxt": 0
},
"kind": "number"
}
},
{
"type": "TsImportEqualsDeclaration",
"span": {
"start": 243,
"end": 258,
"ctxt": 0
},
"declare": false,
"isExport": false,
"isTypeOnly": false,
"id": {
"type": "Identifier",
"span": {
"start": 250,
"end": 251,
"ctxt": 0
},
"value": "a",
"optional": false
},
"moduleRef": {
"type": "TsQualifiedName",
"left": {
"type": "Identifier",
"span": {
"start": 254,
"end": 255,
"ctxt": 0
},
"value": "M",
"optional": false
},
"right": {
"type": "Identifier",
"span": {
"start": 256,
"end": 257,
"ctxt": 0
},
"value": "x",
"optional": false
}
}
},
{
"type": "ExportNamedDeclaration",
"span": {
"start": 260,
"end": 300,
"ctxt": 0
},
"specifiers": [
{
"type": "ExportSpecifier",
"span": {
"start": 269,
"end": 270,
"ctxt": 0
},
"orig": {
"type": "Identifier",
"span": {
"start": 269,
"end": 270,
"ctxt": 0
},
"value": "v",
"optional": false
},
"exported": null,
"isTypeOnly": false
},
{
"type": "ExportSpecifier",
"span": {
"start": 272,
"end": 273,
"ctxt": 0
},
"orig": {
"type": "Identifier",
"span": {
"start": 272,
"end": 273,
"ctxt": 0
},
"value": "f",
"optional": false
},
"exported": null,
"isTypeOnly": false
},
{
"type": "ExportSpecifier",
"span": {
"start": 275,
"end": 276,
"ctxt": 0
},
"orig": {
"type": "Identifier",
"span": {
"start": 275,
"end": 276,
"ctxt": 0
},
"value": "C",
"optional": false
},
"exported": null,
"isTypeOnly": false
},
{
"type": "ExportSpecifier",
"span": {
"start": 278,
"end": 279,
"ctxt": 0
},
"orig": {
"type": "Identifier",
"span": {
"start": 278,
"end": 279,
"ctxt": 0
},
"value": "I",
"optional": false
},
"exported": null,
"isTypeOnly": false
},
{
"type": "ExportSpecifier",
"span": {
"start": 281,
"end": 282,
"ctxt": 0
},
"orig": {
"type": "Identifier",
"span": {
"start": 281,
"end": 282,
"ctxt": 0
},
"value": "E",
"optional": false
},
"exported": null,
"isTypeOnly": false
},
{
"type": "ExportSpecifier",
"span": {
"start": 284,
"end": 285,
"ctxt": 0
},
"orig": {
"type": "Identifier",
"span": {
"start": 284,
"end": 285,
"ctxt": 0
},
"value": "D",
"optional": false
},
"exported": null,
"isTypeOnly": false
},
{
"type": "ExportSpecifier",
"span": {
"start": 287,
"end": 288,
"ctxt": 0
},
"orig": {
"type": "Identifier",
"span": {
"start": 287,
"end": 288,
"ctxt": 0
},
"value": "M",
"optional": false
},
"exported": null,
"isTypeOnly": false
},
{
"type": "ExportSpecifier",
"span": {
"start": 290,
"end": 291,
"ctxt": 0
},
"orig": {
"type": "Identifier",
"span": {
"start": 290,
"end": 291,
"ctxt": 0
},
"value": "N",
"optional": false
},
"exported": null,
"isTypeOnly": false
},
{
"type": "ExportSpecifier",
"span": {
"start": 293,
"end": 294,
"ctxt": 0
},
"orig": {
"type": "Identifier",
"span": {
"start": 293,
"end": 294,
"ctxt": 0
},
"value": "T",
"optional": false
},
"exported": null,
"isTypeOnly": false
},
{
"type": "ExportSpecifier",
"span": {
"start": 296,
"end": 297,
"ctxt": 0
},
"orig": {
"type": "Identifier",
"span": {
"start": 296,
"end": 297,
"ctxt": 0
},
"value": "a",
"optional": false
},
"exported": null,
"isTypeOnly": false
}
],
"source": null,
"typeOnly": false,
"asserts": null
},
{
"type": "ExportNamedDeclaration",
"span": {
"start": 322,
"end": 374,
"ctxt": 0
},
"specifiers": [
{
"type": "ExportSpecifier",
"span": {
"start": 331,
"end": 332,
"ctxt": 0
},
"orig": {
"type": "Identifier",
"span": {
"start": 331,
"end": 332,
"ctxt": 0
},
"value": "v",
"optional": false
},
"exported": null,
"isTypeOnly": false
},
{
"type": "ExportSpecifier",
"span": {
"start": 334,
"end": 335,
"ctxt": 0
},
"orig": {
"type": "Identifier",
"span": {
"start": 334,
"end": 335,
"ctxt": 0
},
"value": "f",
"optional": false
},
"exported": null,
"isTypeOnly": false
},
{
"type": "ExportSpecifier",
"span": {
"start": 337,
"end": 338,
"ctxt": 0
},
"orig": {
"type": "Identifier",
"span": {
"start": 337,
"end": 338,
"ctxt": 0
},
"value": "C",
"optional": false
},
"exported": null,
"isTypeOnly": false
},
{
"type": "ExportSpecifier",
"span": {
"start": 340,
"end": 341,
"ctxt": 0
},
"orig": {
"type": "Identifier",
"span": {
"start": 340,
"end": 341,
"ctxt": 0
},
"value": "I",
"optional": false
},
"exported": null,
"isTypeOnly": false
},
{
"type": "ExportSpecifier",
"span": {
"start": 343,
"end": 344,
"ctxt": 0
},
"orig": {
"type": "Identifier",
"span": {
"start": 343,
"end": 344,
"ctxt": 0
},
"value": "E",
"optional": false
},
"exported": null,
"isTypeOnly": false
},
{
"type": "ExportSpecifier",
"span": {
"start": 346,
"end": 347,
"ctxt": 0
},
"orig": {
"type": "Identifier",
"span": {
"start": 346,
"end": 347,
"ctxt": 0
},
"value": "D",
"optional": false
},
"exported": null,
"isTypeOnly": false
},
{
"type": "ExportSpecifier",
"span": {
"start": 349,
"end": 350,
"ctxt": 0
},
"orig": {
"type": "Identifier",
"span": {
"start": 349,
"end": 350,
"ctxt": 0
},
"value": "M",
"optional": false
},
"exported": null,
"isTypeOnly": false
},
{
"type": "ExportSpecifier",
"span": {
"start": 352,
"end": 353,
"ctxt": 0
},
"orig": {
"type": "Identifier",
"span": {
"start": 352,
"end": 353,
"ctxt": 0
},
"value": "N",
"optional": false
},
"exported": null,
"isTypeOnly": false
},
{
"type": "ExportSpecifier",
"span": {
"start": 355,
"end": 356,
"ctxt": 0
},
"orig": {
"type": "Identifier",
"span": {
"start": 355,
"end": 356,
"ctxt": 0
},
"value": "T",
"optional": false
},
"exported": null,
"isTypeOnly": false
},
{
"type": "ExportSpecifier",
"span": {
"start": 358,
"end": 359,
"ctxt": 0
},
"orig": {
"type": "Identifier",
"span": {
"start": 358,
"end": 359,
"ctxt": 0
},
"value": "a",
"optional": false
},
"exported": null,
"isTypeOnly": false
}
],
"source": {
"type": "StringLiteral",
"span": {
"start": 367,
"end": 373,
"ctxt": 0
},
"value": "./t1",
"raw": "\"./t1\""
},
"typeOnly": false,
"asserts": null
},
{
"type": "ImportDeclaration",
"span": {
"start": 396,
"end": 448,
"ctxt": 0
},
"specifiers": [
{
"type": "ImportSpecifier",
"span": {
"start": 405,
"end": 406,
"ctxt": 0
},
"local": {
"type": "Identifier",
"span": {
"start": 405,
"end": 406,
"ctxt": 0
},
"value": "v",
"optional": false
},
"imported": null,
"isTypeOnly": false
},
{
"type": "ImportSpecifier",
"span": {
"start": 408,
"end": 409,
"ctxt": 0
},
"local": {
"type": "Identifier",
"span": {
"start": 408,
"end": 409,
"ctxt": 0
},
"value": "f",
"optional": false
},
"imported": null,
"isTypeOnly": false
},
{
"type": "ImportSpecifier",
"span": {
"start": 411,
"end": 412,
"ctxt": 0
},
"local": {
"type": "Identifier",
"span": {
"start": 411,
"end": 412,
"ctxt": 0
},
"value": "C",
"optional": false
},
"imported": null,
"isTypeOnly": false
},
{
"type": "ImportSpecifier",
"span": {
"start": 414,
"end": 415,
"ctxt": 0
},
"local": {
"type": "Identifier",
"span": {
"start": 414,
"end": 415,
"ctxt": 0
},
"value": "I",
"optional": false
},
"imported": null,
"isTypeOnly": false
},
{
"type": "ImportSpecifier",
"span": {
"start": 417,
"end": 418,
"ctxt": 0
},
"local": {
"type": "Identifier",
"span": {
"start": 417,
"end": 418,
"ctxt": 0
},
"value": "E",
"optional": false
},
"imported": null,
"isTypeOnly": false
},
{
"type": "ImportSpecifier",
"span": {
"start": 420,
"end": 421,
"ctxt": 0
},
"local": {
"type": "Identifier",
"span": {
"start": 420,
"end": 421,
"ctxt": 0
},
"value": "D",
"optional": false
},
"imported": null,
"isTypeOnly": false
},
{
"type": "ImportSpecifier",
"span": {
"start": 423,
"end": 424,
"ctxt": 0
},
"local": {
"type": "Identifier",
"span": {
"start": 423,
"end": 424,
"ctxt": 0
},
"value": "M",
"optional": false
},
"imported": null,
"isTypeOnly": false
},
{
"type": "ImportSpecifier",
"span": {
"start": 426,
"end": 427,
"ctxt": 0
},
"local": {
"type": "Identifier",
"span": {
"start": 426,
"end": 427,
"ctxt": 0
},
"value": "N",
"optional": false
},
"imported": null,
"isTypeOnly": false
},
{
"type": "ImportSpecifier",
"span": {
"start": 429,
"end": 430,
"ctxt": 0
},
"local": {
"type": "Identifier",
"span": {
"start": 429,
"end": 430,
"ctxt": 0
},
"value": "T",
"optional": false
},
"imported": null,
"isTypeOnly": false
},
{
"type": "ImportSpecifier",
"span": {
"start": 432,
"end": 433,
"ctxt": 0
},
"local": {
"type": "Identifier",
"span": {
"start": 432,
"end": 433,
"ctxt": 0
},
"value": "a",
"optional": false
},
"imported": null,
"isTypeOnly": false
}
],
"source": {
"type": "StringLiteral",
"span": {
"start": 441,
"end": 447,
"ctxt": 0
},
"value": "./t1",
"raw": "\"./t1\""
},
"typeOnly": false,
"asserts": null
},
{
"type": "ExportNamedDeclaration",
"span": {
"start": 449,
"end": 489,
"ctxt": 0
},
"specifiers": [
{
"type": "ExportSpecifier",
"span": {
"start": 458,
"end": 459,
"ctxt": 0
},
"orig": {
"type": "Identifier",
"span": {
"start": 458,
"end": 459,
"ctxt": 0
},
"value": "v",
"optional": false
},
"exported": null,
"isTypeOnly": false
},
{
"type": "ExportSpecifier",
"span": {
"start": 461,
"end": 462,
"ctxt": 0
},
"orig": {
"type": "Identifier",
"span": {
"start": 461,
"end": 462,
"ctxt": 0
},
"value": "f",
"optional": false
},
"exported": null,
"isTypeOnly": false
},
{
"type": "ExportSpecifier",
"span": {
"start": 464,
"end": 465,
"ctxt": 0
},
"orig": {
"type": "Identifier",
"span": {
"start": 464,
"end": 465,
"ctxt": 0
},
"value": "C",
"optional": false
},
"exported": null,
"isTypeOnly": false
},
{
"type": "ExportSpecifier",
"span": {
"start": 467,
"end": 468,
"ctxt": 0
},
"orig": {
"type": "Identifier",
"span": {
"start": 467,
"end": 468,
"ctxt": 0
},
"value": "I",
"optional": false
},
"exported": null,
"isTypeOnly": false
},
{
"type": "ExportSpecifier",
"span": {
"start": 470,
"end": 471,
"ctxt": 0
},
"orig": {
"type": "Identifier",
"span": {
"start": 470,
"end": 471,
"ctxt": 0
},
"value": "E",
"optional": false
},
"exported": null,
"isTypeOnly": false
},
{
"type": "ExportSpecifier",
"span": {
"start": 473,
"end": 474,
"ctxt": 0
},
"orig": {
"type": "Identifier",
"span": {
"start": 473,
"end": 474,
"ctxt": 0
},
"value": "D",
"optional": false
},
"exported": null,
"isTypeOnly": false
},
{
"type": "ExportSpecifier",
"span": {
"start": 476,
"end": 477,
"ctxt": 0
},
"orig": {
"type": "Identifier",
"span": {
"start": 476,
"end": 477,
"ctxt": 0
},
"value": "M",
"optional": false
},
"exported": null,
"isTypeOnly": false
},
{
"type": "ExportSpecifier",
"span": {
"start": 479,
"end": 480,
"ctxt": 0
},
"orig": {
"type": "Identifier",
"span": {
"start": 479,
"end": 480,
"ctxt": 0
},
"value": "N",
"optional": false
},
"exported": null,
"isTypeOnly": false
},
{
"type": "ExportSpecifier",
"span": {
"start": 482,
"end": 483,
"ctxt": 0
},
"orig": {
"type": "Identifier",
"span": {
"start": 482,
"end": 483,
"ctxt": 0
},
"value": "T",
"optional": false
},
"exported": null,
"isTypeOnly": false
},
{
"type": "ExportSpecifier",
"span": {
"start": 485,
"end": 486,
"ctxt": 0
},
"orig": {
"type": "Identifier",
"span": {
"start": 485,
"end": 486,
"ctxt": 0
},
"value": "a",
"optional": false
},
"exported": null,
"isTypeOnly": false
}
],
"source": null,
"typeOnly": false,
"asserts": null
}
],
"interpreter": null
}