@brightsoftware/date-np
Version:
Simple & minimal Nepali date picker that just works.
19 lines (18 loc) • 754 B
TypeScript
import type { MouseEvent as RMouseEvent, TouchEvent as RTouchEvent, RefObject } from "react";
type useOutsideClickProps = {
ref: RefObject<HTMLElement | null>;
callback: (e: MouseEvent | TouchEvent | RMouseEvent | RTouchEvent) => void;
active: boolean;
};
/**
* A handy hook to run actions based on the click outside the given reference.
* NOTE: Keep in mind that propagation of the `action` or `callback` must be
* prevented to ensure this runs perfectly.
*
* @param ref {RefObject<HTMLElement | null>} Html ref element.
* @param callback {() => void}
* @param active {boolean} trigger to register the event listener.
*
*/
export declare const useOutsideClick: ({ ref, callback, active, }: useOutsideClickProps) => void;
export {};