Add a new type Tuple<3, T> = [T, T, T] #54740
Labels
Declined
The issue was declined as something which matches the TypeScript vision
Suggestion
An idea for TypeScript
Suggestion
π Search Terms
tupel
β Viability Checklist
My suggestion meets these guidelines:
β Suggestion
Add a Tuple type where we can dynamically create tuples:
π Motivating Example
This type would be in the same area as the
Awaited
type because it helps preventing complex type definitions.Tupel-types currently have to be created manually each time. Especially for longer fix length arrays, this gets complicated really fast:
By using a Tuple type, we could fix this:
Also if we wanted to change the type of this tuple, this is done easily and has to be done in one place:
π» Use Cases
What do I want to use this for?
One example would be an rgb-type which allows numbers and strings. It currently looks like this:
We could make this much simpler like this:
The text was updated successfully, but these errors were encountered: