I have an object that can be
var myObj = {
"val1": { id: 1 }
"val2": { id: 3}
}
So, I created type as:
type MyType = { id: number }
And then created another type for myObj as:
type CustomType = {
[key: string] : MyType
}
var myObj: CustomType = {
"val1": { id: 1 }
"val2": { id: 3}
}
But this does not work and gives error.