UNPKG

495 BTypeScriptView Raw
1import type { BasicTarget } from '../utils/domTarget';
2type EventType = MouseEvent | TouchEvent;
3export interface Options {
4 delay?: number;
5 moveThreshold?: {
6 x?: number;
7 y?: number;
8 };
9 onClick?: (event: EventType) => void;
10 onLongPressEnd?: (event: EventType) => void;
11}
12declare function useLongPress(onLongPress: (event: EventType) => void, target: BasicTarget, { delay, moveThreshold, onClick, onLongPressEnd }?: Options): void;
13export default useLongPress;