import { RefObject } from 'react'; declare const MOUSEDOWN = "mousedown"; declare const TOUCHSTART = "touchstart"; declare const _CLICK = "click"; declare const _CONTEXTMENU = "contextmenu"; type HandledEvents = [ typeof MOUSEDOWN, typeof TOUCHSTART, typeof _CLICK, typeof _CONTEXTMENU ]; export type HandledEventsType = HandledEvents[number]; type PossibleEvent = { [Type in HandledEventsType]: HTMLElementEventMap[Type]; }[HandledEventsType]; type Handler = (event: PossibleEvent) => void; /** * Hook for listening for outside clicks. * * @param ref main component to out of which outside clicks will be detected * @param handler function called on outside click * @param customEventsTypes list of events to handle that are happening outside (optional, pass something else than `undefined` to overwrite default `['mousedown', 'touchstart']`) * @param ignoreSelectors list of selectors/classes which, in case it is found that any of parent elements of triggering element has this class, event `handler` won't be called */ export declare const useOnClickOutside: (ref: RefObject, handler: Handler | null, customEventsTypes?: HandledEventsType[], ignoreSelectors?: string[]) => void; export {};