import { Disposable } from '@typed/disposable' ; export function addEventListener < A extends keyof WindowEventHandlersEventMap , B extends Window > ( eventType , node , listener , options ? ) ; export function addEventListener < A extends keyof SVGElementEventMap , B extends SVGElement > ( eventType , node , listener , options ? ) ; export function addEventListener < A extends keyof HTMLElementEventMap , B extends HTMLElement > ( eventType , node , listener , options ? ) ; export function addEventListener < A extends keyof ElementEventMap , B extends Element > ( eventType , node , listener , options ? ) ; export function addEventListener < A extends EventTarget > ( eventType , node , listener , options ? ) ; export function addEventListener < A extends EventTarget > ( eventType , node , listener , options ? ) { node . addEventListener ( eventType , listener as EventListener , options ) ; const dispose = ( ) => node . removeEventListener ( eventType , listener as EventListener , options ) ; return { dispose } ; }