type return_type = ReturnType<() => string>; // string // or function hello_world(): string { return "hello world"; } type return_type = ReturnType<typeof hello_world>; // string
if (typeof abc === "number") { // do something }