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.
321 lines
7.7 KiB
JSON
321 lines
7.7 KiB
JSON
{
|
|
"type": "Script",
|
|
"span": {
|
|
"start": 40,
|
|
"end": 147,
|
|
"ctxt": 0
|
|
},
|
|
"body": [
|
|
{
|
|
"type": "FunctionDeclaration",
|
|
"identifier": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 57,
|
|
"end": 61,
|
|
"ctxt": 0
|
|
},
|
|
"value": "test",
|
|
"optional": false
|
|
},
|
|
"declare": true,
|
|
"params": [],
|
|
"decorators": [],
|
|
"span": {
|
|
"start": 40,
|
|
"end": 86,
|
|
"ctxt": 0
|
|
},
|
|
"body": null,
|
|
"generator": false,
|
|
"async": false,
|
|
"typeParameters": {
|
|
"type": "TsTypeParameterDeclaration",
|
|
"span": {
|
|
"start": 61,
|
|
"end": 77,
|
|
"ctxt": 0
|
|
},
|
|
"parameters": [
|
|
{
|
|
"type": "TsTypeParameter",
|
|
"span": {
|
|
"start": 62,
|
|
"end": 63,
|
|
"ctxt": 0
|
|
},
|
|
"name": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 62,
|
|
"end": 63,
|
|
"ctxt": 0
|
|
},
|
|
"value": "A",
|
|
"optional": false
|
|
},
|
|
"in": false,
|
|
"out": false,
|
|
"const": false,
|
|
"constraint": null,
|
|
"default": null
|
|
},
|
|
{
|
|
"type": "TsTypeParameter",
|
|
"span": {
|
|
"start": 65,
|
|
"end": 76,
|
|
"ctxt": 0
|
|
},
|
|
"name": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 65,
|
|
"end": 66,
|
|
"ctxt": 0
|
|
},
|
|
"value": "B",
|
|
"optional": false
|
|
},
|
|
"in": false,
|
|
"out": false,
|
|
"const": false,
|
|
"constraint": {
|
|
"type": "TsTypeReference",
|
|
"span": {
|
|
"start": 75,
|
|
"end": 76,
|
|
"ctxt": 0
|
|
},
|
|
"typeName": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 75,
|
|
"end": 76,
|
|
"ctxt": 0
|
|
},
|
|
"value": "A",
|
|
"optional": false
|
|
},
|
|
"typeParams": null
|
|
},
|
|
"default": null
|
|
}
|
|
]
|
|
},
|
|
"returnType": {
|
|
"type": "TsTypeAnnotation",
|
|
"span": {
|
|
"start": 79,
|
|
"end": 85,
|
|
"ctxt": 0
|
|
},
|
|
"typeAnnotation": {
|
|
"type": "TsKeywordType",
|
|
"span": {
|
|
"start": 81,
|
|
"end": 85,
|
|
"ctxt": 0
|
|
},
|
|
"kind": "void"
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"type": "ExpressionStatement",
|
|
"span": {
|
|
"start": 88,
|
|
"end": 117,
|
|
"ctxt": 0
|
|
},
|
|
"expression": {
|
|
"type": "CallExpression",
|
|
"span": {
|
|
"start": 88,
|
|
"end": 116,
|
|
"ctxt": 0
|
|
},
|
|
"callee": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 88,
|
|
"end": 92,
|
|
"ctxt": 0
|
|
},
|
|
"value": "test",
|
|
"optional": false
|
|
},
|
|
"arguments": [],
|
|
"typeArguments": {
|
|
"type": "TsTypeParameterInstantiation",
|
|
"span": {
|
|
"start": 92,
|
|
"end": 114,
|
|
"ctxt": 0
|
|
},
|
|
"params": [
|
|
{
|
|
"type": "TsTypeLiteral",
|
|
"span": {
|
|
"start": 93,
|
|
"end": 105,
|
|
"ctxt": 0
|
|
},
|
|
"members": [
|
|
{
|
|
"type": "TsPropertySignature",
|
|
"span": {
|
|
"start": 94,
|
|
"end": 104,
|
|
"ctxt": 0
|
|
},
|
|
"readonly": false,
|
|
"key": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 94,
|
|
"end": 95,
|
|
"ctxt": 0
|
|
},
|
|
"value": "t",
|
|
"optional": false
|
|
},
|
|
"computed": false,
|
|
"optional": true,
|
|
"init": null,
|
|
"params": [],
|
|
"typeAnnotation": {
|
|
"type": "TsTypeAnnotation",
|
|
"span": {
|
|
"start": 96,
|
|
"end": 104,
|
|
"ctxt": 0
|
|
},
|
|
"typeAnnotation": {
|
|
"type": "TsKeywordType",
|
|
"span": {
|
|
"start": 98,
|
|
"end": 104,
|
|
"ctxt": 0
|
|
},
|
|
"kind": "string"
|
|
}
|
|
},
|
|
"typeParams": null
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "TsKeywordType",
|
|
"span": {
|
|
"start": 107,
|
|
"end": 113,
|
|
"ctxt": 0
|
|
},
|
|
"kind": "object"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"type": "ExpressionStatement",
|
|
"span": {
|
|
"start": 118,
|
|
"end": 147,
|
|
"ctxt": 0
|
|
},
|
|
"expression": {
|
|
"type": "CallExpression",
|
|
"span": {
|
|
"start": 118,
|
|
"end": 146,
|
|
"ctxt": 0
|
|
},
|
|
"callee": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 118,
|
|
"end": 122,
|
|
"ctxt": 0
|
|
},
|
|
"value": "test",
|
|
"optional": false
|
|
},
|
|
"arguments": [],
|
|
"typeArguments": {
|
|
"type": "TsTypeParameterInstantiation",
|
|
"span": {
|
|
"start": 122,
|
|
"end": 144,
|
|
"ctxt": 0
|
|
},
|
|
"params": [
|
|
{
|
|
"type": "TsTypeLiteral",
|
|
"span": {
|
|
"start": 123,
|
|
"end": 135,
|
|
"ctxt": 0
|
|
},
|
|
"members": [
|
|
{
|
|
"type": "TsPropertySignature",
|
|
"span": {
|
|
"start": 124,
|
|
"end": 134,
|
|
"ctxt": 0
|
|
},
|
|
"readonly": false,
|
|
"key": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 124,
|
|
"end": 125,
|
|
"ctxt": 0
|
|
},
|
|
"value": "t",
|
|
"optional": false
|
|
},
|
|
"computed": false,
|
|
"optional": true,
|
|
"init": null,
|
|
"params": [],
|
|
"typeAnnotation": {
|
|
"type": "TsTypeAnnotation",
|
|
"span": {
|
|
"start": 126,
|
|
"end": 134,
|
|
"ctxt": 0
|
|
},
|
|
"typeAnnotation": {
|
|
"type": "TsKeywordType",
|
|
"span": {
|
|
"start": 128,
|
|
"end": 134,
|
|
"ctxt": 0
|
|
},
|
|
"kind": "string"
|
|
}
|
|
},
|
|
"typeParams": null
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "TsKeywordType",
|
|
"span": {
|
|
"start": 137,
|
|
"end": 143,
|
|
"ctxt": 0
|
|
},
|
|
"kind": "bigint"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
}
|
|
],
|
|
"interpreter": null
|
|
}
|