Skip to content

Commit 43bd77d

Browse files
committed
SingleGestureType as a union
1 parent 652fe3f commit 43bd77d

File tree

3 files changed

+49
-20
lines changed

3 files changed

+49
-20
lines changed

packages/react-native-gesture-handler/src/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,6 @@ export * from './v3/hooks/relations';
170170

171171
export {
172172
SingleGestureName,
173-
SingleGestureType,
174173
ComposedGesture as ComposedGestureType,
175174
} from './v3/types';
176175

Lines changed: 49 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,66 @@
1+
import { FlingGestureEvent, FlingGestureType } from './useFling';
2+
import { HoverGestureEvent, HoverGestureType } from './useHover';
3+
import { LongPressGestureEvent, LongPressGestureType } from './useLongPress';
4+
import { ManualGestureEvent, ManualGestureType } from './useManual';
5+
import { NativeGestureEvent, NativeGestureType } from './useNative';
6+
import { PanGestureEvent, PanGestureType } from './usePan';
7+
import { PinchGestureEvent, PinchGestureType } from './usePinch';
8+
import { RotationGestureEvent, RotationGestureType } from './useRotation';
9+
import { TapGestureEvent, TapGestureType } from './useTap';
10+
111
export type { TapGestureConfig } from './useTap';
2-
export { useTap, TapGestureType, TapGestureEvent } from './useTap';
12+
export type { TapGestureType, TapGestureEvent };
13+
export { useTap } from './useTap';
314

415
export type { FlingGestureConfig } from './useFling';
5-
export { useFling, FlingGestureType, FlingGestureEvent } from './useFling';
16+
export type { FlingGestureType, FlingGestureEvent };
17+
export { useFling } from './useFling';
618

719
export type { LongPressGestureConfig } from './useLongPress';
8-
export {
9-
useLongPress,
10-
LongPressGestureType,
11-
LongPressGestureEvent,
12-
} from './useLongPress';
20+
export type { LongPressGestureType, LongPressGestureEvent };
21+
export { useLongPress } from './useLongPress';
1322

1423
export type { PinchGestureConfig } from './usePinch';
15-
export { usePinch, PinchGestureType, PinchGestureEvent } from './usePinch';
24+
export type { PinchGestureType, PinchGestureEvent };
25+
export { usePinch } from './usePinch';
1626

1727
export type { RotationGestureConfig } from './useRotation';
18-
export {
19-
useRotation,
20-
RotationGestureType,
21-
RotationGestureEvent,
22-
} from './useRotation';
28+
export type { RotationGestureType, RotationGestureEvent };
29+
export { useRotation } from './useRotation';
2330

2431
export type { HoverGestureConfig } from './useHover';
25-
export { useHover, HoverGestureType, HoverGestureEvent } from './useHover';
32+
export type { HoverGestureType, HoverGestureEvent };
33+
export { useHover } from './useHover';
2634

2735
export type { ManualGestureConfig } from './useManual';
28-
export { useManual, ManualGestureType, ManualGestureEvent } from './useManual';
36+
export type { ManualGestureType, ManualGestureEvent };
37+
export { useManual } from './useManual';
2938

3039
export type { NativeViewGestureConfig } from './useNative';
31-
export { useNative, NativeGestureType, NativeGestureEvent } from './useNative';
40+
export type { NativeGestureType, NativeGestureEvent };
41+
export { useNative } from './useNative';
3242

3343
export type { PanGestureConfig } from './usePan';
34-
export { usePan, PanGestureType, PanGestureEvent } from './usePan';
44+
export type { PanGestureType, PanGestureEvent };
45+
export { usePan } from './usePan';
46+
47+
export type SingleGestureType =
48+
| TapGestureType
49+
| FlingGestureType
50+
| LongPressGestureType
51+
| PinchGestureType
52+
| RotationGestureType
53+
| HoverGestureType
54+
| ManualGestureType
55+
| NativeGestureType
56+
| PanGestureType;
57+
export type SingleGestureEvent =
58+
| TapGestureEvent
59+
| FlingGestureEvent
60+
| LongPressGestureEvent
61+
| PinchGestureEvent
62+
| RotationGestureEvent
63+
| HoverGestureEvent
64+
| ManualGestureEvent
65+
| NativeGestureEvent
66+
| PanGestureEvent;

packages/react-native-gesture-handler/src/v3/types.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,6 @@ export type SingleGesture<THandlerData, TConfig> = {
106106
gestureRelations: GestureRelations;
107107
};
108108

109-
export type SingleGestureType = SingleGesture<unknown, unknown>;
110-
111109
export type ComposedGesture = {
112110
tags: number[];
113111
type: ComposedGestureName;

0 commit comments

Comments
 (0)