I have the interface:
export type TCategoryAnalyzes = {
categoryId: string,
analyzes: IAnalyzesStorageData[],
region: string,
};
The goal is to make it something like:
export type TCategoryAnalyzes = {
region: { // string
categoryId: string,
analyzes: IAnalyzesStorageData[],
}
};
Where the region
key must be of a string
type
export type TCategoryAnalyzes = {
[region: string]: {
categoryId: string;
analyzes: IAnalyzesStorageData[];
};
};
this his how you can achieve it.