Skip to content

Commit 48a560c

Browse files
committed
Merge branch '@akwasniewski/add-missing-types' into @akwasniewski/v3-examples
2 parents e99d6b9 + 2b291b6 commit 48a560c

File tree

12 files changed

+122
-23
lines changed

12 files changed

+122
-23
lines changed

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

Lines changed: 14 additions & 14 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';
@@ -169,7 +169,7 @@ export { LogicDetector } from './v3/LogicDetector';
169169
export * from './v3/hooks/useGesture';
170170
export * from './v3/hooks/relations';
171171

172-
export { SingleGestureName } from './v3/types';
172+
export { SingleGestureName, ComposedGesture } from './v3/types';
173173

174174
export * from './v3/hooks/gestures';
175175

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,67 @@
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';
10+
111
export type { TapGestureConfig } from './useTap';
12+
export type { TapGesture, TapGestureEvent };
213
export { useTap } from './useTap';
314

415
export type { FlingGestureConfig } from './useFling';
16+
export type { FlingGesture, FlingGestureEvent };
517
export { useFling } from './useFling';
618

719
export type { LongPressGestureConfig } from './useLongPress';
20+
export type { LongPressGesture, LongPressGestureEvent };
821
export { useLongPress } from './useLongPress';
922

1023
export type { PinchGestureConfig } from './usePinch';
24+
export type { PinchGesture, PinchGestureEvent };
1125
export { usePinch } from './usePinch';
1226

1327
export type { RotationGestureConfig } from './useRotation';
28+
export type { RotationGesture, RotationGestureEvent };
1429
export { useRotation } from './useRotation';
1530

1631
export type { HoverGestureConfig } from './useHover';
32+
export type { HoverGesture, HoverGestureEvent };
1733
export { useHover } from './useHover';
1834

1935
export type { ManualGestureConfig } from './useManual';
36+
export type { ManualGesture, ManualGestureEvent };
2037
export { useManual } from './useManual';
2138

2239
export type { NativeViewGestureConfig } from './useNative';
40+
export type { NativeGesture, NativeGestureEvent };
2341
export { useNative } from './useNative';
2442

2543
export type { PanGestureConfig } from './usePan';
44+
export type { PanGesture, PanGestureEvent };
2645
export { usePan } from './usePan';
46+
47+
export type SingleGesture =
48+
| TapGesture
49+
| FlingGesture
50+
| LongPressGesture
51+
| PinchGesture
52+
| RotationGesture
53+
| HoverGesture
54+
| ManualGesture
55+
| NativeGesture
56+
| PanGesture;
57+
58+
export type SingleGestureEvent =
59+
| TapGestureEvent
60+
| FlingGestureEvent
61+
| LongPressGestureEvent
62+
| PinchGestureEvent
63+
| RotationGestureEvent
64+
| HoverGestureEvent
65+
| ManualGestureEvent
66+
| NativeGestureEvent
67+
| PanGestureEvent;

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import {
22
BaseGestureConfig,
33
ExcludeInternalConfigProps,
4+
GestureEvents,
5+
SingleGesture,
46
SingleGestureName,
57
} from '../../types';
68
import { useGesture } from '../useGesture';
@@ -51,3 +53,9 @@ export function useFling(config: FlingGestureConfig) {
5153

5254
return useGesture(SingleGestureName.Fling, flingConfig);
5355
}
56+
57+
export type FlingGestureEvent = GestureEvents<FlingHandlerData>;
58+
export type FlingGesture = SingleGesture<
59+
FlingHandlerData,
60+
FlingGestureProperties
61+
>;

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ import {
44
BaseGestureConfig,
55
ExcludeInternalConfigProps,
66
HandlerData,
7+
GestureEvents,
8+
SingleGesture,
79
SingleGestureName,
810
} from '../../types';
911
import { useGesture } from '../useGesture';
@@ -60,3 +62,9 @@ export function useHover(config: HoverGestureConfig) {
6062

6163
return useGesture(SingleGestureName.Hover, hoverConfig);
6264
}
65+
66+
export type HoverGestureEvent = GestureEvents<HoverHandlerData>;
67+
export type HoverGesture = SingleGesture<
68+
HoverHandlerData,
69+
HoverGestureProperties
70+
>;

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import {
22
BaseGestureConfig,
33
ExcludeInternalConfigProps,
4+
GestureEvents,
5+
SingleGesture,
46
SingleGestureName,
57
} from '../../types';
68
import { useGesture } from '../useGesture';
@@ -78,3 +80,9 @@ export function useLongPress(config: LongPressGestureConfig) {
7880
longPressConfig
7981
);
8082
}
83+
84+
export type LongPressGestureEvent = GestureEvents<LongPressHandlerData>;
85+
export type LongPressGesture = SingleGesture<
86+
LongPressHandlerData,
87+
LongPressGestureProperties
88+
>;

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import {
22
BaseGestureConfig,
33
ExcludeInternalConfigProps,
4+
GestureEvents,
5+
SingleGesture,
46
SingleGestureName,
57
} from '../../types';
68
import { useGesture } from '../useGesture';
@@ -24,3 +26,9 @@ export function useManual(config: ManualGestureConfig) {
2426

2527
return useGesture(SingleGestureName.Manual, manualConfig);
2628
}
29+
30+
export type ManualGestureEvent = GestureEvents<ManualHandlerData>;
31+
export type ManualGesture = SingleGesture<
32+
ManualHandlerData,
33+
ManualGestureProperties
34+
>;

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import {
22
BaseGestureConfig,
33
ExcludeInternalConfigProps,
4+
GestureEvents,
5+
SingleGesture,
46
SingleGestureName,
57
} from '../../types';
68
import { useGesture } from '../useGesture';
@@ -42,3 +44,9 @@ export function useNative(config: NativeViewGestureConfig) {
4244

4345
return useGesture(SingleGestureName.Native, nativeConfig);
4446
}
47+
48+
export type NativeGestureEvent = GestureEvents<NativeViewHandlerData>;
49+
export type NativeGesture = SingleGesture<
50+
NativeViewHandlerData,
51+
NativeViewGestureProperties
52+
>;

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ import {
33
BaseGestureConfig,
44
ExcludeInternalConfigProps,
55
HandlerData,
6+
GestureEvents,
7+
SingleGesture,
68
SingleGestureName,
79
} from '../../types';
810
import { useGesture } from '../useGesture';
@@ -273,3 +275,6 @@ export function usePan(config: PanGestureConfig) {
273275
panConfig
274276
);
275277
}
278+
279+
export type PanGestureEvent = GestureEvents<PanHandlerData>;
280+
export type PanGesture = SingleGesture<PanHandlerData, PanGestureProperties>;

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ import {
22
BaseGestureConfig,
33
ExcludeInternalConfigProps,
44
HandlerData,
5+
GestureEvents,
6+
SingleGesture,
57
SingleGestureName,
68
} from '../../types';
79
import { useGesture } from '../useGesture';
@@ -44,3 +46,9 @@ export function usePinch(config: PinchGestureConfig) {
4446

4547
return useGesture(SingleGestureName.Pinch, pinchConfig);
4648
}
49+
50+
export type PinchGestureEvent = GestureEvents<PinchHandlerData>;
51+
export type PinchGesture = SingleGesture<
52+
PinchHandlerData,
53+
PinchGestureProperties
54+
>;

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ import {
22
BaseGestureConfig,
33
ExcludeInternalConfigProps,
44
HandlerData,
5+
GestureEvents,
6+
SingleGesture,
57
SingleGestureName,
68
} from '../../types';
79
import { useGesture } from '../useGesture';
@@ -46,3 +48,9 @@ export function useRotation(config: RotationGestureConfig) {
4648

4749
return useGesture(SingleGestureName.Rotation, rotationConfig);
4850
}
51+
52+
export type RotationGestureEvent = GestureEvents<RotationHandlerData>;
53+
export type RotationGesture = SingleGesture<
54+
RotationHandlerData,
55+
RotationGestureProperties
56+
>;

0 commit comments

Comments
 (0)