TypeScript interface for object with arbitrary numeric property names? code example
Example: TypeScript interface for object with arbitrary numeric property names?
interface NumberToString {
[n: number]: string;
}
var x: NumberToString;
x = { 1: 42 }; // Error
x[1].charAt(0); // OK
x['foo'] = 'bar'; // Still not an error, though