When we declare the type of an arrow function with generic parameters, we can do the following:
interface ArrowFunc {
<T>(arg: T): T;
}
type ArrowFunc2 = <T>(arg: T): T;
Now I need to use this type with the generic parameter specified, how may I achieve this? Obviously type Func = ArrowFunc<T> doesn't work, since the generic parameter belongs to the function instead of the type.
type ArrowFunc2<T> = (arg: T): T;ArrowFuncand create a concrete type from it where we replaceTwith a type of our choice as demonstrated here: tsplay.dev/WzP9LN. Is this what you want?