I have a generic function like this:
function foo<T>(val: T) { return val; }
I have some types:
type StringType = string;
type NumType = number;
Now I want to make a reference to the 'foo' function with a given type, but it wont work:
const stringFunc = foo<StringType>;
const numFunc = foo<NumType>;
Note that I don't want to invoke the 'foo' function, otherwise, I could do:
const stringFunc = (val: string) => foo<StringType>(val);
const numFunc = (val: number) => foo<NumType>(val);
Is it possible?