On this page
  1. Awaited
  2. Syntax & Overview
  3. Notes & Pitfalls
  4. Example

Awaited

Prev: `Parameters` | Up: function_and_promise | Next: `NoInfer`
Rel: function_and_promise, Conditional & Mapped Types
Ref: TypeScript Docs — Utility Types
Tags: #public #web #typescript #utility-types #function_and_promise #tier/core


Syntax & Overview

Awaited<T>

Recursively unwraps Promise / thenable types, mirroring runtime await.

Notes & Pitfalls

Example

async function fetchUser() {
  return { id: 1, name: "Ada" };
}

type User = Awaited<ReturnType<typeof fetchUser>>; // { id: number; name: string }

Linked from

Related notes