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

382 lines
10 KiB
JSON
Raw Normal View History

{
"type": "Script",
"span": {
"start": 1,
"end": 233,
"ctxt": 0
},
"body": [
{
"type": "TsInterfaceDeclaration",
"span": {
"start": 1,
"end": 233,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 11,
"end": 19,
"ctxt": 0
},
"value": "Document",
"optional": false
},
"declare": false,
"typeParams": null,
"extends": [],
"body": {
"type": "TsInterfaceBody",
"span": {
"start": 20,
"end": 233,
"ctxt": 0
},
"body": [
{
"type": "TsMethodSignature",
"span": {
"start": 26,
"end": 70,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 26,
"end": 39,
"ctxt": 0
},
"value": "createElement",
"optional": false
},
"computed": false,
"optional": false,
"params": [
{
"type": "Identifier",
"span": {
"start": 40,
"end": 55,
"ctxt": 0
},
"value": "tagName",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 47,
"end": 55,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 49,
"end": 55,
"ctxt": 0
},
"kind": "string"
}
}
}
],
"typeAnn": {
"type": "TsTypeAnnotation",
"span": {
"start": 56,
"end": 69,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 58,
"end": 69,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 58,
"end": 69,
"ctxt": 0
},
"value": "HTMLElement",
"optional": false
},
"typeParams": null
}
},
"typeParams": null
},
{
"type": "TsMethodSignature",
"span": {
"start": 75,
"end": 127,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 75,
"end": 88,
"ctxt": 0
},
"value": "createElement",
"optional": false
},
"computed": false,
"optional": false,
"params": [
{
"type": "Identifier",
"span": {
"start": 89,
"end": 106,
"ctxt": 0
},
"value": "tagName",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 96,
"end": 106,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsLiteralType",
"span": {
"start": 98,
"end": 106,
"ctxt": 0
},
"literal": {
"type": "StringLiteral",
"span": {
"start": 98,
"end": 106,
"ctxt": 0
},
"value": "canvas",
"raw": "'canvas'"
}
}
}
}
],
"typeAnn": {
"type": "TsTypeAnnotation",
"span": {
"start": 107,
"end": 126,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 109,
"end": 126,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 109,
"end": 126,
"ctxt": 0
},
"value": "HTMLCanvasElement",
"optional": false
},
"typeParams": null
}
},
"typeParams": null
},
{
"type": "TsMethodSignature",
"span": {
"start": 132,
"end": 178,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 132,
"end": 145,
"ctxt": 0
},
"value": "createElement",
"optional": false
},
"computed": false,
"optional": false,
"params": [
{
"type": "Identifier",
"span": {
"start": 146,
"end": 160,
"ctxt": 0
},
"value": "tagName",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 153,
"end": 160,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsLiteralType",
"span": {
"start": 155,
"end": 160,
"ctxt": 0
},
"literal": {
"type": "StringLiteral",
"span": {
"start": 155,
"end": 160,
"ctxt": 0
},
"value": "div",
"raw": "'div'"
}
}
}
}
],
"typeAnn": {
"type": "TsTypeAnnotation",
"span": {
"start": 161,
"end": 177,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 163,
"end": 177,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 163,
"end": 177,
"ctxt": 0
},
"value": "HTMLDivElement",
"optional": false
},
"typeParams": null
}
},
"typeParams": null
},
{
"type": "TsMethodSignature",
"span": {
"start": 183,
"end": 231,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 183,
"end": 196,
"ctxt": 0
},
"value": "createElement",
"optional": false
},
"computed": false,
"optional": false,
"params": [
{
"type": "Identifier",
"span": {
"start": 197,
"end": 212,
"ctxt": 0
},
"value": "tagName",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 204,
"end": 212,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsLiteralType",
"span": {
"start": 206,
"end": 212,
"ctxt": 0
},
"literal": {
"type": "StringLiteral",
"span": {
"start": 206,
"end": 212,
"ctxt": 0
},
"value": "span",
"raw": "'span'"
}
}
}
}
],
"typeAnn": {
"type": "TsTypeAnnotation",
"span": {
"start": 213,
"end": 230,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 215,
"end": 230,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 215,
"end": 230,
"ctxt": 0
},
"value": "HTMLSpanElement",
"optional": false
},
"typeParams": null
}
},
"typeParams": null
}
]
}
}
],
"interpreter": null
}