I am expecting the following example JSON response from API, and I am trying to make an interface for it.
{
types: [
{
id: 1,
contents: [
{
id: 1001,
perishable: 0
},
{
id: 1002,
perishable: 0
}
]
}
]
}
Here is how I am trying to define the interface, but I am not sure if I am doing this right. Basically, the response I get back is "types" which is an array of objects, and each object inside it has an array called "contents". Also, how to say something is an array of objects?
export interface Types {
id: string;
contents: Array<any>;
}
Is that right?