TypeScript Obtenez le type de retour de promesse
type AsyncReturnType<T extends (...args: any) => any> =
T extends (...args: any) => Promise<infer U> ? U :
T extends (...args: any) => infer U ? U :
any
florinrelea