Get the awaited return type of a function.
Function type
Combines return type extraction with automatic Promise unwrapping. It's come in handy when dealing with async functions.
type F1 = () => string;type R1 = AwaitedReturnType< F1 >; // stringtype F2 = () => Promise< number >;type R2 = AwaitedReturnType< F2 >; // number Copy
type F1 = () => string;type R1 = AwaitedReturnType< F1 >; // stringtype F2 = () => Promise< number >;type R2 = AwaitedReturnType< F2 >; // number
Get the awaited return type of a function.