UNPKG

@coreui/react-pro

Version:

UI Components Library for React.js

27 lines (26 loc) 779 B
export interface SwipeCallbacks { onLeft?: () => void; onRight?: () => void; onEnd?: () => void; } /** * Detects horizontal swipe gestures on an element, using Pointer events when * available and falling back to Touch events otherwise. A modified port of the * vanilla `@coreui/coreui` swipe helper. */ declare class Swipe { private readonly element; private readonly callbacks; private deltaX; private readonly supportPointerEvents; constructor(element: HTMLElement, callbacks?: SwipeCallbacks); static isSupported(): boolean; dispose(): void; private readonly start; private readonly move; private readonly end; private handleSwipe; private eventIsPointerPenTouch; private initEvents; } export default Swipe;