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

445 lines
9.7 KiB
JSON

{
"type": "Module",
"span": {
"start": 72,
"end": 379,
"ctxt": 0
},
"body": [
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 78,
"end": 79,
"ctxt": 0
},
"value": "A",
"optional": false
},
"declare": false,
"span": {
"start": 72,
"end": 94,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassProperty",
"span": {
"start": 82,
"end": 92,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 82,
"end": 83,
"ctxt": 0
},
"value": "a",
"optional": false
},
"value": null,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 84,
"end": 92,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 86,
"end": 92,
"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": "TsExportAssignment",
"span": {
"start": 95,
"end": 106,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 104,
"end": 105,
"ctxt": 0
},
"value": "A",
"optional": false
}
},
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 134,
"end": 143,
"ctxt": 0
},
"value": "SomeClass",
"optional": false
},
"declare": false,
"span": {
"start": 128,
"end": 146,
"ctxt": 0
},
"decorators": [],
"body": [],
"superClass": null,
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
},
{
"type": "TsExportAssignment",
"span": {
"start": 147,
"end": 166,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 156,
"end": 165,
"ctxt": 0
},
"value": "SomeClass",
"optional": false
}
},
{
"type": "TsImportEqualsDeclaration",
"span": {
"start": 188,
"end": 219,
"ctxt": 0
},
"declare": false,
"isExport": false,
"isTypeOnly": true,
"id": {
"type": "Identifier",
"span": {
"start": 200,
"end": 201,
"ctxt": 0
},
"value": "A",
"optional": false
},
"moduleRef": {
"type": "TsExternalModuleReference",
"span": {
"start": 204,
"end": 218,
"ctxt": 0
},
"expression": {
"type": "StringLiteral",
"span": {
"start": 212,
"end": 217,
"ctxt": 0
},
"value": "./a",
"raw": "'./a'"
}
}
},
{
"type": "TsImportEqualsDeclaration",
"span": {
"start": 226,
"end": 255,
"ctxt": 0
},
"declare": false,
"isExport": false,
"isTypeOnly": false,
"id": {
"type": "Identifier",
"span": {
"start": 233,
"end": 237,
"ctxt": 0
},
"value": "type",
"optional": false
},
"moduleRef": {
"type": "TsExternalModuleReference",
"span": {
"start": 240,
"end": 254,
"ctxt": 0
},
"expression": {
"type": "StringLiteral",
"span": {
"start": 248,
"end": 253,
"ctxt": 0
},
"value": "./b",
"raw": "'./b'"
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 265,
"end": 277,
"ctxt": 0
},
"expression": {
"type": "MemberExpression",
"span": {
"start": 265,
"end": 276,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 265,
"end": 266,
"ctxt": 0
},
"value": "A",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 267,
"end": 276,
"ctxt": 0
},
"value": "prototype",
"optional": false
}
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 287,
"end": 311,
"ctxt": 0
},
"kind": "const",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 293,
"end": 310,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 293,
"end": 294,
"ctxt": 0
},
"value": "a",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 294,
"end": 297,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 296,
"end": 297,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 296,
"end": 297,
"ctxt": 0
},
"value": "A",
"optional": false
},
"typeParams": null
}
}
},
"init": {
"type": "ObjectExpression",
"span": {
"start": 300,
"end": 310,
"ctxt": 0
},
"properties": [
{
"type": "KeyValueProperty",
"key": {
"type": "Identifier",
"span": {
"start": 302,
"end": 303,
"ctxt": 0
},
"value": "a",
"optional": false
},
"value": {
"type": "StringLiteral",
"span": {
"start": 305,
"end": 308,
"ctxt": 0
},
"value": "a",
"raw": "'a'"
}
}
]
},
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 318,
"end": 328,
"ctxt": 0
},
"expression": {
"type": "UnaryExpression",
"span": {
"start": 318,
"end": 327,
"ctxt": 0
},
"operator": "void",
"argument": {
"type": "Identifier",
"span": {
"start": 323,
"end": 327,
"ctxt": 0
},
"value": "type",
"optional": false
}
}
},
{
"type": "ExportDeclaration",
"span": {
"start": 335,
"end": 379,
"ctxt": 0
},
"declaration": {
"type": "VariableDeclaration",
"span": {
"start": 342,
"end": 379,
"ctxt": 0
},
"kind": "const",
"declare": true,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 356,
"end": 378,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 356,
"end": 368,
"ctxt": 0
},
"value": "AConstructor",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 368,
"end": 378,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeQuery",
"span": {
"start": 370,
"end": 378,
"ctxt": 0
},
"exprName": {
"type": "Identifier",
"span": {
"start": 377,
"end": 378,
"ctxt": 0
},
"value": "A",
"optional": false
},
"typeArguments": null
}
}
},
"init": null,
"definite": false
}
]
}
}
],
"interpreter": null
}