I have a {string: Function} map a:
const a: A = {
foo: (x: string) => 8,
bar: (y: number, z: boolean) => 6,
}
I then transform it such that every mapped function has a different type of return value:
const b: B = {
foo: (x: string) => (8).toString(),
bar: (y: number, z: boolean) => (6).toString(),
}
In TypeScript, is there any way to describe type B as derived from A, in my dream world, I'd like to be able to do:
type A = {
foo: (string) => number
bar: (number, boolean) => number
}
type B = {
[K in keyof A]: (E in argsof A[K]) => string
}