Is there a way to specify an immutablejs Map keys? In my case, I need to enforce a key of 'id' with a value of type number.
I experimented with different variations, like:
let campaignSelected: Map<{id: string}, number>;
but it didn't work out.
Error:(12, 13) TS2322:Type 'Map<string, number>' is not assignable to type 'Map<{ id: string; }, number>'.
Type 'string' is not assignable to type '{ id: string; }'.
I also attempted the following without success:
type myIdType = {id: number}
export interface IMsDatabase {
uiState: {
campaign: {
timelineSelected: Map<myIdType, number>;
}
}
}
Thank you for your attention,
Sean