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