vanilla-swipe
Version:
Tiny vanilla JS library to detect swipe direction.
26 lines (25 loc) • 865 B
TypeScript
import { State, ConstructorProps } from './types';
export * from './types';
export default class VanillaSwipe {
state: State;
props: ConstructorProps;
static isTouchEventsSupported(): boolean;
constructor(props: ConstructorProps);
init(): void;
update(props: ConstructorProps): void;
destroy(): void;
setupTouchListeners(): void;
cleanupTouchListeners(): void;
setupMouseListeners(): void;
cleanupMouseListeners(): void;
getEventData(e: TouchEvent | MouseEvent, options?: {
directionDelta: number;
}): import("./types").EventData;
handleSwipeStart(e: any): void;
handleSwipeMove(e: any): void;
handleSwipeEnd(e: any): void;
handleMouseDown(e: MouseEvent): void;
handleMouseMove(e: MouseEvent): void;
handleMouseUp(e: MouseEvent): void;
handleMouseLeave(e: MouseEvent): void;
}