"Partial makes everything optional. Required does the inverse. Both are one-line utilities you'll reach for weekly."
Partial<T> — make every field optional
Partial<User> takes the User type and produces a new type where every field is optional. { id: number; name: string } becomes { id?: number; name?: string }. Useful for update payloads, configuration overrides, optional form state — anywhere the caller might supply only some fields.
The standard library implementation is one line: type Partial<T> = { [K in keyof T]?: T[K] }. A mapped type that loops over T's keys and applies ? to each. The Type Manipulation track covers mapped types in detail; for now, the pattern is enough to recognize.
Required<T> — make every field mandatory
The inverse. Required<Profile> takes a type with optional fields and makes them all required. Useful when receiving a possibly-incomplete object and asserting completeness, or when narrowing a default-laden config to its strict form after applying defaults.
Common use case: update objects
API endpoints often accept partial update payloads. function updateUser(id: number, patch: Partial<User>) is the clean way to type this: the patch may contain any subset of User's fields. Without Partial, you'd write the entire shape with every field optional by hand — error-prone and brittle to schema changes.