Can TypeScript allow for the declaration of a ReturnType<...> that doesn't fetch the return value's type but instead retrieves the type of the first argument?
type SingleArgFunction<A, R> = (arg: A) => R
// incorrect - how can the following line be corrected?
type FirstArgType<T extends SingleArgFunction<infer A, any>> = A
const numberToString: SingleArgFunction<number, string> =
(x: number) => String(x)
type R = ReturnType<typeof numberToString> // R => string
type F = FirstArgType<typeof numberToString> // F => number