/** * Unwrap a `Promise` to obtain its return value. * @see https://github.com/Microsoft/TypeScript/pull/21613 */ export type Awaited = { '1': T extends { then(onfulfilled: (value: infer U) => any): any; } ? Awaited : T; }[T extends number ? '1' : '1'];