type ArrMap<T extends any[]> = {[Index in keyof T]: [T[Index], number]};
type Type<T> = new (...args: any[]) => T;
class Test {
constructor(a: number) {}
}
function testOne<T extends Type<any>>(arr: ArrMap<[T]>) {
const res = arr.map(item => item[0]); // Works with T[] as result
}
function testTwo<T extends Type<any>>(arr: ArrMap<ConstructorParameters<T>>) {
arr.map(item => item[0]); // Doesn't even compile
}
function testThree<T extends Type<any>>(arr: ArrMap<[...ConstructorParameters<T>]>) {
const res = arr.map(item => item[0]); // For some reason ConstructorParameters<T>[number][]
}
How can I make testTwo work like testOne?