#Infer parametrized type of a callback argument based on the return value of the callback

1 messages · Page 1 of 1 (latest)

raven arch
mild sableBOT
#

@raven arch Here's a shortened URL of your playground link! You can remove the full link from your message.

hbtz#0

Preview:```ts
type Returner<T> = () => T

function foo<T>(fn: (arg: Returner<T>) => T) {}

foo(x => "hi")
//^?```

raven arch