Cheat Sheets

TypeScript Utility Types Cheat Sheet: Partial, Pick, Omit, Record & ReturnType

By ArpaNeuro Team September 20, 2026
TypeScript utility types cheat sheet

TypeScript utility types are built-in mapped types: Partial makes every field optional, Pick/Omit reshape objects, Record builds dictionaries, and ReturnType/Parameters extract function types. Use them to keep DTOs in sync instead of copy-pasting interfaces.

This TypeScript cheat sheet is written for people searching for a fast, accurate reference: students, junior developers, and teams shipping production software. Pin it, copy the snippets, and come back when syntax slips.

Quick reference

  • Partial<T>: All properties optional — handy for patches.
  • Required<T>: Opposite of Partial.
  • Pick<T, K>: Keep keys K from T.
  • Omit<T, K>: Drop keys K.
  • Record<K, V>: Object with keys K and values V.
  • Readonly<T>: All props readonly (shallow).
  • Exclude / Extract: Filter unions. NonNullable<T> drops null/undefined.
  • ReturnType / Parameters: From a function type. Awaited<T> unwraps promises.

Copy-paste examples

DTO helpers for an API patch

Omit server-generated fields on create. Partial for PATCH bodies.

interface User {
  id: number;
  email: string;
  name: string;
  role: 'user' | 'admin';
}
export type UserCreate = Omit<User, 'id'>;
export type UserPatch = Partial<Pick<User, 'email' | 'name'>>;
export type UsersById = Record<number, User>;
export type Role = User['role'];

Common mistakes

  • Partial on a nested object and assuming deep fields are optional (it is shallow).
  • Omit of a discriminant and breaking your union.
  • Re-declaring ReturnType helpers that already exist in lib.es5.d.ts.
  • Using Record<string, T> when a union of known keys was safer.

FAQ

  1. Are utility types runtime? No. They only exist for the checker. You still write the object in JS.
  1. Pick vs destructuring? Pick is a type. Destructuring is a value. You often use both: type the rest object as Omit<Props, "className">.
  1. Can I write my own mapped type? Yes: { [K in keyof T]: T[K] | null }. Prefer built-ins until you need something they do not express.

Related TypeScript cheat sheets

Build with this stack

When a cheat sheet is not enough — you need a production app, a student FYP, or a custom dashboard — ArpaNeuro builds custom web development and also sells ready-made source code. Request a quote and tell us the stack.

Browse software development services or the source code marketplace if you want a working codebase instead of starting from a blank file.

← All Articles Get a Quote →