export declare type GlobalEventHandlerMap = { [EventType in keyof GlobalEventHandlersEventMap]?: (event: GlobalEventHandlersEventMap[EventType]) => void | Promise; }; /** * Listens to an event on the given `target` and returns a cleanup function to stop listening. * * @param target - The target to listen for the events on. * @param type - The name of the event to listen to. * @param listener - The function to be called when the event is fired. * @param options - Configures the event listener. * @returns Stop listening cleanup function. * @example * ```ts * const disposeListener = listen(window, 'resize', () => {}); * * // Stop listening. * disposeListener(); * ``` */ export declare function listen(target: EventTarget, type: EventType, listener: GlobalEventHandlerMap[EventType], options?: boolean | EventListenerOptions | AddEventListenerOptions): () => void; export declare function isPointerEvent(event: Event | undefined): event is PointerEvent; export declare function isTouchEvent(event: Event | undefined): event is TouchEvent; export declare function isMouseEvent(event: Event | undefined): event is MouseEvent; export declare function waitForEvent(target: EventTarget, type: EventType, options?: (EventListenerOptions | AddEventListenerOptions) & { timeout?: number; }): Promise; /** * A disposal bin used to add cleanup callbacks that can be called when required. */ export declare class DisposalBin { protected _disposal: (() => void)[]; add(...callbacks: (() => void)[]): void; /** * Dispose callbacks. */ empty(): void; } //# sourceMappingURL=events.d.ts.map