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

397 lines
9.1 KiB
JSON

{
"type": "Module",
"span": {
"start": 217,
"end": 1075,
"ctxt": 0
},
"body": [
{
"type": "VariableDeclaration",
"span": {
"start": 217,
"end": 260,
"ctxt": 0
},
"kind": "const",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 223,
"end": 259,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 223,
"end": 230,
"ctxt": 0
},
"value": "myTypes",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "ObjectExpression",
"span": {
"start": 233,
"end": 259,
"ctxt": 0
},
"properties": []
},
"definite": false
}
]
},
{
"type": "ExportNamedDeclaration",
"span": {
"start": 517,
"end": 534,
"ctxt": 0
},
"specifiers": [
{
"type": "ExportSpecifier",
"span": {
"start": 525,
"end": 532,
"ctxt": 0
},
"orig": {
"type": "Identifier",
"span": {
"start": 525,
"end": 532,
"ctxt": 0
},
"value": "myTypes",
"optional": false
},
"exported": null,
"isTypeOnly": false
}
],
"source": null,
"typeOnly": false,
"asserts": null
},
{
"type": "ImportDeclaration",
"span": {
"start": 558,
"end": 592,
"ctxt": 0
},
"specifiers": [
{
"type": "ImportSpecifier",
"span": {
"start": 566,
"end": 573,
"ctxt": 0
},
"local": {
"type": "Identifier",
"span": {
"start": 566,
"end": 573,
"ctxt": 0
},
"value": "myTypes",
"optional": false
},
"imported": null,
"isTypeOnly": false
}
],
"source": {
"type": "StringLiteral",
"span": {
"start": 580,
"end": 591,
"ctxt": 0
},
"value": "./file.js",
"raw": "'./file.js'"
},
"typeOnly": false,
"asserts": null
},
{
"type": "VariableDeclaration",
"span": {
"start": 667,
"end": 714,
"ctxt": 0
},
"kind": "const",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 673,
"end": 713,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 673,
"end": 684,
"ctxt": 0
},
"value": "testFnTypes",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "ObjectExpression",
"span": {
"start": 687,
"end": 713,
"ctxt": 0
},
"properties": []
},
"definite": false
}
]
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 924,
"end": 930,
"ctxt": 0
},
"value": "testFn",
"optional": false
},
"declare": false,
"params": [
{
"type": "Parameter",
"span": {
"start": 931,
"end": 936,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 931,
"end": 936,
"ctxt": 0
},
"value": "input",
"optional": false,
"typeAnnotation": null
}
}
],
"decorators": [],
"span": {
"start": 915,
"end": 1044,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 938,
"end": 1044,
"ctxt": 0
},
"stmts": [
{
"type": "IfStatement",
"span": {
"start": 944,
"end": 1042,
"ctxt": 0
},
"test": {
"type": "BinaryExpression",
"span": {
"start": 948,
"end": 973,
"ctxt": 0
},
"operator": "===",
"left": {
"type": "UnaryExpression",
"span": {
"start": 948,
"end": 960,
"ctxt": 0
},
"operator": "typeof",
"argument": {
"type": "Identifier",
"span": {
"start": 955,
"end": 960,
"ctxt": 0
},
"value": "input",
"optional": false
}
},
"right": {
"type": "StringLiteral",
"span": {
"start": 965,
"end": 973,
"ctxt": 0
},
"value": "number",
"raw": "'number'"
}
},
"consequent": {
"type": "BlockStatement",
"span": {
"start": 975,
"end": 1008,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 985,
"end": 1002,
"ctxt": 0
},
"argument": {
"type": "BinaryExpression",
"span": {
"start": 992,
"end": 1001,
"ctxt": 0
},
"operator": "*",
"left": {
"type": "NumericLiteral",
"span": {
"start": 992,
"end": 993,
"ctxt": 0
},
"value": 2.0,
"raw": "2"
},
"right": {
"type": "Identifier",
"span": {
"start": 996,
"end": 1001,
"ctxt": 0
},
"value": "input",
"optional": false
}
}
}
]
},
"alternate": {
"type": "BlockStatement",
"span": {
"start": 1014,
"end": 1042,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 1024,
"end": 1036,
"ctxt": 0
},
"argument": {
"type": "NullLiteral",
"span": {
"start": 1031,
"end": 1035,
"ctxt": 0
}
}
}
]
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
{
"type": "ExportNamedDeclaration",
"span": {
"start": 1046,
"end": 1075,
"ctxt": 0
},
"specifiers": [
{
"type": "ExportSpecifier",
"span": {
"start": 1054,
"end": 1060,
"ctxt": 0
},
"orig": {
"type": "Identifier",
"span": {
"start": 1054,
"end": 1060,
"ctxt": 0
},
"value": "testFn",
"optional": false
},
"exported": null,
"isTypeOnly": false
},
{
"type": "ExportSpecifier",
"span": {
"start": 1062,
"end": 1073,
"ctxt": 0
},
"orig": {
"type": "Identifier",
"span": {
"start": 1062,
"end": 1073,
"ctxt": 0
},
"value": "testFnTypes",
"optional": false
},
"exported": null,
"isTypeOnly": false
}
],
"source": null,
"typeOnly": false,
"asserts": null
}
],
"interpreter": null
}