Last active
May 16, 2023 16:37
-
-
Save wolak041/9b6b9f9c4c48836e8d3f83f4b7a9b44a to your computer and use it in GitHub Desktop.
This file contains 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 ReturnType<T> = T extends (...args: any[]) => infer R ? R : any; | |
// void | |
type Example1 = ReturnType<(n: number, s: string) => void>; | |
// any | |
type Example2 = ReturnType<number>; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment