react-native-gesture-handler 2.13.4 → 2.14.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/android/build.gradle +3 -2
- package/android/gradle.properties +2 -2
- package/android/src/main/java/com/swmansion/gesturehandler/core/GestureHandlerOrchestrator.kt +36 -72
- package/android/src/main/java/com/swmansion/gesturehandler/react/Extensions.kt +1 -1
- package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerEvent.kt +12 -14
- package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerInteractionManager.kt +8 -1
- package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerModule.kt +34 -88
- package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerRootView.kt +1 -1
- package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerStateChangeEvent.kt +18 -12
- package/android/src/main/java/com/swmansion/gesturehandler/react/eventbuilders/FlingGestureHandlerEventDataBuilder.kt +30 -0
- package/android/src/main/java/com/swmansion/gesturehandler/react/eventbuilders/GestureHandlerEventDataBuilder.kt +22 -0
- package/android/src/main/java/com/swmansion/gesturehandler/react/eventbuilders/HoverGestureHandlerEventDataBuilder.kt +30 -0
- package/android/src/main/java/com/swmansion/gesturehandler/react/eventbuilders/LongPressGestureHandlerEventDataBuilder.kt +33 -0
- package/android/src/main/java/com/swmansion/gesturehandler/react/eventbuilders/ManualGestureHandlerEventDataBuilder.kt +5 -0
- package/android/src/main/java/com/swmansion/gesturehandler/react/eventbuilders/NativeGestureHandlerEventDataBuilder.kt +18 -0
- package/android/src/main/java/com/swmansion/gesturehandler/react/eventbuilders/PanGestureHandlerEventDataBuilder.kt +42 -0
- package/android/src/main/java/com/swmansion/gesturehandler/react/eventbuilders/PinchGestureHandlerEventDataBuilder.kt +30 -0
- package/android/src/main/java/com/swmansion/gesturehandler/react/eventbuilders/RotationGestureHandlerEventDataBuilder.kt +30 -0
- package/android/src/main/java/com/swmansion/gesturehandler/react/eventbuilders/TapGestureHandlerEventDataBuilder.kt +30 -0
- package/android/src/main/jni/CMakeLists.txt +14 -2
- package/ios/Handlers/RNHoverHandler.m +15 -14
- package/ios/RNGestureHandler.m +11 -0
- package/ios/RNGestureHandlerButtonComponentView.mm +2 -0
- package/lib/commonjs/components/gestureHandlerRootHOC.js.map +1 -1
- package/lib/commonjs/components/touchables/TouchableNativeFeedback.android.js +1 -1
- package/lib/commonjs/components/touchables/TouchableNativeFeedback.android.js.map +1 -1
- package/lib/commonjs/components/touchables/TouchableWithoutFeedback.js.map +1 -1
- package/lib/commonjs/getReactNativeVersion.js +22 -0
- package/lib/commonjs/getReactNativeVersion.js.map +1 -0
- package/lib/commonjs/getReactNativeVersion.web.js +11 -0
- package/lib/commonjs/getReactNativeVersion.web.js.map +1 -0
- package/lib/commonjs/handlers/gestureHandlerCommon.js +1 -1
- package/lib/commonjs/handlers/gestureHandlerCommon.js.map +1 -1
- package/lib/commonjs/handlers/gestures/GestureDetector.js +13 -3
- package/lib/commonjs/handlers/gestures/GestureDetector.js.map +1 -1
- package/lib/commonjs/handlers/gestures/gesture.js +8 -0
- package/lib/commonjs/handlers/gestures/gesture.js.map +1 -1
- package/lib/commonjs/handlers/gestures/gestureStateManager.js +39 -37
- package/lib/commonjs/handlers/gestures/gestureStateManager.js.map +1 -1
- package/lib/commonjs/utils.js +0 -13
- package/lib/commonjs/utils.js.map +1 -1
- package/lib/commonjs/web/handlers/FlingGestureHandler.js +4 -6
- package/lib/commonjs/web/handlers/FlingGestureHandler.js.map +1 -1
- package/lib/commonjs/web/handlers/GestureHandler.js.map +1 -1
- package/lib/commonjs/web/interfaces.js.map +1 -1
- package/lib/commonjs/web/tools/GestureHandlerOrchestrator.js +4 -15
- package/lib/commonjs/web/tools/GestureHandlerOrchestrator.js.map +1 -1
- package/lib/commonjs/web/tools/InteractionManager.js +27 -29
- package/lib/commonjs/web/tools/InteractionManager.js.map +1 -1
- package/lib/commonjs/web/tools/PointerEventManager.js +13 -3
- package/lib/commonjs/web/tools/PointerEventManager.js.map +1 -1
- package/lib/module/components/gestureHandlerRootHOC.js.map +1 -1
- package/lib/module/components/touchables/TouchableNativeFeedback.android.js +1 -1
- package/lib/module/components/touchables/TouchableNativeFeedback.android.js.map +1 -1
- package/lib/module/components/touchables/TouchableWithoutFeedback.js.map +1 -1
- package/lib/module/getReactNativeVersion.js +10 -0
- package/lib/module/getReactNativeVersion.js.map +1 -0
- package/lib/module/getReactNativeVersion.web.js +4 -0
- package/lib/module/getReactNativeVersion.web.js.map +1 -0
- package/lib/module/handlers/gestureHandlerCommon.js +1 -1
- package/lib/module/handlers/gestureHandlerCommon.js.map +1 -1
- package/lib/module/handlers/gestures/GestureDetector.js +12 -3
- package/lib/module/handlers/gestures/GestureDetector.js.map +1 -1
- package/lib/module/handlers/gestures/gesture.js +8 -0
- package/lib/module/handlers/gestures/gesture.js.map +1 -1
- package/lib/module/handlers/gestures/gestureStateManager.js +44 -42
- package/lib/module/handlers/gestures/gestureStateManager.js.map +1 -1
- package/lib/module/utils.js +0 -6
- package/lib/module/utils.js.map +1 -1
- package/lib/module/web/handlers/FlingGestureHandler.js +4 -6
- package/lib/module/web/handlers/FlingGestureHandler.js.map +1 -1
- package/lib/module/web/handlers/GestureHandler.js.map +1 -1
- package/lib/module/web/interfaces.js.map +1 -1
- package/lib/module/web/tools/GestureHandlerOrchestrator.js +4 -15
- package/lib/module/web/tools/GestureHandlerOrchestrator.js.map +1 -1
- package/lib/module/web/tools/InteractionManager.js +27 -29
- package/lib/module/web/tools/InteractionManager.js.map +1 -1
- package/lib/module/web/tools/PointerEventManager.js +12 -3
- package/lib/module/web/tools/PointerEventManager.js.map +1 -1
- package/lib/typescript/ActionType.d.ts +1 -1
- package/lib/typescript/Directions.d.ts +1 -1
- package/lib/typescript/PlatformConstants.d.ts +1 -1
- package/lib/typescript/RNGestureHandlerModule.d.ts +1 -1
- package/lib/typescript/State.d.ts +1 -1
- package/lib/typescript/TouchEventType.d.ts +1 -1
- package/lib/typescript/components/DrawerLayout.d.ts +9 -9
- package/lib/typescript/components/GestureButtons.d.ts +3 -3
- package/lib/typescript/components/GestureComponents.d.ts +6 -6
- package/lib/typescript/components/GestureComponents.web.d.ts +1 -1
- package/lib/typescript/components/GestureHandlerRootView.android.d.ts +2 -1
- package/lib/typescript/components/GestureHandlerRootView.d.ts +2 -1
- package/lib/typescript/components/GestureHandlerRootView.web.d.ts +2 -1
- package/lib/typescript/components/Swipeable.d.ts +4 -4
- package/lib/typescript/components/gestureHandlerRootHOC.d.ts +1 -1
- package/lib/typescript/components/touchables/GenericTouchable.d.ts +4 -3
- package/lib/typescript/components/touchables/TouchableHighlight.d.ts +4 -3
- package/lib/typescript/components/touchables/TouchableNativeFeedback.android.d.ts +7 -6
- package/lib/typescript/components/touchables/TouchableOpacity.d.ts +3 -2
- package/lib/typescript/components/touchables/TouchableWithoutFeedback.d.ts +1 -1
- package/lib/typescript/getReactNativeVersion.d.ts +4 -0
- package/lib/typescript/getReactNativeVersion.web.d.ts +1 -0
- package/lib/typescript/handlers/FlingGestureHandler.d.ts +2 -2
- package/lib/typescript/handlers/ForceTouchGestureHandler.d.ts +2 -2
- package/lib/typescript/handlers/LongPressGestureHandler.d.ts +2 -2
- package/lib/typescript/handlers/NativeViewGestureHandler.d.ts +3 -3
- package/lib/typescript/handlers/PanGestureHandler.d.ts +2 -2
- package/lib/typescript/handlers/PinchGestureHandler.d.ts +2 -2
- package/lib/typescript/handlers/RotationGestureHandler.d.ts +2 -2
- package/lib/typescript/handlers/TapGestureHandler.d.ts +2 -2
- package/lib/typescript/handlers/createHandler.d.ts +1 -1
- package/lib/typescript/handlers/gestureHandlerCommon.d.ts +11 -10
- package/lib/typescript/handlers/gestureHandlerTypesCompat.d.ts +32 -32
- package/lib/typescript/handlers/gestures/GestureDetector.d.ts +2 -2
- package/lib/typescript/handlers/gestures/flingGesture.d.ts +1 -1
- package/lib/typescript/handlers/gestures/forceTouchGesture.d.ts +2 -2
- package/lib/typescript/handlers/gestures/gesture.d.ts +7 -5
- package/lib/typescript/handlers/gestures/gestureComposition.d.ts +4 -4
- package/lib/typescript/handlers/gestures/gestureStateManager.d.ts +3 -1
- package/lib/typescript/handlers/gestures/hoverGesture.d.ts +3 -3
- package/lib/typescript/handlers/gestures/longPressGesture.d.ts +1 -1
- package/lib/typescript/handlers/gestures/manualGesture.d.ts +1 -1
- package/lib/typescript/handlers/gestures/nativeGesture.d.ts +1 -1
- package/lib/typescript/handlers/gestures/panGesture.d.ts +2 -2
- package/lib/typescript/handlers/gestures/pinchGesture.d.ts +2 -2
- package/lib/typescript/handlers/gestures/rotationGesture.d.ts +2 -2
- package/lib/typescript/handlers/gestures/tapGesture.d.ts +1 -1
- package/lib/typescript/jestUtils/jestUtils.d.ts +6 -6
- package/lib/typescript/typeUtils.d.ts +1 -1
- package/lib/typescript/utils.d.ts +1 -5
- package/lib/typescript/web/interfaces.d.ts +4 -3
- package/lib/typescript/web/tools/GestureHandlerOrchestrator.d.ts +0 -1
- package/lib/typescript/web/tools/InteractionManager.d.ts +2 -1
- package/lib/typescript/web_hammer/GestureHandler.d.ts +2 -2
- package/package.json +7 -7
- package/src/components/gestureHandlerRootHOC.tsx +1 -3
- package/src/components/touchables/TouchableNativeFeedback.android.tsx +2 -1
- package/src/components/touchables/TouchableWithoutFeedback.tsx +3 -3
- package/src/getReactNativeVersion.ts +11 -0
- package/src/getReactNativeVersion.web.ts +3 -0
- package/src/handlers/gestureHandlerCommon.ts +6 -1
- package/src/handlers/gestures/GestureDetector.tsx +9 -6
- package/src/handlers/gestures/gesture.ts +9 -1
- package/src/handlers/gestures/gestureStateManager.ts +42 -40
- package/src/utils.ts +0 -8
- package/src/web/handlers/FlingGestureHandler.ts +5 -5
- package/src/web/handlers/GestureHandler.ts +1 -1
- package/src/web/interfaces.ts +1 -0
- package/src/web/tools/GestureHandlerOrchestrator.ts +4 -13
- package/src/web/tools/InteractionManager.ts +37 -30
- package/src/web/tools/PointerEventManager.ts +14 -3
- package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerEventDataExtractor.kt +0 -8
- /package/android/{src/fabric → fabric/src/main}/java/com/swmansion/gesturehandler/RNGestureHandlerComponentsRegistry.java +0 -0
- /package/android/{src/fabric → fabric/src/main}/java/com/swmansion/gesturehandler/ReactContextExtensions.kt +0 -0
- /package/android/{src/paper → paper/src/main}/java/com/facebook/react/viewmanagers/RNGestureHandlerButtonManagerDelegate.java +0 -0
- /package/android/{src/paper → paper/src/main}/java/com/facebook/react/viewmanagers/RNGestureHandlerButtonManagerInterface.java +0 -0
- /package/android/{src/paper → paper/src/main}/java/com/facebook/react/viewmanagers/RNGestureHandlerRootViewManagerDelegate.java +0 -0
- /package/android/{src/paper → paper/src/main}/java/com/facebook/react/viewmanagers/RNGestureHandlerRootViewManagerInterface.java +0 -0
- /package/android/{src/paper → paper/src/main}/java/com/swmansion/gesturehandler/ReactContextExtensions.kt +0 -0
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { StyleProp, ViewStyle } from 'react-native';
|
|
3
|
-
export default function gestureHandlerRootHOC<P extends
|
|
3
|
+
export default function gestureHandlerRootHOC<P extends object>(Component: React.ComponentType<P>, containerStyles?: StyleProp<ViewStyle>): React.ComponentType<P>;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
1
2
|
import { Component } from 'react';
|
|
2
3
|
import { StyleProp, ViewStyle, TouchableWithoutFeedbackProps, Insets } from 'react-native';
|
|
3
4
|
import { GestureEvent, HandlerStateChangeEvent } from '../../handlers/gestureHandlerCommon';
|
|
@@ -15,7 +16,7 @@ export declare const TOUCHABLE_STATE: {
|
|
|
15
16
|
readonly BEGAN: 1;
|
|
16
17
|
readonly MOVED_OUTSIDE: 2;
|
|
17
18
|
};
|
|
18
|
-
|
|
19
|
+
type TouchableState = typeof TOUCHABLE_STATE[keyof typeof TOUCHABLE_STATE];
|
|
19
20
|
export interface GenericTouchableProps extends Omit<TouchableWithoutFeedbackProps, 'hitSlop'> {
|
|
20
21
|
onPress?: () => void;
|
|
21
22
|
onPressIn?: () => void;
|
|
@@ -31,7 +32,7 @@ interface InternalProps {
|
|
|
31
32
|
extraButtonProps: TouchableNativeFeedbackExtraProps;
|
|
32
33
|
onStateChange?: (oldState: TouchableState, newState: TouchableState) => void;
|
|
33
34
|
}
|
|
34
|
-
|
|
35
|
+
type Timeout = ReturnType<typeof setTimeout> | null | undefined;
|
|
35
36
|
/**
|
|
36
37
|
* GenericTouchable is not intented to be used as it is.
|
|
37
38
|
* Should be treated as a source for the rest of touchables
|
|
@@ -62,6 +63,6 @@ export default class GenericTouchable extends Component<GenericTouchableProps &
|
|
|
62
63
|
componentWillUnmount(): void;
|
|
63
64
|
onMoveIn(): void;
|
|
64
65
|
onMoveOut(): void;
|
|
65
|
-
render(): JSX.Element;
|
|
66
|
+
render(): React.JSX.Element;
|
|
66
67
|
}
|
|
67
68
|
export {};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
1
2
|
import { Component } from 'react';
|
|
2
3
|
import { GenericTouchableProps } from './GenericTouchable';
|
|
3
4
|
import { TouchableHighlightProps as RNTouchableHighlightProps, ColorValue } from 'react-native';
|
|
@@ -9,7 +10,7 @@ interface State {
|
|
|
9
10
|
backgroundColor?: ColorValue;
|
|
10
11
|
};
|
|
11
12
|
}
|
|
12
|
-
export
|
|
13
|
+
export type TouchableHighlightProps = RNTouchableHighlightProps & GenericTouchableProps;
|
|
13
14
|
/**
|
|
14
15
|
* TouchableHighlight follows RN's implementation
|
|
15
16
|
*/
|
|
@@ -28,8 +29,8 @@ export default class TouchableHighlight extends Component<TouchableHighlightProp
|
|
|
28
29
|
showUnderlay: () => void;
|
|
29
30
|
hasPressHandler: () => (((event: import("react-native").GestureResponderEvent) => void) & (() => void)) | undefined;
|
|
30
31
|
hideUnderlay: () => void;
|
|
31
|
-
renderChildren(): JSX.Element;
|
|
32
|
+
renderChildren(): React.JSX.Element;
|
|
32
33
|
onStateChange: (_from: number, to: number) => void;
|
|
33
|
-
render(): JSX.Element;
|
|
34
|
+
render(): React.JSX.Element;
|
|
34
35
|
}
|
|
35
36
|
export {};
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { TouchableNativeFeedbackProps as RNTouchableNativeFeedbackProps, ColorValue } from 'react-native';
|
|
2
|
+
import * as React from 'react';
|
|
2
3
|
import { Component } from 'react';
|
|
3
4
|
import { GenericTouchableProps } from './GenericTouchable';
|
|
4
|
-
export
|
|
5
|
+
export type TouchableNativeFeedbackExtraProps = {
|
|
5
6
|
borderless?: boolean;
|
|
6
7
|
rippleColor?: number | null;
|
|
7
8
|
rippleRadius?: number | null;
|
|
8
9
|
foreground?: boolean;
|
|
9
10
|
};
|
|
10
|
-
export
|
|
11
|
+
export type TouchableNativeFeedbackProps = RNTouchableNativeFeedbackProps & GenericTouchableProps;
|
|
11
12
|
/**
|
|
12
13
|
* TouchableNativeFeedback behaves slightly different than RN's TouchableNativeFeedback.
|
|
13
14
|
* There's small difference with handling long press ripple since RN's implementation calls
|
|
@@ -22,17 +23,17 @@ export default class TouchableNativeFeedback extends Component<TouchableNativeFe
|
|
|
22
23
|
};
|
|
23
24
|
delayLongPress: number;
|
|
24
25
|
};
|
|
25
|
-
static SelectableBackground: (rippleRadius?: number
|
|
26
|
+
static SelectableBackground: (rippleRadius?: number) => {
|
|
26
27
|
type: string;
|
|
27
28
|
attribute: string;
|
|
28
29
|
rippleRadius: number | undefined;
|
|
29
30
|
};
|
|
30
|
-
static SelectableBackgroundBorderless: (rippleRadius?: number
|
|
31
|
+
static SelectableBackgroundBorderless: (rippleRadius?: number) => {
|
|
31
32
|
type: string;
|
|
32
33
|
attribute: string;
|
|
33
34
|
rippleRadius: number | undefined;
|
|
34
35
|
};
|
|
35
|
-
static Ripple: (color: ColorValue, borderless: boolean, rippleRadius?: number
|
|
36
|
+
static Ripple: (color: ColorValue, borderless: boolean, rippleRadius?: number) => {
|
|
36
37
|
type: string;
|
|
37
38
|
color: ColorValue;
|
|
38
39
|
borderless: boolean;
|
|
@@ -40,5 +41,5 @@ export default class TouchableNativeFeedback extends Component<TouchableNativeFe
|
|
|
40
41
|
};
|
|
41
42
|
static canUseNativeForeground: () => boolean;
|
|
42
43
|
getExtraButtonProps(): TouchableNativeFeedbackExtraProps;
|
|
43
|
-
render(): JSX.Element;
|
|
44
|
+
render(): React.JSX.Element;
|
|
44
45
|
}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { Animated, TouchableOpacityProps as RNTouchableOpacityProps } from 'react-native';
|
|
2
2
|
import { GenericTouchableProps } from './GenericTouchable';
|
|
3
|
+
import * as React from 'react';
|
|
3
4
|
import { Component } from 'react';
|
|
4
|
-
export
|
|
5
|
+
export type TouchableOpacityProps = RNTouchableOpacityProps & GenericTouchableProps & {
|
|
5
6
|
useNativeAnimations?: boolean;
|
|
6
7
|
};
|
|
7
8
|
/**
|
|
@@ -20,5 +21,5 @@ export default class TouchableOpacity extends Component<TouchableOpacityProps> {
|
|
|
20
21
|
opacity: Animated.Value;
|
|
21
22
|
setOpacityTo: (value: number, duration: number) => void;
|
|
22
23
|
onStateChange: (_from: number, to: number) => void;
|
|
23
|
-
render(): JSX.Element;
|
|
24
|
+
render(): React.JSX.Element;
|
|
24
25
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import GenericTouchable, { GenericTouchableProps } from './GenericTouchable';
|
|
3
|
-
export
|
|
3
|
+
export type TouchableWithoutFeedbackProps = GenericTouchableProps;
|
|
4
4
|
declare const TouchableWithoutFeedback: React.ForwardRefExoticComponent<GenericTouchableProps & {
|
|
5
5
|
children?: React.ReactNode;
|
|
6
6
|
} & React.RefAttributes<GenericTouchable>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function getReactNativeVersion(): void;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BaseGestureHandlerProps } from './gestureHandlerCommon';
|
|
2
2
|
export declare const flingGestureHandlerProps: readonly ["numberOfPointers", "direction"];
|
|
3
|
-
export
|
|
3
|
+
export type FlingGestureHandlerEventPayload = {
|
|
4
4
|
x: number;
|
|
5
5
|
y: number;
|
|
6
6
|
absoluteX: number;
|
|
@@ -30,5 +30,5 @@ export interface FlingGestureConfig {
|
|
|
30
30
|
export interface FlingGestureHandlerProps extends BaseGestureHandlerProps<FlingGestureHandlerEventPayload>, FlingGestureConfig {
|
|
31
31
|
}
|
|
32
32
|
export declare const flingHandlerName = "FlingGestureHandler";
|
|
33
|
-
export
|
|
33
|
+
export type FlingGestureHandler = typeof FlingGestureHandler;
|
|
34
34
|
export declare const FlingGestureHandler: import("react").ComponentType<FlingGestureHandlerProps & import("react").RefAttributes<any>>;
|
|
@@ -6,7 +6,7 @@ declare class ForceTouchFallback extends React.Component<PropsWithChildren<unkno
|
|
|
6
6
|
componentDidMount(): void;
|
|
7
7
|
render(): React.ReactNode;
|
|
8
8
|
}
|
|
9
|
-
export
|
|
9
|
+
export type ForceTouchGestureHandlerEventPayload = {
|
|
10
10
|
x: number;
|
|
11
11
|
y: number;
|
|
12
12
|
absoluteX: number;
|
|
@@ -36,7 +36,7 @@ export interface ForceTouchGestureConfig {
|
|
|
36
36
|
}
|
|
37
37
|
export interface ForceTouchGestureHandlerProps extends BaseGestureHandlerProps<ForceTouchGestureHandlerEventPayload>, ForceTouchGestureConfig {
|
|
38
38
|
}
|
|
39
|
-
export
|
|
39
|
+
export type ForceTouchGestureHandler = typeof ForceTouchGestureHandler & {
|
|
40
40
|
forceTouchAvailable: boolean;
|
|
41
41
|
};
|
|
42
42
|
export declare const forceTouchHandlerName = "ForceTouchGestureHandler";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BaseGestureHandlerProps } from './gestureHandlerCommon';
|
|
2
2
|
export declare const longPressGestureHandlerProps: readonly ["minDurationMs", "maxDist"];
|
|
3
|
-
export
|
|
3
|
+
export type LongPressGestureHandlerEventPayload = {
|
|
4
4
|
/**
|
|
5
5
|
* X coordinate, expressed in points, of the current position of the pointer
|
|
6
6
|
* (finger or a leading pointer when there are multiple fingers placed)
|
|
@@ -52,5 +52,5 @@ export interface LongPressGestureConfig {
|
|
|
52
52
|
export interface LongPressGestureHandlerProps extends BaseGestureHandlerProps<LongPressGestureHandlerEventPayload>, LongPressGestureConfig {
|
|
53
53
|
}
|
|
54
54
|
export declare const longPressHandlerName = "LongPressGestureHandler";
|
|
55
|
-
export
|
|
55
|
+
export type LongPressGestureHandler = typeof LongPressGestureHandler;
|
|
56
56
|
export declare const LongPressGestureHandler: import("react").ComponentType<LongPressGestureHandlerProps & import("react").RefAttributes<any>>;
|
|
@@ -16,13 +16,13 @@ export interface NativeViewGestureConfig {
|
|
|
16
16
|
}
|
|
17
17
|
export interface NativeViewGestureHandlerProps extends BaseGestureHandlerProps<NativeViewGestureHandlerPayload>, NativeViewGestureConfig {
|
|
18
18
|
}
|
|
19
|
-
export
|
|
19
|
+
export type NativeViewGestureHandlerPayload = {
|
|
20
20
|
/**
|
|
21
21
|
* True if gesture was performed inside of containing view, false otherwise.
|
|
22
22
|
*/
|
|
23
23
|
pointerInside: boolean;
|
|
24
24
|
};
|
|
25
|
-
export declare const nativeViewProps: readonly ["id", "enabled", "shouldCancelWhenOutside", "hitSlop", "cancelsTouchesInView", "userSelect", "activeCursor", "waitFor", "simultaneousHandlers", "onBegan", "onFailed", "onCancelled", "onActivated", "onEnded", "onGestureEvent", "onHandlerStateChange", "shouldActivateOnStart", "disallowInterruption"];
|
|
25
|
+
export declare const nativeViewProps: readonly ["id", "enabled", "shouldCancelWhenOutside", "hitSlop", "cancelsTouchesInView", "userSelect", "activeCursor", "waitFor", "simultaneousHandlers", "blocksHandlers", "onBegan", "onFailed", "onCancelled", "onActivated", "onEnded", "onGestureEvent", "onHandlerStateChange", "shouldActivateOnStart", "disallowInterruption"];
|
|
26
26
|
export declare const nativeViewHandlerName = "NativeViewGestureHandler";
|
|
27
|
-
export
|
|
27
|
+
export type NativeViewGestureHandler = typeof NativeViewGestureHandler;
|
|
28
28
|
export declare const NativeViewGestureHandler: import("react").ComponentType<NativeViewGestureHandlerProps & import("react").RefAttributes<any>>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { BaseGestureHandlerProps } from './gestureHandlerCommon';
|
|
2
2
|
export declare const panGestureHandlerProps: readonly ["activeOffsetY", "activeOffsetX", "failOffsetY", "failOffsetX", "minDist", "minVelocity", "minVelocityX", "minVelocityY", "minPointers", "maxPointers", "avgTouches", "enableTrackpadTwoFingerGesture", "activateAfterLongPress"];
|
|
3
3
|
export declare const panGestureHandlerCustomNativeProps: readonly ["activeOffsetYStart", "activeOffsetYEnd", "activeOffsetXStart", "activeOffsetXEnd", "failOffsetYStart", "failOffsetYEnd", "failOffsetXStart", "failOffsetXEnd"];
|
|
4
|
-
export
|
|
4
|
+
export type PanGestureHandlerEventPayload = {
|
|
5
5
|
/**
|
|
6
6
|
* X coordinate of the current position of the pointer (finger or a leading
|
|
7
7
|
* pointer when there are multiple fingers placed) relative to the view
|
|
@@ -133,7 +133,7 @@ export interface PanGestureHandlerProps extends BaseGestureHandlerProps<PanGestu
|
|
|
133
133
|
failOffsetX?: number | number[];
|
|
134
134
|
}
|
|
135
135
|
export declare const panHandlerName = "PanGestureHandler";
|
|
136
|
-
export
|
|
136
|
+
export type PanGestureHandler = typeof PanGestureHandler;
|
|
137
137
|
export declare const PanGestureHandler: import("react").ComponentType<PanGestureHandlerProps & import("react").RefAttributes<any>>;
|
|
138
138
|
export declare function managePanProps(props: PanGestureHandlerProps): PanGestureHandlerProps & Partial<Record<"activeOffsetXStart" | "activeOffsetXEnd" | "failOffsetXStart" | "failOffsetXEnd" | "activeOffsetYStart" | "activeOffsetYEnd" | "failOffsetYStart" | "failOffsetYEnd", number>>;
|
|
139
139
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BaseGestureHandlerProps } from './gestureHandlerCommon';
|
|
2
|
-
export
|
|
2
|
+
export type PinchGestureHandlerEventPayload = {
|
|
3
3
|
/**
|
|
4
4
|
* The scale factor relative to the points of the two touches in screen
|
|
5
5
|
* coordinates.
|
|
@@ -25,5 +25,5 @@ export declare type PinchGestureHandlerEventPayload = {
|
|
|
25
25
|
export interface PinchGestureHandlerProps extends BaseGestureHandlerProps<PinchGestureHandlerEventPayload> {
|
|
26
26
|
}
|
|
27
27
|
export declare const pinchHandlerName = "PinchGestureHandler";
|
|
28
|
-
export
|
|
28
|
+
export type PinchGestureHandler = typeof PinchGestureHandler;
|
|
29
29
|
export declare const PinchGestureHandler: import("react").ComponentType<PinchGestureHandlerProps & import("react").RefAttributes<any>>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BaseGestureHandlerProps } from './gestureHandlerCommon';
|
|
2
|
-
export
|
|
2
|
+
export type RotationGestureHandlerEventPayload = {
|
|
3
3
|
/**
|
|
4
4
|
* Amount rotated, expressed in radians, from the gesture's focal point
|
|
5
5
|
* (anchor).
|
|
@@ -25,5 +25,5 @@ export declare type RotationGestureHandlerEventPayload = {
|
|
|
25
25
|
export interface RotationGestureHandlerProps extends BaseGestureHandlerProps<RotationGestureHandlerEventPayload> {
|
|
26
26
|
}
|
|
27
27
|
export declare const rotationHandlerName = "RotationGestureHandler";
|
|
28
|
-
export
|
|
28
|
+
export type RotationGestureHandler = typeof RotationGestureHandler;
|
|
29
29
|
export declare const RotationGestureHandler: import("react").ComponentType<RotationGestureHandlerProps & import("react").RefAttributes<any>>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BaseGestureHandlerProps } from './gestureHandlerCommon';
|
|
2
2
|
export declare const tapGestureHandlerProps: readonly ["maxDurationMs", "maxDelayMs", "numberOfTaps", "maxDeltaX", "maxDeltaY", "maxDist", "minPointers"];
|
|
3
|
-
export
|
|
3
|
+
export type TapGestureHandlerEventPayload = {
|
|
4
4
|
x: number;
|
|
5
5
|
y: number;
|
|
6
6
|
absoluteX: number;
|
|
@@ -53,5 +53,5 @@ export interface TapGestureConfig {
|
|
|
53
53
|
export interface TapGestureHandlerProps extends BaseGestureHandlerProps<TapGestureHandlerEventPayload>, TapGestureConfig {
|
|
54
54
|
}
|
|
55
55
|
export declare const tapHandlerName = "TapGestureHandler";
|
|
56
|
-
export
|
|
56
|
+
export type TapGestureHandler = typeof TapGestureHandler;
|
|
57
57
|
export declare const TapGestureHandler: import("react").ComponentType<TapGestureHandlerProps & import("react").RefAttributes<any>>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { BaseGestureHandlerProps } from './gestureHandlerCommon';
|
|
3
|
-
|
|
3
|
+
type CreateHandlerArgs<HandlerPropsT extends Record<string, unknown>> = Readonly<{
|
|
4
4
|
name: string;
|
|
5
5
|
allowedProps: Readonly<Extract<keyof HandlerPropsT, string>[]>;
|
|
6
6
|
config: Readonly<Record<string, unknown>>;
|
|
@@ -2,7 +2,7 @@ import * as React from 'react';
|
|
|
2
2
|
import { State } from '../State';
|
|
3
3
|
import { TouchEventType } from '../TouchEventType';
|
|
4
4
|
import { ValueOf } from '../typeUtils';
|
|
5
|
-
export declare const baseGestureHandlerProps: readonly ["id", "enabled", "shouldCancelWhenOutside", "hitSlop", "cancelsTouchesInView", "userSelect", "activeCursor", "waitFor", "simultaneousHandlers", "onBegan", "onFailed", "onCancelled", "onActivated", "onEnded", "onGestureEvent", "onHandlerStateChange"];
|
|
5
|
+
export declare const baseGestureHandlerProps: readonly ["id", "enabled", "shouldCancelWhenOutside", "hitSlop", "cancelsTouchesInView", "userSelect", "activeCursor", "waitFor", "simultaneousHandlers", "blocksHandlers", "onBegan", "onFailed", "onCancelled", "onActivated", "onEnded", "onGestureEvent", "onHandlerStateChange"];
|
|
6
6
|
export declare const baseGestureHandlerWithMonitorProps: string[];
|
|
7
7
|
export interface GestureEventPayload {
|
|
8
8
|
handlerTag: number;
|
|
@@ -12,23 +12,23 @@ export interface GestureEventPayload {
|
|
|
12
12
|
export interface HandlerStateChangeEventPayload extends GestureEventPayload {
|
|
13
13
|
oldState: ValueOf<typeof State>;
|
|
14
14
|
}
|
|
15
|
-
export
|
|
16
|
-
export
|
|
17
|
-
export
|
|
15
|
+
export type HitSlop = number | Partial<Record<'left' | 'right' | 'top' | 'bottom' | 'vertical' | 'horizontal', number>> | Record<'width' | 'left', number> | Record<'width' | 'right', number> | Record<'height' | 'top', number> | Record<'height' | 'bottom', number>;
|
|
16
|
+
export type UserSelect = 'none' | 'auto' | 'text';
|
|
17
|
+
export type ActiveCursor = 'auto' | 'default' | 'none' | 'context-menu' | 'help' | 'pointer' | 'progress' | 'wait' | 'cell' | 'crosshair' | 'text' | 'vertical-text' | 'alias' | 'copy' | 'move' | 'no-drop' | 'not-allowed' | 'grab' | 'grabbing' | 'e-resize' | 'n-resize' | 'ne-resize' | 'nw-resize' | 's-resize' | 'se-resize' | 'sw-resize' | 'w-resize' | 'ew-resize' | 'ns-resize' | 'nesw-resize' | 'nwse-resize' | 'col-resize' | 'row-resize' | 'all-scroll' | 'zoom-in' | 'zoom-out';
|
|
18
18
|
export interface GestureEvent<ExtraEventPayloadT = Record<string, unknown>> {
|
|
19
19
|
nativeEvent: Readonly<GestureEventPayload & ExtraEventPayloadT>;
|
|
20
20
|
}
|
|
21
21
|
export interface HandlerStateChangeEvent<ExtraEventPayloadT = Record<string, unknown>> {
|
|
22
22
|
nativeEvent: Readonly<HandlerStateChangeEventPayload & ExtraEventPayloadT>;
|
|
23
23
|
}
|
|
24
|
-
export
|
|
24
|
+
export type TouchData = {
|
|
25
25
|
id: number;
|
|
26
26
|
x: number;
|
|
27
27
|
y: number;
|
|
28
28
|
absoluteX: number;
|
|
29
29
|
absoluteY: number;
|
|
30
30
|
};
|
|
31
|
-
export
|
|
31
|
+
export type GestureTouchEvent = {
|
|
32
32
|
handlerTag: number;
|
|
33
33
|
numberOfTouches: number;
|
|
34
34
|
state: ValueOf<typeof State>;
|
|
@@ -36,19 +36,20 @@ export declare type GestureTouchEvent = {
|
|
|
36
36
|
allTouches: TouchData[];
|
|
37
37
|
changedTouches: TouchData[];
|
|
38
38
|
};
|
|
39
|
-
export
|
|
40
|
-
export
|
|
41
|
-
export
|
|
39
|
+
export type GestureUpdateEvent<GestureEventPayloadT = Record<string, unknown>> = GestureEventPayload & GestureEventPayloadT;
|
|
40
|
+
export type GestureStateChangeEvent<GestureStateChangeEventPayloadT = Record<string, unknown>> = HandlerStateChangeEventPayload & GestureStateChangeEventPayloadT;
|
|
41
|
+
export type CommonGestureConfig = {
|
|
42
42
|
enabled?: boolean;
|
|
43
43
|
shouldCancelWhenOutside?: boolean;
|
|
44
44
|
hitSlop?: HitSlop;
|
|
45
45
|
userSelect?: UserSelect;
|
|
46
46
|
activeCursor?: ActiveCursor;
|
|
47
47
|
};
|
|
48
|
-
export
|
|
48
|
+
export type BaseGestureHandlerProps<ExtraEventPayloadT extends Record<string, unknown> = Record<string, unknown>> = CommonGestureConfig & {
|
|
49
49
|
id?: string;
|
|
50
50
|
waitFor?: React.Ref<unknown> | React.Ref<unknown>[];
|
|
51
51
|
simultaneousHandlers?: React.Ref<unknown> | React.Ref<unknown>[];
|
|
52
|
+
blocksHandlers?: React.Ref<unknown> | React.Ref<unknown>[];
|
|
52
53
|
testID?: string;
|
|
53
54
|
cancelsTouchesInView?: boolean;
|
|
54
55
|
onBegan?: (event: HandlerStateChangeEvent) => void;
|
|
@@ -8,35 +8,35 @@ import { PinchGestureHandlerEventPayload, PinchGestureHandlerProps } from './Pin
|
|
|
8
8
|
import { RotationGestureHandlerEventPayload, RotationGestureHandlerProps } from './RotationGestureHandler';
|
|
9
9
|
import { TapGestureHandlerEventPayload, TapGestureHandlerProps } from './TapGestureHandler';
|
|
10
10
|
import { NativeViewGestureHandlerPayload, NativeViewGestureHandlerProps } from './NativeViewGestureHandler';
|
|
11
|
-
export
|
|
12
|
-
export
|
|
13
|
-
export
|
|
14
|
-
export
|
|
15
|
-
export
|
|
16
|
-
export
|
|
17
|
-
export
|
|
18
|
-
export
|
|
19
|
-
export
|
|
20
|
-
export
|
|
21
|
-
export
|
|
22
|
-
export
|
|
23
|
-
export
|
|
24
|
-
export
|
|
25
|
-
export
|
|
26
|
-
export
|
|
27
|
-
export
|
|
28
|
-
export
|
|
29
|
-
export
|
|
30
|
-
export
|
|
31
|
-
export
|
|
32
|
-
export
|
|
33
|
-
export
|
|
34
|
-
export
|
|
35
|
-
export
|
|
36
|
-
export
|
|
37
|
-
export
|
|
38
|
-
export
|
|
39
|
-
export
|
|
40
|
-
export
|
|
41
|
-
export
|
|
42
|
-
export
|
|
11
|
+
export type GestureHandlerGestureEventNativeEvent = GestureEventPayload;
|
|
12
|
+
export type GestureHandlerStateChangeNativeEvent = HandlerStateChangeEventPayload;
|
|
13
|
+
export type GestureHandlerGestureEvent = GestureEvent;
|
|
14
|
+
export type GestureHandlerStateChangeEvent = HandlerStateChangeEvent;
|
|
15
|
+
export type NativeViewGestureHandlerGestureEvent = GestureEvent<NativeViewGestureHandlerPayload>;
|
|
16
|
+
export type NativeViewGestureHandlerStateChangeEvent = HandlerStateChangeEvent<NativeViewGestureHandlerPayload>;
|
|
17
|
+
export type TapGestureHandlerGestureEvent = GestureEvent<TapGestureHandlerEventPayload>;
|
|
18
|
+
export type TapGestureHandlerStateChangeEvent = HandlerStateChangeEvent<TapGestureHandlerEventPayload>;
|
|
19
|
+
export type ForceTouchGestureHandlerGestureEvent = GestureEvent<ForceTouchGestureHandlerEventPayload>;
|
|
20
|
+
export type ForceTouchGestureHandlerStateChangeEvent = HandlerStateChangeEvent<ForceTouchGestureHandlerEventPayload>;
|
|
21
|
+
export type LongPressGestureHandlerGestureEvent = GestureEvent<LongPressGestureHandlerEventPayload>;
|
|
22
|
+
export type LongPressGestureHandlerStateChangeEvent = HandlerStateChangeEvent<LongPressGestureHandlerEventPayload>;
|
|
23
|
+
export type PanGestureHandlerGestureEvent = GestureEvent<PanGestureHandlerEventPayload>;
|
|
24
|
+
export type PanGestureHandlerStateChangeEvent = HandlerStateChangeEvent<PanGestureHandlerEventPayload>;
|
|
25
|
+
export type PinchGestureHandlerGestureEvent = GestureEvent<PinchGestureHandlerEventPayload>;
|
|
26
|
+
export type PinchGestureHandlerStateChangeEvent = HandlerStateChangeEvent<PinchGestureHandlerEventPayload>;
|
|
27
|
+
export type RotationGestureHandlerGestureEvent = GestureEvent<RotationGestureHandlerEventPayload>;
|
|
28
|
+
export type RotationGestureHandlerStateChangeEvent = HandlerStateChangeEvent<RotationGestureHandlerEventPayload>;
|
|
29
|
+
export type FlingGestureHandlerGestureEvent = GestureEvent<FlingGestureHandlerEventPayload>;
|
|
30
|
+
export type FlingGestureHandlerStateChangeEvent = HandlerStateChangeEvent<FlingGestureHandlerEventPayload>;
|
|
31
|
+
export type NativeViewGestureHandlerProperties = NativeViewGestureHandlerProps;
|
|
32
|
+
export type TapGestureHandlerProperties = TapGestureHandlerProps;
|
|
33
|
+
export type LongPressGestureHandlerProperties = LongPressGestureHandlerProps;
|
|
34
|
+
export type PanGestureHandlerProperties = PanGestureHandlerProps;
|
|
35
|
+
export type PinchGestureHandlerProperties = PinchGestureHandlerProps;
|
|
36
|
+
export type RotationGestureHandlerProperties = RotationGestureHandlerProps;
|
|
37
|
+
export type FlingGestureHandlerProperties = FlingGestureHandlerProps;
|
|
38
|
+
export type ForceTouchGestureHandlerProperties = ForceTouchGestureHandlerProps;
|
|
39
|
+
export type RawButtonProperties = RawButtonProps;
|
|
40
|
+
export type BaseButtonProperties = BaseButtonProps;
|
|
41
|
+
export type RectButtonProperties = RectButtonProps;
|
|
42
|
+
export type BorderlessButtonProperties = BorderlessButtonProps;
|
|
@@ -3,7 +3,7 @@ import { GestureType, HandlerCallbacks } from './gesture';
|
|
|
3
3
|
import { SharedValue } from './reanimatedWrapper';
|
|
4
4
|
import { UserSelect } from '../gestureHandlerCommon';
|
|
5
5
|
import { ComposedGesture } from './gestureComposition';
|
|
6
|
-
export
|
|
6
|
+
export type GestureConfigReference = {
|
|
7
7
|
config: GestureType[];
|
|
8
8
|
animatedEventHandler: unknown;
|
|
9
9
|
animatedHandlers: SharedValue<HandlerCallbacks<Record<string, unknown>>[] | null> | null;
|
|
@@ -15,5 +15,5 @@ interface GestureDetectorProps {
|
|
|
15
15
|
userSelect?: UserSelect;
|
|
16
16
|
children?: React.ReactNode;
|
|
17
17
|
}
|
|
18
|
-
export declare const GestureDetector: (props: GestureDetectorProps) => JSX.Element;
|
|
18
|
+
export declare const GestureDetector: (props: GestureDetectorProps) => React.JSX.Element;
|
|
19
19
|
export {};
|
|
@@ -6,4 +6,4 @@ export declare class FlingGesture extends BaseGesture<FlingGestureHandlerEventPa
|
|
|
6
6
|
numberOfPointers(pointers: number): this;
|
|
7
7
|
direction(direction: number): this;
|
|
8
8
|
}
|
|
9
|
-
export
|
|
9
|
+
export type FlingGestureType = InstanceType<typeof FlingGesture>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { BaseGestureConfig, ContinousBaseGesture } from './gesture';
|
|
2
2
|
import { ForceTouchGestureConfig, ForceTouchGestureHandlerEventPayload } from '../ForceTouchGestureHandler';
|
|
3
3
|
import { GestureUpdateEvent } from '../gestureHandlerCommon';
|
|
4
|
-
export
|
|
4
|
+
export type ForceTouchGestureChangeEventPayload = {
|
|
5
5
|
forceChange: number;
|
|
6
6
|
};
|
|
7
7
|
export declare class ForceTouchGesture extends ContinousBaseGesture<ForceTouchGestureHandlerEventPayload, ForceTouchGestureChangeEventPayload> {
|
|
@@ -12,4 +12,4 @@ export declare class ForceTouchGesture extends ContinousBaseGesture<ForceTouchGe
|
|
|
12
12
|
feedbackOnActivation(value: boolean): this;
|
|
13
13
|
onChange(callback: (event: GestureUpdateEvent<GestureUpdateEvent<ForceTouchGestureHandlerEventPayload & ForceTouchGestureChangeEventPayload>>) => void): this;
|
|
14
14
|
}
|
|
15
|
-
export
|
|
15
|
+
export type ForceTouchGestureType = InstanceType<typeof ForceTouchGesture>;
|
|
@@ -8,20 +8,21 @@ import { PinchGestureHandlerEventPayload } from '../PinchGestureHandler';
|
|
|
8
8
|
import { RotationGestureHandlerEventPayload } from '../RotationGestureHandler';
|
|
9
9
|
import { TapGestureHandlerEventPayload } from '../TapGestureHandler';
|
|
10
10
|
import { NativeViewGestureHandlerPayload } from '../NativeViewGestureHandler';
|
|
11
|
-
export
|
|
12
|
-
export
|
|
11
|
+
export type GestureType = BaseGesture<Record<string, unknown>> | BaseGesture<Record<string, never>> | BaseGesture<TapGestureHandlerEventPayload> | BaseGesture<PanGestureHandlerEventPayload> | BaseGesture<LongPressGestureHandlerEventPayload> | BaseGesture<RotationGestureHandlerEventPayload> | BaseGesture<PinchGestureHandlerEventPayload> | BaseGesture<FlingGestureHandlerEventPayload> | BaseGesture<ForceTouchGestureHandlerEventPayload> | BaseGesture<NativeViewGestureHandlerPayload>;
|
|
12
|
+
export type GestureRef = number | GestureType | React.RefObject<GestureType | undefined> | React.RefObject<React.ComponentType | undefined>;
|
|
13
13
|
export interface BaseGestureConfig extends CommonGestureConfig, Record<string, unknown> {
|
|
14
14
|
ref?: React.MutableRefObject<GestureType | undefined>;
|
|
15
15
|
requireToFail?: GestureRef[];
|
|
16
16
|
simultaneousWith?: GestureRef[];
|
|
17
|
+
blocksHandlers?: GestureRef[];
|
|
17
18
|
needsPointerData?: boolean;
|
|
18
19
|
manualActivation?: boolean;
|
|
19
20
|
runOnJS?: boolean;
|
|
20
21
|
testId?: string;
|
|
21
22
|
cancelsTouchesInView?: boolean;
|
|
22
23
|
}
|
|
23
|
-
|
|
24
|
-
export
|
|
24
|
+
type TouchEventHandlerType = (event: GestureTouchEvent, stateManager: GestureStateManagerType) => void;
|
|
25
|
+
export type HandlerCallbacks<EventPayloadT extends Record<string, unknown>> = {
|
|
25
26
|
gestureId: number;
|
|
26
27
|
handlerTag: number;
|
|
27
28
|
onBegin?: (event: GestureStateChangeEvent<EventPayloadT>) => void;
|
|
@@ -50,7 +51,7 @@ export declare const CALLBACK_TYPE: {
|
|
|
50
51
|
readonly TOUCHES_UP: 9;
|
|
51
52
|
readonly TOUCHES_CANCELLED: 10;
|
|
52
53
|
};
|
|
53
|
-
export
|
|
54
|
+
export type CALLBACK_TYPE = typeof CALLBACK_TYPE[keyof typeof CALLBACK_TYPE];
|
|
54
55
|
export declare abstract class Gesture {
|
|
55
56
|
/**
|
|
56
57
|
* Return array of gestures, providing the same interface for creating and updating
|
|
@@ -93,6 +94,7 @@ export declare abstract class BaseGesture<EventPayloadT extends Record<string, u
|
|
|
93
94
|
runOnJS(runOnJS: boolean): this;
|
|
94
95
|
simultaneousWithExternalGesture(...gestures: Exclude<GestureRef, number>[]): this;
|
|
95
96
|
requireExternalGestureToFail(...gestures: Exclude<GestureRef, number>[]): this;
|
|
97
|
+
blocksExternalGesture(...gestures: Exclude<GestureRef, number>[]): this;
|
|
96
98
|
withTestId(id: string): this;
|
|
97
99
|
cancelsTouchesInView(value: boolean): this;
|
|
98
100
|
initialize(): void;
|
|
@@ -15,7 +15,7 @@ export declare class SimultaneousGesture extends ComposedGesture {
|
|
|
15
15
|
export declare class ExclusiveGesture extends ComposedGesture {
|
|
16
16
|
prepare(): void;
|
|
17
17
|
}
|
|
18
|
-
export
|
|
19
|
-
export
|
|
20
|
-
export
|
|
21
|
-
export
|
|
18
|
+
export type ComposedGestureType = InstanceType<typeof ComposedGesture>;
|
|
19
|
+
export type RaceGestureType = ComposedGestureType;
|
|
20
|
+
export type SimultaneousGestureType = InstanceType<typeof SimultaneousGesture>;
|
|
21
|
+
export type ExclusiveGestureType = InstanceType<typeof ExclusiveGesture>;
|
|
@@ -4,6 +4,8 @@ export interface GestureStateManagerType {
|
|
|
4
4
|
fail: () => void;
|
|
5
5
|
end: () => void;
|
|
6
6
|
}
|
|
7
|
+
declare function create(handlerTag: number): GestureStateManagerType;
|
|
7
8
|
export declare const GestureStateManager: {
|
|
8
|
-
create
|
|
9
|
+
create: typeof create;
|
|
9
10
|
};
|
|
11
|
+
export {};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { BaseGestureConfig, ContinousBaseGesture } from './gesture';
|
|
2
2
|
import { GestureUpdateEvent } from '../gestureHandlerCommon';
|
|
3
|
-
export
|
|
3
|
+
export type HoverGestureHandlerEventPayload = {
|
|
4
4
|
x: number;
|
|
5
5
|
y: number;
|
|
6
6
|
absoluteX: number;
|
|
7
7
|
absoluteY: number;
|
|
8
8
|
};
|
|
9
|
-
export
|
|
9
|
+
export type HoverGestureChangeEventPayload = {
|
|
10
10
|
changeX: number;
|
|
11
11
|
changeY: number;
|
|
12
12
|
};
|
|
@@ -29,4 +29,4 @@ export declare class HoverGesture extends ContinousBaseGesture<HoverGestureHandl
|
|
|
29
29
|
effect(effect: HoverEffect): this;
|
|
30
30
|
onChange(callback: (event: GestureUpdateEvent<HoverGestureHandlerEventPayload & HoverGestureChangeEventPayload>) => void): this;
|
|
31
31
|
}
|
|
32
|
-
export
|
|
32
|
+
export type HoverGestureType = InstanceType<typeof HoverGesture>;
|
|
@@ -6,4 +6,4 @@ export declare class LongPressGesture extends BaseGesture<LongPressGestureHandle
|
|
|
6
6
|
minDuration(duration: number): this;
|
|
7
7
|
maxDistance(distance: number): this;
|
|
8
8
|
}
|
|
9
|
-
export
|
|
9
|
+
export type LongPressGestureType = InstanceType<typeof LongPressGesture>;
|
|
@@ -4,4 +4,4 @@ export declare class ManualGesture extends ContinousBaseGesture<Record<string, n
|
|
|
4
4
|
constructor();
|
|
5
5
|
onChange(callback: (event: GestureUpdateEvent<Record<string, never>>) => void): this;
|
|
6
6
|
}
|
|
7
|
-
export
|
|
7
|
+
export type ManualGestureType = InstanceType<typeof ManualGesture>;
|
|
@@ -6,4 +6,4 @@ export declare class NativeGesture extends BaseGesture<NativeViewGestureHandlerP
|
|
|
6
6
|
shouldActivateOnStart(value: boolean): this;
|
|
7
7
|
disallowInterruption(value: boolean): this;
|
|
8
8
|
}
|
|
9
|
-
export
|
|
9
|
+
export type NativeGestureType = InstanceType<typeof NativeGesture>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { BaseGestureConfig, ContinousBaseGesture } from './gesture';
|
|
2
2
|
import { GestureUpdateEvent } from '../gestureHandlerCommon';
|
|
3
3
|
import { PanGestureConfig, PanGestureHandlerEventPayload } from '../PanGestureHandler';
|
|
4
|
-
export
|
|
4
|
+
export type PanGestureChangeEventPayload = {
|
|
5
5
|
changeX: number;
|
|
6
6
|
changeY: number;
|
|
7
7
|
};
|
|
@@ -23,4 +23,4 @@ export declare class PanGesture extends ContinousBaseGesture<PanGestureHandlerEv
|
|
|
23
23
|
activateAfterLongPress(duration: number): this;
|
|
24
24
|
onChange(callback: (event: GestureUpdateEvent<PanGestureHandlerEventPayload & PanGestureChangeEventPayload>) => void): this;
|
|
25
25
|
}
|
|
26
|
-
export
|
|
26
|
+
export type PanGestureType = InstanceType<typeof PanGesture>;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { ContinousBaseGesture } from './gesture';
|
|
2
2
|
import { PinchGestureHandlerEventPayload } from '../PinchGestureHandler';
|
|
3
3
|
import { GestureUpdateEvent } from '../gestureHandlerCommon';
|
|
4
|
-
export
|
|
4
|
+
export type PinchGestureChangeEventPayload = {
|
|
5
5
|
scaleChange: number;
|
|
6
6
|
};
|
|
7
7
|
export declare class PinchGesture extends ContinousBaseGesture<PinchGestureHandlerEventPayload, PinchGestureChangeEventPayload> {
|
|
8
8
|
constructor();
|
|
9
9
|
onChange(callback: (event: GestureUpdateEvent<PinchGestureHandlerEventPayload & PinchGestureChangeEventPayload>) => void): this;
|
|
10
10
|
}
|
|
11
|
-
export
|
|
11
|
+
export type PinchGestureType = InstanceType<typeof PinchGesture>;
|