TypeScript - Utility types
TypeScript has built-in utilities that enable the creation of modified types based on existing types. Using these utilities helps you maintain relationships between dependent types, which can be valuable during future refactoring.
It's advisable to consider using utility types in places where you would otherwise create a new type by copying and pasting parts from an existing one.
Object values transformation
I know I can create a transformed type based on the object type values using Partial, Required and Readonly
Object parts
I know how to create a new type containing only part of the keys using Pick and Omit operators
Function transformation
I use Parameters to access the list of parameter types
I use ReturnType to check what type is returned from a specific function type
Union transformations
I know when to use Exclude, Extract, and NonNullable utilities to narrow union elements from an existing one
I know I can create a transformed type based on the object type values using Partial, Required and Readonly
I know how to create a new type containing only part of the keys using Pick and Omit operators
I use Parameters to access the list of parameter types
I use ReturnType to check what type is returned from a specific function type
I know when to use Exclude, Extract, and NonNullable utilities to narrow union elements from an existing one