Indexable type for objects in TypeScript
Now let's make an indexable type for the object. To do this, we'll create the IObject interface. We'll specify that the object's key will be a string and its value will be a number:
interface IObject {
[index: string]: number;
}
Let's give our variable a value in the form of an object with string keys and numeric values:
let obj: IObject = {'a': 1, 'b': 2, 'c': 3};
Create an interface that describes an object with keys as numbers and values as strings.