UNPKG

2.05 kBTypeScriptView Raw
1import React from 'react';
2import { GestureType } from '../gesture';
3import { UserSelect, TouchAction } from '../../gestureHandlerCommon';
4import { ComposedGesture } from '../gestureComposition';
5interface GestureDetectorProps {
6 children?: React.ReactNode;
7 /**
8 * A gesture object containing the configuration and callbacks.
9 * Can be any of:
10 * - base gestures (`Tap`, `Pan`, ...)
11 * - `ComposedGesture` (`Race`, `Simultaneous`, `Exclusive`)
12 */
13 gesture: ComposedGesture | GestureType;
14 /**
15 * #### Web only
16 * This parameter allows to specify which `userSelect` property should be applied to underlying view.
17 * Possible values are `"none" | "auto" | "text"`. Default value is set to `"none"`.
18 */
19 userSelect?: UserSelect;
20 /**
21 * #### Web only
22 * Specifies whether context menu should be enabled after clicking on underlying view with right mouse button.
23 * Default value is set to `false`.
24 */
25 enableContextMenu?: boolean;
26 /**
27 * #### Web only
28 * This parameter allows to specify which `touchAction` property should be applied to underlying view.
29 * Supports all CSS touch-action values (e.g. `"none"`, `"pan-y"`). Default value is set to `"none"`.
30 */
31 touchAction?: TouchAction;
32}
33/**
34 * `GestureDetector` is responsible for creating and updating native gesture handlers based on the config of provided gesture.
35 *
36 * ### Props
37 * - `gesture`
38 * - `userSelect` (**Web only**)
39 * - `enableContextMenu` (**Web only**)
40 * - `touchAction` (**Web only**)
41 *
42 * ### Remarks
43 * - Gesture Detector will use first native view in its subtree to recognize gestures, however if this view is used only to group its children it may get automatically collapsed.
44 * - Using the same instance of a gesture across multiple Gesture Detectors is not possible.
45 *
46 * @see https://docs.swmansion.com/react-native-gesture-handler/docs/gestures/gesture-detector
47 */
48export declare const GestureDetector: (props: GestureDetectorProps) => React.JSX.Element;
49export {};