I have the following function:
function test(): number { return 42; }
I can obtain the type of the function by using typeof
typeof
The easiest way in the TypeScript 2.8:
const foo = (): FooReturnType => { } type returnType = ReturnType; // returnType = FooReturnType