I have such example of data, that I receive:
{
Europe: {
WestEurope: {
Belgium: [French, English, Dutch]
}
}
}
Not sure how I can create an interface for such a dynamic structure, where I have a tree:
Object->Object(of Regions)->Object(of SubRegions)->Object(of Countries)->ArrayOfStrings(of languages)
I tried so:
export interface Localisation {
[key: string]: Localisation;
}
export interface Region {
[key: string]: Region;
}
export interface SubRegion {
[key: string]: SubRegion;
}
export interface Country {
[key: string]: Country;
}
export interface Language {
[index: number]: Array<string>;
}
but they aren't 'chained' -> so 'Localisation' doesn't know that it contains 'Regions' etc. And I want to connect them somehow. Is it possible?