← Cheat Sheets

TypeScript Utility Types

Built-in helpers that transform types.

# TypeScript Utility Types

Built-in helpers that transform types.

| Utility | Result |
|---|---|
| `Partial<T>` | All properties optional |
| `Required<T>` | All properties required |
| `Readonly<T>` | All properties readonly |
| `Pick<T, "a" \| "b">` | Only chosen keys |
| `Omit<T, "a">` | All keys except these |
| `Record<K, V>` | Object with keys K and values V |
| `Exclude<U, X>` | Remove members from a union |
| `Extract<U, X>` | Keep matching members |
| `NonNullable<T>` | Remove null and undefined |
| `ReturnType<typeof fn>` | Function return type |
| `Parameters<typeof fn>` | Tuple of parameter types |
| `Awaited<T>` | Unwrap a Promise type |