I have a type defined as follows:
type IColumn = {
name: string;
key: string;
attributes: { [key: string]: string | string[] };
shortable: boolean;
};
The only field of attributes that can be string[]
is called options
So I would like to do something of the type:
type IColumn = {
name: string;
key: string;
attributes: { [key: string]: string ; options: string[] };
shortable: boolean;
};
To avoid having to specify at each use of attributes whether it is string
or string[]
. But this does not work.
Is there a way to make it?