Similar to this example
type Arr = [true, false, "string"]
type t = Arr[0] // true
Id like to assign the types of a sprad operators parameters.
// Not correct syntax; Just thought as an example
function func(...param: [...Arr]) {}
So that the function could be called like this
func(true, false, "string")
Of course for this simple example you could just explicitly tell the function its parameters. Though I need this in order to be able to wrap those types each into an object as generic, without knowing them.
class Data<Type> {
}
class Cls<Types extends any[]> {
constructor(...data: Data<Types[{{{at index of spread operator}}}]>)
}
If this is not possible, a solution based on infering the Types out of the generics would also be appreciated.