Need Assistance?

support@tutorialshub.in

Built-in Utility Types

ReturnType<T> & Parameters<T>

ADVERTISEMENT
TypeScript Free Lesson
5 min read
ADVERTISEMENT

Need the return type of a function from a library that didn't export its interface? Wrap typeof fn inside ReturnType<typeof fn> (and Awaited<...> if it's async)!

ADVERTISEMENT
Hi, I'm Tuby! Here to help you