How can one constrain a typescript generic to be an indexer?
// The following line fails to compile even though Key is number | string type Dictionary<Key extends number | string, Value> = { [index: Key]: Value };
Use in
keyword:
type Dictionary<TKey extends number | string, TValue> = {
[key in TKey]: TValue
};