{ "type": "Script", "span": { "start": 63, "end": 751, "ctxt": 0 }, "body": [ { "type": "TsInterfaceDeclaration", "span": { "start": 63, "end": 94, "ctxt": 0 }, "id": { "type": "Identifier", "span": { "start": 73, "end": 77, "ctxt": 0 }, "value": "Base", "optional": false }, "declare": false, "typeParams": null, "extends": [], "body": { "type": "TsInterfaceBody", "span": { "start": 78, "end": 94, "ctxt": 0 }, "body": [ { "type": "TsPropertySignature", "span": { "start": 80, "end": 92, "ctxt": 0 }, "readonly": false, "key": { "type": "Identifier", "span": { "start": 80, "end": 83, "ctxt": 0 }, "value": "foo", "optional": false }, "computed": false, "optional": false, "init": null, "params": [], "typeAnnotation": { "type": "TsTypeAnnotation", "span": { "start": 83, "end": 91, "ctxt": 0 }, "typeAnnotation": { "type": "TsKeywordType", "span": { "start": 85, "end": 91, "ctxt": 0 }, "kind": "string" } }, "typeParams": null } ] } }, { "type": "TsInterfaceDeclaration", "span": { "start": 95, "end": 142, "ctxt": 0 }, "id": { "type": "Identifier", "span": { "start": 105, "end": 112, "ctxt": 0 }, "value": "Derived", "optional": false }, "declare": false, "typeParams": null, "extends": [ { "type": "TsExpressionWithTypeArguments", "span": { "start": 121, "end": 125, "ctxt": 0 }, "expression": { "type": "Identifier", "span": { "start": 121, "end": 125, "ctxt": 0 }, "value": "Base", "optional": false }, "typeArguments": null } ], "body": { "type": "TsInterfaceBody", "span": { "start": 126, "end": 142, "ctxt": 0 }, "body": [ { "type": "TsPropertySignature", "span": { "start": 128, "end": 140, "ctxt": 0 }, "readonly": false, "key": { "type": "Identifier", "span": { "start": 128, "end": 131, "ctxt": 0 }, "value": "bar", "optional": false }, "computed": false, "optional": false, "init": null, "params": [], "typeAnnotation": { "type": "TsTypeAnnotation", "span": { "start": 131, "end": 139, "ctxt": 0 }, "typeAnnotation": { "type": "TsKeywordType", "span": { "start": 133, "end": 139, "ctxt": 0 }, "kind": "string" } }, "typeParams": null } ] } }, { "type": "TsInterfaceDeclaration", "span": { "start": 143, "end": 194, "ctxt": 0 }, "id": { "type": "Identifier", "span": { "start": 153, "end": 161, "ctxt": 0 }, "value": "Derived2", "optional": false }, "declare": false, "typeParams": null, "extends": [ { "type": "TsExpressionWithTypeArguments", "span": { "start": 170, "end": 177, "ctxt": 0 }, "expression": { "type": "Identifier", "span": { "start": 170, "end": 177, "ctxt": 0 }, "value": "Derived", "optional": false }, "typeArguments": null } ], "body": { "type": "TsInterfaceBody", "span": { "start": 178, "end": 194, "ctxt": 0 }, "body": [ { "type": "TsPropertySignature", "span": { "start": 180, "end": 192, "ctxt": 0 }, "readonly": false, "key": { "type": "Identifier", "span": { "start": 180, "end": 183, "ctxt": 0 }, "value": "baz", "optional": false }, "computed": false, "optional": false, "init": null, "params": [], "typeAnnotation": { "type": "TsTypeAnnotation", "span": { "start": 183, "end": 191, "ctxt": 0 }, "typeAnnotation": { "type": "TsKeywordType", "span": { "start": 185, "end": 191, "ctxt": 0 }, "kind": "string" } }, "typeParams": null } ] } }, { "type": "ClassDeclaration", "identifier": { "type": "Identifier", "span": { "start": 202, "end": 203, "ctxt": 0 }, "value": "A", "optional": false }, "declare": false, "span": { "start": 196, "end": 233, "ctxt": 0 }, "decorators": [], "body": [ { "type": "TsIndexSignature", "params": [ { "type": "Identifier", "span": { "start": 211, "end": 220, "ctxt": 0 }, "value": "x", "optional": false, "typeAnnotation": { "type": "TsTypeAnnotation", "span": { "start": 212, "end": 220, "ctxt": 0 }, "typeAnnotation": { "type": "TsKeywordType", "span": { "start": 214, "end": 220, "ctxt": 0 }, "kind": "number" } } } ], "typeAnnotation": { "type": "TsTypeAnnotation", "span": { "start": 221, "end": 230, "ctxt": 0 }, "typeAnnotation": { "type": "TsTypeReference", "span": { "start": 223, "end": 230, "ctxt": 0 }, "typeName": { "type": "Identifier", "span": { "start": 223, "end": 230, "ctxt": 0 }, "value": "Derived", "optional": false }, "typeParams": null } }, "readonly": false, "static": false, "span": { "start": 210, "end": 231, "ctxt": 0 } } ], "superClass": null, "isAbstract": false, "typeParams": null, "superTypeParams": null, "implements": [] }, { "type": "VariableDeclaration", "span": { "start": 235, "end": 244, "ctxt": 0 }, "kind": "var", "declare": false, "declarations": [ { "type": "VariableDeclarator", "span": { "start": 239, "end": 243, "ctxt": 0 }, "id": { "type": "Identifier", "span": { "start": 239, "end": 240, "ctxt": 0 }, "value": "a", "optional": false, "typeAnnotation": { "type": "TsTypeAnnotation", "span": { "start": 240, "end": 243, "ctxt": 0 }, "typeAnnotation": { "type": "TsTypeReference", "span": { "start": 242, "end": 243, "ctxt": 0 }, "typeName": { "type": "Identifier", "span": { "start": 242, "end": 243, "ctxt": 0 }, "value": "A", "optional": false }, "typeParams": null } } }, "init": null, "definite": false } ] }, { "type": "VariableDeclaration", "span": { "start": 245, "end": 275, "ctxt": 0 }, "kind": "var", "declare": false, "declarations": [ { "type": "VariableDeclarator", "span": { "start": 249, "end": 274, "ctxt": 0 }, "id": { "type": "Identifier", "span": { "start": 249, "end": 250, "ctxt": 0 }, "value": "b", "optional": false, "typeAnnotation": { "type": "TsTypeAnnotation", "span": { "start": 250, "end": 274, "ctxt": 0 }, "typeAnnotation": { "type": "TsTypeLiteral", "span": { "start": 252, "end": 274, "ctxt": 0 }, "members": [ { "type": "TsIndexSignature", "params": [ { "type": "Identifier", "span": { "start": 255, "end": 264, "ctxt": 0 }, "value": "x", "optional": false, "typeAnnotation": { "type": "TsTypeAnnotation", "span": { "start": 256, "end": 264, "ctxt": 0 }, "typeAnnotation": { "type": "TsKeywordType", "span": { "start": 258, "end": 264, "ctxt": 0 }, "kind": "number" } } } ], "typeAnnotation": { "type": "TsTypeAnnotation", "span": { "start": 265, "end": 271, "ctxt": 0 }, "typeAnnotation": { "type": "TsTypeReference", "span": { "start": 267, "end": 271, "ctxt": 0 }, "typeName": { "type": "Identifier", "span": { "start": 267, "end": 271, "ctxt": 0 }, "value": "Base", "optional": false }, "typeParams": null } }, "readonly": false, "static": false, "span": { "start": 254, "end": 272, "ctxt": 0 } } ] } } }, "init": null, "definite": false } ] }, { "type": "ExpressionStatement", "span": { "start": 277, "end": 283, "ctxt": 0 }, "expression": { "type": "AssignmentExpression", "span": { "start": 277, "end": 282, "ctxt": 0 }, "operator": "=", "left": { "type": "Identifier", "span": { "start": 277, "end": 278, "ctxt": 0 }, "value": "a", "optional": false, "typeAnnotation": null }, "right": { "type": "Identifier", "span": { "start": 281, "end": 282, "ctxt": 0 }, "value": "b", "optional": false } } }, { "type": "ExpressionStatement", "span": { "start": 293, "end": 299, "ctxt": 0 }, "expression": { "type": "AssignmentExpression", "span": { "start": 293, "end": 298, "ctxt": 0 }, "operator": "=", "left": { "type": "Identifier", "span": { "start": 293, "end": 294, "ctxt": 0 }, "value": "b", "optional": false, "typeAnnotation": null }, "right": { "type": "Identifier", "span": { "start": 297, "end": 298, "ctxt": 0 }, "value": "a", "optional": false } } }, { "type": "ClassDeclaration", "identifier": { "type": "Identifier", "span": { "start": 313, "end": 315, "ctxt": 0 }, "value": "B2", "optional": false }, "declare": false, "span": { "start": 307, "end": 362, "ctxt": 0 }, "decorators": [], "body": [ { "type": "TsIndexSignature", "params": [ { "type": "Identifier", "span": { "start": 333, "end": 342, "ctxt": 0 }, "value": "x", "optional": false, "typeAnnotation": { "type": "TsTypeAnnotation", "span": { "start": 334, "end": 342, "ctxt": 0 }, "typeAnnotation": { "type": "TsKeywordType", "span": { "start": 336, "end": 342, "ctxt": 0 }, "kind": "number" } } } ], "typeAnnotation": { "type": "TsTypeAnnotation", "span": { "start": 343, "end": 353, "ctxt": 0 }, "typeAnnotation": { "type": "TsTypeReference", "span": { "start": 345, "end": 353, "ctxt": 0 }, "typeName": { "type": "Identifier", "span": { "start": 345, "end": 353, "ctxt": 0 }, "value": "Derived2", "optional": false }, "typeParams": null } }, "readonly": false, "static": false, "span": { "start": 332, "end": 354, "ctxt": 0 } } ], "superClass": { "type": "Identifier", "span": { "start": 324, "end": 325, "ctxt": 0 }, "value": "A", "optional": false }, "isAbstract": false, "typeParams": null, "superTypeParams": null, "implements": [] }, { "type": "VariableDeclaration", "span": { "start": 364, "end": 399, "ctxt": 0 }, "kind": "var", "declare": false, "declarations": [ { "type": "VariableDeclarator", "span": { "start": 368, "end": 398, "ctxt": 0 }, "id": { "type": "Identifier", "span": { "start": 368, "end": 370, "ctxt": 0 }, "value": "b2", "optional": false, "typeAnnotation": { "type": "TsTypeAnnotation", "span": { "start": 370, "end": 398, "ctxt": 0 }, "typeAnnotation": { "type": "TsTypeLiteral", "span": { "start": 372, "end": 398, "ctxt": 0 }, "members": [ { "type": "TsIndexSignature", "params": [ { "type": "Identifier", "span": { "start": 375, "end": 384, "ctxt": 0 }, "value": "x", "optional": false, "typeAnnotation": { "type": "TsTypeAnnotation", "span": { "start": 376, "end": 384, "ctxt": 0 }, "typeAnnotation": { "type": "TsKeywordType", "span": { "start": 378, "end": 384, "ctxt": 0 }, "kind": "number" } } } ], "typeAnnotation": { "type": "TsTypeAnnotation", "span": { "start": 385, "end": 395, "ctxt": 0 }, "typeAnnotation": { "type": "TsTypeReference", "span": { "start": 387, "end": 395, "ctxt": 0 }, "typeName": { "type": "Identifier", "span": { "start": 387, "end": 395, "ctxt": 0 }, "value": "Derived2", "optional": false }, "typeParams": null } }, "readonly": false, "static": false, "span": { "start": 374, "end": 396, "ctxt": 0 } } ] } } }, "init": null, "definite": false } ] }, { "type": "ExpressionStatement", "span": { "start": 400, "end": 407, "ctxt": 0 }, "expression": { "type": "AssignmentExpression", "span": { "start": 400, "end": 406, "ctxt": 0 }, "operator": "=", "left": { "type": "Identifier", "span": { "start": 400, "end": 401, "ctxt": 0 }, "value": "a", "optional": false, "typeAnnotation": null }, "right": { "type": "Identifier", "span": { "start": 404, "end": 406, "ctxt": 0 }, "value": "b2", "optional": false } } }, { "type": "ExpressionStatement", "span": { "start": 414, "end": 421, "ctxt": 0 }, "expression": { "type": "AssignmentExpression", "span": { "start": 414, "end": 420, "ctxt": 0 }, "operator": "=", "left": { "type": "Identifier", "span": { "start": 414, "end": 416, "ctxt": 0 }, "value": "b2", "optional": false, "typeAnnotation": null }, "right": { "type": "Identifier", "span": { "start": 419, "end": 420, "ctxt": 0 }, "value": "a", "optional": false } } }, { "type": "TsModuleDeclaration", "span": { "start": 432, "end": 751, "ctxt": 0 }, "declare": false, "global": false, "id": { "type": "Identifier", "span": { "start": 439, "end": 447, "ctxt": 0 }, "value": "Generics", "optional": false }, "body": { "type": "TsModuleBlock", "span": { "start": 448, "end": 751, "ctxt": 0 }, "body": [ { "type": "ClassDeclaration", "identifier": { "type": "Identifier", "span": { "start": 460, "end": 461, "ctxt": 0 }, "value": "A", "optional": false }, "declare": false, "span": { "start": 454, "end": 512, "ctxt": 0 }, "decorators": [], "body": [ { "type": "TsIndexSignature", "params": [ { "type": "Identifier", "span": { "start": 492, "end": 501, "ctxt": 0 }, "value": "x", "optional": false, "typeAnnotation": { "type": "TsTypeAnnotation", "span": { "start": 493, "end": 501, "ctxt": 0 }, "typeAnnotation": { "type": "TsKeywordType", "span": { "start": 495, "end": 501, "ctxt": 0 }, "kind": "number" } } } ], "typeAnnotation": { "type": "TsTypeAnnotation", "span": { "start": 502, "end": 505, "ctxt": 0 }, "typeAnnotation": { "type": "TsTypeReference", "span": { "start": 504, "end": 505, "ctxt": 0 }, "typeName": { "type": "Identifier", "span": { "start": 504, "end": 505, "ctxt": 0 }, "value": "T", "optional": false }, "typeParams": null } }, "readonly": false, "static": false, "span": { "start": 491, "end": 506, "ctxt": 0 } } ], "superClass": null, "isAbstract": false, "typeParams": { "type": "TsTypeParameterDeclaration", "span": { "start": 461, "end": 480, "ctxt": 0 }, "parameters": [ { "type": "TsTypeParameter", "span": { "start": 462, "end": 479, "ctxt": 0 }, "name": { "type": "Identifier", "span": { "start": 462, "end": 463, "ctxt": 0 }, "value": "T", "optional": false }, "in": false, "out": false, "const": false, "constraint": { "type": "TsTypeReference", "span": { "start": 472, "end": 479, "ctxt": 0 }, "typeName": { "type": "Identifier", "span": { "start": 472, "end": 479, "ctxt": 0 }, "value": "Derived", "optional": false }, "typeParams": null }, "default": null } ] }, "superTypeParams": null, "implements": [] }, { "type": "FunctionDeclaration", "identifier": { "type": "Identifier", "span": { "start": 527, "end": 530, "ctxt": 0 }, "value": "foo", "optional": false }, "declare": false, "params": [], "decorators": [], "span": { "start": 518, "end": 749, "ctxt": 0 }, "body": { "type": "BlockStatement", "span": { "start": 552, "end": 749, "ctxt": 0 }, "stmts": [ { "type": "VariableDeclaration", "span": { "start": 562, "end": 574, "ctxt": 0 }, "kind": "var", "declare": false, "declarations": [ { "type": "VariableDeclarator", "span": { "start": 566, "end": 573, "ctxt": 0 }, "id": { "type": "Identifier", "span": { "start": 566, "end": 567, "ctxt": 0 }, "value": "a", "optional": false, "typeAnnotation": { "type": "TsTypeAnnotation", "span": { "start": 567, "end": 573, "ctxt": 0 }, "typeAnnotation": { "type": "TsTypeReference", "span": { "start": 569, "end": 573, "ctxt": 0 }, "typeName": { "type": "Identifier", "span": { "start": 569, "end": 570, "ctxt": 0 }, "value": "A", "optional": false }, "typeParams": { "type": "TsTypeParameterInstantiation", "span": { "start": 570, "end": 573, "ctxt": 0 }, "params": [ { "type": "TsTypeReference", "span": { "start": 571, "end": 572, "ctxt": 0 }, "typeName": { "type": "Identifier", "span": { "start": 571, "end": 572, "ctxt": 0 }, "value": "T", "optional": false }, "typeParams": null } ] } } } }, "init": null, "definite": false } ] }, { "type": "VariableDeclaration", "span": { "start": 583, "end": 616, "ctxt": 0 }, "kind": "var", "declare": false, "declarations": [ { "type": "VariableDeclarator", "span": { "start": 587, "end": 615, "ctxt": 0 }, "id": { "type": "Identifier", "span": { "start": 587, "end": 588, "ctxt": 0 }, "value": "b", "optional": false, "typeAnnotation": { "type": "TsTypeAnnotation", "span": { "start": 588, "end": 615, "ctxt": 0 }, "typeAnnotation": { "type": "TsTypeLiteral", "span": { "start": 590, "end": 615, "ctxt": 0 }, "members": [ { "type": "TsIndexSignature", "params": [ { "type": "Identifier", "span": { "start": 593, "end": 602, "ctxt": 0 }, "value": "x", "optional": false, "typeAnnotation": { "type": "TsTypeAnnotation", "span": { "start": 594, "end": 602, "ctxt": 0 }, "typeAnnotation": { "type": "TsKeywordType", "span": { "start": 596, "end": 602, "ctxt": 0 }, "kind": "number" } } } ], "typeAnnotation": { "type": "TsTypeAnnotation", "span": { "start": 603, "end": 612, "ctxt": 0 }, "typeAnnotation": { "type": "TsTypeReference", "span": { "start": 605, "end": 612, "ctxt": 0 }, "typeName": { "type": "Identifier", "span": { "start": 605, "end": 612, "ctxt": 0 }, "value": "Derived", "optional": false }, "typeParams": null } }, "readonly": false, "static": false, "span": { "start": 592, "end": 613, "ctxt": 0 } } ] } } }, "init": null, "definite": false } ] }, { "type": "ExpressionStatement", "span": { "start": 625, "end": 631, "ctxt": 0 }, "expression": { "type": "AssignmentExpression", "span": { "start": 625, "end": 630, "ctxt": 0 }, "operator": "=", "left": { "type": "Identifier", "span": { "start": 625, "end": 626, "ctxt": 0 }, "value": "a", "optional": false, "typeAnnotation": null }, "right": { "type": "Identifier", "span": { "start": 629, "end": 630, "ctxt": 0 }, "value": "b", "optional": false } } }, { "type": "ExpressionStatement", "span": { "start": 649, "end": 655, "ctxt": 0 }, "expression": { "type": "AssignmentExpression", "span": { "start": 649, "end": 654, "ctxt": 0 }, "operator": "=", "left": { "type": "Identifier", "span": { "start": 649, "end": 650, "ctxt": 0 }, "value": "b", "optional": false, "typeAnnotation": null }, "right": { "type": "Identifier", "span": { "start": 653, "end": 654, "ctxt": 0 }, "value": "a", "optional": false } } }, { "type": "VariableDeclaration", "span": { "start": 671, "end": 699, "ctxt": 0 }, "kind": "var", "declare": false, "declarations": [ { "type": "VariableDeclarator", "span": { "start": 675, "end": 698, "ctxt": 0 }, "id": { "type": "Identifier", "span": { "start": 675, "end": 677, "ctxt": 0 }, "value": "b2", "optional": false, "typeAnnotation": { "type": "TsTypeAnnotation", "span": { "start": 677, "end": 698, "ctxt": 0 }, "typeAnnotation": { "type": "TsTypeLiteral", "span": { "start": 679, "end": 698, "ctxt": 0 }, "members": [ { "type": "TsIndexSignature", "params": [ { "type": "Identifier", "span": { "start": 682, "end": 691, "ctxt": 0 }, "value": "x", "optional": false, "typeAnnotation": { "type": "TsTypeAnnotation", "span": { "start": 683, "end": 691, "ctxt": 0 }, "typeAnnotation": { "type": "TsKeywordType", "span": { "start": 685, "end": 691, "ctxt": 0 }, "kind": "number" } } } ], "typeAnnotation": { "type": "TsTypeAnnotation", "span": { "start": 692, "end": 695, "ctxt": 0 }, "typeAnnotation": { "type": "TsTypeReference", "span": { "start": 694, "end": 695, "ctxt": 0 }, "typeName": { "type": "Identifier", "span": { "start": 694, "end": 695, "ctxt": 0 }, "value": "T", "optional": false }, "typeParams": null } }, "readonly": false, "static": false, "span": { "start": 681, "end": 696, "ctxt": 0 } } ] } } }, "init": null, "definite": false } ] }, { "type": "ExpressionStatement", "span": { "start": 708, "end": 715, "ctxt": 0 }, "expression": { "type": "AssignmentExpression", "span": { "start": 708, "end": 714, "ctxt": 0 }, "operator": "=", "left": { "type": "Identifier", "span": { "start": 708, "end": 709, "ctxt": 0 }, "value": "a", "optional": false, "typeAnnotation": null }, "right": { "type": "Identifier", "span": { "start": 712, "end": 714, "ctxt": 0 }, "value": "b2", "optional": false } } }, { "type": "ExpressionStatement", "span": { "start": 730, "end": 737, "ctxt": 0 }, "expression": { "type": "AssignmentExpression", "span": { "start": 730, "end": 736, "ctxt": 0 }, "operator": "=", "left": { "type": "Identifier", "span": { "start": 730, "end": 732, "ctxt": 0 }, "value": "b2", "optional": false, "typeAnnotation": null }, "right": { "type": "Identifier", "span": { "start": 735, "end": 736, "ctxt": 0 }, "value": "a", "optional": false } } } ] }, "generator": false, "async": false, "typeParameters": { "type": "TsTypeParameterDeclaration", "span": { "start": 530, "end": 549, "ctxt": 0 }, "parameters": [ { "type": "TsTypeParameter", "span": { "start": 531, "end": 548, "ctxt": 0 }, "name": { "type": "Identifier", "span": { "start": 531, "end": 532, "ctxt": 0 }, "value": "T", "optional": false }, "in": false, "out": false, "const": false, "constraint": { "type": "TsTypeReference", "span": { "start": 541, "end": 548, "ctxt": 0 }, "typeName": { "type": "Identifier", "span": { "start": 541, "end": 548, "ctxt": 0 }, "value": "Derived", "optional": false }, "typeParams": null }, "default": null } ] }, "returnType": null } ] } } ], "interpreter": null }