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

1228 lines
39 KiB
JSON

{
"type": "Script",
"span": {
"start": 65,
"end": 628,
"ctxt": 0
},
"body": [
{
"type": "TsModuleDeclaration",
"span": {
"start": 65,
"end": 628,
"ctxt": 0
},
"declare": false,
"global": false,
"id": {
"type": "Identifier",
"span": {
"start": 72,
"end": 73,
"ctxt": 0
},
"value": "M",
"optional": false
},
"body": {
"type": "TsModuleBlock",
"span": {
"start": 74,
"end": 628,
"ctxt": 0
},
"body": [
{
"type": "ExportDeclaration",
"span": {
"start": 80,
"end": 127,
"ctxt": 0
},
"declaration": {
"type": "TsInterfaceDeclaration",
"span": {
"start": 87,
"end": 127,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 97,
"end": 98,
"ctxt": 0
},
"value": "A",
"optional": false
},
"declare": false,
"typeParams": null,
"extends": [],
"body": {
"type": "TsInterfaceBody",
"span": {
"start": 99,
"end": 127,
"ctxt": 0
},
"body": [
{
"type": "TsPropertySignature",
"span": {
"start": 109,
"end": 121,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 109,
"end": 112,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 112,
"end": 120,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 114,
"end": 120,
"ctxt": 0
},
"kind": "string"
}
},
"typeParams": null
}
]
}
}
},
{
"type": "ExportDeclaration",
"span": {
"start": 133,
"end": 178,
"ctxt": 0
},
"declaration": {
"type": "TsInterfaceDeclaration",
"span": {
"start": 140,
"end": 178,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 150,
"end": 151,
"ctxt": 0
},
"value": "B",
"optional": false
},
"declare": false,
"typeParams": {
"type": "TsTypeParameterDeclaration",
"span": {
"start": 151,
"end": 154,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
"start": 152,
"end": 153,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 152,
"end": 153,
"ctxt": 0
},
"value": "T",
"optional": false
},
"in": false,
"out": false,
"const": false,
"constraint": null,
"default": null
}
]
},
"extends": [],
"body": {
"type": "TsInterfaceBody",
"span": {
"start": 155,
"end": 178,
"ctxt": 0
},
"body": [
{
"type": "TsPropertySignature",
"span": {
"start": 165,
"end": 172,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 165,
"end": 168,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 168,
"end": 171,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 170,
"end": 171,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 170,
"end": 171,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
}
},
"typeParams": null
}
]
}
}
},
{
"type": "TsModuleDeclaration",
"span": {
"start": 184,
"end": 488,
"ctxt": 0
},
"declare": false,
"global": false,
"id": {
"type": "Identifier",
"span": {
"start": 191,
"end": 193,
"ctxt": 0
},
"value": "M2",
"optional": false
},
"body": {
"type": "TsModuleBlock",
"span": {
"start": 194,
"end": 488,
"ctxt": 0
},
"body": [
{
"type": "ExportDeclaration",
"span": {
"start": 204,
"end": 259,
"ctxt": 0
},
"declaration": {
"type": "TsInterfaceDeclaration",
"span": {
"start": 211,
"end": 259,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 221,
"end": 222,
"ctxt": 0
},
"value": "A",
"optional": false
},
"declare": false,
"typeParams": null,
"extends": [],
"body": {
"type": "TsInterfaceBody",
"span": {
"start": 223,
"end": 259,
"ctxt": 0
},
"body": [
{
"type": "TsPropertySignature",
"span": {
"start": 237,
"end": 249,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 237,
"end": 240,
"ctxt": 0
},
"value": "bar",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 240,
"end": 248,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 242,
"end": 248,
"ctxt": 0
},
"kind": "number"
}
},
"typeParams": null
}
]
}
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 269,
"end": 278,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 273,
"end": 277,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 273,
"end": 274,
"ctxt": 0
},
"value": "a",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 274,
"end": 277,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 276,
"end": 277,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 276,
"end": 277,
"ctxt": 0
},
"value": "A",
"optional": false
},
"typeParams": null
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 287,
"end": 302,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 291,
"end": 301,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 291,
"end": 293,
"ctxt": 0
},
"value": "r1",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "MemberExpression",
"span": {
"start": 296,
"end": 301,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 296,
"end": 297,
"ctxt": 0
},
"value": "a",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 298,
"end": 301,
"ctxt": 0
},
"value": "foo",
"optional": false
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 320,
"end": 335,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 324,
"end": 334,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 324,
"end": 326,
"ctxt": 0
},
"value": "r2",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "MemberExpression",
"span": {
"start": 329,
"end": 334,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 329,
"end": 330,
"ctxt": 0
},
"value": "a",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 331,
"end": 334,
"ctxt": 0
},
"value": "bar",
"optional": false
}
},
"definite": false
}
]
},
{
"type": "ExportDeclaration",
"span": {
"start": 345,
"end": 398,
"ctxt": 0
},
"declaration": {
"type": "TsInterfaceDeclaration",
"span": {
"start": 352,
"end": 398,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 362,
"end": 363,
"ctxt": 0
},
"value": "B",
"optional": false
},
"declare": false,
"typeParams": {
"type": "TsTypeParameterDeclaration",
"span": {
"start": 363,
"end": 366,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
"start": 364,
"end": 365,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 364,
"end": 365,
"ctxt": 0
},
"value": "T",
"optional": false
},
"in": false,
"out": false,
"const": false,
"constraint": null,
"default": null
}
]
},
"extends": [],
"body": {
"type": "TsInterfaceBody",
"span": {
"start": 367,
"end": 398,
"ctxt": 0
},
"body": [
{
"type": "TsPropertySignature",
"span": {
"start": 381,
"end": 388,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 381,
"end": 384,
"ctxt": 0
},
"value": "bar",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 384,
"end": 387,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 386,
"end": 387,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 386,
"end": 387,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
}
},
"typeParams": null
}
]
}
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 408,
"end": 425,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 412,
"end": 424,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 412,
"end": 413,
"ctxt": 0
},
"value": "b",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 413,
"end": 424,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 415,
"end": 424,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 415,
"end": 416,
"ctxt": 0
},
"value": "B",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 416,
"end": 424,
"ctxt": 0
},
"params": [
{
"type": "TsKeywordType",
"span": {
"start": 417,
"end": 423,
"ctxt": 0
},
"kind": "string"
}
]
}
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 434,
"end": 449,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 438,
"end": 448,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 438,
"end": 440,
"ctxt": 0
},
"value": "r3",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "MemberExpression",
"span": {
"start": 443,
"end": 448,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 443,
"end": 444,
"ctxt": 0
},
"value": "b",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 445,
"end": 448,
"ctxt": 0
},
"value": "foo",
"optional": false
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 467,
"end": 482,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 471,
"end": 481,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 471,
"end": 473,
"ctxt": 0
},
"value": "r4",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "MemberExpression",
"span": {
"start": 476,
"end": 481,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 476,
"end": 477,
"ctxt": 0
},
"value": "b",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 478,
"end": 481,
"ctxt": 0
},
"value": "bar",
"optional": false
}
},
"definite": false
}
]
}
]
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 494,
"end": 503,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 498,
"end": 502,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 498,
"end": 499,
"ctxt": 0
},
"value": "a",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 499,
"end": 502,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 501,
"end": 502,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 501,
"end": 502,
"ctxt": 0
},
"value": "A",
"optional": false
},
"typeParams": null
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 508,
"end": 523,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 512,
"end": 522,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 512,
"end": 514,
"ctxt": 0
},
"value": "r1",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "MemberExpression",
"span": {
"start": 517,
"end": 522,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 517,
"end": 518,
"ctxt": 0
},
"value": "a",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 519,
"end": 522,
"ctxt": 0
},
"value": "foo",
"optional": false
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 529,
"end": 544,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 533,
"end": 543,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 533,
"end": 535,
"ctxt": 0
},
"value": "r2",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "MemberExpression",
"span": {
"start": 538,
"end": 543,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 538,
"end": 539,
"ctxt": 0
},
"value": "a",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 540,
"end": 543,
"ctxt": 0
},
"value": "bar",
"optional": false
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 559,
"end": 576,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 563,
"end": 575,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 563,
"end": 564,
"ctxt": 0
},
"value": "b",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 564,
"end": 575,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 566,
"end": 575,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 566,
"end": 567,
"ctxt": 0
},
"value": "B",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 567,
"end": 575,
"ctxt": 0
},
"params": [
{
"type": "TsKeywordType",
"span": {
"start": 568,
"end": 574,
"ctxt": 0
},
"kind": "string"
}
]
}
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 581,
"end": 596,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 585,
"end": 595,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 585,
"end": 587,
"ctxt": 0
},
"value": "r3",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "MemberExpression",
"span": {
"start": 590,
"end": 595,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 590,
"end": 591,
"ctxt": 0
},
"value": "b",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 592,
"end": 595,
"ctxt": 0
},
"value": "foo",
"optional": false
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 602,
"end": 617,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 606,
"end": 616,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 606,
"end": 608,
"ctxt": 0
},
"value": "r4",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "MemberExpression",
"span": {
"start": 611,
"end": 616,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 611,
"end": 612,
"ctxt": 0
},
"value": "b",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 613,
"end": 616,
"ctxt": 0
},
"value": "bar",
"optional": false
}
},
"definite": false
}
]
}
]
}
}
],
"interpreter": null
}