TypeScript · Generics and utility types

Awaited<T>

Unwraps the value type of a promise, recursively.

Syntax
Awaited<Promise<User>>

Example

Example
type User = { id: string };
type Loaded = Awaited<Promise<User>>;

More in this group

as const Generic constraint Generic function Indexed access keyof Parameters<T> Partial<T> Pick<T, K> / Omit<T, K>

Learn this in the course

Reference pages are the quick answer. The course explains the why, shows the full example and ends with a challenge.

Open the course