swc/crates/swc_ecma_parser/tests/tsc/overrideInterfaceProperty.json
2022-02-04 17:08:38 +09:00

818 lines
23 KiB
JSON

{
"type": "Script",
"span": {
"start": 54,
"end": 442,
"ctxt": 0
},
"body": [
{
"type": "TsInterfaceDeclaration",
"span": {
"start": 54,
"end": 104,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 64,
"end": 67,
"ctxt": 0
},
"value": "Mup",
"optional": false
},
"declare": false,
"typeParams": {
"type": "TsTypeParameterDeclaration",
"span": {
"start": 67,
"end": 73,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
"start": 68,
"end": 69,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 68,
"end": 69,
"ctxt": 0
},
"value": "K",
"optional": false
},
"constraint": null,
"default": null
},
{
"type": "TsTypeParameter",
"span": {
"start": 71,
"end": 72,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 71,
"end": 72,
"ctxt": 0
},
"value": "V",
"optional": false
},
"constraint": null,
"default": null
}
]
},
"extends": [],
"body": {
"type": "TsInterfaceBody",
"span": {
"start": 74,
"end": 104,
"ctxt": 0
},
"body": [
{
"type": "TsPropertySignature",
"span": {
"start": 80,
"end": 102,
"ctxt": 0
},
"readonly": true,
"key": {
"type": "Identifier",
"span": {
"start": 89,
"end": 93,
"ctxt": 0
},
"value": "size",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 93,
"end": 101,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 95,
"end": 101,
"ctxt": 0
},
"kind": "number"
}
},
"typeParams": null
}
]
}
},
{
"type": "TsInterfaceDeclaration",
"span": {
"start": 105,
"end": 271,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 115,
"end": 129,
"ctxt": 0
},
"value": "MupConstructor",
"optional": false
},
"declare": false,
"typeParams": null,
"extends": [],
"body": {
"type": "TsInterfaceBody",
"span": {
"start": 130,
"end": 271,
"ctxt": 0
},
"body": [
{
"type": "TsConstructSignatureDeclaration",
"span": {
"start": 136,
"end": 157,
"ctxt": 0
},
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 141,
"end": 156,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 143,
"end": 156,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 143,
"end": 146,
"ctxt": 0
},
"value": "Mup",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 146,
"end": 156,
"ctxt": 0
},
"params": [
{
"type": "TsKeywordType",
"span": {
"start": 147,
"end": 150,
"ctxt": 0
},
"kind": "any"
},
{
"type": "TsKeywordType",
"span": {
"start": 152,
"end": 155,
"ctxt": 0
},
"kind": "any"
}
]
}
}
},
"typeParams": null
},
{
"type": "TsConstructSignatureDeclaration",
"span": {
"start": 162,
"end": 230,
"ctxt": 0
},
"params": [
{
"type": "Identifier",
"span": {
"start": 172,
"end": 217,
"ctxt": 0
},
"value": "entries",
"optional": true,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 180,
"end": 217,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsUnionType",
"span": {
"start": 182,
"end": 217,
"ctxt": 0
},
"types": [
{
"type": "TsTypeOperator",
"span": {
"start": 182,
"end": 210,
"ctxt": 0
},
"op": "readonly",
"typeAnnotation": {
"type": "TsArrayType",
"span": {
"start": 191,
"end": 210,
"ctxt": 0
},
"elemType": {
"type": "TsParenthesizedType",
"span": {
"start": 191,
"end": 208,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeOperator",
"span": {
"start": 192,
"end": 207,
"ctxt": 0
},
"op": "readonly",
"typeAnnotation": {
"type": "TsTupleType",
"span": {
"start": 201,
"end": 207,
"ctxt": 0
},
"elemTypes": [
{
"type": "TsTupleElement",
"span": {
"start": 202,
"end": 203,
"ctxt": 0
},
"label": null,
"ty": {
"type": "TsTypeReference",
"span": {
"start": 202,
"end": 203,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 202,
"end": 203,
"ctxt": 0
},
"value": "K",
"optional": false
},
"typeParams": null
}
},
{
"type": "TsTupleElement",
"span": {
"start": 205,
"end": 206,
"ctxt": 0
},
"label": null,
"ty": {
"type": "TsTypeReference",
"span": {
"start": 205,
"end": 206,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 205,
"end": 206,
"ctxt": 0
},
"value": "V",
"optional": false
},
"typeParams": null
}
}
]
}
}
}
}
},
{
"type": "TsKeywordType",
"span": {
"start": 213,
"end": 217,
"ctxt": 0
},
"kind": "null"
}
]
}
}
}
],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 218,
"end": 229,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 220,
"end": 229,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 220,
"end": 223,
"ctxt": 0
},
"value": "Mup",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 223,
"end": 229,
"ctxt": 0
},
"params": [
{
"type": "TsTypeReference",
"span": {
"start": 224,
"end": 225,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 224,
"end": 225,
"ctxt": 0
},
"value": "K",
"optional": false
},
"typeParams": null
},
{
"type": "TsTypeReference",
"span": {
"start": 227,
"end": 228,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 227,
"end": 228,
"ctxt": 0
},
"value": "V",
"optional": false
},
"typeParams": null
}
]
}
}
},
"typeParams": {
"type": "TsTypeParameterDeclaration",
"span": {
"start": 165,
"end": 171,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
"start": 166,
"end": 167,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 166,
"end": 167,
"ctxt": 0
},
"value": "K",
"optional": false
},
"constraint": null,
"default": null
},
{
"type": "TsTypeParameter",
"span": {
"start": 169,
"end": 170,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 169,
"end": 170,
"ctxt": 0
},
"value": "V",
"optional": false
},
"constraint": null,
"default": null
}
]
}
},
{
"type": "TsPropertySignature",
"span": {
"start": 235,
"end": 269,
"ctxt": 0
},
"readonly": true,
"key": {
"type": "Identifier",
"span": {
"start": 244,
"end": 253,
"ctxt": 0
},
"value": "prototype",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 253,
"end": 268,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 255,
"end": 268,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 255,
"end": 258,
"ctxt": 0
},
"value": "Mup",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 258,
"end": 268,
"ctxt": 0
},
"params": [
{
"type": "TsKeywordType",
"span": {
"start": 259,
"end": 262,
"ctxt": 0
},
"kind": "any"
},
{
"type": "TsKeywordType",
"span": {
"start": 264,
"end": 267,
"ctxt": 0
},
"kind": "any"
}
]
}
}
},
"typeParams": null
}
]
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 272,
"end": 304,
"ctxt": 0
},
"kind": "var",
"declare": true,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 284,
"end": 303,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 284,
"end": 287,
"ctxt": 0
},
"value": "Mup",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 287,
"end": 303,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 289,
"end": 303,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 289,
"end": 303,
"ctxt": 0
},
"value": "MupConstructor",
"optional": false
},
"typeParams": null
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 312,
"end": 316,
"ctxt": 0
},
"value": "Sizz",
"optional": false
},
"declare": false,
"span": {
"start": 306,
"end": 399,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassMethod",
"span": {
"start": 374,
"end": 397,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 378,
"end": 382,
"ctxt": 0
},
"value": "size",
"optional": false
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 374,
"end": 397,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 385,
"end": 397,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 387,
"end": 395,
"ctxt": 0
},
"argument": {
"type": "NumericLiteral",
"span": {
"start": 394,
"end": 395,
"ctxt": 0
},
"value": 0.0
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
"kind": "getter",
"isStatic": false,
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false
}
],
"superClass": {
"type": "Identifier",
"span": {
"start": 325,
"end": 328,
"ctxt": 0
},
"value": "Mup",
"optional": false
},
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
},
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 406,
"end": 412,
"ctxt": 0
},
"value": "Kasizz",
"optional": false
},
"declare": false,
"span": {
"start": 400,
"end": 442,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassProperty",
"span": {
"start": 431,
"end": 440,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 431,
"end": 435,
"ctxt": 0
},
"value": "size",
"optional": false
},
"value": {
"type": "UnaryExpression",
"span": {
"start": 438,
"end": 440,
"ctxt": 0
},
"operator": "-",
"argument": {
"type": "NumericLiteral",
"span": {
"start": 439,
"end": 440,
"ctxt": 0
},
"value": 1.0
}
},
"typeAnnotation": null,
"isStatic": false,
"decorators": [],
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false,
"readonly": false,
"declare": false,
"definite": false
}
],
"superClass": {
"type": "Identifier",
"span": {
"start": 421,
"end": 424,
"ctxt": 0
},
"value": "Mup",
"optional": false
},
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
}
],
"interpreter": null
}