RestrictiveReadonlyRecord
Alternative to the built in Record type which does not permit unexpected members, and is readonly.
Signature
export type RestrictiveReadonlyRecord<K extends symbol | string, T> = {
readonly [P in symbol | string]: P extends K ? T : never;
};
Type Parameters
Parameter | Constraint | Description |
---|---|---|
K | symbol | string | |
T |