@@ -364,11 +364,11 @@ Here is a list of all the available types and its result structure.
364
364
| Simple | ` let x: string;` <br />` let x: number;` <br />` let x: boolean;` <br />` let x: any;` <br />` let x: void ;` <br />` let x: Object ;` <br />` let x: String ;` <br />` let x: MyClass;` | ` { " name" : " <type>" }` |
365
365
| Literals | ` let x: ' foo' ;` <br />` let x: 1 ;` <br />` let x: true ;` | ` { " name" : " literal" , " value" : " <rawvalue>" }` |
366
366
| Typed Classes | ` let x: Array < foo> ;` <br />` let x: Class< foo> ;` <br />` let x: MyClass< bar> ;` | ` { " name" : " <type>" , " elements" : [{ < element- type> }, ... ] }` |
367
- | Object Signature | ` let x: { foo: string, bar?: mixed };` <br />` let x: { [key: string]: string, foo: number };` | ` { " name" : " signature" , " type" : " object" , " raw" : " <raw-signature>" , " signature" : { " properties" : [{ " key" : " <property-name>" | { < property- key- type> }, " value" : { < property- type> , " required" : < true / false > } }, ... ] } }` |
367
+ | Object Signature | ` let x: { foo: string, bar?: mixed };` <br />` let x: { [key: string]: string, foo: number };` | ` { " name" : " signature" , " type" : " object" , " raw" : " <raw-signature>" , " signature" : { " properties" : [{ " key" : " <property-name>" \ | { < property- key- type> }, " value" : { < property- type> , " required" : < true / false > } }, ... ] } }` |
368
368
| Function Signature | ` let x : (x : string ) => void ;` | ` { " name" : " signature" , " type" : " function" , " raw" : " <raw-signature>" , " signature" : { " arguments" : [{ " name" : " <argument-name>" , " type" : { < argument- type> } }, ... ], " return" : { < return - type> } } }` |
369
- | Callable-Object/Function-Object Signature | ` let x: { (x: string): void , prop: string };` | ` { " name" : " signature" , " type" : " object" , " raw" : " <raw-signature>" , " signature" : { " properties" : [{ " key" : " <property-name>" | { < property- key- type> }, " value" : { < property- type> , " required" : < true / false > } }, ... ], " constructor" : { < function -signature> } } }` |
369
+ | Callable-Object/Function-Object Signature | ` let x: { (x: string): void , prop: string };` | ` { " name" : " signature" , " type" : " object" , " raw" : " <raw-signature>" , " signature" : { " properties" : [{ " key" : " <property-name>" \ | { < property- key- type> }, " value" : { < property- type> , " required" : < true / false > } }, ... ], " constructor" : { < function -signature> } } }` |
370
370
| Tuple | `let x: [foo, "value", number];` | `{ "name": "tuple", "raw": "<raw-signature>", "elements": [{ <element-type> }, ...] }` |
371
- | Union | `let x: number | string;` | `{ "name": "union", "raw": "<raw-signature>", "elements": [{ <element-type> }, ...] }` |
371
+ | Union | `let x: number \ | string;` | `{ "name": "union", "raw": "<raw-signature>", "elements": [{ <element-type> }, ...] }` |
372
372
| Intersect | `let x: number & string;` | `{ "name": "intersect", "raw": "<raw-signature>", "elements": [{ <element-type> }, ...] }` |
373
373
| Nullable modifier | `let x: ?number;` | `{ "name": "number", "nullable": true }` |
374
374
0 commit comments