Skip to content

Commit 2b291b6

Browse files
committed
new api gets better names
1 parent 43bd77d commit 2b291b6

File tree

11 files changed

+52
-60
lines changed

11 files changed

+52
-60
lines changed

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

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -54,20 +54,20 @@ export { default as createNativeWrapper } from './handlers/createNativeWrapper';
5454
export type { NativeViewGestureHandlerProps } from './handlers/NativeViewGestureHandler';
5555
export { GestureDetector } from './handlers/gestures/GestureDetector';
5656
export { GestureObjects as Gesture } from './handlers/gestures/gestureObjects';
57-
export type { TapGestureType as TapGesture } from './handlers/gestures/tapGesture';
58-
export type { PanGestureType as PanGesture } from './handlers/gestures/panGesture';
59-
export type { FlingGestureType as FlingGesture } from './handlers/gestures/flingGesture';
60-
export type { LongPressGestureType as LongPressGesture } from './handlers/gestures/longPressGesture';
61-
export type { PinchGestureType as PinchGesture } from './handlers/gestures/pinchGesture';
62-
export type { RotationGestureType as RotationGesture } from './handlers/gestures/rotationGesture';
63-
export type { ForceTouchGestureType as ForceTouchGesture } from './handlers/gestures/forceTouchGesture';
64-
export type { ManualGestureType as ManualGesture } from './handlers/gestures/manualGesture';
65-
export type { HoverGestureType as HoverGesture } from './handlers/gestures/hoverGesture';
57+
export type { TapGestureType } from './handlers/gestures/tapGesture';
58+
export type { PanGestureType } from './handlers/gestures/panGesture';
59+
export type { FlingGestureType } from './handlers/gestures/flingGesture';
60+
export type { LongPressGestureType } from './handlers/gestures/longPressGesture';
61+
export type { PinchGestureType } from './handlers/gestures/pinchGesture';
62+
export type { RotationGestureType } from './handlers/gestures/rotationGesture';
63+
export type { ForceTouchGestureType } from './handlers/gestures/forceTouchGesture';
64+
export type { ManualGestureType } from './handlers/gestures/manualGesture';
65+
export type { HoverGestureType } from './handlers/gestures/hoverGesture';
6666
export type {
67-
ComposedGestureType as ComposedGesture,
68-
RaceGestureType as RaceGesture,
69-
SimultaneousGestureType as SimultaneousGesture,
70-
ExclusiveGestureType as ExclusiveGesture,
67+
ComposedGestureType,
68+
RaceGestureType,
69+
SimultaneousGestureType,
70+
ExclusiveGestureType,
7171
} from './handlers/gestures/gestureComposition';
7272
export type { GestureStateManagerType as GestureStateManager } from './handlers/gestures/gestureStateManager';
7373
export { NativeViewGestureHandler } from './handlers/NativeViewGestureHandler';
@@ -168,10 +168,7 @@ export { NativeDetector } from './v3/NativeDetector/NativeDetector';
168168
export * from './v3/hooks/useGesture';
169169
export * from './v3/hooks/relations';
170170

171-
export {
172-
SingleGestureName,
173-
ComposedGesture as ComposedGestureType,
174-
} from './v3/types';
171+
export { SingleGestureName, ComposedGesture } from './v3/types';
175172

176173
export * from './v3/hooks/gestures';
177174

packages/react-native-gesture-handler/src/v3/hooks/gestures/index.ts

Lines changed: 29 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,60 @@
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';
1+
import { FlingGestureEvent, FlingGesture } from './useFling';
2+
import { HoverGestureEvent, HoverGesture } from './useHover';
3+
import { LongPressGestureEvent, LongPressGesture } from './useLongPress';
4+
import { ManualGestureEvent, ManualGesture } from './useManual';
5+
import { NativeGestureEvent, NativeGesture } from './useNative';
6+
import { PanGestureEvent, PanGesture } from './usePan';
7+
import { PinchGestureEvent, PinchGesture } from './usePinch';
8+
import { RotationGestureEvent, RotationGesture } from './useRotation';
9+
import { TapGestureEvent, TapGesture } from './useTap';
1010

1111
export type { TapGestureConfig } from './useTap';
12-
export type { TapGestureType, TapGestureEvent };
12+
export type { TapGesture, TapGestureEvent };
1313
export { useTap } from './useTap';
1414

1515
export type { FlingGestureConfig } from './useFling';
16-
export type { FlingGestureType, FlingGestureEvent };
16+
export type { FlingGesture, FlingGestureEvent };
1717
export { useFling } from './useFling';
1818

1919
export type { LongPressGestureConfig } from './useLongPress';
20-
export type { LongPressGestureType, LongPressGestureEvent };
20+
export type { LongPressGesture, LongPressGestureEvent };
2121
export { useLongPress } from './useLongPress';
2222

2323
export type { PinchGestureConfig } from './usePinch';
24-
export type { PinchGestureType, PinchGestureEvent };
24+
export type { PinchGesture, PinchGestureEvent };
2525
export { usePinch } from './usePinch';
2626

2727
export type { RotationGestureConfig } from './useRotation';
28-
export type { RotationGestureType, RotationGestureEvent };
28+
export type { RotationGesture, RotationGestureEvent };
2929
export { useRotation } from './useRotation';
3030

3131
export type { HoverGestureConfig } from './useHover';
32-
export type { HoverGestureType, HoverGestureEvent };
32+
export type { HoverGesture, HoverGestureEvent };
3333
export { useHover } from './useHover';
3434

3535
export type { ManualGestureConfig } from './useManual';
36-
export type { ManualGestureType, ManualGestureEvent };
36+
export type { ManualGesture, ManualGestureEvent };
3737
export { useManual } from './useManual';
3838

3939
export type { NativeViewGestureConfig } from './useNative';
40-
export type { NativeGestureType, NativeGestureEvent };
40+
export type { NativeGesture, NativeGestureEvent };
4141
export { useNative } from './useNative';
4242

4343
export type { PanGestureConfig } from './usePan';
44-
export type { PanGestureType, PanGestureEvent };
44+
export type { PanGesture, PanGestureEvent };
4545
export { usePan } from './usePan';
4646

47-
export type SingleGestureType =
48-
| TapGestureType
49-
| FlingGestureType
50-
| LongPressGestureType
51-
| PinchGestureType
52-
| RotationGestureType
53-
| HoverGestureType
54-
| ManualGestureType
55-
| NativeGestureType
56-
| PanGestureType;
47+
export type SingleGesture =
48+
| TapGesture
49+
| FlingGesture
50+
| LongPressGesture
51+
| PinchGesture
52+
| RotationGesture
53+
| HoverGesture
54+
| ManualGesture
55+
| NativeGesture
56+
| PanGesture;
57+
5758
export type SingleGestureEvent =
5859
| TapGestureEvent
5960
| FlingGestureEvent

packages/react-native-gesture-handler/src/v3/hooks/gestures/useFling.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ export function useFling(config: FlingGestureConfig) {
5555
}
5656

5757
export type FlingGestureEvent = GestureEvents<FlingHandlerData>;
58-
export type FlingGestureType = SingleGesture<
58+
export type FlingGesture = SingleGesture<
5959
FlingHandlerData,
6060
FlingGestureProperties
6161
>;

packages/react-native-gesture-handler/src/v3/hooks/gestures/useHover.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ export function useHover(config: HoverGestureConfig) {
4848
}
4949

5050
export type HoverGestureEvent = GestureEvents<HoverHandlerData>;
51-
export type HoverGestureType = SingleGesture<
51+
export type HoverGesture = SingleGesture<
5252
HoverHandlerData,
5353
HoverGestureProperties
5454
>;

packages/react-native-gesture-handler/src/v3/hooks/gestures/useLongPress.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ export function useLongPress(config: LongPressGestureConfig) {
8282
}
8383

8484
export type LongPressGestureEvent = GestureEvents<LongPressHandlerData>;
85-
export type LongPressGestureType = SingleGesture<
85+
export type LongPressGesture = SingleGesture<
8686
LongPressHandlerData,
8787
LongPressGestureProperties
8888
>;

packages/react-native-gesture-handler/src/v3/hooks/gestures/useManual.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export function useManual(config: ManualGestureConfig) {
2828
}
2929

3030
export type ManualGestureEvent = GestureEvents<ManualHandlerData>;
31-
export type ManualGestureType = SingleGesture<
31+
export type ManualGesture = SingleGesture<
3232
ManualHandlerData,
3333
ManualGestureProperties
3434
>;

packages/react-native-gesture-handler/src/v3/hooks/gestures/useNative.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ export function useNative(config: NativeViewGestureConfig) {
4646
}
4747

4848
export type NativeGestureEvent = GestureEvents<NativeViewHandlerData>;
49-
export type NativeGestureType = SingleGesture<
49+
export type NativeGesture = SingleGesture<
5050
NativeViewHandlerData,
5151
NativeViewGestureProperties
5252
>;

packages/react-native-gesture-handler/src/v3/hooks/gestures/usePan.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,4 @@ export function usePan(config: PanGestureConfig) {
261261
}
262262

263263
export type PanGestureEvent = GestureEvents<PanHandlerData>;
264-
export type PanGestureType = SingleGesture<
265-
PanHandlerData,
266-
PanGestureProperties
267-
>;
264+
export type PanGesture = SingleGesture<PanHandlerData, PanGestureProperties>;

packages/react-native-gesture-handler/src/v3/hooks/gestures/usePinch.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export function usePinch(config: PinchGestureConfig) {
3434
}
3535

3636
export type PinchGestureEvent = GestureEvents<PinchHandlerData>;
37-
export type PinchGestureType = SingleGesture<
37+
export type PinchGesture = SingleGesture<
3838
PinchHandlerData,
3939
PinchGestureProperties
4040
>;

packages/react-native-gesture-handler/src/v3/hooks/gestures/useRotation.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ export function useRotation(config: RotationGestureConfig) {
3535
}
3636

3737
export type RotationGestureEvent = GestureEvents<RotationHandlerData>;
38-
export type RotationGestureType = SingleGesture<
38+
export type RotationGesture = SingleGesture<
3939
RotationHandlerData,
4040
RotationGestureProperties
4141
>;

0 commit comments

Comments
 (0)