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

2451 lines
71 KiB
JSON

{
"type": "Script",
"span": {
"start": 19,
"end": 825,
"ctxt": 0
},
"body": [
{
"type": "TsTypeAliasDeclaration",
"span": {
"start": 19,
"end": 42,
"ctxt": 0
},
"declare": false,
"id": {
"type": "Identifier",
"span": {
"start": 24,
"end": 25,
"ctxt": 0
},
"value": "A",
"optional": false
},
"typeParams": null,
"typeAnnotation": {
"type": "TsTypeLiteral",
"span": {
"start": 28,
"end": 41,
"ctxt": 0
},
"members": [
{
"type": "TsPropertySignature",
"span": {
"start": 30,
"end": 39,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 30,
"end": 31,
"ctxt": 0
},
"value": "a",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 31,
"end": 39,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 33,
"end": 39,
"ctxt": 0
},
"kind": "string"
}
},
"typeParams": null
}
]
}
},
{
"type": "TsTypeAliasDeclaration",
"span": {
"start": 43,
"end": 66,
"ctxt": 0
},
"declare": false,
"id": {
"type": "Identifier",
"span": {
"start": 48,
"end": 49,
"ctxt": 0
},
"value": "B",
"optional": false
},
"typeParams": null,
"typeAnnotation": {
"type": "TsTypeLiteral",
"span": {
"start": 52,
"end": 65,
"ctxt": 0
},
"members": [
{
"type": "TsPropertySignature",
"span": {
"start": 54,
"end": 63,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 54,
"end": 55,
"ctxt": 0
},
"value": "b",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 55,
"end": 63,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 57,
"end": 63,
"ctxt": 0
},
"kind": "string"
}
},
"typeParams": null
}
]
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 68,
"end": 98,
"ctxt": 0
},
"kind": "let",
"declare": true,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 80,
"end": 97,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 80,
"end": 83,
"ctxt": 0
},
"value": "sa1",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 83,
"end": 97,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeLiteral",
"span": {
"start": 85,
"end": 97,
"ctxt": 0
},
"members": [
{
"type": "TsPropertySignature",
"span": {
"start": 87,
"end": 95,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 87,
"end": 88,
"ctxt": 0
},
"value": "x",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 88,
"end": 95,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsIntersectionType",
"span": {
"start": 90,
"end": 95,
"ctxt": 0
},
"types": [
{
"type": "TsTypeReference",
"span": {
"start": 90,
"end": 91,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 90,
"end": 91,
"ctxt": 0
},
"value": "A",
"optional": false
},
"typeParams": null
},
{
"type": "TsTypeReference",
"span": {
"start": 94,
"end": 95,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 94,
"end": 95,
"ctxt": 0
},
"value": "B",
"optional": false
},
"typeParams": null
}
]
}
},
"typeParams": null
}
]
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 99,
"end": 136,
"ctxt": 0
},
"kind": "let",
"declare": true,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 111,
"end": 135,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 111,
"end": 114,
"ctxt": 0
},
"value": "sa2",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 114,
"end": 135,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsIntersectionType",
"span": {
"start": 116,
"end": 135,
"ctxt": 0
},
"types": [
{
"type": "TsTypeLiteral",
"span": {
"start": 116,
"end": 124,
"ctxt": 0
},
"members": [
{
"type": "TsPropertySignature",
"span": {
"start": 118,
"end": 122,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 118,
"end": 119,
"ctxt": 0
},
"value": "x",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 119,
"end": 122,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 121,
"end": 122,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 121,
"end": 122,
"ctxt": 0
},
"value": "A",
"optional": false
},
"typeParams": null
}
},
"typeParams": null
}
]
},
{
"type": "TsTypeLiteral",
"span": {
"start": 127,
"end": 135,
"ctxt": 0
},
"members": [
{
"type": "TsPropertySignature",
"span": {
"start": 129,
"end": 133,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 129,
"end": 130,
"ctxt": 0
},
"value": "x",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 130,
"end": 133,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 132,
"end": 133,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 132,
"end": 133,
"ctxt": 0
},
"value": "B",
"optional": false
},
"typeParams": null
}
},
"typeParams": null
}
]
}
]
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 137,
"end": 179,
"ctxt": 0
},
"kind": "let",
"declare": true,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 149,
"end": 178,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 149,
"end": 152,
"ctxt": 0
},
"value": "ta1",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 152,
"end": 178,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeLiteral",
"span": {
"start": 154,
"end": 178,
"ctxt": 0
},
"members": [
{
"type": "TsIndexSignature",
"params": [
{
"type": "Identifier",
"span": {
"start": 157,
"end": 168,
"ctxt": 0
},
"value": "key",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 160,
"end": 168,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 162,
"end": 168,
"ctxt": 0
},
"kind": "string"
}
}
}
],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 169,
"end": 176,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsIntersectionType",
"span": {
"start": 171,
"end": 176,
"ctxt": 0
},
"types": [
{
"type": "TsTypeReference",
"span": {
"start": 171,
"end": 172,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 171,
"end": 172,
"ctxt": 0
},
"value": "A",
"optional": false
},
"typeParams": null
},
{
"type": "TsTypeReference",
"span": {
"start": 175,
"end": 176,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 175,
"end": 176,
"ctxt": 0
},
"value": "B",
"optional": false
},
"typeParams": null
}
]
}
},
"readonly": false,
"static": false,
"span": {
"start": 156,
"end": 176,
"ctxt": 0
}
}
]
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 180,
"end": 241,
"ctxt": 0
},
"kind": "let",
"declare": true,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 192,
"end": 240,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 192,
"end": 195,
"ctxt": 0
},
"value": "ta2",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 195,
"end": 240,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsIntersectionType",
"span": {
"start": 197,
"end": 240,
"ctxt": 0
},
"types": [
{
"type": "TsTypeLiteral",
"span": {
"start": 197,
"end": 217,
"ctxt": 0
},
"members": [
{
"type": "TsIndexSignature",
"params": [
{
"type": "Identifier",
"span": {
"start": 200,
"end": 211,
"ctxt": 0
},
"value": "key",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 203,
"end": 211,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 205,
"end": 211,
"ctxt": 0
},
"kind": "string"
}
}
}
],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 212,
"end": 215,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 214,
"end": 215,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 214,
"end": 215,
"ctxt": 0
},
"value": "A",
"optional": false
},
"typeParams": null
}
},
"readonly": false,
"static": false,
"span": {
"start": 199,
"end": 215,
"ctxt": 0
}
}
]
},
{
"type": "TsTypeLiteral",
"span": {
"start": 220,
"end": 240,
"ctxt": 0
},
"members": [
{
"type": "TsIndexSignature",
"params": [
{
"type": "Identifier",
"span": {
"start": 223,
"end": 234,
"ctxt": 0
},
"value": "key",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 226,
"end": 234,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 228,
"end": 234,
"ctxt": 0
},
"kind": "string"
}
}
}
],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 235,
"end": 238,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 237,
"end": 238,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 237,
"end": 238,
"ctxt": 0
},
"value": "B",
"optional": false
},
"typeParams": null
}
},
"readonly": false,
"static": false,
"span": {
"start": 222,
"end": 238,
"ctxt": 0
}
}
]
}
]
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 243,
"end": 253,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 243,
"end": 252,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "Identifier",
"span": {
"start": 243,
"end": 246,
"ctxt": 0
},
"value": "ta1",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "Identifier",
"span": {
"start": 249,
"end": 252,
"ctxt": 0
},
"value": "sa1",
"optional": false
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 254,
"end": 264,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 254,
"end": 263,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "Identifier",
"span": {
"start": 254,
"end": 257,
"ctxt": 0
},
"value": "ta1",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "Identifier",
"span": {
"start": 260,
"end": 263,
"ctxt": 0
},
"value": "sa2",
"optional": false
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 265,
"end": 275,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 265,
"end": 274,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "Identifier",
"span": {
"start": 265,
"end": 268,
"ctxt": 0
},
"value": "ta2",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "Identifier",
"span": {
"start": 271,
"end": 274,
"ctxt": 0
},
"value": "sa1",
"optional": false
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 276,
"end": 286,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 276,
"end": 285,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "Identifier",
"span": {
"start": 276,
"end": 279,
"ctxt": 0
},
"value": "ta2",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "Identifier",
"span": {
"start": 282,
"end": 285,
"ctxt": 0
},
"value": "sa2",
"optional": false
}
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 288,
"end": 325,
"ctxt": 0
},
"kind": "let",
"declare": true,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 300,
"end": 324,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 300,
"end": 303,
"ctxt": 0
},
"value": "sb1",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 303,
"end": 324,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsIntersectionType",
"span": {
"start": 305,
"end": 324,
"ctxt": 0
},
"types": [
{
"type": "TsTypeLiteral",
"span": {
"start": 305,
"end": 313,
"ctxt": 0
},
"members": [
{
"type": "TsPropertySignature",
"span": {
"start": 307,
"end": 311,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 307,
"end": 308,
"ctxt": 0
},
"value": "x",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 308,
"end": 311,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 310,
"end": 311,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 310,
"end": 311,
"ctxt": 0
},
"value": "A",
"optional": false
},
"typeParams": null
}
},
"typeParams": null
}
]
},
{
"type": "TsTypeLiteral",
"span": {
"start": 316,
"end": 324,
"ctxt": 0
},
"members": [
{
"type": "TsPropertySignature",
"span": {
"start": 318,
"end": 322,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 318,
"end": 319,
"ctxt": 0
},
"value": "y",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 319,
"end": 322,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 321,
"end": 322,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 321,
"end": 322,
"ctxt": 0
},
"value": "B",
"optional": false
},
"typeParams": null
}
},
"typeParams": null
}
]
}
]
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 326,
"end": 364,
"ctxt": 0
},
"kind": "let",
"declare": true,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 338,
"end": 363,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 338,
"end": 341,
"ctxt": 0
},
"value": "tb1",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 341,
"end": 363,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeLiteral",
"span": {
"start": 343,
"end": 363,
"ctxt": 0
},
"members": [
{
"type": "TsIndexSignature",
"params": [
{
"type": "Identifier",
"span": {
"start": 346,
"end": 357,
"ctxt": 0
},
"value": "key",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 349,
"end": 357,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 351,
"end": 357,
"ctxt": 0
},
"kind": "string"
}
}
}
],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 358,
"end": 361,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 360,
"end": 361,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 360,
"end": 361,
"ctxt": 0
},
"value": "A",
"optional": false
},
"typeParams": null
}
},
"readonly": false,
"static": false,
"span": {
"start": 345,
"end": 361,
"ctxt": 0
}
}
]
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 366,
"end": 376,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 366,
"end": 375,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "Identifier",
"span": {
"start": 366,
"end": 369,
"ctxt": 0
},
"value": "tb1",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "Identifier",
"span": {
"start": 372,
"end": 375,
"ctxt": 0
},
"value": "sb1",
"optional": false
}
}
},
{
"type": "TsTypeAliasDeclaration",
"span": {
"start": 410,
"end": 515,
"ctxt": 0
},
"declare": false,
"id": {
"type": "Identifier",
"span": {
"start": 415,
"end": 421,
"ctxt": 0
},
"value": "constr",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterDeclaration",
"span": {
"start": 421,
"end": 434,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
"start": 422,
"end": 428,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 422,
"end": 428,
"ctxt": 0
},
"value": "Source",
"optional": false
},
"in": false,
"out": false,
"const": false,
"constraint": null,
"default": null
},
{
"type": "TsTypeParameter",
"span": {
"start": 430,
"end": 433,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 430,
"end": 433,
"ctxt": 0
},
"value": "Tgt",
"optional": false
},
"in": false,
"out": false,
"const": false,
"constraint": null,
"default": null
}
]
},
"typeAnnotation": {
"type": "TsIntersectionType",
"span": {
"start": 437,
"end": 514,
"ctxt": 0
},
"types": [
{
"type": "TsMappedType",
"span": {
"start": 437,
"end": 468,
"ctxt": 0
},
"readonly": null,
"typeParam": {
"type": "TsTypeParameter",
"span": {
"start": 440,
"end": 457,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 440,
"end": 441,
"ctxt": 0
},
"value": "K",
"optional": false
},
"in": false,
"out": false,
"const": false,
"constraint": {
"type": "TsTypeOperator",
"span": {
"start": 445,
"end": 457,
"ctxt": 0
},
"op": "keyof",
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 451,
"end": 457,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 451,
"end": 457,
"ctxt": 0
},
"value": "Source",
"optional": false
},
"typeParams": null
}
},
"default": null
},
"nameType": null,
"optional": null,
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 460,
"end": 466,
"ctxt": 0
},
"kind": "string"
}
},
{
"type": "TsTypeReference",
"span": {
"start": 471,
"end": 514,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 471,
"end": 475,
"ctxt": 0
},
"value": "Pick",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 475,
"end": 514,
"ctxt": 0
},
"params": [
{
"type": "TsTypeReference",
"span": {
"start": 476,
"end": 479,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 476,
"end": 479,
"ctxt": 0
},
"value": "Tgt",
"optional": false
},
"typeParams": null
},
{
"type": "TsTypeReference",
"span": {
"start": 481,
"end": 513,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 481,
"end": 488,
"ctxt": 0
},
"value": "Exclude",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 488,
"end": 513,
"ctxt": 0
},
"params": [
{
"type": "TsTypeOperator",
"span": {
"start": 489,
"end": 498,
"ctxt": 0
},
"op": "keyof",
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 495,
"end": 498,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 495,
"end": 498,
"ctxt": 0
},
"value": "Tgt",
"optional": false
},
"typeParams": null
}
},
{
"type": "TsTypeOperator",
"span": {
"start": 500,
"end": 512,
"ctxt": 0
},
"op": "keyof",
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 506,
"end": 512,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 506,
"end": 512,
"ctxt": 0
},
"value": "Source",
"optional": false
},
"typeParams": null
}
}
]
}
}
]
}
}
]
}
},
{
"type": "TsTypeAliasDeclaration",
"span": {
"start": 517,
"end": 571,
"ctxt": 0
},
"declare": false,
"id": {
"type": "Identifier",
"span": {
"start": 522,
"end": 523,
"ctxt": 0
},
"value": "s",
"optional": false
},
"typeParams": null,
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 526,
"end": 570,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 526,
"end": 532,
"ctxt": 0
},
"value": "constr",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 532,
"end": 570,
"ctxt": 0
},
"params": [
{
"type": "TsTypeLiteral",
"span": {
"start": 533,
"end": 535,
"ctxt": 0
},
"members": []
},
{
"type": "TsTypeLiteral",
"span": {
"start": 537,
"end": 569,
"ctxt": 0
},
"members": [
{
"type": "TsIndexSignature",
"params": [
{
"type": "Identifier",
"span": {
"start": 540,
"end": 551,
"ctxt": 0
},
"value": "key",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 543,
"end": 551,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 545,
"end": 551,
"ctxt": 0
},
"kind": "string"
}
}
}
],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 552,
"end": 567,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeLiteral",
"span": {
"start": 554,
"end": 567,
"ctxt": 0
},
"members": [
{
"type": "TsPropertySignature",
"span": {
"start": 556,
"end": 565,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 556,
"end": 557,
"ctxt": 0
},
"value": "a",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 557,
"end": 565,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 559,
"end": 565,
"ctxt": 0
},
"kind": "string"
}
},
"typeParams": null
}
]
}
},
"readonly": false,
"static": false,
"span": {
"start": 539,
"end": 567,
"ctxt": 0
}
}
]
}
]
}
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 573,
"end": 592,
"ctxt": 0
},
"kind": "const",
"declare": true,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 587,
"end": 591,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 587,
"end": 588,
"ctxt": 0
},
"value": "q",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 588,
"end": 591,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 590,
"end": 591,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 590,
"end": 591,
"ctxt": 0
},
"value": "s",
"optional": false
},
"typeParams": null
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 593,
"end": 614,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 593,
"end": 613,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 593,
"end": 610,
"ctxt": 0
},
"object": {
"type": "MemberExpression",
"span": {
"start": 593,
"end": 603,
"ctxt": 0
},
"object": {
"type": "MemberExpression",
"span": {
"start": 593,
"end": 601,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 593,
"end": 594,
"ctxt": 0
},
"value": "q",
"optional": false
},
"property": {
"type": "Computed",
"span": {
"start": 594,
"end": 601,
"ctxt": 0
},
"expression": {
"type": "StringLiteral",
"span": {
"start": 595,
"end": 600,
"ctxt": 0
},
"value": "asd",
"raw": "\"asd\""
}
}
},
"property": {
"type": "Identifier",
"span": {
"start": 602,
"end": 603,
"ctxt": 0
},
"value": "a",
"optional": false
}
},
"property": {
"type": "Identifier",
"span": {
"start": 604,
"end": 610,
"ctxt": 0
},
"value": "substr",
"optional": false
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "NumericLiteral",
"span": {
"start": 611,
"end": 612,
"ctxt": 0
},
"value": 1.0,
"raw": "1"
}
}
],
"typeArguments": null
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 615,
"end": 626,
"ctxt": 0
},
"expression": {
"type": "MemberExpression",
"span": {
"start": 615,
"end": 625,
"ctxt": 0
},
"object": {
"type": "MemberExpression",
"span": {
"start": 615,
"end": 623,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 615,
"end": 616,
"ctxt": 0
},
"value": "q",
"optional": false
},
"property": {
"type": "Computed",
"span": {
"start": 616,
"end": 623,
"ctxt": 0
},
"expression": {
"type": "StringLiteral",
"span": {
"start": 617,
"end": 622,
"ctxt": 0
},
"value": "asd",
"raw": "\"asd\""
}
}
},
"property": {
"type": "Identifier",
"span": {
"start": 624,
"end": 625,
"ctxt": 0
},
"value": "b",
"optional": false
}
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 638,
"end": 693,
"ctxt": 0
},
"kind": "const",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 644,
"end": 692,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 644,
"end": 645,
"ctxt": 0
},
"value": "d",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 645,
"end": 688,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeLiteral",
"span": {
"start": 647,
"end": 688,
"ctxt": 0
},
"members": [
{
"type": "TsIndexSignature",
"params": [
{
"type": "Identifier",
"span": {
"start": 650,
"end": 661,
"ctxt": 0
},
"value": "key",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 653,
"end": 661,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 655,
"end": 661,
"ctxt": 0
},
"kind": "string"
}
}
}
],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 662,
"end": 686,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeLiteral",
"span": {
"start": 664,
"end": 686,
"ctxt": 0
},
"members": [
{
"type": "TsPropertySignature",
"span": {
"start": 665,
"end": 675,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 665,
"end": 666,
"ctxt": 0
},
"value": "a",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 666,
"end": 674,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 668,
"end": 674,
"ctxt": 0
},
"kind": "string"
}
},
"typeParams": null
},
{
"type": "TsPropertySignature",
"span": {
"start": 676,
"end": 685,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 676,
"end": 677,
"ctxt": 0
},
"value": "b",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 677,
"end": 685,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 679,
"end": 685,
"ctxt": 0
},
"kind": "string"
}
},
"typeParams": null
}
]
}
},
"readonly": false,
"static": false,
"span": {
"start": 649,
"end": 686,
"ctxt": 0
}
}
]
}
}
},
"init": {
"type": "Identifier",
"span": {
"start": 691,
"end": 692,
"ctxt": 0
},
"value": "q",
"optional": false
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 727,
"end": 773,
"ctxt": 0
},
"kind": "let",
"declare": true,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 739,
"end": 772,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 739,
"end": 741,
"ctxt": 0
},
"value": "ss",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 741,
"end": 772,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsIntersectionType",
"span": {
"start": 743,
"end": 772,
"ctxt": 0
},
"types": [
{
"type": "TsTypeLiteral",
"span": {
"start": 743,
"end": 756,
"ctxt": 0
},
"members": [
{
"type": "TsPropertySignature",
"span": {
"start": 745,
"end": 754,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 745,
"end": 746,
"ctxt": 0
},
"value": "a",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 746,
"end": 754,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 748,
"end": 754,
"ctxt": 0
},
"kind": "string"
}
},
"typeParams": null
}
]
},
{
"type": "TsTypeLiteral",
"span": {
"start": 759,
"end": 772,
"ctxt": 0
},
"members": [
{
"type": "TsPropertySignature",
"span": {
"start": 761,
"end": 770,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 761,
"end": 762,
"ctxt": 0
},
"value": "b",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 762,
"end": 770,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 764,
"end": 770,
"ctxt": 0
},
"kind": "number"
}
},
"typeParams": null
}
]
}
]
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 774,
"end": 816,
"ctxt": 0
},
"kind": "let",
"declare": true,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 786,
"end": 815,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 786,
"end": 788,
"ctxt": 0
},
"value": "tt",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 788,
"end": 815,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeLiteral",
"span": {
"start": 790,
"end": 815,
"ctxt": 0
},
"members": [
{
"type": "TsIndexSignature",
"params": [
{
"type": "Identifier",
"span": {
"start": 793,
"end": 804,
"ctxt": 0
},
"value": "key",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 796,
"end": 804,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 798,
"end": 804,
"ctxt": 0
},
"kind": "string"
}
}
}
],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 805,
"end": 813,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 807,
"end": 813,
"ctxt": 0
},
"kind": "string"
}
},
"readonly": false,
"static": false,
"span": {
"start": 792,
"end": 813,
"ctxt": 0
}
}
]
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 817,
"end": 825,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 817,
"end": 824,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "Identifier",
"span": {
"start": 817,
"end": 819,
"ctxt": 0
},
"value": "tt",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "Identifier",
"span": {
"start": 822,
"end": 824,
"ctxt": 0
},
"value": "ss",
"optional": false
}
}
}
],
"interpreter": null
}