I am trying to add a button to the context menu for widgets, here is the code:
miro.onReady(async (): Promise<void> => {
miro.initialize({
extensionPoints: {
getWidgetMenuItems: (widgets) => {
if (widgets[0]['type'] === 'CARD')
return [{
tooltip: 'Estimate',
svgIcon: '<circle cx="12" cy="12" r="9" fill="none" fill-rule="evenodd" stroke="currentColor" stroke-width="2"/>',
onClick: async (widgets) => {
await jiraCard()
}
}]
}
},
});
})
Unfortunately, this gives me the error
TS2322: Type '(widgets: IWidgetd]) => { tooltip: string; svgIcon: string; onClick: (widgets: any) => Promise<void>; };] | undefined' is not assignable to type '(widgets: IWidgetd], editMode: boolean) => Promise<IWidgetMenuItem | IWidgetMenuItemI]>'.
Type '{ tooltip: string; svgIcon: string; onClick: (widgets: any) => Promise<void>; }t] | undefined' is not assignable to type 'Promise<IWidgetMenuItem | IWidgetMenuItemu]>'.
Type 'undefined' is not assignable to type 'Promise<IWidgetMenuItem | IWidgetMenuIteme]>'.
I’m not sure why this error is happening, as I’m following what I saw on this forum. Does anyone have any advice?