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

614 lines
14 KiB
JSON

{
"type": "Script",
"span": {
"start": 0,
"end": 248,
"ctxt": 0
},
"body": [
{
"type": "TsInterfaceDeclaration",
"span": {
"start": 0,
"end": 30,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 10,
"end": 11,
"ctxt": 0
},
"value": "I",
"optional": false
},
"declare": false,
"typeParams": null,
"extends": [],
"body": {
"type": "TsInterfaceBody",
"span": {
"start": 12,
"end": 30,
"ctxt": 0
},
"body": [
{
"type": "TsPropertySignature",
"span": {
"start": 18,
"end": 28,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 18,
"end": 19,
"ctxt": 0
},
"value": "x",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 19,
"end": 27,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 21,
"end": 27,
"ctxt": 0
},
"kind": "number"
}
},
"typeParams": null
}
]
}
},
{
"type": "TsInterfaceDeclaration",
"span": {
"start": 32,
"end": 111,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 42,
"end": 54,
"ctxt": 0
},
"value": "IConstructor",
"optional": false
},
"declare": false,
"typeParams": null,
"extends": [],
"body": {
"type": "TsInterfaceBody",
"span": {
"start": 55,
"end": 111,
"ctxt": 0
},
"body": [
{
"type": "TsConstructSignatureDeclaration",
"span": {
"start": 61,
"end": 71,
"ctxt": 0
},
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 67,
"end": 70,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 69,
"end": 70,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 69,
"end": 70,
"ctxt": 0
},
"value": "I",
"optional": false
},
"typeParams": null
}
},
"typeParams": null
},
{
"type": "TsPropertySignature",
"span": {
"start": 81,
"end": 91,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 81,
"end": 82,
"ctxt": 0
},
"value": "y",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 82,
"end": 90,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 84,
"end": 90,
"ctxt": 0
},
"kind": "number"
}
},
"typeParams": null
},
{
"type": "TsPropertySignature",
"span": {
"start": 96,
"end": 109,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 96,
"end": 105,
"ctxt": 0
},
"value": "prototype",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 105,
"end": 108,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 107,
"end": 108,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 107,
"end": 108,
"ctxt": 0
},
"value": "I",
"optional": false
},
"typeParams": null
}
},
"typeParams": null
}
]
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 113,
"end": 133,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 117,
"end": 132,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 117,
"end": 118,
"ctxt": 0
},
"value": "I",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 118,
"end": 132,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 120,
"end": 132,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 120,
"end": 132,
"ctxt": 0
},
"value": "IConstructor",
"optional": false
},
"typeParams": null
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 150,
"end": 151,
"ctxt": 0
},
"value": "A",
"optional": false
},
"declare": false,
"span": {
"start": 135,
"end": 192,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassProperty",
"span": {
"start": 158,
"end": 168,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 158,
"end": 159,
"ctxt": 0
},
"value": "x",
"optional": false
},
"value": null,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 159,
"end": 167,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 161,
"end": 167,
"ctxt": 0
},
"kind": "number"
}
},
"isStatic": false,
"decorators": [],
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false,
"readonly": false,
"declare": false,
"definite": false
},
{
"type": "ClassProperty",
"span": {
"start": 173,
"end": 190,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 180,
"end": 181,
"ctxt": 0
},
"value": "y",
"optional": false
},
"value": null,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 181,
"end": 189,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 183,
"end": 189,
"ctxt": 0
},
"kind": "number"
}
},
"isStatic": true,
"decorators": [],
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false,
"readonly": false,
"declare": false,
"definite": false
}
],
"superClass": null,
"isAbstract": true,
"typeParams": null,
"superTypeParams": null,
"implements": []
},
{
"type": "VariableDeclaration",
"span": {
"start": 194,
"end": 211,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 198,
"end": 210,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 198,
"end": 200,
"ctxt": 0
},
"value": "AA",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 200,
"end": 210,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeQuery",
"span": {
"start": 202,
"end": 210,
"ctxt": 0
},
"exprName": {
"type": "Identifier",
"span": {
"start": 209,
"end": 210,
"ctxt": 0
},
"value": "A",
"optional": false
},
"typeArguments": null
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 212,
"end": 219,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 212,
"end": 218,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "Identifier",
"span": {
"start": 212,
"end": 214,
"ctxt": 0
},
"value": "AA",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "Identifier",
"span": {
"start": 217,
"end": 218,
"ctxt": 0
},
"value": "I",
"optional": false
}
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 221,
"end": 239,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 225,
"end": 238,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 225,
"end": 228,
"ctxt": 0
},
"value": "AAA",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 228,
"end": 238,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeQuery",
"span": {
"start": 230,
"end": 238,
"ctxt": 0
},
"exprName": {
"type": "Identifier",
"span": {
"start": 237,
"end": 238,
"ctxt": 0
},
"value": "I",
"optional": false
},
"typeArguments": null
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 240,
"end": 248,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 240,
"end": 247,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "Identifier",
"span": {
"start": 240,
"end": 243,
"ctxt": 0
},
"value": "AAA",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "Identifier",
"span": {
"start": 246,
"end": 247,
"ctxt": 0
},
"value": "A",
"optional": false
}
}
}
],
"interpreter": null
}