using custom-card-helpers fireEvent() method from my cards editor, im a bit confused on how to type that on the on the main card listener/handler:
connectedCallback() {
super.connectedCallback();
...
document.body.addEventListener(
"tabbed-card",
(ev) => this._handleSelectedTab(ev),
{ signal: this.controller.signal },
);
}
}
private _handleSelectedTab(ev: ValidHassDomEvent) {
if ("selectedTab" in ev.detail) {
setTimeout(() => {
this.selectedEditorTabIndex = ev.detail.selectedTab;
}, 1);
}
}
Property 'detail' does not exist on type 'keyof HASSDomEvents'.
Property 'detail' does not exist on type '"undefined"'.ts(2339)
referencingfireEvent(): https://github.com/custom-cards/custom-card-helpers/blob/351921f43168cc3d1cb7c81a4c67215aa4f64103/src/fire-event.ts#L36