Closed iamneaz closed 1 year ago
You can do something like that:
interface IAcceptEvent {
detail: {
hour: string;
minutes: string;
type: string;
};
}
acceptEvent.addEventListener('accept', (event) => {
const {
detail: { hour, minutes, type },
} = event as unknown as IAcceptEvent;
acceptValue.innerHTML = `${hour}:${minutes} ${type}`;
});
I am new to typescript. I am struggling with this particular code of Accept Event to typescript.
this.acceptEvent.addEventListener( "accept", ({ detail: { hour, minutes, type } }) => this.time =
${hour}:${minutes} ${type});
I am struggling to define the type of "detail";