Apply type params to function (type level)

Viewed 27

Imagine I have the following function

const wrap = <T>(t:T)=>({response:T})

Imagine I want to get the type of that function applied to some T

Let's say (with pseudo typescript syntax):


type Wrapped<T> = ReturnType<typeof wrap<T>> //equivalent to {response:T}

Is it even possible?

1 Answers
Related