I have a configuration array in my component like this.
...
config: ButtonConfig[];
...
this.config.push(new ButtonConfig(...));
...
Today, I r
The most simple answer is this:
export type ButtonConfigs = {
[key: string]: ButtonConfig;
}
This works very well, if you want a high level of dynamics.
If you want to lock it down a little, you could define an enum that contains the possible keys you want to allow:
export enum ButtonConfigKeys {
'submitConfig',
'someOtherKey',
'...'
}
export type ButtonConfigs = {
[key: ButtonConfigKeys]: ButtonConfig;
}