my data has this structure:
groups = {
someGroupName: {
total: 30,
count: 3,
average: 10
},
someOtherGroupName: {
total: 60,
count: 3,
average: 20
}
}
I can write an interface for the nested part:
interface Stats {
total: number,
count: number,
average: number
}
but how can I set a type for groups as a whole? I do not know what groups are coming in. I just know that it will be a groupname as the key and the stats object as the value.