Creates a mutable record type with keys of type K and values of type T. All properties are mutable and can be modified after creation.
K
T
The type of keys, must extend PropertyKey (string | number | symbol).
PropertyKey
The type of values.
A mutable record type.
type Config = MutableRecord<string, string | number>;const settings: Config = { host: 'localhost', port: 3000 };settings['host'] = 'new-host'; // OKsettings['timeout'] = 5000; // OK Copy
type Config = MutableRecord<string, string | number>;const settings: Config = { host: 'localhost', port: 3000 };settings['host'] = 'new-host'; // OKsettings['timeout'] = 5000; // OK
Creates a mutable record type with keys of type
Kand values of typeT. All properties are mutable and can be modified after creation.