Tim Mouskhelichvili • May 17, 2023 • 2 minutes to read
Sometimes, when developing a TypeScript project, a developer may need to extract types from a union type. Luckily, this operation is easy to do with the built-in Extract utility type. The Extract<Type, Keys> utility type constructs a new [...]
Tim Mouskhelichvili • May 1, 2023 • 2 minutes to read
Sometimes, when developing a TypeScript project, developers need to exclude a member from an existing union type. Luckily, this operation is easy to do, using the Exclude utility type. The Exclude<UnionType, ExcludedMembers> utility type, constructs a new type [...]
Tim Mouskhelichvili • April 29, 2023 • 2 minutes to read
Sometimes when developing a TypeScript project, developers need to manipulate existing union types and remove null and undefined. Luckily, this task is easy to accomplish using the NonNullable type. The NonNullable<Type> constructs a new type by excluding null [...]
Tim Mouskhelichvili • April 17, 2023 • 2 minutes to read
TypeScript offers many utility types to help developers work better with types. One of them is the ReturnType utility type. But what is it, and how does it work? The ReturnType utility type helps you create a new type [...]
Tim Mouskhelichvili • February 20, 2023 • 2 minutes to read
In TypeScript, sometimes a developer needs to set the optional properties from an interface as required without changing the original interface. Luckily, TypeScript offers a utility type called Required to help achieve this task. The Required utility type accepts [...]
Tim Mouskhelichvili • July 5, 2022 • 2 minutes to read
TypeScript offers many different utility types that help transform other types. One of the most helpful utility types provided by TypeScript is the Omit type. The Omit type creates a new type by excluding one or multiple properties from [...]
Tim Mouskhelichvili • March 24, 2022 • 5 minutes to read
TypeScript adds a lot of useful utility types that help the developer do common type transformations. Whether it's to make properties from a type optional, to create a new tuple, or to pick some properties from a type TypeScript [...]
Tim Mouskhelichvili • March 15, 2022 • 3 minutes to read
The Partial<Type> type is a built-in TypeScript utility type that takes a Type and creates a new type with all Type's properties set to optional. (I know it's a lot of types). It is often used, when you [...]
Tim Mouskhelichvili • March 11, 2022 • 4 minutes to read
The TypeScript Record<Keys, Type> utility type is used to construct a new type whose properties are Keys and values are Type. The Record type helps you create a new TypeScript type from a union type. In this article [...]
Tim Mouskhelichvili • March 9, 2022 • 2 minutes to read
TypeScript provides a lot of utility types that are going to help you do common type transformations. One of those types is the TypeScript Pick type. The Pick type is used when you want to construct a type by [...]