swc/crates/swc_ecma_parser/tests/tsc/genericCallToOverloadedMethodWithOverloadedArguments.json
2022-02-04 17:08:38 +09:00

5814 lines
198 KiB
JSON

{
"type": "Script",
"span": {
"start": 2,
"end": 2629,
"ctxt": 0
},
"body": [
{
"type": "TsModuleDeclaration",
"span": {
"start": 2,
"end": 266,
"ctxt": 0
},
"declare": false,
"global": false,
"id": {
"type": "Identifier",
"span": {
"start": 9,
"end": 11,
"ctxt": 0
},
"value": "m1",
"optional": false
},
"body": {
"type": "TsModuleBlock",
"span": {
"start": 12,
"end": 266,
"ctxt": 0
},
"body": [
{
"type": "TsInterfaceDeclaration",
"span": {
"start": 19,
"end": 104,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 29,
"end": 36,
"ctxt": 0
},
"value": "Promise",
"optional": false
},
"declare": false,
"typeParams": {
"type": "TsTypeParameterDeclaration",
"span": {
"start": 36,
"end": 39,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
"start": 37,
"end": 38,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 37,
"end": 38,
"ctxt": 0
},
"value": "T",
"optional": false
},
"constraint": null,
"default": null
}
]
},
"extends": [],
"body": {
"type": "TsInterfaceBody",
"span": {
"start": 40,
"end": 104,
"ctxt": 0
},
"body": [
{
"type": "TsMethodSignature",
"span": {
"start": 51,
"end": 97,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 51,
"end": 55,
"ctxt": 0
},
"value": "then",
"optional": false
},
"computed": false,
"optional": false,
"params": [
{
"type": "Identifier",
"span": {
"start": 59,
"end": 83,
"ctxt": 0
},
"value": "cb",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 61,
"end": 83,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsFunctionType",
"span": {
"start": 63,
"end": 83,
"ctxt": 0
},
"params": [
{
"type": "Identifier",
"span": {
"start": 64,
"end": 68,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 65,
"end": 68,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 67,
"end": 68,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 67,
"end": 68,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
}
}
}
],
"typeParams": null,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 70,
"end": 83,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 73,
"end": 83,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 73,
"end": 80,
"ctxt": 0
},
"value": "Promise",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 80,
"end": 83,
"ctxt": 0
},
"params": [
{
"type": "TsTypeReference",
"span": {
"start": 81,
"end": 82,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 81,
"end": 82,
"ctxt": 0
},
"value": "U",
"optional": false
},
"typeParams": null
}
]
}
}
}
}
}
}
],
"typeAnn": {
"type": "TsTypeAnnotation",
"span": {
"start": 84,
"end": 96,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 86,
"end": 96,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 86,
"end": 93,
"ctxt": 0
},
"value": "Promise",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 93,
"end": 96,
"ctxt": 0
},
"params": [
{
"type": "TsTypeReference",
"span": {
"start": 94,
"end": 95,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 94,
"end": 95,
"ctxt": 0
},
"value": "U",
"optional": false
},
"typeParams": null
}
]
}
}
},
"typeParams": {
"type": "TsTypeParameterDeclaration",
"span": {
"start": 55,
"end": 58,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
"start": 56,
"end": 57,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 56,
"end": 57,
"ctxt": 0
},
"value": "U",
"optional": false
},
"constraint": null,
"default": null
}
]
}
}
]
}
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 129,
"end": 141,
"ctxt": 0
},
"value": "testFunction",
"optional": false
},
"declare": true,
"params": [
{
"type": "Parameter",
"span": {
"start": 142,
"end": 151,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 142,
"end": 151,
"ctxt": 0
},
"value": "n",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 143,
"end": 151,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 145,
"end": 151,
"ctxt": 0
},
"kind": "number"
}
}
}
}
],
"decorators": [],
"span": {
"start": 112,
"end": 170,
"ctxt": 0
},
"body": null,
"generator": false,
"async": false,
"typeParameters": null,
"returnType": {
"type": "TsTypeAnnotation",
"span": {
"start": 152,
"end": 169,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 154,
"end": 169,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 154,
"end": 161,
"ctxt": 0
},
"value": "Promise",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 161,
"end": 169,
"ctxt": 0
},
"params": [
{
"type": "TsKeywordType",
"span": {
"start": 162,
"end": 168,
"ctxt": 0
},
"kind": "number"
}
]
}
}
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 178,
"end": 210,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 182,
"end": 209,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 182,
"end": 192,
"ctxt": 0
},
"value": "numPromise",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 192,
"end": 209,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 194,
"end": 209,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 194,
"end": 201,
"ctxt": 0
},
"value": "Promise",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 201,
"end": 209,
"ctxt": 0
},
"params": [
{
"type": "TsKeywordType",
"span": {
"start": 202,
"end": 208,
"ctxt": 0
},
"kind": "number"
}
]
}
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 216,
"end": 263,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 220,
"end": 262,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 220,
"end": 230,
"ctxt": 0
},
"value": "newPromise",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "CallExpression",
"span": {
"start": 233,
"end": 262,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 233,
"end": 248,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 233,
"end": 243,
"ctxt": 0
},
"value": "numPromise",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 244,
"end": 248,
"ctxt": 0
},
"value": "then",
"optional": false
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "Identifier",
"span": {
"start": 249,
"end": 261,
"ctxt": 0
},
"value": "testFunction",
"optional": false
}
}
],
"typeArguments": null
},
"definite": false
}
]
}
]
}
},
{
"type": "TsModuleDeclaration",
"span": {
"start": 312,
"end": 640,
"ctxt": 0
},
"declare": false,
"global": false,
"id": {
"type": "Identifier",
"span": {
"start": 319,
"end": 321,
"ctxt": 0
},
"value": "m2",
"optional": false
},
"body": {
"type": "TsModuleBlock",
"span": {
"start": 322,
"end": 640,
"ctxt": 0
},
"body": [
{
"type": "TsInterfaceDeclaration",
"span": {
"start": 329,
"end": 414,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 339,
"end": 346,
"ctxt": 0
},
"value": "Promise",
"optional": false
},
"declare": false,
"typeParams": {
"type": "TsTypeParameterDeclaration",
"span": {
"start": 346,
"end": 349,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
"start": 347,
"end": 348,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 347,
"end": 348,
"ctxt": 0
},
"value": "T",
"optional": false
},
"constraint": null,
"default": null
}
]
},
"extends": [],
"body": {
"type": "TsInterfaceBody",
"span": {
"start": 350,
"end": 414,
"ctxt": 0
},
"body": [
{
"type": "TsMethodSignature",
"span": {
"start": 361,
"end": 407,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 361,
"end": 365,
"ctxt": 0
},
"value": "then",
"optional": false
},
"computed": false,
"optional": false,
"params": [
{
"type": "Identifier",
"span": {
"start": 369,
"end": 393,
"ctxt": 0
},
"value": "cb",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 371,
"end": 393,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsFunctionType",
"span": {
"start": 373,
"end": 393,
"ctxt": 0
},
"params": [
{
"type": "Identifier",
"span": {
"start": 374,
"end": 378,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 375,
"end": 378,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 377,
"end": 378,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 377,
"end": 378,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
}
}
}
],
"typeParams": null,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 380,
"end": 393,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 383,
"end": 393,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 383,
"end": 390,
"ctxt": 0
},
"value": "Promise",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 390,
"end": 393,
"ctxt": 0
},
"params": [
{
"type": "TsTypeReference",
"span": {
"start": 391,
"end": 392,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 391,
"end": 392,
"ctxt": 0
},
"value": "U",
"optional": false
},
"typeParams": null
}
]
}
}
}
}
}
}
],
"typeAnn": {
"type": "TsTypeAnnotation",
"span": {
"start": 394,
"end": 406,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 396,
"end": 406,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 396,
"end": 403,
"ctxt": 0
},
"value": "Promise",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 403,
"end": 406,
"ctxt": 0
},
"params": [
{
"type": "TsTypeReference",
"span": {
"start": 404,
"end": 405,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 404,
"end": 405,
"ctxt": 0
},
"value": "U",
"optional": false
},
"typeParams": null
}
]
}
}
},
"typeParams": {
"type": "TsTypeParameterDeclaration",
"span": {
"start": 365,
"end": 368,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
"start": 366,
"end": 367,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 366,
"end": 367,
"ctxt": 0
},
"value": "U",
"optional": false
},
"constraint": null,
"default": null
}
]
}
}
]
}
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 439,
"end": 451,
"ctxt": 0
},
"value": "testFunction",
"optional": false
},
"declare": true,
"params": [
{
"type": "Parameter",
"span": {
"start": 452,
"end": 461,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 452,
"end": 461,
"ctxt": 0
},
"value": "n",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 453,
"end": 461,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 455,
"end": 461,
"ctxt": 0
},
"kind": "number"
}
}
}
}
],
"decorators": [],
"span": {
"start": 422,
"end": 480,
"ctxt": 0
},
"body": null,
"generator": false,
"async": false,
"typeParameters": null,
"returnType": {
"type": "TsTypeAnnotation",
"span": {
"start": 462,
"end": 479,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 464,
"end": 479,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 464,
"end": 471,
"ctxt": 0
},
"value": "Promise",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 471,
"end": 479,
"ctxt": 0
},
"params": [
{
"type": "TsKeywordType",
"span": {
"start": 472,
"end": 478,
"ctxt": 0
},
"kind": "number"
}
]
}
}
}
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 503,
"end": 515,
"ctxt": 0
},
"value": "testFunction",
"optional": false
},
"declare": true,
"params": [
{
"type": "Parameter",
"span": {
"start": 516,
"end": 525,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 516,
"end": 525,
"ctxt": 0
},
"value": "s",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 517,
"end": 525,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 519,
"end": 525,
"ctxt": 0
},
"kind": "string"
}
}
}
}
],
"decorators": [],
"span": {
"start": 486,
"end": 544,
"ctxt": 0
},
"body": null,
"generator": false,
"async": false,
"typeParameters": null,
"returnType": {
"type": "TsTypeAnnotation",
"span": {
"start": 526,
"end": 543,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 528,
"end": 543,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 528,
"end": 535,
"ctxt": 0
},
"value": "Promise",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 535,
"end": 543,
"ctxt": 0
},
"params": [
{
"type": "TsKeywordType",
"span": {
"start": 536,
"end": 542,
"ctxt": 0
},
"kind": "string"
}
]
}
}
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 552,
"end": 584,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 556,
"end": 583,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 556,
"end": 566,
"ctxt": 0
},
"value": "numPromise",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 566,
"end": 583,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 568,
"end": 583,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 568,
"end": 575,
"ctxt": 0
},
"value": "Promise",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 575,
"end": 583,
"ctxt": 0
},
"params": [
{
"type": "TsKeywordType",
"span": {
"start": 576,
"end": 582,
"ctxt": 0
},
"kind": "number"
}
]
}
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 590,
"end": 637,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 594,
"end": 636,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 594,
"end": 604,
"ctxt": 0
},
"value": "newPromise",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "CallExpression",
"span": {
"start": 607,
"end": 636,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 607,
"end": 622,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 607,
"end": 617,
"ctxt": 0
},
"value": "numPromise",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 618,
"end": 622,
"ctxt": 0
},
"value": "then",
"optional": false
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "Identifier",
"span": {
"start": 623,
"end": 635,
"ctxt": 0
},
"value": "testFunction",
"optional": false
}
}
],
"typeArguments": null
},
"definite": false
}
]
}
]
}
},
{
"type": "TsModuleDeclaration",
"span": {
"start": 686,
"end": 1042,
"ctxt": 0
},
"declare": false,
"global": false,
"id": {
"type": "Identifier",
"span": {
"start": 693,
"end": 695,
"ctxt": 0
},
"value": "m3",
"optional": false
},
"body": {
"type": "TsModuleBlock",
"span": {
"start": 696,
"end": 1042,
"ctxt": 0
},
"body": [
{
"type": "TsInterfaceDeclaration",
"span": {
"start": 703,
"end": 880,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 713,
"end": 720,
"ctxt": 0
},
"value": "Promise",
"optional": false
},
"declare": false,
"typeParams": {
"type": "TsTypeParameterDeclaration",
"span": {
"start": 720,
"end": 723,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
"start": 721,
"end": 722,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 721,
"end": 722,
"ctxt": 0
},
"value": "T",
"optional": false
},
"constraint": null,
"default": null
}
]
},
"extends": [],
"body": {
"type": "TsInterfaceBody",
"span": {
"start": 724,
"end": 880,
"ctxt": 0
},
"body": [
{
"type": "TsMethodSignature",
"span": {
"start": 735,
"end": 781,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 735,
"end": 739,
"ctxt": 0
},
"value": "then",
"optional": false
},
"computed": false,
"optional": false,
"params": [
{
"type": "Identifier",
"span": {
"start": 743,
"end": 767,
"ctxt": 0
},
"value": "cb",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 745,
"end": 767,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsFunctionType",
"span": {
"start": 747,
"end": 767,
"ctxt": 0
},
"params": [
{
"type": "Identifier",
"span": {
"start": 748,
"end": 752,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 749,
"end": 752,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 751,
"end": 752,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 751,
"end": 752,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
}
}
}
],
"typeParams": null,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 754,
"end": 767,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 757,
"end": 767,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 757,
"end": 764,
"ctxt": 0
},
"value": "Promise",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 764,
"end": 767,
"ctxt": 0
},
"params": [
{
"type": "TsTypeReference",
"span": {
"start": 765,
"end": 766,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 765,
"end": 766,
"ctxt": 0
},
"value": "U",
"optional": false
},
"typeParams": null
}
]
}
}
}
}
}
}
],
"typeAnn": {
"type": "TsTypeAnnotation",
"span": {
"start": 768,
"end": 780,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 770,
"end": 780,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 770,
"end": 777,
"ctxt": 0
},
"value": "Promise",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 777,
"end": 780,
"ctxt": 0
},
"params": [
{
"type": "TsTypeReference",
"span": {
"start": 778,
"end": 779,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 778,
"end": 779,
"ctxt": 0
},
"value": "U",
"optional": false
},
"typeParams": null
}
]
}
}
},
"typeParams": {
"type": "TsTypeParameterDeclaration",
"span": {
"start": 739,
"end": 742,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
"start": 740,
"end": 741,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 740,
"end": 741,
"ctxt": 0
},
"value": "U",
"optional": false
},
"constraint": null,
"default": null
}
]
}
},
{
"type": "TsMethodSignature",
"span": {
"start": 791,
"end": 873,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 791,
"end": 795,
"ctxt": 0
},
"value": "then",
"optional": false
},
"computed": false,
"optional": false,
"params": [
{
"type": "Identifier",
"span": {
"start": 799,
"end": 823,
"ctxt": 0
},
"value": "cb",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 801,
"end": 823,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsFunctionType",
"span": {
"start": 803,
"end": 823,
"ctxt": 0
},
"params": [
{
"type": "Identifier",
"span": {
"start": 804,
"end": 808,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 805,
"end": 808,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 807,
"end": 808,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 807,
"end": 808,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
}
}
}
],
"typeParams": null,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 810,
"end": 823,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 813,
"end": 823,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 813,
"end": 820,
"ctxt": 0
},
"value": "Promise",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 820,
"end": 823,
"ctxt": 0
},
"params": [
{
"type": "TsTypeReference",
"span": {
"start": 821,
"end": 822,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 821,
"end": 822,
"ctxt": 0
},
"value": "U",
"optional": false
},
"typeParams": null
}
]
}
}
}
}
}
},
{
"type": "Identifier",
"span": {
"start": 825,
"end": 859,
"ctxt": 0
},
"value": "error",
"optional": true,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 831,
"end": 859,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsFunctionType",
"span": {
"start": 833,
"end": 859,
"ctxt": 0
},
"params": [
{
"type": "Identifier",
"span": {
"start": 834,
"end": 844,
"ctxt": 0
},
"value": "error",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 839,
"end": 844,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 841,
"end": 844,
"ctxt": 0
},
"kind": "any"
}
}
}
],
"typeParams": null,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 846,
"end": 859,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 849,
"end": 859,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 849,
"end": 856,
"ctxt": 0
},
"value": "Promise",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 856,
"end": 859,
"ctxt": 0
},
"params": [
{
"type": "TsTypeReference",
"span": {
"start": 857,
"end": 858,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 857,
"end": 858,
"ctxt": 0
},
"value": "U",
"optional": false
},
"typeParams": null
}
]
}
}
}
}
}
}
],
"typeAnn": {
"type": "TsTypeAnnotation",
"span": {
"start": 860,
"end": 872,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 862,
"end": 872,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 862,
"end": 869,
"ctxt": 0
},
"value": "Promise",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 869,
"end": 872,
"ctxt": 0
},
"params": [
{
"type": "TsTypeReference",
"span": {
"start": 870,
"end": 871,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 870,
"end": 871,
"ctxt": 0
},
"value": "U",
"optional": false
},
"typeParams": null
}
]
}
}
},
"typeParams": {
"type": "TsTypeParameterDeclaration",
"span": {
"start": 795,
"end": 798,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
"start": 796,
"end": 797,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 796,
"end": 797,
"ctxt": 0
},
"value": "U",
"optional": false
},
"constraint": null,
"default": null
}
]
}
}
]
}
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 905,
"end": 917,
"ctxt": 0
},
"value": "testFunction",
"optional": false
},
"declare": true,
"params": [
{
"type": "Parameter",
"span": {
"start": 918,
"end": 927,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 918,
"end": 927,
"ctxt": 0
},
"value": "n",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 919,
"end": 927,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 921,
"end": 927,
"ctxt": 0
},
"kind": "number"
}
}
}
}
],
"decorators": [],
"span": {
"start": 888,
"end": 946,
"ctxt": 0
},
"body": null,
"generator": false,
"async": false,
"typeParameters": null,
"returnType": {
"type": "TsTypeAnnotation",
"span": {
"start": 928,
"end": 945,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 930,
"end": 945,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 930,
"end": 937,
"ctxt": 0
},
"value": "Promise",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 937,
"end": 945,
"ctxt": 0
},
"params": [
{
"type": "TsKeywordType",
"span": {
"start": 938,
"end": 944,
"ctxt": 0
},
"kind": "number"
}
]
}
}
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 954,
"end": 986,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 958,
"end": 985,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 958,
"end": 968,
"ctxt": 0
},
"value": "numPromise",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 968,
"end": 985,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 970,
"end": 985,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 970,
"end": 977,
"ctxt": 0
},
"value": "Promise",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 977,
"end": 985,
"ctxt": 0
},
"params": [
{
"type": "TsKeywordType",
"span": {
"start": 978,
"end": 984,
"ctxt": 0
},
"kind": "number"
}
]
}
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 992,
"end": 1039,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 996,
"end": 1038,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 996,
"end": 1006,
"ctxt": 0
},
"value": "newPromise",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "CallExpression",
"span": {
"start": 1009,
"end": 1038,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 1009,
"end": 1024,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 1009,
"end": 1019,
"ctxt": 0
},
"value": "numPromise",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 1020,
"end": 1024,
"ctxt": 0
},
"value": "then",
"optional": false
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "Identifier",
"span": {
"start": 1025,
"end": 1037,
"ctxt": 0
},
"value": "testFunction",
"optional": false
}
}
],
"typeArguments": null
},
"definite": false
}
]
}
]
}
},
{
"type": "TsModuleDeclaration",
"span": {
"start": 1088,
"end": 1508,
"ctxt": 0
},
"declare": false,
"global": false,
"id": {
"type": "Identifier",
"span": {
"start": 1095,
"end": 1097,
"ctxt": 0
},
"value": "m4",
"optional": false
},
"body": {
"type": "TsModuleBlock",
"span": {
"start": 1098,
"end": 1508,
"ctxt": 0
},
"body": [
{
"type": "TsInterfaceDeclaration",
"span": {
"start": 1105,
"end": 1282,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 1115,
"end": 1122,
"ctxt": 0
},
"value": "Promise",
"optional": false
},
"declare": false,
"typeParams": {
"type": "TsTypeParameterDeclaration",
"span": {
"start": 1122,
"end": 1125,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
"start": 1123,
"end": 1124,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 1123,
"end": 1124,
"ctxt": 0
},
"value": "T",
"optional": false
},
"constraint": null,
"default": null
}
]
},
"extends": [],
"body": {
"type": "TsInterfaceBody",
"span": {
"start": 1126,
"end": 1282,
"ctxt": 0
},
"body": [
{
"type": "TsMethodSignature",
"span": {
"start": 1137,
"end": 1183,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 1137,
"end": 1141,
"ctxt": 0
},
"value": "then",
"optional": false
},
"computed": false,
"optional": false,
"params": [
{
"type": "Identifier",
"span": {
"start": 1145,
"end": 1169,
"ctxt": 0
},
"value": "cb",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 1147,
"end": 1169,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsFunctionType",
"span": {
"start": 1149,
"end": 1169,
"ctxt": 0
},
"params": [
{
"type": "Identifier",
"span": {
"start": 1150,
"end": 1154,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 1151,
"end": 1154,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 1153,
"end": 1154,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 1153,
"end": 1154,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
}
}
}
],
"typeParams": null,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 1156,
"end": 1169,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 1159,
"end": 1169,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 1159,
"end": 1166,
"ctxt": 0
},
"value": "Promise",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 1166,
"end": 1169,
"ctxt": 0
},
"params": [
{
"type": "TsTypeReference",
"span": {
"start": 1167,
"end": 1168,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 1167,
"end": 1168,
"ctxt": 0
},
"value": "U",
"optional": false
},
"typeParams": null
}
]
}
}
}
}
}
}
],
"typeAnn": {
"type": "TsTypeAnnotation",
"span": {
"start": 1170,
"end": 1182,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 1172,
"end": 1182,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 1172,
"end": 1179,
"ctxt": 0
},
"value": "Promise",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 1179,
"end": 1182,
"ctxt": 0
},
"params": [
{
"type": "TsTypeReference",
"span": {
"start": 1180,
"end": 1181,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 1180,
"end": 1181,
"ctxt": 0
},
"value": "U",
"optional": false
},
"typeParams": null
}
]
}
}
},
"typeParams": {
"type": "TsTypeParameterDeclaration",
"span": {
"start": 1141,
"end": 1144,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
"start": 1142,
"end": 1143,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 1142,
"end": 1143,
"ctxt": 0
},
"value": "U",
"optional": false
},
"constraint": null,
"default": null
}
]
}
},
{
"type": "TsMethodSignature",
"span": {
"start": 1193,
"end": 1275,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 1193,
"end": 1197,
"ctxt": 0
},
"value": "then",
"optional": false
},
"computed": false,
"optional": false,
"params": [
{
"type": "Identifier",
"span": {
"start": 1201,
"end": 1225,
"ctxt": 0
},
"value": "cb",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 1203,
"end": 1225,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsFunctionType",
"span": {
"start": 1205,
"end": 1225,
"ctxt": 0
},
"params": [
{
"type": "Identifier",
"span": {
"start": 1206,
"end": 1210,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 1207,
"end": 1210,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 1209,
"end": 1210,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 1209,
"end": 1210,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
}
}
}
],
"typeParams": null,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 1212,
"end": 1225,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 1215,
"end": 1225,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 1215,
"end": 1222,
"ctxt": 0
},
"value": "Promise",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 1222,
"end": 1225,
"ctxt": 0
},
"params": [
{
"type": "TsTypeReference",
"span": {
"start": 1223,
"end": 1224,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 1223,
"end": 1224,
"ctxt": 0
},
"value": "U",
"optional": false
},
"typeParams": null
}
]
}
}
}
}
}
},
{
"type": "Identifier",
"span": {
"start": 1227,
"end": 1261,
"ctxt": 0
},
"value": "error",
"optional": true,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 1233,
"end": 1261,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsFunctionType",
"span": {
"start": 1235,
"end": 1261,
"ctxt": 0
},
"params": [
{
"type": "Identifier",
"span": {
"start": 1236,
"end": 1246,
"ctxt": 0
},
"value": "error",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 1241,
"end": 1246,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 1243,
"end": 1246,
"ctxt": 0
},
"kind": "any"
}
}
}
],
"typeParams": null,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 1248,
"end": 1261,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 1251,
"end": 1261,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 1251,
"end": 1258,
"ctxt": 0
},
"value": "Promise",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 1258,
"end": 1261,
"ctxt": 0
},
"params": [
{
"type": "TsTypeReference",
"span": {
"start": 1259,
"end": 1260,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 1259,
"end": 1260,
"ctxt": 0
},
"value": "U",
"optional": false
},
"typeParams": null
}
]
}
}
}
}
}
}
],
"typeAnn": {
"type": "TsTypeAnnotation",
"span": {
"start": 1262,
"end": 1274,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 1264,
"end": 1274,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 1264,
"end": 1271,
"ctxt": 0
},
"value": "Promise",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 1271,
"end": 1274,
"ctxt": 0
},
"params": [
{
"type": "TsTypeReference",
"span": {
"start": 1272,
"end": 1273,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 1272,
"end": 1273,
"ctxt": 0
},
"value": "U",
"optional": false
},
"typeParams": null
}
]
}
}
},
"typeParams": {
"type": "TsTypeParameterDeclaration",
"span": {
"start": 1197,
"end": 1200,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
"start": 1198,
"end": 1199,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 1198,
"end": 1199,
"ctxt": 0
},
"value": "U",
"optional": false
},
"constraint": null,
"default": null
}
]
}
}
]
}
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 1307,
"end": 1319,
"ctxt": 0
},
"value": "testFunction",
"optional": false
},
"declare": true,
"params": [
{
"type": "Parameter",
"span": {
"start": 1320,
"end": 1329,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 1320,
"end": 1329,
"ctxt": 0
},
"value": "n",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 1321,
"end": 1329,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 1323,
"end": 1329,
"ctxt": 0
},
"kind": "number"
}
}
}
}
],
"decorators": [],
"span": {
"start": 1290,
"end": 1348,
"ctxt": 0
},
"body": null,
"generator": false,
"async": false,
"typeParameters": null,
"returnType": {
"type": "TsTypeAnnotation",
"span": {
"start": 1330,
"end": 1347,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 1332,
"end": 1347,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 1332,
"end": 1339,
"ctxt": 0
},
"value": "Promise",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 1339,
"end": 1347,
"ctxt": 0
},
"params": [
{
"type": "TsKeywordType",
"span": {
"start": 1340,
"end": 1346,
"ctxt": 0
},
"kind": "number"
}
]
}
}
}
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 1371,
"end": 1383,
"ctxt": 0
},
"value": "testFunction",
"optional": false
},
"declare": true,
"params": [
{
"type": "Parameter",
"span": {
"start": 1384,
"end": 1393,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 1384,
"end": 1393,
"ctxt": 0
},
"value": "s",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 1385,
"end": 1393,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 1387,
"end": 1393,
"ctxt": 0
},
"kind": "string"
}
}
}
}
],
"decorators": [],
"span": {
"start": 1354,
"end": 1412,
"ctxt": 0
},
"body": null,
"generator": false,
"async": false,
"typeParameters": null,
"returnType": {
"type": "TsTypeAnnotation",
"span": {
"start": 1394,
"end": 1411,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 1396,
"end": 1411,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 1396,
"end": 1403,
"ctxt": 0
},
"value": "Promise",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 1403,
"end": 1411,
"ctxt": 0
},
"params": [
{
"type": "TsKeywordType",
"span": {
"start": 1404,
"end": 1410,
"ctxt": 0
},
"kind": "string"
}
]
}
}
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 1420,
"end": 1452,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 1424,
"end": 1451,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 1424,
"end": 1434,
"ctxt": 0
},
"value": "numPromise",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 1434,
"end": 1451,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 1436,
"end": 1451,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 1436,
"end": 1443,
"ctxt": 0
},
"value": "Promise",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 1443,
"end": 1451,
"ctxt": 0
},
"params": [
{
"type": "TsKeywordType",
"span": {
"start": 1444,
"end": 1450,
"ctxt": 0
},
"kind": "number"
}
]
}
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 1458,
"end": 1505,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 1462,
"end": 1504,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 1462,
"end": 1472,
"ctxt": 0
},
"value": "newPromise",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "CallExpression",
"span": {
"start": 1475,
"end": 1504,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 1475,
"end": 1490,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 1475,
"end": 1485,
"ctxt": 0
},
"value": "numPromise",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 1486,
"end": 1490,
"ctxt": 0
},
"value": "then",
"optional": false
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "Identifier",
"span": {
"start": 1491,
"end": 1503,
"ctxt": 0
},
"value": "testFunction",
"optional": false
}
}
],
"typeArguments": null
},
"definite": false
}
]
}
]
}
},
{
"type": "TsModuleDeclaration",
"span": {
"start": 1554,
"end": 2097,
"ctxt": 0
},
"declare": false,
"global": false,
"id": {
"type": "Identifier",
"span": {
"start": 1561,
"end": 1563,
"ctxt": 0
},
"value": "m5",
"optional": false
},
"body": {
"type": "TsModuleBlock",
"span": {
"start": 1564,
"end": 2097,
"ctxt": 0
},
"body": [
{
"type": "TsInterfaceDeclaration",
"span": {
"start": 1571,
"end": 1871,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 1581,
"end": 1588,
"ctxt": 0
},
"value": "Promise",
"optional": false
},
"declare": false,
"typeParams": {
"type": "TsTypeParameterDeclaration",
"span": {
"start": 1588,
"end": 1591,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
"start": 1589,
"end": 1590,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 1589,
"end": 1590,
"ctxt": 0
},
"value": "T",
"optional": false
},
"constraint": null,
"default": null
}
]
},
"extends": [],
"body": {
"type": "TsInterfaceBody",
"span": {
"start": 1592,
"end": 1871,
"ctxt": 0
},
"body": [
{
"type": "TsMethodSignature",
"span": {
"start": 1603,
"end": 1649,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 1603,
"end": 1607,
"ctxt": 0
},
"value": "then",
"optional": false
},
"computed": false,
"optional": false,
"params": [
{
"type": "Identifier",
"span": {
"start": 1611,
"end": 1635,
"ctxt": 0
},
"value": "cb",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 1613,
"end": 1635,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsFunctionType",
"span": {
"start": 1615,
"end": 1635,
"ctxt": 0
},
"params": [
{
"type": "Identifier",
"span": {
"start": 1616,
"end": 1620,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 1617,
"end": 1620,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 1619,
"end": 1620,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 1619,
"end": 1620,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
}
}
}
],
"typeParams": null,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 1622,
"end": 1635,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 1625,
"end": 1635,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 1625,
"end": 1632,
"ctxt": 0
},
"value": "Promise",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 1632,
"end": 1635,
"ctxt": 0
},
"params": [
{
"type": "TsTypeReference",
"span": {
"start": 1633,
"end": 1634,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 1633,
"end": 1634,
"ctxt": 0
},
"value": "U",
"optional": false
},
"typeParams": null
}
]
}
}
}
}
}
}
],
"typeAnn": {
"type": "TsTypeAnnotation",
"span": {
"start": 1636,
"end": 1648,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 1638,
"end": 1648,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 1638,
"end": 1645,
"ctxt": 0
},
"value": "Promise",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 1645,
"end": 1648,
"ctxt": 0
},
"params": [
{
"type": "TsTypeReference",
"span": {
"start": 1646,
"end": 1647,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 1646,
"end": 1647,
"ctxt": 0
},
"value": "U",
"optional": false
},
"typeParams": null
}
]
}
}
},
"typeParams": {
"type": "TsTypeParameterDeclaration",
"span": {
"start": 1607,
"end": 1610,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
"start": 1608,
"end": 1609,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 1608,
"end": 1609,
"ctxt": 0
},
"value": "U",
"optional": false
},
"constraint": null,
"default": null
}
]
}
},
{
"type": "TsMethodSignature",
"span": {
"start": 1659,
"end": 1741,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 1659,
"end": 1663,
"ctxt": 0
},
"value": "then",
"optional": false
},
"computed": false,
"optional": false,
"params": [
{
"type": "Identifier",
"span": {
"start": 1667,
"end": 1691,
"ctxt": 0
},
"value": "cb",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 1669,
"end": 1691,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsFunctionType",
"span": {
"start": 1671,
"end": 1691,
"ctxt": 0
},
"params": [
{
"type": "Identifier",
"span": {
"start": 1672,
"end": 1676,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 1673,
"end": 1676,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 1675,
"end": 1676,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 1675,
"end": 1676,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
}
}
}
],
"typeParams": null,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 1678,
"end": 1691,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 1681,
"end": 1691,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 1681,
"end": 1688,
"ctxt": 0
},
"value": "Promise",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 1688,
"end": 1691,
"ctxt": 0
},
"params": [
{
"type": "TsTypeReference",
"span": {
"start": 1689,
"end": 1690,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 1689,
"end": 1690,
"ctxt": 0
},
"value": "U",
"optional": false
},
"typeParams": null
}
]
}
}
}
}
}
},
{
"type": "Identifier",
"span": {
"start": 1693,
"end": 1727,
"ctxt": 0
},
"value": "error",
"optional": true,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 1699,
"end": 1727,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsFunctionType",
"span": {
"start": 1701,
"end": 1727,
"ctxt": 0
},
"params": [
{
"type": "Identifier",
"span": {
"start": 1702,
"end": 1712,
"ctxt": 0
},
"value": "error",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 1707,
"end": 1712,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 1709,
"end": 1712,
"ctxt": 0
},
"kind": "any"
}
}
}
],
"typeParams": null,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 1714,
"end": 1727,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 1717,
"end": 1727,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 1717,
"end": 1724,
"ctxt": 0
},
"value": "Promise",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 1724,
"end": 1727,
"ctxt": 0
},
"params": [
{
"type": "TsTypeReference",
"span": {
"start": 1725,
"end": 1726,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 1725,
"end": 1726,
"ctxt": 0
},
"value": "U",
"optional": false
},
"typeParams": null
}
]
}
}
}
}
}
}
],
"typeAnn": {
"type": "TsTypeAnnotation",
"span": {
"start": 1728,
"end": 1740,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 1730,
"end": 1740,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 1730,
"end": 1737,
"ctxt": 0
},
"value": "Promise",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 1737,
"end": 1740,
"ctxt": 0
},
"params": [
{
"type": "TsTypeReference",
"span": {
"start": 1738,
"end": 1739,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 1738,
"end": 1739,
"ctxt": 0
},
"value": "U",
"optional": false
},
"typeParams": null
}
]
}
}
},
"typeParams": {
"type": "TsTypeParameterDeclaration",
"span": {
"start": 1663,
"end": 1666,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
"start": 1664,
"end": 1665,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 1664,
"end": 1665,
"ctxt": 0
},
"value": "U",
"optional": false
},
"constraint": null,
"default": null
}
]
}
},
{
"type": "TsMethodSignature",
"span": {
"start": 1751,
"end": 1864,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 1751,
"end": 1755,
"ctxt": 0
},
"value": "then",
"optional": false
},
"computed": false,
"optional": false,
"params": [
{
"type": "Identifier",
"span": {
"start": 1759,
"end": 1783,
"ctxt": 0
},
"value": "cb",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 1761,
"end": 1783,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsFunctionType",
"span": {
"start": 1763,
"end": 1783,
"ctxt": 0
},
"params": [
{
"type": "Identifier",
"span": {
"start": 1764,
"end": 1768,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 1765,
"end": 1768,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 1767,
"end": 1768,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 1767,
"end": 1768,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
}
}
}
],
"typeParams": null,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 1770,
"end": 1783,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 1773,
"end": 1783,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 1773,
"end": 1780,
"ctxt": 0
},
"value": "Promise",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 1780,
"end": 1783,
"ctxt": 0
},
"params": [
{
"type": "TsTypeReference",
"span": {
"start": 1781,
"end": 1782,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 1781,
"end": 1782,
"ctxt": 0
},
"value": "U",
"optional": false
},
"typeParams": null
}
]
}
}
}
}
}
},
{
"type": "Identifier",
"span": {
"start": 1785,
"end": 1810,
"ctxt": 0
},
"value": "error",
"optional": true,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 1791,
"end": 1810,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsFunctionType",
"span": {
"start": 1793,
"end": 1810,
"ctxt": 0
},
"params": [
{
"type": "Identifier",
"span": {
"start": 1794,
"end": 1804,
"ctxt": 0
},
"value": "error",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 1799,
"end": 1804,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 1801,
"end": 1804,
"ctxt": 0
},
"kind": "any"
}
}
}
],
"typeParams": null,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 1806,
"end": 1810,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 1809,
"end": 1810,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 1809,
"end": 1810,
"ctxt": 0
},
"value": "U",
"optional": false
},
"typeParams": null
}
}
}
}
},
{
"type": "Identifier",
"span": {
"start": 1812,
"end": 1850,
"ctxt": 0
},
"value": "progress",
"optional": true,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 1821,
"end": 1850,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsFunctionType",
"span": {
"start": 1823,
"end": 1850,
"ctxt": 0
},
"params": [
{
"type": "Identifier",
"span": {
"start": 1824,
"end": 1841,
"ctxt": 0
},
"value": "preservation",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 1836,
"end": 1841,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 1838,
"end": 1841,
"ctxt": 0
},
"kind": "any"
}
}
}
],
"typeParams": null,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 1843,
"end": 1850,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 1846,
"end": 1850,
"ctxt": 0
},
"kind": "void"
}
}
}
}
}
],
"typeAnn": {
"type": "TsTypeAnnotation",
"span": {
"start": 1851,
"end": 1863,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 1853,
"end": 1863,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 1853,
"end": 1860,
"ctxt": 0
},
"value": "Promise",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 1860,
"end": 1863,
"ctxt": 0
},
"params": [
{
"type": "TsTypeReference",
"span": {
"start": 1861,
"end": 1862,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 1861,
"end": 1862,
"ctxt": 0
},
"value": "U",
"optional": false
},
"typeParams": null
}
]
}
}
},
"typeParams": {
"type": "TsTypeParameterDeclaration",
"span": {
"start": 1755,
"end": 1758,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
"start": 1756,
"end": 1757,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 1756,
"end": 1757,
"ctxt": 0
},
"value": "U",
"optional": false
},
"constraint": null,
"default": null
}
]
}
}
]
}
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 1896,
"end": 1908,
"ctxt": 0
},
"value": "testFunction",
"optional": false
},
"declare": true,
"params": [
{
"type": "Parameter",
"span": {
"start": 1909,
"end": 1918,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 1909,
"end": 1918,
"ctxt": 0
},
"value": "n",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 1910,
"end": 1918,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 1912,
"end": 1918,
"ctxt": 0
},
"kind": "number"
}
}
}
}
],
"decorators": [],
"span": {
"start": 1879,
"end": 1937,
"ctxt": 0
},
"body": null,
"generator": false,
"async": false,
"typeParameters": null,
"returnType": {
"type": "TsTypeAnnotation",
"span": {
"start": 1919,
"end": 1936,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 1921,
"end": 1936,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 1921,
"end": 1928,
"ctxt": 0
},
"value": "Promise",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 1928,
"end": 1936,
"ctxt": 0
},
"params": [
{
"type": "TsKeywordType",
"span": {
"start": 1929,
"end": 1935,
"ctxt": 0
},
"kind": "number"
}
]
}
}
}
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 1960,
"end": 1972,
"ctxt": 0
},
"value": "testFunction",
"optional": false
},
"declare": true,
"params": [
{
"type": "Parameter",
"span": {
"start": 1973,
"end": 1982,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 1973,
"end": 1982,
"ctxt": 0
},
"value": "s",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 1974,
"end": 1982,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 1976,
"end": 1982,
"ctxt": 0
},
"kind": "string"
}
}
}
}
],
"decorators": [],
"span": {
"start": 1943,
"end": 2001,
"ctxt": 0
},
"body": null,
"generator": false,
"async": false,
"typeParameters": null,
"returnType": {
"type": "TsTypeAnnotation",
"span": {
"start": 1983,
"end": 2000,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 1985,
"end": 2000,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 1985,
"end": 1992,
"ctxt": 0
},
"value": "Promise",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 1992,
"end": 2000,
"ctxt": 0
},
"params": [
{
"type": "TsKeywordType",
"span": {
"start": 1993,
"end": 1999,
"ctxt": 0
},
"kind": "string"
}
]
}
}
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 2009,
"end": 2041,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 2013,
"end": 2040,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 2013,
"end": 2023,
"ctxt": 0
},
"value": "numPromise",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 2023,
"end": 2040,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 2025,
"end": 2040,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 2025,
"end": 2032,
"ctxt": 0
},
"value": "Promise",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 2032,
"end": 2040,
"ctxt": 0
},
"params": [
{
"type": "TsKeywordType",
"span": {
"start": 2033,
"end": 2039,
"ctxt": 0
},
"kind": "number"
}
]
}
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 2047,
"end": 2094,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 2051,
"end": 2093,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 2051,
"end": 2061,
"ctxt": 0
},
"value": "newPromise",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "CallExpression",
"span": {
"start": 2064,
"end": 2093,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 2064,
"end": 2079,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 2064,
"end": 2074,
"ctxt": 0
},
"value": "numPromise",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 2075,
"end": 2079,
"ctxt": 0
},
"value": "then",
"optional": false
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "Identifier",
"span": {
"start": 2080,
"end": 2092,
"ctxt": 0
},
"value": "testFunction",
"optional": false
}
}
],
"typeArguments": null
},
"definite": false
}
]
}
]
}
},
{
"type": "TsModuleDeclaration",
"span": {
"start": 2143,
"end": 2629,
"ctxt": 0
},
"declare": false,
"global": false,
"id": {
"type": "Identifier",
"span": {
"start": 2150,
"end": 2152,
"ctxt": 0
},
"value": "m6",
"optional": false
},
"body": {
"type": "TsModuleBlock",
"span": {
"start": 2153,
"end": 2629,
"ctxt": 0
},
"body": [
{
"type": "TsInterfaceDeclaration",
"span": {
"start": 2160,
"end": 2337,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 2170,
"end": 2177,
"ctxt": 0
},
"value": "Promise",
"optional": false
},
"declare": false,
"typeParams": {
"type": "TsTypeParameterDeclaration",
"span": {
"start": 2177,
"end": 2180,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
"start": 2178,
"end": 2179,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 2178,
"end": 2179,
"ctxt": 0
},
"value": "T",
"optional": false
},
"constraint": null,
"default": null
}
]
},
"extends": [],
"body": {
"type": "TsInterfaceBody",
"span": {
"start": 2181,
"end": 2337,
"ctxt": 0
},
"body": [
{
"type": "TsMethodSignature",
"span": {
"start": 2192,
"end": 2238,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 2192,
"end": 2196,
"ctxt": 0
},
"value": "then",
"optional": false
},
"computed": false,
"optional": false,
"params": [
{
"type": "Identifier",
"span": {
"start": 2200,
"end": 2224,
"ctxt": 0
},
"value": "cb",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 2202,
"end": 2224,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsFunctionType",
"span": {
"start": 2204,
"end": 2224,
"ctxt": 0
},
"params": [
{
"type": "Identifier",
"span": {
"start": 2205,
"end": 2209,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 2206,
"end": 2209,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 2208,
"end": 2209,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 2208,
"end": 2209,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
}
}
}
],
"typeParams": null,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 2211,
"end": 2224,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 2214,
"end": 2224,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 2214,
"end": 2221,
"ctxt": 0
},
"value": "Promise",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 2221,
"end": 2224,
"ctxt": 0
},
"params": [
{
"type": "TsTypeReference",
"span": {
"start": 2222,
"end": 2223,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 2222,
"end": 2223,
"ctxt": 0
},
"value": "U",
"optional": false
},
"typeParams": null
}
]
}
}
}
}
}
}
],
"typeAnn": {
"type": "TsTypeAnnotation",
"span": {
"start": 2225,
"end": 2237,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 2227,
"end": 2237,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 2227,
"end": 2234,
"ctxt": 0
},
"value": "Promise",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 2234,
"end": 2237,
"ctxt": 0
},
"params": [
{
"type": "TsTypeReference",
"span": {
"start": 2235,
"end": 2236,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 2235,
"end": 2236,
"ctxt": 0
},
"value": "U",
"optional": false
},
"typeParams": null
}
]
}
}
},
"typeParams": {
"type": "TsTypeParameterDeclaration",
"span": {
"start": 2196,
"end": 2199,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
"start": 2197,
"end": 2198,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 2197,
"end": 2198,
"ctxt": 0
},
"value": "U",
"optional": false
},
"constraint": null,
"default": null
}
]
}
},
{
"type": "TsMethodSignature",
"span": {
"start": 2248,
"end": 2330,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 2248,
"end": 2252,
"ctxt": 0
},
"value": "then",
"optional": false
},
"computed": false,
"optional": false,
"params": [
{
"type": "Identifier",
"span": {
"start": 2256,
"end": 2280,
"ctxt": 0
},
"value": "cb",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 2258,
"end": 2280,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsFunctionType",
"span": {
"start": 2260,
"end": 2280,
"ctxt": 0
},
"params": [
{
"type": "Identifier",
"span": {
"start": 2261,
"end": 2265,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 2262,
"end": 2265,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 2264,
"end": 2265,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 2264,
"end": 2265,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
}
}
}
],
"typeParams": null,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 2267,
"end": 2280,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 2270,
"end": 2280,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 2270,
"end": 2277,
"ctxt": 0
},
"value": "Promise",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 2277,
"end": 2280,
"ctxt": 0
},
"params": [
{
"type": "TsTypeReference",
"span": {
"start": 2278,
"end": 2279,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 2278,
"end": 2279,
"ctxt": 0
},
"value": "U",
"optional": false
},
"typeParams": null
}
]
}
}
}
}
}
},
{
"type": "Identifier",
"span": {
"start": 2282,
"end": 2316,
"ctxt": 0
},
"value": "error",
"optional": true,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 2288,
"end": 2316,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsFunctionType",
"span": {
"start": 2290,
"end": 2316,
"ctxt": 0
},
"params": [
{
"type": "Identifier",
"span": {
"start": 2291,
"end": 2301,
"ctxt": 0
},
"value": "error",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 2296,
"end": 2301,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 2298,
"end": 2301,
"ctxt": 0
},
"kind": "any"
}
}
}
],
"typeParams": null,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 2303,
"end": 2316,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 2306,
"end": 2316,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 2306,
"end": 2313,
"ctxt": 0
},
"value": "Promise",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 2313,
"end": 2316,
"ctxt": 0
},
"params": [
{
"type": "TsTypeReference",
"span": {
"start": 2314,
"end": 2315,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 2314,
"end": 2315,
"ctxt": 0
},
"value": "U",
"optional": false
},
"typeParams": null
}
]
}
}
}
}
}
}
],
"typeAnn": {
"type": "TsTypeAnnotation",
"span": {
"start": 2317,
"end": 2329,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 2319,
"end": 2329,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 2319,
"end": 2326,
"ctxt": 0
},
"value": "Promise",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 2326,
"end": 2329,
"ctxt": 0
},
"params": [
{
"type": "TsTypeReference",
"span": {
"start": 2327,
"end": 2328,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 2327,
"end": 2328,
"ctxt": 0
},
"value": "U",
"optional": false
},
"typeParams": null
}
]
}
}
},
"typeParams": {
"type": "TsTypeParameterDeclaration",
"span": {
"start": 2252,
"end": 2255,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
"start": 2253,
"end": 2254,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 2253,
"end": 2254,
"ctxt": 0
},
"value": "U",
"optional": false
},
"constraint": null,
"default": null
}
]
}
}
]
}
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 2362,
"end": 2374,
"ctxt": 0
},
"value": "testFunction",
"optional": false
},
"declare": true,
"params": [
{
"type": "Parameter",
"span": {
"start": 2375,
"end": 2384,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 2375,
"end": 2384,
"ctxt": 0
},
"value": "n",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 2376,
"end": 2384,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 2378,
"end": 2384,
"ctxt": 0
},
"kind": "number"
}
}
}
}
],
"decorators": [],
"span": {
"start": 2345,
"end": 2403,
"ctxt": 0
},
"body": null,
"generator": false,
"async": false,
"typeParameters": null,
"returnType": {
"type": "TsTypeAnnotation",
"span": {
"start": 2385,
"end": 2402,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 2387,
"end": 2402,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 2387,
"end": 2394,
"ctxt": 0
},
"value": "Promise",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 2394,
"end": 2402,
"ctxt": 0
},
"params": [
{
"type": "TsKeywordType",
"span": {
"start": 2395,
"end": 2401,
"ctxt": 0
},
"kind": "number"
}
]
}
}
}
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 2426,
"end": 2438,
"ctxt": 0
},
"value": "testFunction",
"optional": false
},
"declare": true,
"params": [
{
"type": "Parameter",
"span": {
"start": 2439,
"end": 2448,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 2439,
"end": 2448,
"ctxt": 0
},
"value": "s",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 2440,
"end": 2448,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 2442,
"end": 2448,
"ctxt": 0
},
"kind": "string"
}
}
}
}
],
"decorators": [],
"span": {
"start": 2409,
"end": 2467,
"ctxt": 0
},
"body": null,
"generator": false,
"async": false,
"typeParameters": null,
"returnType": {
"type": "TsTypeAnnotation",
"span": {
"start": 2449,
"end": 2466,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 2451,
"end": 2466,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 2451,
"end": 2458,
"ctxt": 0
},
"value": "Promise",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 2458,
"end": 2466,
"ctxt": 0
},
"params": [
{
"type": "TsKeywordType",
"span": {
"start": 2459,
"end": 2465,
"ctxt": 0
},
"kind": "string"
}
]
}
}
}
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 2490,
"end": 2502,
"ctxt": 0
},
"value": "testFunction",
"optional": false
},
"declare": true,
"params": [
{
"type": "Parameter",
"span": {
"start": 2503,
"end": 2513,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 2503,
"end": 2513,
"ctxt": 0
},
"value": "b",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 2504,
"end": 2513,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 2506,
"end": 2513,
"ctxt": 0
},
"kind": "boolean"
}
}
}
}
],
"decorators": [],
"span": {
"start": 2473,
"end": 2533,
"ctxt": 0
},
"body": null,
"generator": false,
"async": false,
"typeParameters": null,
"returnType": {
"type": "TsTypeAnnotation",
"span": {
"start": 2514,
"end": 2532,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 2516,
"end": 2532,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 2516,
"end": 2523,
"ctxt": 0
},
"value": "Promise",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 2523,
"end": 2532,
"ctxt": 0
},
"params": [
{
"type": "TsKeywordType",
"span": {
"start": 2524,
"end": 2531,
"ctxt": 0
},
"kind": "boolean"
}
]
}
}
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 2541,
"end": 2573,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 2545,
"end": 2572,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 2545,
"end": 2555,
"ctxt": 0
},
"value": "numPromise",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 2555,
"end": 2572,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 2557,
"end": 2572,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 2557,
"end": 2564,
"ctxt": 0
},
"value": "Promise",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 2564,
"end": 2572,
"ctxt": 0
},
"params": [
{
"type": "TsKeywordType",
"span": {
"start": 2565,
"end": 2571,
"ctxt": 0
},
"kind": "number"
}
]
}
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 2579,
"end": 2626,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 2583,
"end": 2625,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 2583,
"end": 2593,
"ctxt": 0
},
"value": "newPromise",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "CallExpression",
"span": {
"start": 2596,
"end": 2625,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 2596,
"end": 2611,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 2596,
"end": 2606,
"ctxt": 0
},
"value": "numPromise",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 2607,
"end": 2611,
"ctxt": 0
},
"value": "then",
"optional": false
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "Identifier",
"span": {
"start": 2612,
"end": 2624,
"ctxt": 0
},
"value": "testFunction",
"optional": false
}
}
],
"typeArguments": null
},
"definite": false
}
]
}
]
}
}
],
"interpreter": null
}