Skip to content

Instantly share code, notes, and snippets.

@bryanmylee
Created April 23, 2022 09:48
Show Gist options
  • Save bryanmylee/eab3192ecbbcbcd23c85653c5b3013e6 to your computer and use it in GitHub Desktop.
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
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