An index signature describes the type of values for keys that aren't known ahead of time, useful for dictionaries keyed by dynamic strings such as addresses or symbols.
ts
interface Balances {
[address: string]: number;
}
const balances: Balances = {};
balances["0xabc"] = 100;
balances["0xdef"] = 50;
interface MixedRecord {
owner: string; // known key
[key: string]: string; // all other keys must also be string
}Every declared, specific property must be compatible with the index signature's value type — that's why in `MixedRecord`, `owner` had to be typed `string` too, matching `[key: string]: string`. With `noUncheckedIndexedAccess` enabled, indexed lookups return `T | undefined` instead of `T`, correctly reflecting that the key might not exist.