UNPKG

@smui/common

Version:
24 lines (23 loc) 821 B
/** * A way to keep track of things you've "on"ed so you can "off" them too. * * This is needed because Svelte doesn't have an "off" function, it returns * unlisten functions from its "on" function. */ export declare class SvelteEventManager { elementMap: Map<Element | Window | Document, { [k: string]: Map<Function, Function>; }>; /** * Listen to an event on an element. */ on<T extends Event>(element: Element | Window | Document, event: string, handler: (evt: T) => void, options?: AddEventListenerOptions): void; /** * Unlisten to an event on an element. */ off<T extends Event>(element: Element | Window | Document, event: string, handler: (evt: T) => void): void; /** * Unlisten to all events managed by this instance. */ clear(): void; }