type Position = { x: number; y: number; }; export type UseSwipeDirection = 'up' | 'down' | 'left' | 'right' | 'none'; export interface UseSwipeOptions { /** * 滑动阈值,默认值为50 */ threshold?: number; /** * 事件监听选项,默认值为false */ listenerOptions?: boolean | { passive?: boolean; capture?: boolean; }; /** * 滑动开始时的回调函数 */ onSwipeStart?: (e: TouchEvent) => void; /** * 滑动过程中的回调函数 */ onSwipe?: (e: TouchEvent) => void; /** * 滑动结束时的回调函数 */ onSwipeEnd?: (e: TouchEvent) => void; /** * 是否禁用 */ disabled?: boolean; } /** * Reactive swipe detection. * * @param target * @param options */ export declare function useSwipe(target: EventTarget | null | undefined, options?: UseSwipeOptions): { offset: () => Position; direction: () => "none" | "left" | "right" | "up" | "down"; }; /** * This is a polyfill for passive event support detection * @see https://github.com/WICG/EventListenerOptions/blob/gh-pages/explainer.md */ export declare function checkPassiveEventSupport(document?: Document): boolean; export {};