This is a subtle thing about indexes. When using an interface with an index signature, for example:
[index: number] : string
This means that at any time when an index exists number, it must be set to a value string. It does not limit the instance of the object to only numbers. When there is a number, it should be set to string.
From the specification (3.7.4. Index Signatures Currently):
, , . , T, T.
:
[index: number]: number;
:
dictionary[1] = "apple";
: "Cannot convert 'string' to 'number'."
, ( ), .