Created
April 23, 2022 09:48
-
-
Save bryanmylee/eab3192ecbbcbcd23c85653c5b3013e6 to your computer and use it in GitHub Desktop.
Given an array of functions, get the type for an array of the function return types
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 ReturnTypes<T extends Array<(...a: any[]) => any>> = { | |
[P in keyof T]: T[P] extends (...a: any[]) => infer R ? R : never | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment