For the last week, I\'ve been researching how it could be possible to type function return values to the funtion itself in TypeScript.
What is hard to me is types ar
This can be accomplished with conditional types introduced in typescript 2.8:
let someFunction: () => String; let x : ReturnType<typeof someFunction>;
In case you are curious about the design alternatives the typescript team considered, the discussion in #6606 provides a good overview.