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