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

179 lines
3.8 KiB
JSON

{
"type": "Script",
"span": {
"start": 1,
"end": 74,
"ctxt": 0
},
"body": [
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 18,
"end": 19,
"ctxt": 0
},
"value": "f",
"optional": false
},
"declare": true,
"params": [
{
"type": "Parameter",
"span": {
"start": 20,
"end": 28,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 20,
"end": 28,
"ctxt": 0
},
"value": "x",
"optional": true,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 22,
"end": 28,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsLiteralType",
"span": {
"start": 24,
"end": 28,
"ctxt": 0
},
"literal": {
"type": "StringLiteral",
"span": {
"start": 24,
"end": 28,
"ctxt": 0
},
"value": "hi",
"raw": "\"hi\""
}
}
}
}
}
],
"decorators": [],
"span": {
"start": 1,
"end": 36,
"ctxt": 0
},
"body": null,
"generator": false,
"async": false,
"typeParameters": null,
"returnType": {
"type": "TsTypeAnnotation",
"span": {
"start": 29,
"end": 35,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 31,
"end": 35,
"ctxt": 0
},
"kind": "void"
}
}
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 54,
"end": 55,
"ctxt": 0
},
"value": "f",
"optional": false
},
"declare": true,
"params": [
{
"type": "Parameter",
"span": {
"start": 56,
"end": 66,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 56,
"end": 66,
"ctxt": 0
},
"value": "x",
"optional": true,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 58,
"end": 66,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 60,
"end": 66,
"ctxt": 0
},
"kind": "string"
}
}
}
}
],
"decorators": [],
"span": {
"start": 37,
"end": 74,
"ctxt": 0
},
"body": null,
"generator": false,
"async": false,
"typeParameters": null,
"returnType": {
"type": "TsTypeAnnotation",
"span": {
"start": 67,
"end": 73,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 69,
"end": 73,
"ctxt": 0
},
"kind": "void"
}
}
}
],
"interpreter": null
}