Awaited<T> unwraps a promise type the way await does: Awaited<Promise<string>> is string, and nested promises are unwrapped all the way. Its most common use is with ReturnType on an async function, Awaited<ReturnType<typeof loadAccount>>, which names the resolved value. TypeScript 4.5 added it.
Without Awaited, the ReturnType of an async function is the Promise itself, so reading account.name from it is TS2339, as the second example shows.
At a glance
| JSDoc in a .js file | TypeScript in a .ts file |
|---|---|
/** @type {Awaited<ReturnType<typeof loadAccount>>} */ | : Awaited<ReturnType<typeof loadAccount>> |
Examples
/** @param {string} id */
export async function loadAccount(id) {
return { id, name: "Jane", orders: /** @type {string[]} */ ([]) };
}
/** @typedef {Awaited<ReturnType<typeof loadAccount>>} Account */
/** @param {Account} account */
export function greeting(account) {
return `Hello, ${account.name}`;
}
loadAccount("u_1").then(greeting);export async function loadAccount(id: string) {
return { id, name: "Jane", orders: [] as string[] };
}
type Account = Awaited<ReturnType<typeof loadAccount>>;
export function greeting(account: Account) {
return `Hello, ${account.name}`;
}
loadAccount("u_1").then(greeting);jsconfig.json for this example
{
"compilerOptions": {
"checkJs": true,
"noEmit": true,
"strict": true,
"target": "es2022",
"module": "nodenext",
"types": []
},
"include": ["*.js"]
} /** @param {string} id */
export async function loadAccount(id) {
return { id, name: "Jane" };
}
/** @typedef {ReturnType<typeof loadAccount>} Pending */
/** @param {Pending} account */
export function greeting(account) {
return `Hello, ${account.name}`;error TS2339: Property 'name' does not exist on type 'Promise<{ id: string; name: string; }>'.
}jsconfig.json for this example
{
"compilerOptions": {
"checkJs": true,
"noEmit": true,
"strict": true,
"target": "es2022",
"module": "nodenext",
"types": []
},
"include": ["*.js"]
} Where it shows up
TypeScript uses Awaited itself in the types of Promise.all, Promise.race and async function returns, so it appears in hovers and messages even if you never write it. Values that are not promises pass through unchanged: Awaited<number> is number.
Gotchas
- Before TypeScript 4.5, the usual workaround was a hand-written conditional type with
infer;Awaitedreplaces it. Awaitedunwraps any object with athenmethod that looks like a promise, not only native promises.
Questions
How do I get the resolved type of an async function in JSDoc?
{Awaited<ReturnType<typeof yourAsyncFunction>>}.
Sources
- Utility Types: Awaited<Type> · TypeScript handbook
- TypeScript 4.5: the Awaited type and Promise improvements · TypeScript release notes
Last reviewed 20 October 2026.