I want to create a type that represents an object with a defined number of entries. Both key and the value should be of type number
.
In theory, I would like to have something like this:
type MatchResult = {
[key: number]: number;
[key: number]: number;
}
The above type represents a match result of 2 teams where the key is the team id and the value is the number of scored goals (this is a good example of usage of such type).
The example above gives an error - you can't define multiple index types.