swc/crates/swc_ecma_parser/tests/tsc/exportsAndImports1-amd.json
2022-04-05 12:46:35 +00:00

1384 lines
30 KiB
JSON

{
"type": "Module",
"span": {
"start": 53,
"end": 499,
"ctxt": 0
},
"body": [
{
"type": "VariableDeclaration",
"span": {
"start": 53,
"end": 63,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 57,
"end": 62,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 57,
"end": 58,
"ctxt": 0
},
"value": "v",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "NumericLiteral",
"span": {
"start": 61,
"end": 62,
"ctxt": 0
},
"value": 1.0,
"raw": "1"
},
"definite": false
}
]
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 73,
"end": 74,
"ctxt": 0
},
"value": "f",
"optional": false
},
"declare": false,
"params": [],
"decorators": [],
"span": {
"start": 64,
"end": 80,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 77,
"end": 80,
"ctxt": 0
},
"stmts": []
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 87,
"end": 88,
"ctxt": 0
},
"value": "C",
"optional": false
},
"declare": false,
"span": {
"start": 81,
"end": 92,
"ctxt": 0
},
"decorators": [],
"body": [],
"superClass": null,
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
},
{
"type": "TsInterfaceDeclaration",
"span": {
"start": 93,
"end": 108,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 103,
"end": 104,
"ctxt": 0
},
"value": "I",
"optional": false
},
"declare": false,
"typeParams": null,
"extends": [],
"body": {
"type": "TsInterfaceBody",
"span": {
"start": 105,
"end": 108,
"ctxt": 0
},
"body": []
}
},
{
"type": "TsEnumDeclaration",
"span": {
"start": 109,
"end": 131,
"ctxt": 0
},
"declare": false,
"isConst": false,
"id": {
"type": "Identifier",
"span": {
"start": 114,
"end": 115,
"ctxt": 0
},
"value": "E",
"optional": false
},
"members": [
{
"type": "TsEnumMember",
"span": {
"start": 122,
"end": 123,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 122,
"end": 123,
"ctxt": 0
},
"value": "A",
"optional": false
},
"init": null
},
{
"type": "TsEnumMember",
"span": {
"start": 125,
"end": 126,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 125,
"end": 126,
"ctxt": 0
},
"value": "B",
"optional": false
},
"init": null
},
{
"type": "TsEnumMember",
"span": {
"start": 128,
"end": 129,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 128,
"end": 129,
"ctxt": 0
},
"value": "C",
"optional": false
},
"init": null
}
]
},
{
"type": "TsEnumDeclaration",
"span": {
"start": 132,
"end": 160,
"ctxt": 0
},
"declare": false,
"isConst": true,
"id": {
"type": "Identifier",
"span": {
"start": 143,
"end": 144,
"ctxt": 0
},
"value": "D",
"optional": false
},
"members": [
{
"type": "TsEnumMember",
"span": {
"start": 151,
"end": 152,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 151,
"end": 152,
"ctxt": 0
},
"value": "A",
"optional": false
},
"init": null
},
{
"type": "TsEnumMember",
"span": {
"start": 154,
"end": 155,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 154,
"end": 155,
"ctxt": 0
},
"value": "B",
"optional": false
},
"init": null
},
{
"type": "TsEnumMember",
"span": {
"start": 157,
"end": 158,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 157,
"end": 158,
"ctxt": 0
},
"value": "C",
"optional": false
},
"init": null
}
]
},
{
"type": "TsModuleDeclaration",
"span": {
"start": 161,
"end": 191,
"ctxt": 0
},
"declare": false,
"global": false,
"id": {
"type": "Identifier",
"span": {
"start": 168,
"end": 169,
"ctxt": 0
},
"value": "M",
"optional": false
},
"body": {
"type": "TsModuleBlock",
"span": {
"start": 170,
"end": 191,
"ctxt": 0
},
"body": [
{
"type": "ExportDeclaration",
"span": {
"start": 176,
"end": 189,
"ctxt": 0
},
"declaration": {
"type": "VariableDeclaration",
"span": {
"start": 183,
"end": 189,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 187,
"end": 188,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 187,
"end": 188,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": null
},
"init": null,
"definite": false
}
]
}
}
]
}
},
{
"type": "TsModuleDeclaration",
"span": {
"start": 192,
"end": 235,
"ctxt": 0
},
"declare": false,
"global": false,
"id": {
"type": "Identifier",
"span": {
"start": 199,
"end": 200,
"ctxt": 0
},
"value": "N",
"optional": false
},
"body": {
"type": "TsModuleBlock",
"span": {
"start": 201,
"end": 235,
"ctxt": 0
},
"body": [
{
"type": "ExportDeclaration",
"span": {
"start": 207,
"end": 233,
"ctxt": 0
},
"declaration": {
"type": "TsInterfaceDeclaration",
"span": {
"start": 214,
"end": 233,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 224,
"end": 225,
"ctxt": 0
},
"value": "I",
"optional": false
},
"declare": false,
"typeParams": null,
"extends": [],
"body": {
"type": "TsInterfaceBody",
"span": {
"start": 226,
"end": 233,
"ctxt": 0
},
"body": []
}
}
}
]
}
},
{
"type": "TsTypeAliasDeclaration",
"span": {
"start": 236,
"end": 252,
"ctxt": 0
},
"declare": false,
"id": {
"type": "Identifier",
"span": {
"start": 241,
"end": 242,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null,
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 245,
"end": 251,
"ctxt": 0
},
"kind": "number"
}
},
{
"type": "TsImportEqualsDeclaration",
"span": {
"start": 253,
"end": 268,
"ctxt": 0
},
"declare": false,
"isExport": false,
"isTypeOnly": false,
"id": {
"type": "Identifier",
"span": {
"start": 260,
"end": 261,
"ctxt": 0
},
"value": "a",
"optional": false
},
"moduleRef": {
"type": "TsQualifiedName",
"left": {
"type": "Identifier",
"span": {
"start": 264,
"end": 265,
"ctxt": 0
},
"value": "M",
"optional": false
},
"right": {
"type": "Identifier",
"span": {
"start": 266,
"end": 267,
"ctxt": 0
},
"value": "x",
"optional": false
}
}
},
{
"type": "ExportNamedDeclaration",
"span": {
"start": 270,
"end": 310,
"ctxt": 0
},
"specifiers": [
{
"type": "ExportSpecifier",
"span": {
"start": 279,
"end": 280,
"ctxt": 0
},
"orig": {
"type": "Identifier",
"span": {
"start": 279,
"end": 280,
"ctxt": 0
},
"value": "v",
"optional": false
},
"exported": null,
"isTypeOnly": false
},
{
"type": "ExportSpecifier",
"span": {
"start": 282,
"end": 283,
"ctxt": 0
},
"orig": {
"type": "Identifier",
"span": {
"start": 282,
"end": 283,
"ctxt": 0
},
"value": "f",
"optional": false
},
"exported": null,
"isTypeOnly": false
},
{
"type": "ExportSpecifier",
"span": {
"start": 285,
"end": 286,
"ctxt": 0
},
"orig": {
"type": "Identifier",
"span": {
"start": 285,
"end": 286,
"ctxt": 0
},
"value": "C",
"optional": false
},
"exported": null,
"isTypeOnly": false
},
{
"type": "ExportSpecifier",
"span": {
"start": 288,
"end": 289,
"ctxt": 0
},
"orig": {
"type": "Identifier",
"span": {
"start": 288,
"end": 289,
"ctxt": 0
},
"value": "I",
"optional": false
},
"exported": null,
"isTypeOnly": false
},
{
"type": "ExportSpecifier",
"span": {
"start": 291,
"end": 292,
"ctxt": 0
},
"orig": {
"type": "Identifier",
"span": {
"start": 291,
"end": 292,
"ctxt": 0
},
"value": "E",
"optional": false
},
"exported": null,
"isTypeOnly": false
},
{
"type": "ExportSpecifier",
"span": {
"start": 294,
"end": 295,
"ctxt": 0
},
"orig": {
"type": "Identifier",
"span": {
"start": 294,
"end": 295,
"ctxt": 0
},
"value": "D",
"optional": false
},
"exported": null,
"isTypeOnly": false
},
{
"type": "ExportSpecifier",
"span": {
"start": 297,
"end": 298,
"ctxt": 0
},
"orig": {
"type": "Identifier",
"span": {
"start": 297,
"end": 298,
"ctxt": 0
},
"value": "M",
"optional": false
},
"exported": null,
"isTypeOnly": false
},
{
"type": "ExportSpecifier",
"span": {
"start": 300,
"end": 301,
"ctxt": 0
},
"orig": {
"type": "Identifier",
"span": {
"start": 300,
"end": 301,
"ctxt": 0
},
"value": "N",
"optional": false
},
"exported": null,
"isTypeOnly": false
},
{
"type": "ExportSpecifier",
"span": {
"start": 303,
"end": 304,
"ctxt": 0
},
"orig": {
"type": "Identifier",
"span": {
"start": 303,
"end": 304,
"ctxt": 0
},
"value": "T",
"optional": false
},
"exported": null,
"isTypeOnly": false
},
{
"type": "ExportSpecifier",
"span": {
"start": 306,
"end": 307,
"ctxt": 0
},
"orig": {
"type": "Identifier",
"span": {
"start": 306,
"end": 307,
"ctxt": 0
},
"value": "a",
"optional": false
},
"exported": null,
"isTypeOnly": false
}
],
"source": null,
"typeOnly": false,
"asserts": null
},
{
"type": "ExportNamedDeclaration",
"span": {
"start": 332,
"end": 384,
"ctxt": 0
},
"specifiers": [
{
"type": "ExportSpecifier",
"span": {
"start": 341,
"end": 342,
"ctxt": 0
},
"orig": {
"type": "Identifier",
"span": {
"start": 341,
"end": 342,
"ctxt": 0
},
"value": "v",
"optional": false
},
"exported": null,
"isTypeOnly": false
},
{
"type": "ExportSpecifier",
"span": {
"start": 344,
"end": 345,
"ctxt": 0
},
"orig": {
"type": "Identifier",
"span": {
"start": 344,
"end": 345,
"ctxt": 0
},
"value": "f",
"optional": false
},
"exported": null,
"isTypeOnly": false
},
{
"type": "ExportSpecifier",
"span": {
"start": 347,
"end": 348,
"ctxt": 0
},
"orig": {
"type": "Identifier",
"span": {
"start": 347,
"end": 348,
"ctxt": 0
},
"value": "C",
"optional": false
},
"exported": null,
"isTypeOnly": false
},
{
"type": "ExportSpecifier",
"span": {
"start": 350,
"end": 351,
"ctxt": 0
},
"orig": {
"type": "Identifier",
"span": {
"start": 350,
"end": 351,
"ctxt": 0
},
"value": "I",
"optional": false
},
"exported": null,
"isTypeOnly": false
},
{
"type": "ExportSpecifier",
"span": {
"start": 353,
"end": 354,
"ctxt": 0
},
"orig": {
"type": "Identifier",
"span": {
"start": 353,
"end": 354,
"ctxt": 0
},
"value": "E",
"optional": false
},
"exported": null,
"isTypeOnly": false
},
{
"type": "ExportSpecifier",
"span": {
"start": 356,
"end": 357,
"ctxt": 0
},
"orig": {
"type": "Identifier",
"span": {
"start": 356,
"end": 357,
"ctxt": 0
},
"value": "D",
"optional": false
},
"exported": null,
"isTypeOnly": false
},
{
"type": "ExportSpecifier",
"span": {
"start": 359,
"end": 360,
"ctxt": 0
},
"orig": {
"type": "Identifier",
"span": {
"start": 359,
"end": 360,
"ctxt": 0
},
"value": "M",
"optional": false
},
"exported": null,
"isTypeOnly": false
},
{
"type": "ExportSpecifier",
"span": {
"start": 362,
"end": 363,
"ctxt": 0
},
"orig": {
"type": "Identifier",
"span": {
"start": 362,
"end": 363,
"ctxt": 0
},
"value": "N",
"optional": false
},
"exported": null,
"isTypeOnly": false
},
{
"type": "ExportSpecifier",
"span": {
"start": 365,
"end": 366,
"ctxt": 0
},
"orig": {
"type": "Identifier",
"span": {
"start": 365,
"end": 366,
"ctxt": 0
},
"value": "T",
"optional": false
},
"exported": null,
"isTypeOnly": false
},
{
"type": "ExportSpecifier",
"span": {
"start": 368,
"end": 369,
"ctxt": 0
},
"orig": {
"type": "Identifier",
"span": {
"start": 368,
"end": 369,
"ctxt": 0
},
"value": "a",
"optional": false
},
"exported": null,
"isTypeOnly": false
}
],
"source": {
"type": "StringLiteral",
"span": {
"start": 377,
"end": 383,
"ctxt": 0
},
"value": "./t1",
"raw": "\"./t1\""
},
"typeOnly": false,
"asserts": null
},
{
"type": "ImportDeclaration",
"span": {
"start": 406,
"end": 458,
"ctxt": 0
},
"specifiers": [
{
"type": "ImportSpecifier",
"span": {
"start": 415,
"end": 416,
"ctxt": 0
},
"local": {
"type": "Identifier",
"span": {
"start": 415,
"end": 416,
"ctxt": 0
},
"value": "v",
"optional": false
},
"imported": null,
"isTypeOnly": false
},
{
"type": "ImportSpecifier",
"span": {
"start": 418,
"end": 419,
"ctxt": 0
},
"local": {
"type": "Identifier",
"span": {
"start": 418,
"end": 419,
"ctxt": 0
},
"value": "f",
"optional": false
},
"imported": null,
"isTypeOnly": false
},
{
"type": "ImportSpecifier",
"span": {
"start": 421,
"end": 422,
"ctxt": 0
},
"local": {
"type": "Identifier",
"span": {
"start": 421,
"end": 422,
"ctxt": 0
},
"value": "C",
"optional": false
},
"imported": null,
"isTypeOnly": false
},
{
"type": "ImportSpecifier",
"span": {
"start": 424,
"end": 425,
"ctxt": 0
},
"local": {
"type": "Identifier",
"span": {
"start": 424,
"end": 425,
"ctxt": 0
},
"value": "I",
"optional": false
},
"imported": null,
"isTypeOnly": false
},
{
"type": "ImportSpecifier",
"span": {
"start": 427,
"end": 428,
"ctxt": 0
},
"local": {
"type": "Identifier",
"span": {
"start": 427,
"end": 428,
"ctxt": 0
},
"value": "E",
"optional": false
},
"imported": null,
"isTypeOnly": false
},
{
"type": "ImportSpecifier",
"span": {
"start": 430,
"end": 431,
"ctxt": 0
},
"local": {
"type": "Identifier",
"span": {
"start": 430,
"end": 431,
"ctxt": 0
},
"value": "D",
"optional": false
},
"imported": null,
"isTypeOnly": false
},
{
"type": "ImportSpecifier",
"span": {
"start": 433,
"end": 434,
"ctxt": 0
},
"local": {
"type": "Identifier",
"span": {
"start": 433,
"end": 434,
"ctxt": 0
},
"value": "M",
"optional": false
},
"imported": null,
"isTypeOnly": false
},
{
"type": "ImportSpecifier",
"span": {
"start": 436,
"end": 437,
"ctxt": 0
},
"local": {
"type": "Identifier",
"span": {
"start": 436,
"end": 437,
"ctxt": 0
},
"value": "N",
"optional": false
},
"imported": null,
"isTypeOnly": false
},
{
"type": "ImportSpecifier",
"span": {
"start": 439,
"end": 440,
"ctxt": 0
},
"local": {
"type": "Identifier",
"span": {
"start": 439,
"end": 440,
"ctxt": 0
},
"value": "T",
"optional": false
},
"imported": null,
"isTypeOnly": false
},
{
"type": "ImportSpecifier",
"span": {
"start": 442,
"end": 443,
"ctxt": 0
},
"local": {
"type": "Identifier",
"span": {
"start": 442,
"end": 443,
"ctxt": 0
},
"value": "a",
"optional": false
},
"imported": null,
"isTypeOnly": false
}
],
"source": {
"type": "StringLiteral",
"span": {
"start": 451,
"end": 457,
"ctxt": 0
},
"value": "./t1",
"raw": "\"./t1\""
},
"typeOnly": false,
"asserts": null
},
{
"type": "ExportNamedDeclaration",
"span": {
"start": 459,
"end": 499,
"ctxt": 0
},
"specifiers": [
{
"type": "ExportSpecifier",
"span": {
"start": 468,
"end": 469,
"ctxt": 0
},
"orig": {
"type": "Identifier",
"span": {
"start": 468,
"end": 469,
"ctxt": 0
},
"value": "v",
"optional": false
},
"exported": null,
"isTypeOnly": false
},
{
"type": "ExportSpecifier",
"span": {
"start": 471,
"end": 472,
"ctxt": 0
},
"orig": {
"type": "Identifier",
"span": {
"start": 471,
"end": 472,
"ctxt": 0
},
"value": "f",
"optional": false
},
"exported": null,
"isTypeOnly": false
},
{
"type": "ExportSpecifier",
"span": {
"start": 474,
"end": 475,
"ctxt": 0
},
"orig": {
"type": "Identifier",
"span": {
"start": 474,
"end": 475,
"ctxt": 0
},
"value": "C",
"optional": false
},
"exported": null,
"isTypeOnly": false
},
{
"type": "ExportSpecifier",
"span": {
"start": 477,
"end": 478,
"ctxt": 0
},
"orig": {
"type": "Identifier",
"span": {
"start": 477,
"end": 478,
"ctxt": 0
},
"value": "I",
"optional": false
},
"exported": null,
"isTypeOnly": false
},
{
"type": "ExportSpecifier",
"span": {
"start": 480,
"end": 481,
"ctxt": 0
},
"orig": {
"type": "Identifier",
"span": {
"start": 480,
"end": 481,
"ctxt": 0
},
"value": "E",
"optional": false
},
"exported": null,
"isTypeOnly": false
},
{
"type": "ExportSpecifier",
"span": {
"start": 483,
"end": 484,
"ctxt": 0
},
"orig": {
"type": "Identifier",
"span": {
"start": 483,
"end": 484,
"ctxt": 0
},
"value": "D",
"optional": false
},
"exported": null,
"isTypeOnly": false
},
{
"type": "ExportSpecifier",
"span": {
"start": 486,
"end": 487,
"ctxt": 0
},
"orig": {
"type": "Identifier",
"span": {
"start": 486,
"end": 487,
"ctxt": 0
},
"value": "M",
"optional": false
},
"exported": null,
"isTypeOnly": false
},
{
"type": "ExportSpecifier",
"span": {
"start": 489,
"end": 490,
"ctxt": 0
},
"orig": {
"type": "Identifier",
"span": {
"start": 489,
"end": 490,
"ctxt": 0
},
"value": "N",
"optional": false
},
"exported": null,
"isTypeOnly": false
},
{
"type": "ExportSpecifier",
"span": {
"start": 492,
"end": 493,
"ctxt": 0
},
"orig": {
"type": "Identifier",
"span": {
"start": 492,
"end": 493,
"ctxt": 0
},
"value": "T",
"optional": false
},
"exported": null,
"isTypeOnly": false
},
{
"type": "ExportSpecifier",
"span": {
"start": 495,
"end": 496,
"ctxt": 0
},
"orig": {
"type": "Identifier",
"span": {
"start": 495,
"end": 496,
"ctxt": 0
},
"value": "a",
"optional": false
},
"exported": null,
"isTypeOnly": false
}
],
"source": null,
"typeOnly": false,
"asserts": null
}
],
"interpreter": null
}