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

1922 lines
51 KiB
JSON

{
"type": "Script",
"span": {
"start": 69,
"end": 1601,
"ctxt": 0
},
"body": [
{
"type": "TsInterfaceDeclaration",
"span": {
"start": 69,
"end": 100,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 79,
"end": 83,
"ctxt": 0
},
"value": "Base",
"optional": false
},
"declare": false,
"typeParams": null,
"extends": [],
"body": {
"type": "TsInterfaceBody",
"span": {
"start": 84,
"end": 100,
"ctxt": 0
},
"body": [
{
"type": "TsPropertySignature",
"span": {
"start": 86,
"end": 98,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 86,
"end": 89,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 89,
"end": 97,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 91,
"end": 97,
"ctxt": 0
},
"kind": "string"
}
},
"typeParams": null
}
]
}
},
{
"type": "TsInterfaceDeclaration",
"span": {
"start": 101,
"end": 148,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 111,
"end": 118,
"ctxt": 0
},
"value": "Derived",
"optional": false
},
"declare": false,
"typeParams": null,
"extends": [
{
"type": "TsExpressionWithTypeArguments",
"span": {
"start": 127,
"end": 131,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 127,
"end": 131,
"ctxt": 0
},
"value": "Base",
"optional": false
},
"typeArguments": null
}
],
"body": {
"type": "TsInterfaceBody",
"span": {
"start": 132,
"end": 148,
"ctxt": 0
},
"body": [
{
"type": "TsPropertySignature",
"span": {
"start": 134,
"end": 146,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 134,
"end": 137,
"ctxt": 0
},
"value": "bar",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 137,
"end": 145,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 139,
"end": 145,
"ctxt": 0
},
"kind": "string"
}
},
"typeParams": null
}
]
}
},
{
"type": "TsInterfaceDeclaration",
"span": {
"start": 149,
"end": 200,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 159,
"end": 167,
"ctxt": 0
},
"value": "Derived2",
"optional": false
},
"declare": false,
"typeParams": null,
"extends": [
{
"type": "TsExpressionWithTypeArguments",
"span": {
"start": 176,
"end": 183,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 176,
"end": 183,
"ctxt": 0
},
"value": "Derived",
"optional": false
},
"typeArguments": null
}
],
"body": {
"type": "TsInterfaceBody",
"span": {
"start": 184,
"end": 200,
"ctxt": 0
},
"body": [
{
"type": "TsPropertySignature",
"span": {
"start": 186,
"end": 198,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 186,
"end": 189,
"ctxt": 0
},
"value": "baz",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 189,
"end": 197,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 191,
"end": 197,
"ctxt": 0
},
"kind": "string"
}
},
"typeParams": null
}
]
}
},
{
"type": "TsInterfaceDeclaration",
"span": {
"start": 812,
"end": 843,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 822,
"end": 823,
"ctxt": 0
},
"value": "T",
"optional": false
},
"declare": false,
"typeParams": null,
"extends": [],
"body": {
"type": "TsInterfaceBody",
"span": {
"start": 824,
"end": 843,
"ctxt": 0
},
"body": [
{
"type": "TsPropertySignature",
"span": {
"start": 830,
"end": 841,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 830,
"end": 833,
"ctxt": 0
},
"value": "Foo",
"optional": false
},
"computed": false,
"optional": true,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 834,
"end": 840,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 836,
"end": 840,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 836,
"end": 840,
"ctxt": 0
},
"value": "Base",
"optional": false
},
"typeParams": null
}
},
"typeParams": null
}
]
}
},
{
"type": "TsInterfaceDeclaration",
"span": {
"start": 845,
"end": 887,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 855,
"end": 856,
"ctxt": 0
},
"value": "S",
"optional": false
},
"declare": false,
"typeParams": null,
"extends": [
{
"type": "TsExpressionWithTypeArguments",
"span": {
"start": 865,
"end": 866,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 865,
"end": 866,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeArguments": null
}
],
"body": {
"type": "TsInterfaceBody",
"span": {
"start": 867,
"end": 887,
"ctxt": 0
},
"body": [
{
"type": "TsPropertySignature",
"span": {
"start": 873,
"end": 885,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 873,
"end": 876,
"ctxt": 0
},
"value": "Foo",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 876,
"end": 885,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 878,
"end": 885,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 878,
"end": 885,
"ctxt": 0
},
"value": "Derived",
"optional": false
},
"typeParams": null
}
},
"typeParams": null
}
]
}
},
{
"type": "TsInterfaceDeclaration",
"span": {
"start": 889,
"end": 920,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 899,
"end": 901,
"ctxt": 0
},
"value": "T2",
"optional": false
},
"declare": false,
"typeParams": null,
"extends": [],
"body": {
"type": "TsInterfaceBody",
"span": {
"start": 902,
"end": 920,
"ctxt": 0
},
"body": [
{
"type": "TsPropertySignature",
"span": {
"start": 908,
"end": 917,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "NumericLiteral",
"span": {
"start": 908,
"end": 909,
"ctxt": 0
},
"value": 1.0,
"raw": "1"
},
"computed": false,
"optional": true,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 910,
"end": 916,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 912,
"end": 916,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 912,
"end": 916,
"ctxt": 0
},
"value": "Base",
"optional": false
},
"typeParams": null
}
},
"typeParams": null
}
]
}
},
{
"type": "TsInterfaceDeclaration",
"span": {
"start": 922,
"end": 965,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 932,
"end": 934,
"ctxt": 0
},
"value": "S2",
"optional": false
},
"declare": false,
"typeParams": null,
"extends": [
{
"type": "TsExpressionWithTypeArguments",
"span": {
"start": 943,
"end": 945,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 943,
"end": 945,
"ctxt": 0
},
"value": "T2",
"optional": false
},
"typeArguments": null
}
],
"body": {
"type": "TsInterfaceBody",
"span": {
"start": 946,
"end": 965,
"ctxt": 0
},
"body": [
{
"type": "TsPropertySignature",
"span": {
"start": 952,
"end": 963,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "NumericLiteral",
"span": {
"start": 952,
"end": 953,
"ctxt": 0
},
"value": 1.0,
"raw": "1"
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 953,
"end": 962,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 955,
"end": 962,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 955,
"end": 962,
"ctxt": 0
},
"value": "Derived",
"optional": false
},
"typeParams": null
}
},
"typeParams": null
}
]
}
},
{
"type": "TsInterfaceDeclaration",
"span": {
"start": 967,
"end": 999,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 977,
"end": 979,
"ctxt": 0
},
"value": "T3",
"optional": false
},
"declare": false,
"typeParams": null,
"extends": [],
"body": {
"type": "TsInterfaceBody",
"span": {
"start": 980,
"end": 999,
"ctxt": 0
},
"body": [
{
"type": "TsPropertySignature",
"span": {
"start": 986,
"end": 997,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "StringLiteral",
"span": {
"start": 986,
"end": 989,
"ctxt": 0
},
"value": "1",
"raw": "'1'"
},
"computed": false,
"optional": true,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 990,
"end": 996,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 992,
"end": 996,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 992,
"end": 996,
"ctxt": 0
},
"value": "Base",
"optional": false
},
"typeParams": null
}
},
"typeParams": null
}
]
}
},
{
"type": "TsInterfaceDeclaration",
"span": {
"start": 1001,
"end": 1047,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 1011,
"end": 1013,
"ctxt": 0
},
"value": "S3",
"optional": false
},
"declare": false,
"typeParams": null,
"extends": [
{
"type": "TsExpressionWithTypeArguments",
"span": {
"start": 1022,
"end": 1024,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 1022,
"end": 1024,
"ctxt": 0
},
"value": "T3",
"optional": false
},
"typeArguments": null
}
],
"body": {
"type": "TsInterfaceBody",
"span": {
"start": 1025,
"end": 1047,
"ctxt": 0
},
"body": [
{
"type": "TsPropertySignature",
"span": {
"start": 1031,
"end": 1045,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "StringLiteral",
"span": {
"start": 1031,
"end": 1035,
"ctxt": 0
},
"value": "1.",
"raw": "'1.'"
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 1035,
"end": 1044,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 1037,
"end": 1044,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 1037,
"end": 1044,
"ctxt": 0
},
"value": "Derived",
"optional": false
},
"typeParams": null
}
},
"typeParams": null
}
]
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 1072,
"end": 1095,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 1076,
"end": 1094,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 1076,
"end": 1077,
"ctxt": 0
},
"value": "a",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 1077,
"end": 1094,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeLiteral",
"span": {
"start": 1079,
"end": 1094,
"ctxt": 0
},
"members": [
{
"type": "TsPropertySignature",
"span": {
"start": 1081,
"end": 1092,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 1081,
"end": 1084,
"ctxt": 0
},
"value": "Foo",
"optional": false
},
"computed": false,
"optional": true,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 1085,
"end": 1091,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 1087,
"end": 1091,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 1087,
"end": 1091,
"ctxt": 0
},
"value": "Base",
"optional": false
},
"typeParams": null
}
},
"typeParams": null
}
]
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 1096,
"end": 1127,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 1100,
"end": 1126,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 1100,
"end": 1101,
"ctxt": 0
},
"value": "b",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "ObjectExpression",
"span": {
"start": 1104,
"end": 1126,
"ctxt": 0
},
"properties": [
{
"type": "KeyValueProperty",
"key": {
"type": "Identifier",
"span": {
"start": 1106,
"end": 1109,
"ctxt": 0
},
"value": "Foo",
"optional": false
},
"value": {
"type": "TsTypeAssertion",
"span": {
"start": 1111,
"end": 1124,
"ctxt": 0
},
"expression": {
"type": "NullLiteral",
"span": {
"start": 1120,
"end": 1124,
"ctxt": 0
}
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 1112,
"end": 1119,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 1112,
"end": 1119,
"ctxt": 0
},
"value": "Derived",
"optional": false
},
"typeParams": null
}
}
}
]
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 1128,
"end": 1149,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 1132,
"end": 1148,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 1132,
"end": 1133,
"ctxt": 0
},
"value": "r",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "ConditionalExpression",
"span": {
"start": 1136,
"end": 1148,
"ctxt": 0
},
"test": {
"type": "BooleanLiteral",
"span": {
"start": 1136,
"end": 1140,
"ctxt": 0
},
"value": true
},
"consequent": {
"type": "Identifier",
"span": {
"start": 1143,
"end": 1144,
"ctxt": 0
},
"value": "a",
"optional": false
},
"alternate": {
"type": "Identifier",
"span": {
"start": 1147,
"end": 1148,
"ctxt": 0
},
"value": "b",
"optional": false
}
},
"definite": false
}
]
},
{
"type": "TsModuleDeclaration",
"span": {
"start": 1151,
"end": 1601,
"ctxt": 0
},
"declare": false,
"global": false,
"id": {
"type": "Identifier",
"span": {
"start": 1158,
"end": 1167,
"ctxt": 0
},
"value": "TwoLevels",
"optional": false
},
"body": {
"type": "TsModuleBlock",
"span": {
"start": 1168,
"end": 1601,
"ctxt": 0
},
"body": [
{
"type": "TsInterfaceDeclaration",
"span": {
"start": 1174,
"end": 1213,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 1184,
"end": 1185,
"ctxt": 0
},
"value": "T",
"optional": false
},
"declare": false,
"typeParams": null,
"extends": [],
"body": {
"type": "TsInterfaceBody",
"span": {
"start": 1186,
"end": 1213,
"ctxt": 0
},
"body": [
{
"type": "TsPropertySignature",
"span": {
"start": 1196,
"end": 1207,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 1196,
"end": 1199,
"ctxt": 0
},
"value": "Foo",
"optional": false
},
"computed": false,
"optional": true,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 1200,
"end": 1206,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 1202,
"end": 1206,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 1202,
"end": 1206,
"ctxt": 0
},
"value": "Base",
"optional": false
},
"typeParams": null
}
},
"typeParams": null
}
]
}
},
{
"type": "TsInterfaceDeclaration",
"span": {
"start": 1219,
"end": 1271,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 1229,
"end": 1230,
"ctxt": 0
},
"value": "S",
"optional": false
},
"declare": false,
"typeParams": null,
"extends": [
{
"type": "TsExpressionWithTypeArguments",
"span": {
"start": 1239,
"end": 1240,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 1239,
"end": 1240,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeArguments": null
}
],
"body": {
"type": "TsInterfaceBody",
"span": {
"start": 1241,
"end": 1271,
"ctxt": 0
},
"body": [
{
"type": "TsPropertySignature",
"span": {
"start": 1251,
"end": 1264,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 1251,
"end": 1254,
"ctxt": 0
},
"value": "Foo",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 1254,
"end": 1264,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 1256,
"end": 1264,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 1256,
"end": 1264,
"ctxt": 0
},
"value": "Derived2",
"optional": false
},
"typeParams": null
}
},
"typeParams": null
}
]
}
},
{
"type": "TsInterfaceDeclaration",
"span": {
"start": 1277,
"end": 1315,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 1287,
"end": 1289,
"ctxt": 0
},
"value": "T2",
"optional": false
},
"declare": false,
"typeParams": null,
"extends": [],
"body": {
"type": "TsInterfaceBody",
"span": {
"start": 1290,
"end": 1315,
"ctxt": 0
},
"body": [
{
"type": "TsPropertySignature",
"span": {
"start": 1300,
"end": 1309,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "NumericLiteral",
"span": {
"start": 1300,
"end": 1301,
"ctxt": 0
},
"value": 1.0,
"raw": "1"
},
"computed": false,
"optional": true,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 1302,
"end": 1308,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 1304,
"end": 1308,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 1304,
"end": 1308,
"ctxt": 0
},
"value": "Base",
"optional": false
},
"typeParams": null
}
},
"typeParams": null
}
]
}
},
{
"type": "TsInterfaceDeclaration",
"span": {
"start": 1321,
"end": 1373,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 1331,
"end": 1333,
"ctxt": 0
},
"value": "S2",
"optional": false
},
"declare": false,
"typeParams": null,
"extends": [
{
"type": "TsExpressionWithTypeArguments",
"span": {
"start": 1342,
"end": 1344,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 1342,
"end": 1344,
"ctxt": 0
},
"value": "T2",
"optional": false
},
"typeArguments": null
}
],
"body": {
"type": "TsInterfaceBody",
"span": {
"start": 1345,
"end": 1373,
"ctxt": 0
},
"body": [
{
"type": "TsPropertySignature",
"span": {
"start": 1355,
"end": 1367,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "NumericLiteral",
"span": {
"start": 1355,
"end": 1356,
"ctxt": 0
},
"value": 1.0,
"raw": "1"
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 1356,
"end": 1366,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 1358,
"end": 1366,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 1358,
"end": 1366,
"ctxt": 0
},
"value": "Derived2",
"optional": false
},
"typeParams": null
}
},
"typeParams": null
}
]
}
},
{
"type": "TsInterfaceDeclaration",
"span": {
"start": 1379,
"end": 1419,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 1389,
"end": 1391,
"ctxt": 0
},
"value": "T3",
"optional": false
},
"declare": false,
"typeParams": null,
"extends": [],
"body": {
"type": "TsInterfaceBody",
"span": {
"start": 1392,
"end": 1419,
"ctxt": 0
},
"body": [
{
"type": "TsPropertySignature",
"span": {
"start": 1402,
"end": 1413,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "StringLiteral",
"span": {
"start": 1402,
"end": 1405,
"ctxt": 0
},
"value": "1",
"raw": "'1'"
},
"computed": false,
"optional": true,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 1406,
"end": 1412,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 1408,
"end": 1412,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 1408,
"end": 1412,
"ctxt": 0
},
"value": "Base",
"optional": false
},
"typeParams": null
}
},
"typeParams": null
}
]
}
},
{
"type": "TsInterfaceDeclaration",
"span": {
"start": 1425,
"end": 1480,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 1435,
"end": 1437,
"ctxt": 0
},
"value": "S3",
"optional": false
},
"declare": false,
"typeParams": null,
"extends": [
{
"type": "TsExpressionWithTypeArguments",
"span": {
"start": 1446,
"end": 1448,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 1446,
"end": 1448,
"ctxt": 0
},
"value": "T3",
"optional": false
},
"typeArguments": null
}
],
"body": {
"type": "TsInterfaceBody",
"span": {
"start": 1449,
"end": 1480,
"ctxt": 0
},
"body": [
{
"type": "TsPropertySignature",
"span": {
"start": 1459,
"end": 1474,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "StringLiteral",
"span": {
"start": 1459,
"end": 1463,
"ctxt": 0
},
"value": "1.",
"raw": "'1.'"
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 1463,
"end": 1473,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 1465,
"end": 1473,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 1465,
"end": 1473,
"ctxt": 0
},
"value": "Derived2",
"optional": false
},
"typeParams": null
}
},
"typeParams": null
}
]
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 1513,
"end": 1536,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 1517,
"end": 1535,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 1517,
"end": 1518,
"ctxt": 0
},
"value": "a",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 1518,
"end": 1535,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeLiteral",
"span": {
"start": 1520,
"end": 1535,
"ctxt": 0
},
"members": [
{
"type": "TsPropertySignature",
"span": {
"start": 1522,
"end": 1533,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 1522,
"end": 1525,
"ctxt": 0
},
"value": "Foo",
"optional": false
},
"computed": false,
"optional": true,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 1526,
"end": 1532,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 1528,
"end": 1532,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 1528,
"end": 1532,
"ctxt": 0
},
"value": "Base",
"optional": false
},
"typeParams": null
}
},
"typeParams": null
}
]
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 1541,
"end": 1573,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 1545,
"end": 1572,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 1545,
"end": 1546,
"ctxt": 0
},
"value": "b",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "ObjectExpression",
"span": {
"start": 1549,
"end": 1572,
"ctxt": 0
},
"properties": [
{
"type": "KeyValueProperty",
"key": {
"type": "Identifier",
"span": {
"start": 1551,
"end": 1554,
"ctxt": 0
},
"value": "Foo",
"optional": false
},
"value": {
"type": "TsTypeAssertion",
"span": {
"start": 1556,
"end": 1570,
"ctxt": 0
},
"expression": {
"type": "NullLiteral",
"span": {
"start": 1566,
"end": 1570,
"ctxt": 0
}
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 1557,
"end": 1565,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 1557,
"end": 1565,
"ctxt": 0
},
"value": "Derived2",
"optional": false
},
"typeParams": null
}
}
}
]
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 1578,
"end": 1599,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 1582,
"end": 1598,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 1582,
"end": 1583,
"ctxt": 0
},
"value": "r",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "ConditionalExpression",
"span": {
"start": 1586,
"end": 1598,
"ctxt": 0
},
"test": {
"type": "BooleanLiteral",
"span": {
"start": 1586,
"end": 1590,
"ctxt": 0
},
"value": true
},
"consequent": {
"type": "Identifier",
"span": {
"start": 1593,
"end": 1594,
"ctxt": 0
},
"value": "a",
"optional": false
},
"alternate": {
"type": "Identifier",
"span": {
"start": 1597,
"end": 1598,
"ctxt": 0
},
"value": "b",
"optional": false
}
},
"definite": false
}
]
}
]
}
}
],
"interpreter": null
}