You are allowed to define both a string and numeric index signature.
From the spec:
An object type can contain at most one string index signature and one numeric index signature.
So you can do this:
interface IMap<T> {
[index: string]: T;
[index: number]: T;
}
Is that what you were after?
Also, when you define only a string index signature:
Specifically, in a type with a string index signature of type T, all properties and numeric index signatures must have types that are assignable to T.
And so:
class Foo {
[index: string]: number;
}
let f = new Foo();
f[1] = 1; //OK
f[6] = "hi"; //ERROR: Type 'string' is not assignable to type 'number'
stringornumberas of today