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

302 lines
6.9 KiB
JSON
Raw Normal View History

{
"type": "Script",
"span": {
"start": 33,
"end": 164,
"ctxt": 0
},
"body": [
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 39,
"end": 40,
"ctxt": 0
},
"value": "C",
"optional": false
},
"declare": false,
"span": {
"start": 33,
"end": 76,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "TsIndexSignature",
"params": [
{
"type": "Identifier",
"span": {
"start": 55,
"end": 64,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 56,
"end": 64,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 58,
"end": 64,
"ctxt": 0
},
"kind": "string"
}
}
}
],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 65,
"end": 73,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 67,
"end": 73,
"ctxt": 0
},
"kind": "string"
}
},
"readonly": false,
"static": true,
"span": {
"start": 47,
"end": 74,
"ctxt": 0
}
}
],
"superClass": null,
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
},
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 84,
"end": 85,
"ctxt": 0
},
"value": "D",
"optional": false
},
"declare": false,
"span": {
"start": 78,
"end": 121,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "TsIndexSignature",
"params": [
{
"type": "Identifier",
"span": {
"start": 100,
"end": 109,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 101,
"end": 109,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 103,
"end": 109,
"ctxt": 0
},
"kind": "number"
}
}
}
],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 110,
"end": 118,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 112,
"end": 118,
"ctxt": 0
},
"kind": "string"
}
},
"readonly": false,
"static": true,
"span": {
"start": 92,
"end": 119,
"ctxt": 0
}
}
],
"superClass": null,
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
},
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 129,
"end": 130,
"ctxt": 0
},
"value": "E",
"optional": false
},
"declare": false,
"span": {
"start": 123,
"end": 164,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "TsIndexSignature",
"params": [
{
"type": "Identifier",
"span": {
"start": 148,
"end": 157,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 149,
"end": 157,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 151,
"end": 157,
"ctxt": 0
},
"kind": "string"
}
}
}
],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 158,
"end": 161,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 160,
"end": 161,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 160,
"end": 161,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
}
},
"readonly": false,
"static": true,
"span": {
"start": 140,
"end": 162,
"ctxt": 0
}
}
],
"superClass": null,
"isAbstract": false,
"typeParams": {
"type": "TsTypeParameterDeclaration",
"span": {
"start": 130,
"end": 133,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
"start": 131,
"end": 132,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 131,
"end": 132,
"ctxt": 0
},
"value": "T",
"optional": false
},
"in": false,
"out": false,
"constraint": null,
"default": null
}
]
},
"superTypeParams": null,
"implements": []
}
],
"interpreter": null
}