Skip to content

Commit ca2a154

Browse files
authored
doc: utility type (#569)
1 parent 7fbcf27 commit ca2a154

File tree

2 files changed

+20
-2
lines changed

2 files changed

+20
-2
lines changed

README.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2654,13 +2654,18 @@ Conditional Types are a difficult topic to get around so here are some extra res
26542654
26552655
### Troubleshooting Handbook: Utilities
26562656
2657-
These are all built in, [see source in es5.d.ts](https://github.com/microsoft/TypeScript/blob/2c458c0d1ccb96442bca9ce43aa987fb0becf8a9/src/lib/es5.d.ts#L1401-L1474):
2657+
These are all built in, [see source in es5.d.ts](https://github.com/microsoft/TypeScript/blob/33a34e5b96bfe086266f4765ab9789a2a02507f9/src/lib/es5.d.ts#L1523-L1637):
26582658
2659+
- `Awaited`: emulate the behavior of `await`
2660+
- `Capitalize`: convert first character of string literal type to uppercase
26592661
- `ConstructorParameters`: a tuple of class constructor's parameter types
26602662
- `Exclude`: exclude a type from another type
26612663
- `Extract`: select a subtype that is assignable to another type
26622664
- `InstanceType`: the instance type you get from a `new`ing a class constructor
2665+
- `Lowercase`: convert string literal type to lowercase
26632666
- `NonNullable`: exclude `null` and `undefined` from a type
2667+
- `Omit`: construct a type with the properties of another type.
2668+
- `OmitThisParameter`: remove the 'this' parameter from a function type.
26642669
- `Parameters`: a tuple of a function's parameter types
26652670
- `Partial`: Make all properties in an object optional
26662671
- `Readonly`: Make all properties in an object readonly
@@ -2669,6 +2674,10 @@ These are all built in, [see source in es5.d.ts](https://github.com/microsoft/Ty
26692674
- `Record`: A map from a key type to a value type
26702675
- `Required`: Make all properties in an object required
26712676
- `ReturnType`: A function's return type
2677+
- `ThisParameterType`: extract the type of the 'this' parameter of a function type
2678+
- `ThisType`: marker for contextual 'this' type
2679+
- `Uncapitalize`: convert first character of string literal type to lowercase
2680+
- `Uppercase`: convert string literal type to uppercase
26722681
26732682
<!--END-SECTION:utilities-->
26742683

docs/basic/troubleshooting/utilities.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,18 @@ title: "Troubleshooting Handbook: Utilities"
44
sidebar_label: Utilities
55
---
66

7-
These are all built in, [see source in es5.d.ts](https://github.com/microsoft/TypeScript/blob/2c458c0d1ccb96442bca9ce43aa987fb0becf8a9/src/lib/es5.d.ts#L1401-L1474):
7+
These are all built in, [see source in es5.d.ts](https://github.com/microsoft/TypeScript/blob/33a34e5b96bfe086266f4765ab9789a2a02507f9/src/lib/es5.d.ts#L1523-L1637):
88

9+
- `Awaited`: emulate the behavior of `await`
10+
- `Capitalize`: convert first character of string literal type to uppercase
911
- `ConstructorParameters`: a tuple of class constructor's parameter types
1012
- `Exclude`: exclude a type from another type
1113
- `Extract`: select a subtype that is assignable to another type
1214
- `InstanceType`: the instance type you get from a `new`ing a class constructor
15+
- `Lowercase`: convert string literal type to lowercase
1316
- `NonNullable`: exclude `null` and `undefined` from a type
17+
- `Omit`: construct a type with the properties of another type.
18+
- `OmitThisParameter`: remove the 'this' parameter from a function type.
1419
- `Parameters`: a tuple of a function's parameter types
1520
- `Partial`: Make all properties in an object optional
1621
- `Readonly`: Make all properties in an object readonly
@@ -19,3 +24,7 @@ These are all built in, [see source in es5.d.ts](https://github.com/microsoft/Ty
1924
- `Record`: A map from a key type to a value type
2025
- `Required`: Make all properties in an object required
2126
- `ReturnType`: A function's return type
27+
- `ThisParameterType`: extract the type of the 'this' parameter of a function type
28+
- `ThisType`: marker for contextual 'this' type
29+
- `Uncapitalize`: convert first character of string literal type to lowercase
30+
- `Uppercase`: convert string literal type to uppercase

0 commit comments

Comments
 (0)