TypeScript: Support conditional types syntax (#7404)

Microsoft/TypeScript#21316 and Microsoft/TypeScript#21496
This commit is contained in:
Andy
2018-02-24 05:56:14 -08:00
committed by Nicolò Ribaudo
parent 960fa66c9e
commit 6f6c8dabba
16 changed files with 587 additions and 1 deletions

View File

@@ -1875,6 +1875,22 @@ Aliases: `TSTypeElement`
---
### tSConditionalType
```javascript
t.tsConditionalType(checkType, extendsType, trueType, falseType)
```
See also `t.isTSConditionalType(node, opts)` and `t.assertTSConditionalType(node, opts)`.
Aliases: `TSType`
- `checkType`: `TSType` (required)
- `extendsType`: `TSType` (required)
- `trueType`: `TSType` (required)
- `falseType`: `TSType` (required)
---
### tSConstructSignatureDeclaration
```javascript
t.tsConstructSignatureDeclaration(typeParameters, parameters, typeAnnotation)
@@ -2074,6 +2090,19 @@ Aliases: `TSType`
---
### tSInferType
```javascript
t.tsInferType(typeParameter)
```
See also `t.isTSInferType(node, opts)` and `t.assertTSInferType(node, opts)`.
Aliases: `TSType`
- `typeParameter`: `TSType` (required)
---
### tSInterfaceBody
```javascript
t.tsInterfaceBody(body)