When I establish a type in the following way:
type O = { [k: string]: any };
I assume that the keys in O
will be limited to the type string
. However, if I create:
type KO = keyof O;
KO
ends up being string|number
. Why is this the case? Even though I specifically narrowed the keys of O
to be strings
by declaring [k:string]
, why does KO
include numbers
as well?