beautiful-react-hooks
Version:
A collection of beautiful (and hopefully useful) React hooks to speed-up your components and hooks development
11 lines (10 loc) • 589 B
TypeScript
/**
* Takes a mouse or a touch events and returns clientX and clientY values
* @param event
* @return {[undefined, undefined]}
*/
export declare const getPointerCoordinates: (event: TouchEvent | MouseEvent) => [number, number];
export declare const getHorizontalDirection: (alpha: number) => "left" | "right";
export declare const getVerticalDirection: (alpha: number) => "up" | "down";
export type Direction = 'right' | 'left' | 'down' | 'up';
export declare const getDirection: (currentPoint: [number, number], startingPoint: [number, number], alpha: [number, number]) => Direction;