type Dict = { [key: string]: number };
type K = keyof Dict;
string | numberThe answer is string | number. With a string index signature, keyof includes number too. JavaScript converts numeric keys to strings, so dict[0] is also allowed.string is the tempting wrong answer. Note that a number index signature alone would give just number.
Read more