Utility Types
TypeScript provides several utility types to facilitate common type transformations. These utilities are available globally.
Awaited: emulate the behavior of await
Capitalize: convert first character of string literal type to uppercase
ConstructorParameters: a tuple of class constructor's parameter types
Exclude: exclude a type from another type
Extract: select a subtype that is assignable to another type
InstanceType: the instance type you get from a newing a class constructor
Lowercase: convert string literal type to lowercase
NonNullable: exclude null and undefined from a type
Omit: construct a type with the properties of another type.
OmitThisParameter: remove the 'this' parameter from a function type.
Parameters: a tuple of a function's parameter types
Partial: Make all properties in an object optional
Readonly: Make all properties in an object readonly
ReadonlyArray: Make an immutable array of the given type
Pick: A subtype of an object type with a subset of its keys
Record: A map from a key type to a value type
Required: Make all properties in an object required
ReturnType: A function's return type
ThisParameterType: extract the type of the 'this' parameter of a function type
ThisType: marker for contextual 'this' type
Uncapitalize: convert first character of string literal type to lowercase
Uppercase: convert string literal type to uppercase
Dynamic Constructors
- Parameters<Type>
- ConstructorParameters<Type>
- ReturnType<Type>
- InstanceType<Type>
- ThisParameterType<Type>
- OmitThisParameter<Type>
- ThisType<Type>
Intrinsic String Manipulation Types
https://www.typescriptlang.org/docs/handbook/2/template-literal-types.html#uppercasestringtype
https://www.typescriptlang.org/docs/handbook/utility-types.html