I'm using typescript and I want to have a type that has a property that is an array. but I want to make the array fixed length, is that possible?
what I mean is :
//example code , not my actual case but similar
export type Car = {
  doors:Door[];//here I want it to be exactly 4 doors
  /// rest of code
}
I tried doing this :
export type Pattern = {
  doors: Array<Door>[4];
  ////
};
but that made doors (property) doors: Door instead of an array of 4 Door objects.
any ideas?
 
    