I am working on designing an interface that allows for an array of objects and strings to be stored.
For instance:
const array = [
'',
{id: '', labels: ['']}
]
I attempted to achieve this using the following code:
export interface Obj{
id: string;
label: string[];
}
export interface Objs extends Array<Obj> {
}
However, this approach does not support strings, resulting in an error:
const array: Objs = [
'',
{id: '', labels: ['']}
]