UNPKG

tdesign-mobile-vue

Version:
28 lines (27 loc) 1.47 kB
import { FullGestureState, WebKitGestureEvent, UserGestureConfig } from '@use-gesture/vanilla'; export declare type PinchState = Omit<FullGestureState<'pinch'>, 'event'> & { event: PointerEvent | TouchEvent | WheelEvent | WebKitGestureEvent; }; export declare type DragState = Omit<FullGestureState<'drag'>, 'event'> & { event: PointerEvent | TouchEvent | WheelEvent | WebKitGestureEvent; }; declare const Gesture: (target: EventTarget, _handlers: Partial<import("@use-gesture/vanilla").NativeHandlers<import("@use-gesture/vanilla").EventTypes> & import("@use-gesture/vanilla").UserHandlers<import("@use-gesture/vanilla").EventTypes>>, _config?: UserGestureConfig) => import("@use-gesture/vanilla/dist/declarations/src/Recognizer").Recognizer<undefined>; export declare type GestureHandler = { onDrag?: (state: DragState) => void; onDragStart?: (state: DragState) => void; onDragEnd?: (state: DragState) => void; onPinch?: (state: PinchState) => void; onPinchStart?: (state: PinchState) => void; onPinchEnd?: (state: PinchState) => void; }; export declare type UseGestureConfig = { destroyInvisible?: boolean; visible?: boolean; }; declare type UseGrestureReturn = { gesture: ReturnType<typeof Gesture> | null; destroy: () => void; create: (target: Element, handler: GestureHandler, config?: UserGestureConfig) => void; }; export declare function useGesture(config: UseGestureConfig): UseGrestureReturn; export {};