UNPKG

@bytedance/mona-client-web

Version:

web for mona

29 lines (28 loc) 998 B
import { SwiperChangeEvent } from '@bytedance/mona'; interface UseSlideParams { current: number; total: number; vertical: boolean; duration: number; circular: boolean; onChange?: (event: SwiperChangeEvent) => void; } export declare function useSlide({ current: initCurrent, total, vertical, duration, circular, onChange, }: UseSlideParams): { next: (byAuto?: boolean, e?: React.TouchEvent) => void; prev: (byAuto?: boolean, e?: React.TouchEvent) => void; wrapperRef: import("react").MutableRefObject<HTMLDivElement | null>; activeIndex: number; }; type HandleFunc = ((e: React.TouchEvent) => void) | null; interface UseTouchParams { left: HandleFunc; right: HandleFunc; top: HandleFunc; bottom: HandleFunc; duration: number; } export declare function useTouch({ left, right, top, bottom, duration }: UseTouchParams): { handleTouchStart: (e: React.TouchEvent) => void; handleTouchMove: (e: React.TouchEvent) => void; }; export {};