We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ca964a4 commit 2fc9b95Copy full SHA for 2fc9b95
index.d.ts
@@ -1,4 +1,6 @@
1
-export function on<K extends keyof GlobalEventHandlersEventMap>(name: K, selector: string, listener: (this: GlobalEventHandlers, ev: GlobalEventHandlersEventMap[K]) => any, options?: EventListenerOptions): void;
2
-export function on(name: string, selector: string, listener: EventListener, options?: EventListenerOptions): void;
3
-export function off(name: string, selector: string, listener: EventListener, options?: EventListenerOptions): void;
4
-export function fire(target: EventTarget, name: string, detail?: any): boolean;
+type DelegatedEventListener = (this: Element, ev: CustomEvent & {currentTarget: Element}) => any
+
+export function on<K extends keyof GlobalEventHandlersEventMap>(name: K, selector: string, listener: (this: GlobalEventHandlers & Element, ev: GlobalEventHandlersEventMap[K] & {currentTarget: Element}) => any, options?: EventListenerOptions): void;
+export function on(name: string, selector: string, listener: DelegatedEventListener, options?: EventListenerOptions): void;
5
+export function off(name: string, selector: string, listener: DelegatedEventListener, options?: EventListenerOptions): void;
6
+export function fire(target: Element, name: string, detail?: any): boolean;
0 commit comments