import * as React from "react"; declare type ElementEventListener = (this: HTMLElement, ev: HTMLElementEventMap[K]) => void; declare type DocumentEventListener = (this: Document, ev: DocumentEventMap[K]) => void; declare type WindowEventListener = (this: Window, ev: WindowEventMap[K]) => void; declare type Options = boolean | AddEventListenerOptions; declare type UseEventListener = { (config: { target: React.RefObject | T | null; eventType: K; handler: ElementEventListener; options?: Options; }, shouldAttach?: boolean): void; (config: { target: T | null; eventType: K; handler: DocumentEventListener; options?: Options; }, shouldAttach?: boolean): void; (config: { target: T | null; eventType: K; handler: WindowEventListener; options?: Options; }, shouldAttach?: boolean): void; }; /** * Cherry-picked from https://github.com/mimshins/utilityjs/tree/main/src/hook/useEventListener */ declare const useEventListener: UseEventListener; export default useEventListener;