I'm trying to achieve something like clone of one array type with specified value types as array with functions which return specified values.
Say we have array tuple like:
[string, number]
And what I want is to get generated type from it like:
[() => string, () => number]
What I've tried was to make type alias with keyof usage:
type tupleTransform<T extends Array<any>> = { [U in keyof T ]: (() => T[U]) };
And it almost worked except that it also checks for methods of Array so if I'll make:
const tupleTransformer: tupleTransform<[string, number]> = [() => 'a', () => 5]
It will fire me error that eg some method is not returning proper type