I am creating a shogi game board using Typescript. A shogi board has 9 ranks and files.
I\'d like to assert a 9x9 multidimensional array as a type to ensure both the
type PushFront = (
((front : FrontT, ...rest : TailT) => any) extends ((...tuple : infer TupleT) => any) ?
TupleT :
never
)
type Tuple = {
0 : OutputT,
1 : Tuple>
}[
OutputT["length"] extends LengthT ?
0 :
1
]
//type t3 = [string, string, string]
type t3 = Tuple
//type length = 0 | 3 | 1 | 2
type length = Partial>['length']
Add a generic way to specify length of a tuple type #issuecomment-513116547