Given an array containing elements of two different entities:
interface A {
type: string
}
interface B {
type: number
}
const a = {} as A
const b = {} as B
const array = [a, b]
The array is of type (A | B)[]
How can we create a utility type that will return a typed array [A, B]
?