Hi!
My environment is the following (I’m using @mobiscroll/angular
):
- Angular 15.2.0
- Mobiscroll 5.22.3
I have an event handler attached to the event onLabelClick
. This event emits an MbscLabelClickEvent
which has the following specification:
export interface MbscLabelClickEvent {
date: Date;
domEvent: any;
label: MbscCalendarLabel;
labels: MbscCalendarLabel[];
event: MbscCalendarEvent;
inst: EventcalendarBase;
}
Mobiscroll exports the MbscLabelClickEvent
but it doesn’t export the MbscCalendarLabel
interface which I need for adding the correct types in my code.
The use case would be similar to something like this:
// This is the event handle that is attached to the onLabelClick event
handleLabelClick(event: MbscLabelClickEvent): void {
callSomeFunctionThatReceivesTheLabels(event.labels ?? []);
}
callSomeFunctionThatReceivesTheLabels(labels: MbscCalendarLabel[]): void {
// Here I show a modal based on the labels clicked
}
I can add the correct type for the argument of the second function because I need Mobiscroll to make public the interface MbscCalendarLabel
(is part of the public API of Mobiscroll as it’s a field in the onLabelClick
event).
Right now as a workaround I have the following in my code which I don’t like a lot:
import { MbscCalendarLabel } from '@mobiscroll/angular/dist/js/core/shared/calendar-view/calendar-view.types';
I would prefer to be able to write the following import:
import { MbscCalendarLabel } from '@mobiscroll/angular':