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

258 lines
6.6 KiB
JSON
Raw Normal View History

{
"type": "Script",
"span": {
"start": 0,
2022-02-04 14:17:42 +03:00
"end": 94,
"ctxt": 0
},
"body": [
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 17,
"end": 21,
"ctxt": 0
},
"value": "foo3",
"optional": false
},
"declare": true,
"params": [
{
"type": "Parameter",
"span": {
"start": 22,
"end": 47,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 22,
"end": 47,
"ctxt": 0
},
"value": "cb",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 24,
"end": 47,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsFunctionType",
"span": {
"start": 26,
"end": 47,
"ctxt": 0
},
"params": [
{
"type": "Identifier",
"span": {
"start": 27,
"end": 36,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 28,
"end": 36,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 30,
"end": 36,
"ctxt": 0
},
"kind": "number"
}
}
}
],
"typeParams": null,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 38,
"end": 47,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 41,
"end": 47,
"ctxt": 0
},
"kind": "number"
}
}
}
}
}
}
],
"decorators": [],
"span": {
"start": 0,
"end": 60,
"ctxt": 0
},
"body": null,
"generator": false,
"async": false,
"typeParameters": null,
"returnType": {
"type": "TsTypeAnnotation",
"span": {
"start": 48,
"end": 59,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeQuery",
"span": {
"start": 50,
"end": 59,
"ctxt": 0
},
"exprName": {
"type": "Identifier",
"span": {
"start": 57,
"end": 59,
"ctxt": 0
},
"value": "cb",
"optional": false
},
"typeArguments": null
}
}
},
{
"type": "VariableDeclaration",
"span": {
2022-02-04 14:17:42 +03:00
"start": 61,
"end": 94,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
2022-02-04 14:17:42 +03:00
"start": 65,
"end": 93,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 65,
"end": 67,
"ctxt": 0
},
"value": "r5",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "CallExpression",
"span": {
2022-02-04 14:17:42 +03:00
"start": 70,
"end": 93,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 70,
"end": 74,
"ctxt": 0
},
"value": "foo3",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "ArrowFunctionExpression",
"span": {
2022-02-04 14:17:42 +03:00
"start": 75,
"end": 92,
"ctxt": 0
},
"params": [
{
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 76,
"end": 85,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
2022-02-04 14:17:42 +03:00
"start": 77,
"end": 85,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
2022-02-04 14:17:42 +03:00
"start": 79,
"end": 85,
"ctxt": 0
},
"kind": "number"
}
}
}
],
"body": {
"type": "StringLiteral",
"span": {
2022-02-04 14:17:42 +03:00
"start": 90,
"end": 92,
"ctxt": 0
},
"value": "",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
},
"async": false,
"generator": false,
"typeParameters": null,
"returnType": null
}
}
],
"typeArguments": null
},
"definite": false
}
]
}
],
"interpreter": null
}