ahooks
Version:
react hooks library
5 lines (4 loc) • 316 B
TypeScript
import type { BasicTarget } from '../utils/domTarget';
type DocumentEventKey = keyof DocumentEventMap;
declare const useClickAway: <T extends Event = Event>(onClickAway: (event: T) => void, target: BasicTarget | BasicTarget[], eventName?: DocumentEventKey | DocumentEventKey[]) => void;
export default useClickAway;