///
import React, { Component } from 'react';
export declare type GestureHandler = (s: IGestureStauts) => void;
export declare type Finger = {
x: number;
y: number;
};
export declare type MultiFingerStatus = {
x: number;
y: number;
z: number;
angle: number;
};
export declare type SingeFingerMoveStatus = {
x: number;
y: number;
z: number;
time: number;
velocity: number;
angle: number;
};
export interface IGesture {
enableRotate?: boolean;
enablePinch?: boolean;
direction?: string;
onPinch?: GestureHandler;
onPinchStart?: GestureHandler;
onPinchMove?: GestureHandler;
onPinchEnd?: GestureHandler;
onPinchCancel?: GestureHandler;
onPinchIn?: GestureHandler;
onPinchOut?: GestureHandler;
onRotate?: GestureHandler;
onRotateStart?: GestureHandler;
onRotateMove?: GestureHandler;
onRotateEnd?: GestureHandler;
onRotateCancel?: GestureHandler;
onPan?: GestureHandler;
onPanStart?: GestureHandler;
onPanMove?: GestureHandler;
onPanEnd?: GestureHandler;
onPanCancel?: GestureHandler;
onPanLeft?: GestureHandler;
onPanRight?: GestureHandler;
onPanUp?: GestureHandler;
onPanDown?: GestureHandler;
onTap?: GestureHandler;
onPress?: GestureHandler;
onPressUp?: GestureHandler;
onSwipe?: GestureHandler;
onSwipeLeft?: GestureHandler;
onSwipeRight?: GestureHandler;
onSwipeUp?: GestureHandler;
onSwipeDown?: GestureHandler;
}
export interface IGestureStauts {
startTime: number;
startTouches: Finger[];
startMutliFingerStatus?: MultiFingerStatus[];
time: number;
touches: Finger[];
mutliFingerStatus?: MultiFingerStatus[];
moveStatus?: SingeFingerMoveStatus;
press?: boolean;
pan?: boolean;
swipe?: boolean;
direction?: number;
pinch?: boolean;
scale?: number;
rotate?: boolean;
rotation?: number;
}
export default class Gesture extends Component {
static defaultProps: {
enableRotate: boolean;
enablePinch: boolean;
direction: string;
};
state: {};
protected gesture: IGestureStauts;
protected event: any;
private pressTimer;
private directionSetting;
constructor(props: any);
triggerEvent: (name: any, ...args: any[]) => void;
triggerCombineEvent: (mainEventName: any, eventStatus: any, ...args: any[]) => void;
triggerSubEvent: (mainEventName: any, eventStatus: any, ...args: any[]) => void;
triggerPinchEvent: (mainEventName: any, eventStatus: any, ...args: any[]) => void;
initPressTimer: () => void;
cleanPressTimer: () => void;
setGestureState: (params: any) => void;
getGestureState: () => {
startTime: number;
startTouches: Finger[];
startMutliFingerStatus?: MultiFingerStatus[] | undefined;
time: number;
touches: Finger[];
mutliFingerStatus?: MultiFingerStatus[] | undefined;
moveStatus?: SingeFingerMoveStatus | undefined;
press?: boolean | undefined;
pan?: boolean | undefined;
swipe?: boolean | undefined;
direction?: number | undefined;
pinch?: boolean | undefined;
scale?: number | undefined;
rotate?: boolean | undefined;
rotation?: number | undefined;
};
cleanGestureState: () => void;
getTouches: (e: any) => any;
_handleTouchStart: (e: any) => void;
initGestureStatus: (e: any) => void;
checkIfMultiTouchStart: () => void;
_handleTouchMove: (e: any) => void;
checkIfMultiTouchMove: () => void;
allowGesture: () => boolean;
checkIfSingleTouchMove: () => void;
checkIfMultiTouchEnd: (status: any) => void;
updateGestureStatus: (e: any) => void;
_handleTouchEnd: (e: any) => void;
_handleTouchCancel: (e: any) => void;
doSingleTouchEnd: (status: any) => void;
componentWillUnmount(): void;
getTouchAction: () => "auto" | "pan-x pan-y" | "pan-x" | "pan-y";
render(): React.ReactElement;
}