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

1934 lines
52 KiB
JSON
Raw Normal View History

{
"type": "Script",
"span": {
"start": 70,
"end": 1672,
"ctxt": 0
},
"body": [
{
"type": "TsInterfaceDeclaration",
"span": {
"start": 70,
"end": 101,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 80,
"end": 84,
"ctxt": 0
},
"value": "Base",
"optional": false
},
"declare": false,
"typeParams": null,
"extends": [],
"body": {
"type": "TsInterfaceBody",
"span": {
"start": 85,
"end": 101,
"ctxt": 0
},
"body": [
{
"type": "TsPropertySignature",
"span": {
"start": 87,
"end": 99,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 87,
"end": 90,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 90,
"end": 98,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 92,
"end": 98,
"ctxt": 0
},
"kind": "string"
}
},
"typeParams": null
}
]
}
},
{
"type": "TsInterfaceDeclaration",
"span": {
"start": 103,
"end": 150,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 113,
"end": 120,
"ctxt": 0
},
"value": "Derived",
"optional": false
},
"declare": false,
"typeParams": null,
"extends": [
{
"type": "TsExpressionWithTypeArguments",
"span": {
"start": 129,
"end": 133,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 129,
"end": 133,
"ctxt": 0
},
"value": "Base",
"optional": false
},
"typeArguments": null
}
],
"body": {
"type": "TsInterfaceBody",
"span": {
"start": 134,
"end": 150,
"ctxt": 0
},
"body": [
{
"type": "TsPropertySignature",
"span": {
"start": 136,
"end": 148,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 136,
"end": 139,
"ctxt": 0
},
"value": "bar",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 139,
"end": 147,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 141,
"end": 147,
"ctxt": 0
},
"kind": "string"
}
},
"typeParams": null
}
]
}
},
{
"type": "TsInterfaceDeclaration",
"span": {
"start": 152,
"end": 203,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 162,
"end": 170,
"ctxt": 0
},
"value": "Derived2",
"optional": false
},
"declare": false,
"typeParams": null,
"extends": [
{
"type": "TsExpressionWithTypeArguments",
"span": {
"start": 179,
"end": 186,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 179,
"end": 186,
"ctxt": 0
},
"value": "Derived",
"optional": false
},
"typeArguments": null
}
],
"body": {
"type": "TsInterfaceBody",
"span": {
"start": 187,
"end": 203,
"ctxt": 0
},
"body": [
{
"type": "TsPropertySignature",
"span": {
"start": 189,
"end": 201,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 189,
"end": 192,
"ctxt": 0
},
"value": "baz",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 192,
"end": 200,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 194,
"end": 200,
"ctxt": 0
},
"kind": "string"
}
},
"typeParams": null
}
]
}
},
{
"type": "TsInterfaceDeclaration",
"span": {
"start": 825,
"end": 858,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 835,
"end": 836,
"ctxt": 0
},
"value": "T",
"optional": false
},
"declare": false,
"typeParams": null,
"extends": [],
"body": {
"type": "TsInterfaceBody",
"span": {
"start": 837,
"end": 858,
"ctxt": 0
},
"body": [
{
"type": "TsPropertySignature",
"span": {
"start": 844,
"end": 855,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 844,
"end": 847,
"ctxt": 0
},
"value": "Foo",
"optional": false
},
"computed": false,
"optional": true,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 848,
"end": 854,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 850,
"end": 854,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 850,
"end": 854,
"ctxt": 0
},
"value": "Base",
"optional": false
},
"typeParams": null
}
},
"typeParams": null
}
]
}
},
{
"type": "TsInterfaceDeclaration",
"span": {
"start": 862,
"end": 906,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 872,
"end": 873,
"ctxt": 0
},
"value": "S",
"optional": false
},
"declare": false,
"typeParams": null,
"extends": [
{
"type": "TsExpressionWithTypeArguments",
"span": {
"start": 882,
"end": 883,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 882,
"end": 883,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeArguments": null
}
],
"body": {
"type": "TsInterfaceBody",
"span": {
"start": 884,
"end": 906,
"ctxt": 0
},
"body": [
{
"type": "TsPropertySignature",
"span": {
"start": 891,
"end": 903,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 891,
"end": 894,
"ctxt": 0
},
"value": "Foo",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 894,
"end": 903,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 896,
"end": 903,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 896,
"end": 903,
"ctxt": 0
},
"value": "Derived",
"optional": false
},
"typeParams": null
}
},
"typeParams": null
}
]
}
},
{
"type": "TsInterfaceDeclaration",
"span": {
"start": 910,
"end": 943,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 920,
"end": 922,
"ctxt": 0
},
"value": "T2",
"optional": false
},
"declare": false,
"typeParams": null,
"extends": [],
"body": {
"type": "TsInterfaceBody",
"span": {
"start": 923,
"end": 943,
"ctxt": 0
},
"body": [
{
"type": "TsPropertySignature",
"span": {
"start": 930,
"end": 939,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "NumericLiteral",
"span": {
"start": 930,
"end": 931,
"ctxt": 0
},
"value": 1.0
},
"computed": false,
"optional": true,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 932,
"end": 938,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 934,
"end": 938,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 934,
"end": 938,
"ctxt": 0
},
"value": "Base",
"optional": false
},
"typeParams": null
}
},
"typeParams": null
}
]
}
},
{
"type": "TsInterfaceDeclaration",
"span": {
"start": 947,
"end": 992,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 957,
"end": 959,
"ctxt": 0
},
"value": "S2",
"optional": false
},
"declare": false,
"typeParams": null,
"extends": [
{
"type": "TsExpressionWithTypeArguments",
"span": {
"start": 968,
"end": 970,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 968,
"end": 970,
"ctxt": 0
},
"value": "T2",
"optional": false
},
"typeArguments": null
}
],
"body": {
"type": "TsInterfaceBody",
"span": {
"start": 971,
"end": 992,
"ctxt": 0
},
"body": [
{
"type": "TsPropertySignature",
"span": {
"start": 978,
"end": 989,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "NumericLiteral",
"span": {
"start": 978,
"end": 979,
"ctxt": 0
},
"value": 1.0
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 979,
"end": 988,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 981,
"end": 988,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 981,
"end": 988,
"ctxt": 0
},
"value": "Derived",
"optional": false
},
"typeParams": null
}
},
"typeParams": null
}
]
}
},
{
"type": "TsInterfaceDeclaration",
"span": {
"start": 996,
"end": 1030,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 1006,
"end": 1008,
"ctxt": 0
},
"value": "T3",
"optional": false
},
"declare": false,
"typeParams": null,
"extends": [],
"body": {
"type": "TsInterfaceBody",
"span": {
"start": 1009,
"end": 1030,
"ctxt": 0
},
"body": [
{
"type": "TsPropertySignature",
"span": {
"start": 1016,
"end": 1027,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "StringLiteral",
"span": {
"start": 1016,
"end": 1019,
"ctxt": 0
},
"value": "1",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
},
"computed": false,
"optional": true,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 1020,
"end": 1026,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 1022,
"end": 1026,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 1022,
"end": 1026,
"ctxt": 0
},
"value": "Base",
"optional": false
},
"typeParams": null
}
},
"typeParams": null
}
]
}
},
{
"type": "TsInterfaceDeclaration",
"span": {
"start": 1034,
"end": 1082,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 1044,
"end": 1046,
"ctxt": 0
},
"value": "S3",
"optional": false
},
"declare": false,
"typeParams": null,
"extends": [
{
"type": "TsExpressionWithTypeArguments",
"span": {
"start": 1055,
"end": 1057,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 1055,
"end": 1057,
"ctxt": 0
},
"value": "T3",
"optional": false
},
"typeArguments": null
}
],
"body": {
"type": "TsInterfaceBody",
"span": {
"start": 1058,
"end": 1082,
"ctxt": 0
},
"body": [
{
"type": "TsPropertySignature",
"span": {
"start": 1065,
"end": 1079,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "StringLiteral",
"span": {
"start": 1065,
"end": 1069,
"ctxt": 0
},
"value": "1.",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 1069,
"end": 1078,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 1071,
"end": 1078,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 1071,
"end": 1078,
"ctxt": 0
},
"value": "Derived",
"optional": false
},
"typeParams": null
}
},
"typeParams": null
}
]
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 1110,
"end": 1133,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 1114,
"end": 1132,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 1114,
"end": 1115,
"ctxt": 0
},
"value": "a",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 1115,
"end": 1132,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeLiteral",
"span": {
"start": 1117,
"end": 1132,
"ctxt": 0
},
"members": [
{
"type": "TsPropertySignature",
"span": {
"start": 1119,
"end": 1130,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 1119,
"end": 1122,
"ctxt": 0
},
"value": "Foo",
"optional": false
},
"computed": false,
"optional": true,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 1123,
"end": 1129,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 1125,
"end": 1129,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 1125,
"end": 1129,
"ctxt": 0
},
"value": "Base",
"optional": false
},
"typeParams": null
}
},
"typeParams": null
}
]
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 1135,
"end": 1166,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 1139,
"end": 1165,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 1139,
"end": 1140,
"ctxt": 0
},
"value": "b",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "ObjectExpression",
"span": {
"start": 1143,
"end": 1165,
"ctxt": 0
},
"properties": [
{
"type": "KeyValueProperty",
"key": {
"type": "Identifier",
"span": {
"start": 1145,
"end": 1148,
"ctxt": 0
},
"value": "Foo",
"optional": false
},
"value": {
"type": "TsTypeAssertion",
"span": {
"start": 1150,
"end": 1163,
"ctxt": 0
},
"expression": {
"type": "NullLiteral",
"span": {
"start": 1159,
"end": 1163,
"ctxt": 0
}
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 1151,
"end": 1158,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 1151,
"end": 1158,
"ctxt": 0
},
"value": "Derived",
"optional": false
},
"typeParams": null
}
}
}
]
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 1168,
"end": 1189,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 1172,
"end": 1188,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 1172,
"end": 1173,
"ctxt": 0
},
"value": "r",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "ConditionalExpression",
"span": {
"start": 1176,
"end": 1188,
"ctxt": 0
},
"test": {
"type": "BooleanLiteral",
"span": {
"start": 1176,
"end": 1180,
"ctxt": 0
},
"value": true
},
"consequent": {
"type": "Identifier",
"span": {
"start": 1183,
"end": 1184,
"ctxt": 0
},
"value": "a",
"optional": false
},
"alternate": {
"type": "Identifier",
"span": {
"start": 1187,
"end": 1188,
"ctxt": 0
},
"value": "b",
"optional": false
}
},
"definite": false
}
]
},
{
"type": "TsModuleDeclaration",
"span": {
"start": 1193,
"end": 1672,
"ctxt": 0
},
"declare": false,
"global": false,
"id": {
"type": "Identifier",
"span": {
"start": 1200,
"end": 1209,
"ctxt": 0
},
"value": "TwoLevels",
"optional": false
},
"body": {
"type": "TsModuleBlock",
"span": {
"start": 1210,
"end": 1672,
"ctxt": 0
},
"body": [
{
"type": "TsInterfaceDeclaration",
"span": {
"start": 1217,
"end": 1258,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 1227,
"end": 1228,
"ctxt": 0
},
"value": "T",
"optional": false
},
"declare": false,
"typeParams": null,
"extends": [],
"body": {
"type": "TsInterfaceBody",
"span": {
"start": 1229,
"end": 1258,
"ctxt": 0
},
"body": [
{
"type": "TsPropertySignature",
"span": {
"start": 1240,
"end": 1251,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 1240,
"end": 1243,
"ctxt": 0
},
"value": "Foo",
"optional": false
},
"computed": false,
"optional": true,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 1244,
"end": 1250,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 1246,
"end": 1250,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 1246,
"end": 1250,
"ctxt": 0
},
"value": "Base",
"optional": false
},
"typeParams": null
}
},
"typeParams": null
}
]
}
},
{
"type": "TsInterfaceDeclaration",
"span": {
"start": 1266,
"end": 1320,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 1276,
"end": 1277,
"ctxt": 0
},
"value": "S",
"optional": false
},
"declare": false,
"typeParams": null,
"extends": [
{
"type": "TsExpressionWithTypeArguments",
"span": {
"start": 1286,
"end": 1287,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 1286,
"end": 1287,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeArguments": null
}
],
"body": {
"type": "TsInterfaceBody",
"span": {
"start": 1288,
"end": 1320,
"ctxt": 0
},
"body": [
{
"type": "TsPropertySignature",
"span": {
"start": 1299,
"end": 1312,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 1299,
"end": 1302,
"ctxt": 0
},
"value": "Foo",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 1302,
"end": 1312,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 1304,
"end": 1312,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 1304,
"end": 1312,
"ctxt": 0
},
"value": "Derived2",
"optional": false
},
"typeParams": null
}
},
"typeParams": null
}
]
}
},
{
"type": "TsInterfaceDeclaration",
"span": {
"start": 1328,
"end": 1368,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 1338,
"end": 1340,
"ctxt": 0
},
"value": "T2",
"optional": false
},
"declare": false,
"typeParams": null,
"extends": [],
"body": {
"type": "TsInterfaceBody",
"span": {
"start": 1341,
"end": 1368,
"ctxt": 0
},
"body": [
{
"type": "TsPropertySignature",
"span": {
"start": 1352,
"end": 1361,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "NumericLiteral",
"span": {
"start": 1352,
"end": 1353,
"ctxt": 0
},
"value": 1.0
},
"computed": false,
"optional": true,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 1354,
"end": 1360,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 1356,
"end": 1360,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 1356,
"end": 1360,
"ctxt": 0
},
"value": "Base",
"optional": false
},
"typeParams": null
}
},
"typeParams": null
}
]
}
},
{
"type": "TsInterfaceDeclaration",
"span": {
"start": 1376,
"end": 1430,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 1386,
"end": 1388,
"ctxt": 0
},
"value": "S2",
"optional": false
},
"declare": false,
"typeParams": null,
"extends": [
{
"type": "TsExpressionWithTypeArguments",
"span": {
"start": 1397,
"end": 1399,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 1397,
"end": 1399,
"ctxt": 0
},
"value": "T2",
"optional": false
},
"typeArguments": null
}
],
"body": {
"type": "TsInterfaceBody",
"span": {
"start": 1400,
"end": 1430,
"ctxt": 0
},
"body": [
{
"type": "TsPropertySignature",
"span": {
"start": 1411,
"end": 1423,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "NumericLiteral",
"span": {
"start": 1411,
"end": 1412,
"ctxt": 0
},
"value": 1.0
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 1412,
"end": 1422,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 1414,
"end": 1422,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 1414,
"end": 1422,
"ctxt": 0
},
"value": "Derived2",
"optional": false
},
"typeParams": null
}
},
"typeParams": null
}
]
}
},
{
"type": "TsInterfaceDeclaration",
"span": {
"start": 1438,
"end": 1480,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 1448,
"end": 1450,
"ctxt": 0
},
"value": "T3",
"optional": false
},
"declare": false,
"typeParams": null,
"extends": [],
"body": {
"type": "TsInterfaceBody",
"span": {
"start": 1451,
"end": 1480,
"ctxt": 0
},
"body": [
{
"type": "TsPropertySignature",
"span": {
"start": 1462,
"end": 1473,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "StringLiteral",
"span": {
"start": 1462,
"end": 1465,
"ctxt": 0
},
"value": "1",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
},
"computed": false,
"optional": true,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 1466,
"end": 1472,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 1468,
"end": 1472,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 1468,
"end": 1472,
"ctxt": 0
},
"value": "Base",
"optional": false
},
"typeParams": null
}
},
"typeParams": null
}
]
}
},
{
"type": "TsInterfaceDeclaration",
"span": {
"start": 1488,
"end": 1545,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 1498,
"end": 1500,
"ctxt": 0
},
"value": "S3",
"optional": false
},
"declare": false,
"typeParams": null,
"extends": [
{
"type": "TsExpressionWithTypeArguments",
"span": {
"start": 1509,
"end": 1511,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 1509,
"end": 1511,
"ctxt": 0
},
"value": "T3",
"optional": false
},
"typeArguments": null
}
],
"body": {
"type": "TsInterfaceBody",
"span": {
"start": 1512,
"end": 1545,
"ctxt": 0
},
"body": [
{
"type": "TsPropertySignature",
"span": {
"start": 1523,
"end": 1538,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "StringLiteral",
"span": {
"start": 1523,
"end": 1527,
"ctxt": 0
},
"value": "1.",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 1527,
"end": 1537,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 1529,
"end": 1537,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 1529,
"end": 1537,
"ctxt": 0
},
"value": "Derived2",
"optional": false
},
"typeParams": null
}
},
"typeParams": null
}
]
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 1581,
"end": 1604,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 1585,
"end": 1603,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 1585,
"end": 1586,
"ctxt": 0
},
"value": "a",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 1586,
"end": 1603,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeLiteral",
"span": {
"start": 1588,
"end": 1603,
"ctxt": 0
},
"members": [
{
"type": "TsPropertySignature",
"span": {
"start": 1590,
"end": 1601,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 1590,
"end": 1593,
"ctxt": 0
},
"value": "Foo",
"optional": false
},
"computed": false,
"optional": true,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 1594,
"end": 1600,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 1596,
"end": 1600,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 1596,
"end": 1600,
"ctxt": 0
},
"value": "Base",
"optional": false
},
"typeParams": null
}
},
"typeParams": null
}
]
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 1610,
"end": 1642,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 1614,
"end": 1641,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 1614,
"end": 1615,
"ctxt": 0
},
"value": "b",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "ObjectExpression",
"span": {
"start": 1618,
"end": 1641,
"ctxt": 0
},
"properties": [
{
"type": "KeyValueProperty",
"key": {
"type": "Identifier",
"span": {
"start": 1620,
"end": 1623,
"ctxt": 0
},
"value": "Foo",
"optional": false
},
"value": {
"type": "TsTypeAssertion",
"span": {
"start": 1625,
"end": 1639,
"ctxt": 0
},
"expression": {
"type": "NullLiteral",
"span": {
"start": 1635,
"end": 1639,
"ctxt": 0
}
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 1626,
"end": 1634,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 1626,
"end": 1634,
"ctxt": 0
},
"value": "Derived2",
"optional": false
},
"typeParams": null
}
}
}
]
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 1648,
"end": 1669,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 1652,
"end": 1668,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 1652,
"end": 1653,
"ctxt": 0
},
"value": "r",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "ConditionalExpression",
"span": {
"start": 1656,
"end": 1668,
"ctxt": 0
},
"test": {
"type": "BooleanLiteral",
"span": {
"start": 1656,
"end": 1660,
"ctxt": 0
},
"value": true
},
"consequent": {
"type": "Identifier",
"span": {
"start": 1663,
"end": 1664,
"ctxt": 0
},
"value": "a",
"optional": false
},
"alternate": {
"type": "Identifier",
"span": {
"start": 1667,
"end": 1668,
"ctxt": 0
},
"value": "b",
"optional": false
}
},
"definite": false
}
]
}
]
}
}
],
"interpreter": null
}