beautiful-react-hooks
Version:
A collection of beautiful (and hopefully useful) React hooks to speed-up your components and hooks development
14 lines (13 loc) • 699 B
TypeScript
import { RefObject } from 'react';
/**
* Returns an array where the first item is the touch state from the `useTouchState` hook and the second item
* is the object of callback setters from the `useTouchEvents` hook.
* It is intended as a shortcut to those hooks.
*/
declare const useTouch: <TElement extends HTMLElement>(targetRef?: RefObject<TElement>) => (TouchList | Readonly<{
onTouchStart: import("./shared/types").CallbackSetter<TouchEvent>;
onTouchEnd: import("./shared/types").CallbackSetter<TouchEvent>;
onTouchCancel: import("./shared/types").CallbackSetter<TouchEvent>;
onTouchMove: import("./shared/types").CallbackSetter<TouchEvent>;
}>)[];
export default useTouch;