function add(a: number, b: number): number { return a + b; } type AddReturnType = ReturnType<typeof add>; // type AddReturnType = number; // --- function addStr(a: string, b: string): string{ return a + b; } type AddReturnType2 = ReturnType<typeof addStr>; // type AddReturnType2 = string;// TypeScript 2.8 onwards const foo = (): FooReturnType => { }; type returnType = ReturnType<typeof foo>; // returnType = FooReturnTypefunctionName() : ReturnType { ... }type T10 = ReturnType<() => string>; // string type T11 = ReturnType<(s: string) => void>; // void type T12 = ReturnType<(<T>() => T)>; // {} type T13 = ReturnType<(<T extends U, U extends number[]>() => T)>; // number[]