UNPKG

5.05 kBTypeScriptView Raw
1import { FlingGesture } from './flingGesture';
2import { ForceTouchGesture } from './forceTouchGesture';
3import { Gesture } from './gesture';
4import { ComposedGesture, ExclusiveGesture, SimultaneousGesture } from './gestureComposition';
5import { LongPressGesture } from './longPressGesture';
6import { PanGesture } from './panGesture';
7import { PinchGesture } from './pinchGesture';
8import { RotationGesture } from './rotationGesture';
9import { TapGesture } from './tapGesture';
10import { NativeGesture } from './nativeGesture';
11import { ManualGesture } from './manualGesture';
12import { HoverGesture } from './hoverGesture';
13/**
14 * `Gesture` is the object that allows you to create and compose gestures.
15 *
16 * ### Remarks
17 * - Consider wrapping your gesture configurations with `useMemo`, as it will reduce the amount of work Gesture Handler has to do under the hood when updating gestures.
18 *
19 * @see https://docs.swmansion.com/react-native-gesture-handler/docs/gestures/gesture
20 */
21export declare const GestureObjects: {
22 /**
23 * A discrete gesture that recognizes one or many taps.
24 * @see https://docs.swmansion.com/react-native-gesture-handler/docs/gestures/tap-gesture
25 */
26 Tap: () => TapGesture;
27 /**
28 * A continuous gesture that can recognize a panning (dragging) gesture and track its movement.
29 * @see https://docs.swmansion.com/react-native-gesture-handler/docs/gestures/pan-gesture
30 */
31 Pan: () => PanGesture;
32 /**
33 * A continuous gesture that recognizes pinch gesture. It allows for tracking the distance between two fingers and use that information to scale or zoom your content.
34 * @see https://docs.swmansion.com/react-native-gesture-handler/docs/gestures/pinch-gesture
35 */
36 Pinch: () => PinchGesture;
37 /**
38 * A continuous gesture that can recognize rotation and track its movement.
39 * @see https://docs.swmansion.com/react-native-gesture-handler/docs/gestures/rotation-gesture
40 */
41 Rotation: () => RotationGesture;
42 /**
43 * A discrete gesture that activates when the movement is sufficiently fast.
44 * @see https://docs.swmansion.com/react-native-gesture-handler/docs/gestures/fling-gesture
45 */
46 Fling: () => FlingGesture;
47 /**
48 * A discrete gesture that activates when the corresponding view is pressed for a sufficiently long time.
49 * @see https://docs.swmansion.com/react-native-gesture-handler/docs/gestures/long-press-gesture
50 */
51 LongPress: () => LongPressGesture;
52 /**
53 * #### iOS only
54 * A continuous gesture that recognizes force of a touch. It allows for tracking pressure of touch on some iOS devices.
55 * @see https://docs.swmansion.com/react-native-gesture-handler/docs/gestures/force-touch-gesture
56 */
57 ForceTouch: () => ForceTouchGesture;
58 /**
59 * A gesture that allows other touch handling components to participate in RNGH's gesture system.
60 * When used, the other component should be the direct child of a `GestureDetector`.
61 * @see https://docs.swmansion.com/react-native-gesture-handler/docs/gestures/native-gesture
62 */
63 Native: () => NativeGesture;
64 /**
65 * A plain gesture that has no specific activation criteria nor event data set.
66 * Its state has to be controlled manually using a state manager.
67 * It will not fail when all the pointers are lifted from the screen.
68 * @see https://docs.swmansion.com/react-native-gesture-handler/docs/gestures/manual-gesture
69 */
70 Manual: () => ManualGesture;
71 /**
72 * A continuous gesture that can recognize hovering above the view it's attached to.
73 * The hover effect may be activated by moving a mouse or a stylus over the view.
74 *
75 * @see https://docs.swmansion.com/react-native-gesture-handler/docs/gestures/hover-gesture
76 */
77 Hover: () => HoverGesture;
78 /**
79 * Builds a composed gesture consisting of gestures provided as parameters.
80 * The first one that becomes active cancels the rest of gestures.
81 * @see https://docs.swmansion.com/react-native-gesture-handler/docs/fundamentals/gesture-composition/#race
82 */
83 Race: (...gestures: Gesture[]) => ComposedGesture;
84 /**
85 * Builds a composed gesture that allows all base gestures to run simultaneously.
86 * @see https://docs.swmansion.com/react-native-gesture-handler/docs/fundamentals/gesture-composition/#simultaneous
87 */
88 Simultaneous(...gestures: Gesture[]): SimultaneousGesture;
89 /**
90 * Builds a composed gesture where only one of the provided gestures can become active.
91 * Priority is decided through the order of gestures: the first one has higher priority
92 * than the second one, second one has higher priority than the third one, and so on.
93 * For example, to make a gesture that recognizes both single and double tap you need
94 * to call Exclusive(doubleTap, singleTap).
95 * @see https://docs.swmansion.com/react-native-gesture-handler/docs/fundamentals/gesture-composition/#exclusive
96 */
97 Exclusive(...gestures: Gesture[]): ExclusiveGesture;
98};