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

202 lines
5.6 KiB
JSON

{
"type": "Script",
"span": {
"start": 1,
"end": 84,
"ctxt": 0
},
"body": [
{
"type": "VariableDeclaration",
"span": {
"start": 1,
"end": 28,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 5,
"end": 27,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 5,
"end": 8,
"ctxt": 0
},
"value": "foo",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 8,
"end": 27,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeLiteral",
"span": {
"start": 10,
"end": 27,
"ctxt": 0
},
"members": [
{
"type": "TsIndexSignature",
"params": [
{
"type": "Identifier",
"span": {
"start": 13,
"end": 23,
"ctxt": 0
},
"value": "index",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 18,
"end": 23,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 20,
"end": 23,
"ctxt": 0
},
"kind": "any"
}
}
}
],
"typeAnnotation": null,
"readonly": false,
"static": false,
"span": {
"start": 12,
"end": 25,
"ctxt": 0
}
}
]
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 53,
"end": 84,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 57,
"end": 83,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 57,
"end": 61,
"ctxt": 0
},
"value": "foo2",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 61,
"end": 83,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeLiteral",
"span": {
"start": 63,
"end": 83,
"ctxt": 0
},
"members": [
{
"type": "TsIndexSignature",
"params": [
{
"type": "Identifier",
"span": {
"start": 66,
"end": 79,
"ctxt": 0
},
"value": "index",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 71,
"end": 79,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 73,
"end": 79,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 73,
"end": 79,
"ctxt": 0
},
"value": "RegExp",
"optional": false
},
"typeParams": null
}
}
}
],
"typeAnnotation": null,
"readonly": false,
"static": false,
"span": {
"start": 65,
"end": 81,
"ctxt": 0
}
}
]
}
}
},
"init": null,
"definite": false
}
]
}
],
"interpreter": null
}