Last active: 2 years ago
Get Promise return type.
// A = string
type A = Awaited<Promise<string>>;
// B = number
type B = Awaited<Promise<Promise<number>>>;
// C = boolean | number
type C = Awaited<boolean | Promise<number>>;
type APIResult = Awaited<ReturnType<typeof getUser>>