Can I create a type like a dictionary in typescript? For example the type of bar { [id: string] : IPerson; }
which is a dictionary, how can I give it a name, let's say Dict and use that name instead of the whole { [id: string] : IPerson; }
?
class Foo {
bar:{ [id: string] : IPerson; }
}
The data I receive from the server look like this
{
"15" : { name: "James", age: 45},
"34" : { name: "Mary", age: 22},
...
}