UNPKG

react-cool-onclickoutside

Version:

React hook to listen for clicks outside of the component(s).

25 lines (19 loc) 575 B
declare module "react-cool-onclickoutside" { import { RefObject } from "react"; export interface Callback<T extends Event = Event> { (event: T): void; } export interface Options { refs?: RefObject<HTMLElement>[]; disabled?: boolean; eventTypes?: string[]; excludeScrollbar?: boolean; ignoreClass?: string | string[]; detectIFrame?: boolean; } export interface Return { (element: HTMLElement | null): void; } const useOnclickOutside: (callback: Callback, options?: Options) => Return; export default useOnclickOutside; }