It seems quite a simple problem. I am basically trying to create a key value pair object within an interface I have created.
However I have no idea of how to implement this. I consistently get the error Generic type 'Map' requires 2 type argument(s)
My interface object looks like this. I am trying to make the 'type' object to a key, value pair.
export interface CalendarEvent<MetaType = any> {
id?: string | number;
start: Date;
end?: Date;
title: string;
color?: EventColor;
actions?: EventAction[];
allDay?: boolean;
cssClass?: string;
resizable?: {
beforeStart?: boolean;
afterEnd?: boolean;
};
draggable?: boolean;
meta?: MetaType;
amount: number;
type: Map<key: string, value: string>
}
Just supply the generic type - remove the parameter names, i.e:
Map<string, string>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With