forked from glepur/react-native-swipe-gestures
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.d.ts
46 lines (39 loc) · 1.52 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
declare module "react-native-swipe-gestures" {
import { Component } from "react";
import { PanResponderGestureState, ViewProps } from "react-native";
export interface GestureRecognizerProps extends ViewProps {
config?: GestureRecognizerConfig;
onSwipe?(gestureName: string, gestureState: PanResponderGestureState): void;
onSwipeUp?(gestureState: PanResponderGestureState): void;
onSwipeDown?(gestureState: PanResponderGestureState): void;
onSwipeLeft?(gestureState: PanResponderGestureState): void;
onSwipeRight?(gestureState: PanResponderGestureState): void;
}
interface GestureRecognizerConfig {
/**
* Velocity that has to be breached in order for swipe to be triggered (vx and vy properties of gestureState)
* @default 0.3
*/
velocityThreshold?: number;
/**
* Absolute offset that shouldn't be breached for swipe to be triggered (dy for horizontal swipe, dx for vertical swipe)
* @default 80
*/
directionalOffsetThreshold?: number;
/**
* Absolute distance that should be breached for the gesture to not be considered a click (dx or dy properties of gestureState)
* @default 5
*/
gestureIsClickThreshold?: number;
/**
* Disable swipe detection that will cause iOS haywire
* @default true
*/
detectSwipeUp?: boolean;
detectSwipeDown?: boolean;
detectSwipeLeft?: boolean;
detectSwipeRight?: boolean;
}
class GestureRecognizer extends Component<GestureRecognizerProps> {}
export default GestureRecognizer;
}