mirror of
https://github.com/swc-project/swc.git
synced 2024-11-24 10:12:42 +03:00
019cf37199
**Related issue:** - https://github.com/microsoft/TypeScript/pull/51865.
633 lines
16 KiB
JSON
633 lines
16 KiB
JSON
{
|
|
"type": "Script",
|
|
"span": {
|
|
"start": 1,
|
|
"end": 225,
|
|
"ctxt": 0
|
|
},
|
|
"body": [
|
|
{
|
|
"type": "TsInterfaceDeclaration",
|
|
"span": {
|
|
"start": 1,
|
|
"end": 73,
|
|
"ctxt": 0
|
|
},
|
|
"id": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 11,
|
|
"end": 17,
|
|
"ctxt": 0
|
|
},
|
|
"value": "Number",
|
|
"optional": false
|
|
},
|
|
"declare": false,
|
|
"typeParams": null,
|
|
"extends": [],
|
|
"body": {
|
|
"type": "TsInterfaceBody",
|
|
"span": {
|
|
"start": 18,
|
|
"end": 73,
|
|
"ctxt": 0
|
|
},
|
|
"body": [
|
|
{
|
|
"type": "TsMethodSignature",
|
|
"span": {
|
|
"start": 24,
|
|
"end": 42,
|
|
"ctxt": 0
|
|
},
|
|
"readonly": false,
|
|
"key": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 24,
|
|
"end": 31,
|
|
"ctxt": 0
|
|
},
|
|
"value": "doStuff",
|
|
"optional": false
|
|
},
|
|
"computed": false,
|
|
"optional": false,
|
|
"params": [],
|
|
"typeAnn": {
|
|
"type": "TsTypeAnnotation",
|
|
"span": {
|
|
"start": 33,
|
|
"end": 41,
|
|
"ctxt": 0
|
|
},
|
|
"typeAnnotation": {
|
|
"type": "TsKeywordType",
|
|
"span": {
|
|
"start": 35,
|
|
"end": 41,
|
|
"ctxt": 0
|
|
},
|
|
"kind": "string"
|
|
}
|
|
},
|
|
"typeParams": null
|
|
},
|
|
{
|
|
"type": "TsMethodSignature",
|
|
"span": {
|
|
"start": 47,
|
|
"end": 71,
|
|
"ctxt": 0
|
|
},
|
|
"readonly": false,
|
|
"key": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 47,
|
|
"end": 59,
|
|
"ctxt": 0
|
|
},
|
|
"value": "doOtherStuff",
|
|
"optional": false
|
|
},
|
|
"computed": false,
|
|
"optional": false,
|
|
"params": [
|
|
{
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 63,
|
|
"end": 66,
|
|
"ctxt": 0
|
|
},
|
|
"value": "x",
|
|
"optional": false,
|
|
"typeAnnotation": {
|
|
"type": "TsTypeAnnotation",
|
|
"span": {
|
|
"start": 64,
|
|
"end": 66,
|
|
"ctxt": 0
|
|
},
|
|
"typeAnnotation": {
|
|
"type": "TsTypeReference",
|
|
"span": {
|
|
"start": 65,
|
|
"end": 66,
|
|
"ctxt": 0
|
|
},
|
|
"typeName": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 65,
|
|
"end": 66,
|
|
"ctxt": 0
|
|
},
|
|
"value": "T",
|
|
"optional": false
|
|
},
|
|
"typeParams": null
|
|
}
|
|
}
|
|
}
|
|
],
|
|
"typeAnn": {
|
|
"type": "TsTypeAnnotation",
|
|
"span": {
|
|
"start": 67,
|
|
"end": 70,
|
|
"ctxt": 0
|
|
},
|
|
"typeAnnotation": {
|
|
"type": "TsTypeReference",
|
|
"span": {
|
|
"start": 69,
|
|
"end": 70,
|
|
"ctxt": 0
|
|
},
|
|
"typeName": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 69,
|
|
"end": 70,
|
|
"ctxt": 0
|
|
},
|
|
"value": "T",
|
|
"optional": false
|
|
},
|
|
"typeParams": null
|
|
}
|
|
},
|
|
"typeParams": {
|
|
"type": "TsTypeParameterDeclaration",
|
|
"span": {
|
|
"start": 59,
|
|
"end": 62,
|
|
"ctxt": 0
|
|
},
|
|
"parameters": [
|
|
{
|
|
"type": "TsTypeParameter",
|
|
"span": {
|
|
"start": 60,
|
|
"end": 61,
|
|
"ctxt": 0
|
|
},
|
|
"name": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 60,
|
|
"end": 61,
|
|
"ctxt": 0
|
|
},
|
|
"value": "T",
|
|
"optional": false
|
|
},
|
|
"in": false,
|
|
"out": false,
|
|
"const": false,
|
|
"constraint": null,
|
|
"default": null
|
|
}
|
|
]
|
|
}
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "VariableDeclaration",
|
|
"span": {
|
|
"start": 75,
|
|
"end": 85,
|
|
"ctxt": 0
|
|
},
|
|
"kind": "var",
|
|
"declare": false,
|
|
"declarations": [
|
|
{
|
|
"type": "VariableDeclarator",
|
|
"span": {
|
|
"start": 79,
|
|
"end": 84,
|
|
"ctxt": 0
|
|
},
|
|
"id": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 79,
|
|
"end": 80,
|
|
"ctxt": 0
|
|
},
|
|
"value": "x",
|
|
"optional": false,
|
|
"typeAnnotation": null
|
|
},
|
|
"init": {
|
|
"type": "NumericLiteral",
|
|
"span": {
|
|
"start": 83,
|
|
"end": 84,
|
|
"ctxt": 0
|
|
},
|
|
"value": 1.0,
|
|
"raw": "1"
|
|
},
|
|
"definite": false
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "VariableDeclaration",
|
|
"span": {
|
|
"start": 86,
|
|
"end": 114,
|
|
"ctxt": 0
|
|
},
|
|
"kind": "var",
|
|
"declare": false,
|
|
"declarations": [
|
|
{
|
|
"type": "VariableDeclarator",
|
|
"span": {
|
|
"start": 90,
|
|
"end": 113,
|
|
"ctxt": 0
|
|
},
|
|
"id": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 90,
|
|
"end": 91,
|
|
"ctxt": 0
|
|
},
|
|
"value": "a",
|
|
"optional": false,
|
|
"typeAnnotation": {
|
|
"type": "TsTypeAnnotation",
|
|
"span": {
|
|
"start": 91,
|
|
"end": 99,
|
|
"ctxt": 0
|
|
},
|
|
"typeAnnotation": {
|
|
"type": "TsKeywordType",
|
|
"span": {
|
|
"start": 93,
|
|
"end": 99,
|
|
"ctxt": 0
|
|
},
|
|
"kind": "string"
|
|
}
|
|
}
|
|
},
|
|
"init": {
|
|
"type": "CallExpression",
|
|
"span": {
|
|
"start": 102,
|
|
"end": 113,
|
|
"ctxt": 0
|
|
},
|
|
"callee": {
|
|
"type": "MemberExpression",
|
|
"span": {
|
|
"start": 102,
|
|
"end": 111,
|
|
"ctxt": 0
|
|
},
|
|
"object": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 102,
|
|
"end": 103,
|
|
"ctxt": 0
|
|
},
|
|
"value": "x",
|
|
"optional": false
|
|
},
|
|
"property": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 104,
|
|
"end": 111,
|
|
"ctxt": 0
|
|
},
|
|
"value": "doStuff",
|
|
"optional": false
|
|
}
|
|
},
|
|
"arguments": [],
|
|
"typeArguments": null
|
|
},
|
|
"definite": false
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "VariableDeclaration",
|
|
"span": {
|
|
"start": 115,
|
|
"end": 152,
|
|
"ctxt": 0
|
|
},
|
|
"kind": "var",
|
|
"declare": false,
|
|
"declarations": [
|
|
{
|
|
"type": "VariableDeclarator",
|
|
"span": {
|
|
"start": 119,
|
|
"end": 151,
|
|
"ctxt": 0
|
|
},
|
|
"id": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 119,
|
|
"end": 120,
|
|
"ctxt": 0
|
|
},
|
|
"value": "b",
|
|
"optional": false,
|
|
"typeAnnotation": {
|
|
"type": "TsTypeAnnotation",
|
|
"span": {
|
|
"start": 120,
|
|
"end": 128,
|
|
"ctxt": 0
|
|
},
|
|
"typeAnnotation": {
|
|
"type": "TsKeywordType",
|
|
"span": {
|
|
"start": 122,
|
|
"end": 128,
|
|
"ctxt": 0
|
|
},
|
|
"kind": "string"
|
|
}
|
|
}
|
|
},
|
|
"init": {
|
|
"type": "CallExpression",
|
|
"span": {
|
|
"start": 131,
|
|
"end": 151,
|
|
"ctxt": 0
|
|
},
|
|
"callee": {
|
|
"type": "MemberExpression",
|
|
"span": {
|
|
"start": 131,
|
|
"end": 145,
|
|
"ctxt": 0
|
|
},
|
|
"object": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 131,
|
|
"end": 132,
|
|
"ctxt": 0
|
|
},
|
|
"value": "x",
|
|
"optional": false
|
|
},
|
|
"property": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 133,
|
|
"end": 145,
|
|
"ctxt": 0
|
|
},
|
|
"value": "doOtherStuff",
|
|
"optional": false
|
|
}
|
|
},
|
|
"arguments": [
|
|
{
|
|
"spread": null,
|
|
"expression": {
|
|
"type": "StringLiteral",
|
|
"span": {
|
|
"start": 146,
|
|
"end": 150,
|
|
"ctxt": 0
|
|
},
|
|
"value": "hm",
|
|
"raw": "'hm'"
|
|
}
|
|
}
|
|
],
|
|
"typeArguments": null
|
|
},
|
|
"definite": false
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "VariableDeclaration",
|
|
"span": {
|
|
"start": 153,
|
|
"end": 184,
|
|
"ctxt": 0
|
|
},
|
|
"kind": "var",
|
|
"declare": false,
|
|
"declarations": [
|
|
{
|
|
"type": "VariableDeclarator",
|
|
"span": {
|
|
"start": 157,
|
|
"end": 183,
|
|
"ctxt": 0
|
|
},
|
|
"id": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 157,
|
|
"end": 158,
|
|
"ctxt": 0
|
|
},
|
|
"value": "c",
|
|
"optional": false,
|
|
"typeAnnotation": {
|
|
"type": "TsTypeAnnotation",
|
|
"span": {
|
|
"start": 158,
|
|
"end": 166,
|
|
"ctxt": 0
|
|
},
|
|
"typeAnnotation": {
|
|
"type": "TsKeywordType",
|
|
"span": {
|
|
"start": 160,
|
|
"end": 166,
|
|
"ctxt": 0
|
|
},
|
|
"kind": "string"
|
|
}
|
|
}
|
|
},
|
|
"init": {
|
|
"type": "CallExpression",
|
|
"span": {
|
|
"start": 169,
|
|
"end": 183,
|
|
"ctxt": 0
|
|
},
|
|
"callee": {
|
|
"type": "MemberExpression",
|
|
"span": {
|
|
"start": 169,
|
|
"end": 181,
|
|
"ctxt": 0
|
|
},
|
|
"object": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 169,
|
|
"end": 170,
|
|
"ctxt": 0
|
|
},
|
|
"value": "x",
|
|
"optional": false
|
|
},
|
|
"property": {
|
|
"type": "Computed",
|
|
"span": {
|
|
"start": 170,
|
|
"end": 181,
|
|
"ctxt": 0
|
|
},
|
|
"expression": {
|
|
"type": "StringLiteral",
|
|
"span": {
|
|
"start": 171,
|
|
"end": 180,
|
|
"ctxt": 0
|
|
},
|
|
"value": "doStuff",
|
|
"raw": "'doStuff'"
|
|
}
|
|
}
|
|
},
|
|
"arguments": [],
|
|
"typeArguments": null
|
|
},
|
|
"definite": false
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "VariableDeclaration",
|
|
"span": {
|
|
"start": 185,
|
|
"end": 225,
|
|
"ctxt": 0
|
|
},
|
|
"kind": "var",
|
|
"declare": false,
|
|
"declarations": [
|
|
{
|
|
"type": "VariableDeclarator",
|
|
"span": {
|
|
"start": 189,
|
|
"end": 224,
|
|
"ctxt": 0
|
|
},
|
|
"id": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 189,
|
|
"end": 190,
|
|
"ctxt": 0
|
|
},
|
|
"value": "d",
|
|
"optional": false,
|
|
"typeAnnotation": {
|
|
"type": "TsTypeAnnotation",
|
|
"span": {
|
|
"start": 190,
|
|
"end": 198,
|
|
"ctxt": 0
|
|
},
|
|
"typeAnnotation": {
|
|
"type": "TsKeywordType",
|
|
"span": {
|
|
"start": 192,
|
|
"end": 198,
|
|
"ctxt": 0
|
|
},
|
|
"kind": "string"
|
|
}
|
|
}
|
|
},
|
|
"init": {
|
|
"type": "CallExpression",
|
|
"span": {
|
|
"start": 201,
|
|
"end": 224,
|
|
"ctxt": 0
|
|
},
|
|
"callee": {
|
|
"type": "MemberExpression",
|
|
"span": {
|
|
"start": 201,
|
|
"end": 218,
|
|
"ctxt": 0
|
|
},
|
|
"object": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 201,
|
|
"end": 202,
|
|
"ctxt": 0
|
|
},
|
|
"value": "x",
|
|
"optional": false
|
|
},
|
|
"property": {
|
|
"type": "Computed",
|
|
"span": {
|
|
"start": 202,
|
|
"end": 218,
|
|
"ctxt": 0
|
|
},
|
|
"expression": {
|
|
"type": "StringLiteral",
|
|
"span": {
|
|
"start": 203,
|
|
"end": 217,
|
|
"ctxt": 0
|
|
},
|
|
"value": "doOtherStuff",
|
|
"raw": "'doOtherStuff'"
|
|
}
|
|
}
|
|
},
|
|
"arguments": [
|
|
{
|
|
"spread": null,
|
|
"expression": {
|
|
"type": "StringLiteral",
|
|
"span": {
|
|
"start": 219,
|
|
"end": 223,
|
|
"ctxt": 0
|
|
},
|
|
"value": "hm",
|
|
"raw": "'hm'"
|
|
}
|
|
}
|
|
],
|
|
"typeArguments": null
|
|
},
|
|
"definite": false
|
|
}
|
|
]
|
|
}
|
|
],
|
|
"interpreter": null
|
|
}
|