If you're looking for a generic type to use with 2D arrays, you can implement it like this:
// Defining a generic 2D array type
type Arr2DGeneric<T> = T[][];
// The key is to interpret this type from 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],
]
Alternatively, as suggested by @Nalin Ranjan, you can define the specific type for your example like this:
// Specific type for 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],
]