Last active
July 6, 2021 13:39
-
-
Save fostyfost/26713a150bdf8f192865e77bca129d6a to your computer and use it in GitHub Desktop.
Extract return type
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type ExtractReturnTypes<T extends ((...args: unknown[]) => unknown)[]> = [ | |
...{ [K in keyof T]: T[K] extends ((...args: unknown[]) => infer R) ? R : never } | |
] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment