If you want a general type for 2D arrays you can do this:
// Generic 2D array type
type Arr2DGeneric<T> = T[][];
// The trick is to read this type right to left: An array ([]) of arrays ([]) of type T
// example one
const g1: Arr2DGeneric<number|string> = [[0]]
// example two
const g2: Arr2DGeneric<number|string> = [
[0, 'I', 0, 0],
[0, 'I', 0, 0],
[0, 'I', 0, 0],
[0, 'I', 0, 0],
]
// example three
const g3: Arr2DGeneric<number|string> = [
[0, 'J', 0],
[0, 'J', 0],
['J', 'J', 0],
]
Or as @Nalin Ranjan pointed out you can do this to represent the specific type in your example:
// Specific to number | string
type NumStrArr2D = (number|string)[][];
// example one
const ns1:NumStrArr2D = [[0]]
// example two
const ns2:NumStrArr2D = [
[0, 'I', 0, 0],
[0, 'I', 0, 0],
[0, 'I', 0, 0],
[0, 'I', 0, 0],
]
// example three
const ns3:NumStrArr2D = [
[0, 'J', 0],
[0, 'J', 0],
['J', 'J', 0],
]
type TwoDimensional = (string | number)[][];?