Register event types for better type inference
This allows typescript to know which kind of event object is passed to listeners for those event names.
This commit is contained in:
Родитель
ff00f5beb3
Коммит
75d656a84b
|
@ -27,6 +27,14 @@ declare global {
|
|||
['tab-container']: JSXBase['span'] & Partial<Omit<TabContainerElement, keyof HTMLElement>>
|
||||
}
|
||||
}
|
||||
interface GlobalEventHandlersEventMap {
|
||||
'tab-container-change': TabContainerChangeEvent;
|
||||
'tab-container-changed': TabContainerChangeEvent;
|
||||
}
|
||||
interface ElementEventMap {
|
||||
'tab-container-change': TabContainerChangeEvent;
|
||||
'tab-container-changed': TabContainerChangeEvent;
|
||||
}
|
||||
}
|
||||
|
||||
export default TabContainerElement
|
||||
|
|
Загрузка…
Ссылка в новой задаче