How MyType
should be defined to ensure that each item of my array is an array composed of item of the same type?
const array1: MyType = [["foo", "bar"], [42, 42], [true, false]]; // OK
const array2: MyType = [["foo", "bar"], [42, 42], [true, "false"]]; // Should throw a TS error
In my example I used string
, number
& boolean
, but it could be anything.