diff --git a/apps/basic-example/src/NativeDetector.tsx b/apps/basic-example/src/NativeDetector.tsx index c6ee6ef8b8..da305734c9 100644 --- a/apps/basic-example/src/NativeDetector.tsx +++ b/apps/basic-example/src/NativeDetector.tsx @@ -3,8 +3,7 @@ import { Animated, Button, useAnimatedValue } from 'react-native'; import { GestureHandlerRootView, NativeDetector, - SingleGestureName, - useGesture, + usePan, } from 'react-native-gesture-handler'; export default function App() { @@ -18,7 +17,7 @@ export default function App() { } ); - const gesture = useGesture(SingleGestureName.Pan, { + const gesture = usePan({ onUpdate: event, }); diff --git a/apps/common-app/src/new_api/drag_n_drop/Draggable.tsx b/apps/common-app/src/new_api/drag_n_drop/Draggable.tsx index 81f92a4471..9b70bfcaca 100644 --- a/apps/common-app/src/new_api/drag_n_drop/Draggable.tsx +++ b/apps/common-app/src/new_api/drag_n_drop/Draggable.tsx @@ -4,8 +4,8 @@ import { PanGestureHandlerEventPayload, Gesture, GestureDetector, - PanGesture, - TapGesture, + LegacyPanGesture, + LegacyTapGesture, } from 'react-native-gesture-handler'; import Animated, { runOnJS, useAnimatedStyle } from 'react-native-reanimated'; @@ -22,8 +22,8 @@ interface DraggableProps { isActive: boolean; translation: AnimatedPostion; position: { x: number; y: number }; - dragGesture: PanGesture; - tapEndGesture: TapGesture; + dragGesture: LegacyPanGesture; + tapEndGesture: LegacyTapGesture; tileSize: number; rowGap: number; columnGap: number; diff --git a/packages/react-native-gesture-handler/src/__tests__/Events.test.tsx b/packages/react-native-gesture-handler/src/__tests__/Events.test.tsx index 89568044f8..9f57a508ec 100644 --- a/packages/react-native-gesture-handler/src/__tests__/Events.test.tsx +++ b/packages/react-native-gesture-handler/src/__tests__/Events.test.tsx @@ -13,8 +13,8 @@ import { Gesture, GestureDetector, State, - PanGesture, - TapGesture, + LegacyPanGesture, + LegacyTapGesture, } from '../index'; import { useAnimatedGestureHandler } from 'react-native-reanimated'; import { fireGestureHandler, getByGestureTestId } from '../jestUtils'; @@ -300,7 +300,7 @@ describe('Using RNGH v2 gesture API', () => { ); - fireGestureHandler(getByGestureTestId('pan'), [ + fireGestureHandler(getByGestureTestId('pan'), [ { state: State.BEGAN }, { state: State.ACTIVE }, { state: State.END }, @@ -315,7 +315,7 @@ describe('Using RNGH v2 gesture API', () => { test('sends events with additional data to handlers', () => { const panHandlers = mockedEventHandlers(); render(); - fireGestureHandler(getByGestureTestId('pan'), [ + fireGestureHandler(getByGestureTestId('pan'), [ { state: State.BEGAN, translationX: 0 }, { state: State.ACTIVE, translationX: 10 }, { translationX: 20 }, @@ -358,7 +358,7 @@ describe('Event list validation', () => { const panHandlers = mockedEventHandlers(); render(); expect(() => { - fireGestureHandler(getByGestureTestId('pan'), [ + fireGestureHandler(getByGestureTestId('pan'), [ { oldState: State.UNDETERMINED, state: State.BEGAN, x: 0, y: 10 }, { oldState: State.UNDETERMINED, state: State.ACTIVE, x: 1, y: 11 }, ]); @@ -372,7 +372,7 @@ describe('Event list validation', () => { (lastState) => { const panHandlers = mockedEventHandlers(); render(); - fireGestureHandler(getByGestureTestId('pan'), [ + fireGestureHandler(getByGestureTestId('pan'), [ { state: State.BEGAN }, { state: State.ACTIVE }, { state: lastState }, @@ -452,7 +452,7 @@ describe('Filling event list with defaults', () => { test('fills missing ACTIVE states', () => { const panHandlers = mockedEventHandlers(); render(); - fireGestureHandler(getByGestureTestId('pan'), [ + fireGestureHandler(getByGestureTestId('pan'), [ { state: State.BEGAN, x: 0, y: 10 }, { state: State.ACTIVE, x: 1, y: 11 }, { x: 2, y: 12 }, @@ -469,7 +469,7 @@ describe('Filling event list with defaults', () => { test('fills BEGIN and END events for discrete handlers', () => { const handlers = mockedEventHandlers(); render(); - fireGestureHandler(getByGestureTestId('tap'), [{ x: 5 }]); + fireGestureHandler(getByGestureTestId('tap'), [{ x: 5 }]); expect(handlers.begin).toHaveBeenCalledTimes(1); expect(handlers.end).toHaveBeenCalledTimes(1); }); @@ -477,7 +477,7 @@ describe('Filling event list with defaults', () => { test('with FAILED event, fills BEGIN event for discrete handlers', () => { const handlers = mockedEventHandlers(); render(); - fireGestureHandler(getByGestureTestId('tap'), [ + fireGestureHandler(getByGestureTestId('tap'), [ { state: State.FAILED }, ]); expect(handlers.begin).toHaveBeenCalledTimes(1); @@ -488,7 +488,9 @@ describe('Filling event list with defaults', () => { test('uses event data from first event in filled BEGIN, ACTIVE events', () => { const handlers = mockedEventHandlers(); render(); - fireGestureHandler(getByGestureTestId('pan'), [{ x: 120 }]); + fireGestureHandler(getByGestureTestId('pan'), [ + { x: 120 }, + ]); expect(handlers.begin).toHaveBeenCalledWith( expect.objectContaining({ x: 120 }) ); @@ -501,7 +503,7 @@ describe('Filling event list with defaults', () => { test('uses event data from last event in filled END events', () => { const handlers = mockedEventHandlers(); render(); - fireGestureHandler(getByGestureTestId('pan'), [ + fireGestureHandler(getByGestureTestId('pan'), [ { x: 120, state: State.FAILED }, ]); expect(handlers.begin).toHaveBeenCalledTimes(1); @@ -515,7 +517,7 @@ describe('Filling event list with defaults', () => { test('uses event data filled events', () => { const handlers = mockedEventHandlers(); render(); - fireGestureHandler(getByGestureTestId('pan'), [ + fireGestureHandler(getByGestureTestId('pan'), [ { x: 5, y: 15 }, { x: 6, y: 16 }, { x: 7, y: 17 }, @@ -533,7 +535,7 @@ describe('Filling event list with defaults', () => { test("fills BEGIN and END events when they're not present, for discrete handlers", () => { const handlers = mockedEventHandlers(); render(); - fireGestureHandler(getByGestureTestId('tap')); + fireGestureHandler(getByGestureTestId('tap')); expect(handlers.begin).toHaveBeenCalledTimes(1); expect(handlers.end).toHaveBeenCalledTimes(1); }); @@ -541,7 +543,7 @@ describe('Filling event list with defaults', () => { test("fills BEGIN, ACTIVE and END events when they're not present, for continuous handlers", () => { const handlers = mockedEventHandlers(); render(); - fireGestureHandler(getByGestureTestId('pan')); + fireGestureHandler(getByGestureTestId('pan')); expect(handlers.begin).toHaveBeenCalledTimes(1); expect(handlers.active).toHaveBeenCalledTimes(1); expect(handlers.end).toHaveBeenCalledTimes(1); diff --git a/packages/react-native-gesture-handler/src/index.ts b/packages/react-native-gesture-handler/src/index.ts index a6c170e1fd..0e5059addc 100644 --- a/packages/react-native-gesture-handler/src/index.ts +++ b/packages/react-native-gesture-handler/src/index.ts @@ -54,20 +54,20 @@ export { default as createNativeWrapper } from './handlers/createNativeWrapper'; export type { NativeViewGestureHandlerProps } from './handlers/NativeViewGestureHandler'; export { GestureDetector } from './handlers/gestures/GestureDetector'; export { GestureObjects as Gesture } from './handlers/gestures/gestureObjects'; -export type { TapGestureType as TapGesture } from './handlers/gestures/tapGesture'; -export type { PanGestureType as PanGesture } from './handlers/gestures/panGesture'; -export type { FlingGestureType as FlingGesture } from './handlers/gestures/flingGesture'; -export type { LongPressGestureType as LongPressGesture } from './handlers/gestures/longPressGesture'; -export type { PinchGestureType as PinchGesture } from './handlers/gestures/pinchGesture'; -export type { RotationGestureType as RotationGesture } from './handlers/gestures/rotationGesture'; -export type { ForceTouchGestureType as ForceTouchGesture } from './handlers/gestures/forceTouchGesture'; -export type { ManualGestureType as ManualGesture } from './handlers/gestures/manualGesture'; -export type { HoverGestureType as HoverGesture } from './handlers/gestures/hoverGesture'; +export type { TapGestureType as LegacyTapGesture } from './handlers/gestures/tapGesture'; +export type { PanGestureType as LegacyPanGesture } from './handlers/gestures/panGesture'; +export type { FlingGestureType as LegacyFlingGesture } from './handlers/gestures/flingGesture'; +export type { LongPressGestureType as LegacyLongPressGesture } from './handlers/gestures/longPressGesture'; +export type { PinchGestureType as LegacyPinchGesture } from './handlers/gestures/pinchGesture'; +export type { RotationGestureType as LegacyRotationGesture } from './handlers/gestures/rotationGesture'; +export type { ForceTouchGestureType as LegacyForceTouchGesture } from './handlers/gestures/forceTouchGesture'; +export type { ManualGestureType as LegacyManualGesture } from './handlers/gestures/manualGesture'; +export type { HoverGestureType as LegacyHoverGesture } from './handlers/gestures/hoverGesture'; export type { - ComposedGestureType as ComposedGesture, - RaceGestureType as RaceGesture, - SimultaneousGestureType as SimultaneousGesture, - ExclusiveGestureType as ExclusiveGesture, + ComposedGestureType as LegacyComposedGesture, + RaceGestureType as LegacyRaceGesture, + SimultaneousGestureType as LegacySimultaneousGesture, + ExclusiveGestureType as LegacyExclusiveGesture, } from './handlers/gestures/gestureComposition'; export type { GestureStateManagerType as GestureStateManager } from './handlers/gestures/gestureStateManager'; export { NativeViewGestureHandler } from './handlers/NativeViewGestureHandler'; @@ -157,7 +157,8 @@ export { LogicDetector } from './v3/LogicDetector'; export * from './v3/hooks/useGesture'; export * from './v3/hooks/relations'; -export { SingleGestureName } from './v3/types'; +export type { ComposedGesture } from './v3/types'; +export type { GestureTouchEvent as SingleGestureTouchEvent } from './handlers/gestureHandlerCommon'; export * from './v3/hooks/gestures'; diff --git a/packages/react-native-gesture-handler/src/v3/hooks/gestures/fling/useFling.ts b/packages/react-native-gesture-handler/src/v3/hooks/gestures/fling/useFling.ts index 4f06ef17ab..f98656f10e 100644 --- a/packages/react-native-gesture-handler/src/v3/hooks/gestures/fling/useFling.ts +++ b/packages/react-native-gesture-handler/src/v3/hooks/gestures/fling/useFling.ts @@ -1,8 +1,11 @@ import { BaseGestureConfig, ExcludeInternalConfigProps, + SingleGesture, SingleGestureName, WithSharedValue, + GestureStateChangeEvent, + GestureUpdateEvent, } from '../../../types'; import { useGesture } from '../../useGesture'; import { cloneConfig } from '../../utils'; @@ -32,3 +35,12 @@ export function useFling(config: FlingGestureConfig) { return useGesture(SingleGestureName.Fling, flingConfig); } + +export type FlingGestureStateChangeEvent = + GestureStateChangeEvent; +export type FlingGestureUpdateEvent = GestureUpdateEvent; + +export type FlingGesture = SingleGesture< + FlingHandlerData, + FlingGestureProperties +>; diff --git a/packages/react-native-gesture-handler/src/v3/hooks/gestures/hover/useHover.ts b/packages/react-native-gesture-handler/src/v3/hooks/gestures/hover/useHover.ts index c0a611304b..6f51060dfa 100644 --- a/packages/react-native-gesture-handler/src/v3/hooks/gestures/hover/useHover.ts +++ b/packages/react-native-gesture-handler/src/v3/hooks/gestures/hover/useHover.ts @@ -3,9 +3,12 @@ import { HoverEffect } from '../../../../handlers/gestures/hoverGesture'; import { BaseGestureConfig, ExcludeInternalConfigProps, + SingleGesture, HandlerData, SingleGestureName, WithSharedValue, + GestureStateChangeEvent, + GestureUpdateEvent, } from '../../../types'; import { useGesture } from '../../useGesture'; import { cloneConfig, getChangeEventCalculator } from '../../utils'; @@ -54,3 +57,12 @@ export function useHover(config: HoverGestureConfig) { return useGesture(SingleGestureName.Hover, hoverConfig); } + +export type HoverGestureStateChangeEvent = + GestureStateChangeEvent; +export type HoverGestureUpdateEvent = GestureUpdateEvent; + +export type HoverGesture = SingleGesture< + HoverHandlerData, + HoverGestureProperties +>; diff --git a/packages/react-native-gesture-handler/src/v3/hooks/gestures/index.ts b/packages/react-native-gesture-handler/src/v3/hooks/gestures/index.ts index eab3ab4690..f98ea3bbb4 100644 --- a/packages/react-native-gesture-handler/src/v3/hooks/gestures/index.ts +++ b/packages/react-native-gesture-handler/src/v3/hooks/gestures/index.ts @@ -1,26 +1,140 @@ +import type { + FlingGestureStateChangeEvent, + FlingGestureUpdateEvent, + FlingGesture, +} from './fling/useFling'; +import type { + HoverGestureStateChangeEvent, + HoverGestureUpdateEvent, + HoverGesture, +} from './hover/useHover'; +import type { + LongPressGestureStateChangeEvent, + LongPressGestureUpdateEvent, + LongPressGesture, +} from './longPress/useLongPress'; +import type { + ManualGestureStateChangeEvent, + ManualGestureUpdateEvent, + ManualGesture, +} from './manual/useManual'; +import type { + NativeGestureStateChangeEvent, + NativeGestureUpdateEvent, + NativeGesture, +} from './native/useNative'; +import type { + PanGestureStateChangeEvent, + PanGestureUpdateEvent, + PanGesture, +} from './pan/usePan'; +import type { + PinchGestureStateChangeEvent, + PinchGestureUpdateEvent, + PinchGesture, +} from './pinch/usePinch'; +import type { + RotationGestureStateChangeEvent, + RotationGestureUpdateEvent, + RotationGesture, +} from './rotation/useRotation'; +import type { + TapGestureStateChangeEvent, + TapGestureUpdateEvent, + TapGesture, +} from './tap/useTap'; + export type { TapGestureConfig } from './tap/useTap'; +export type { TapGesture, TapGestureStateChangeEvent, TapGestureUpdateEvent }; export { useTap } from './tap/useTap'; export type { FlingGestureConfig } from './fling/useFling'; +export type { + FlingGesture, + FlingGestureStateChangeEvent, + FlingGestureUpdateEvent, +}; export { useFling } from './fling/useFling'; export type { LongPressGestureConfig } from './longPress/useLongPress'; +export type { + LongPressGesture, + LongPressGestureStateChangeEvent, + LongPressGestureUpdateEvent, +}; export { useLongPress } from './longPress/useLongPress'; export type { PinchGestureConfig } from './pinch/usePinch'; +export type { + PinchGesture, + PinchGestureStateChangeEvent, + PinchGestureUpdateEvent, +}; export { usePinch } from './pinch/usePinch'; export type { RotationGestureConfig } from './rotation/useRotation'; +export type { + RotationGesture, + RotationGestureStateChangeEvent, + RotationGestureUpdateEvent, +}; export { useRotation } from './rotation/useRotation'; export type { HoverGestureConfig } from './hover/useHover'; +export type { + HoverGesture, + HoverGestureStateChangeEvent, + HoverGestureUpdateEvent, +}; export { useHover } from './hover/useHover'; export type { ManualGestureConfig } from './manual/useManual'; +export type { + ManualGesture, + ManualGestureStateChangeEvent, + ManualGestureUpdateEvent, +}; export { useManual } from './manual/useManual'; export type { NativeViewGestureConfig } from './native/useNative'; +export type { + NativeGesture, + NativeGestureStateChangeEvent, + NativeGestureUpdateEvent, +}; export { useNative } from './native/useNative'; export type { PanGestureConfig } from './pan/usePan'; +export type { PanGesture, PanGestureStateChangeEvent, PanGestureUpdateEvent }; export { usePan } from './pan/usePan'; + +export type SingleGesture = + | TapGesture + | FlingGesture + | LongPressGesture + | PinchGesture + | RotationGesture + | HoverGesture + | ManualGesture + | NativeGesture + | PanGesture; + +export type SingleGestureStateChangeEvent = + | TapGestureStateChangeEvent + | FlingGestureStateChangeEvent + | LongPressGestureStateChangeEvent + | RotationGestureStateChangeEvent + | HoverGestureStateChangeEvent + | ManualGestureStateChangeEvent + | NativeGestureStateChangeEvent + | PanGestureStateChangeEvent; + +export type SingleGestureUpdateEvent = + | TapGestureUpdateEvent + | FlingGestureUpdateEvent + | LongPressGestureUpdateEvent + | RotationGestureUpdateEvent + | HoverGestureUpdateEvent + | ManualGestureUpdateEvent + | NativeGestureUpdateEvent + | PanGestureUpdateEvent; diff --git a/packages/react-native-gesture-handler/src/v3/hooks/gestures/longPress/useLongPress.ts b/packages/react-native-gesture-handler/src/v3/hooks/gestures/longPress/useLongPress.ts index 932214f07b..ace5b20edb 100644 --- a/packages/react-native-gesture-handler/src/v3/hooks/gestures/longPress/useLongPress.ts +++ b/packages/react-native-gesture-handler/src/v3/hooks/gestures/longPress/useLongPress.ts @@ -1,8 +1,11 @@ import { BaseGestureConfig, ExcludeInternalConfigProps, + SingleGesture, SingleGestureName, WithSharedValue, + GestureStateChangeEvent, + GestureUpdateEvent, } from '../../../types'; import { useGesture } from '../../useGesture'; import { cloneConfig, remapProps } from '../../utils'; @@ -62,3 +65,13 @@ export function useLongPress(config: LongPressGestureConfig) { longPressConfig ); } + +export type LongPressGestureStateChangeEvent = + GestureStateChangeEvent; +export type LongPressGestureUpdateEvent = + GestureUpdateEvent; + +export type LongPressGesture = SingleGesture< + LongPressHandlerData, + LongPressGestureProperties +>; diff --git a/packages/react-native-gesture-handler/src/v3/hooks/gestures/manual/useManual.ts b/packages/react-native-gesture-handler/src/v3/hooks/gestures/manual/useManual.ts index 86ef77a710..873d2cf3ae 100644 --- a/packages/react-native-gesture-handler/src/v3/hooks/gestures/manual/useManual.ts +++ b/packages/react-native-gesture-handler/src/v3/hooks/gestures/manual/useManual.ts @@ -1,7 +1,10 @@ import { BaseGestureConfig, ExcludeInternalConfigProps, + SingleGesture, SingleGestureName, + GestureStateChangeEvent, + GestureUpdateEvent, } from '../../../types'; import { useGesture } from '../../useGesture'; import { cloneConfig } from '../../utils'; @@ -25,3 +28,12 @@ export function useManual(config: ManualGestureConfig) { return useGesture(SingleGestureName.Manual, manualConfig); } + +export type ManualGestureStateChangeEvent = + GestureStateChangeEvent; +export type ManualGestureUpdateEvent = GestureUpdateEvent; + +export type ManualGesture = SingleGesture< + ManualHandlerData, + ManualGestureProperties +>; diff --git a/packages/react-native-gesture-handler/src/v3/hooks/gestures/native/useNative.ts b/packages/react-native-gesture-handler/src/v3/hooks/gestures/native/useNative.ts index c68ff92fd6..0ca8d96d5b 100644 --- a/packages/react-native-gesture-handler/src/v3/hooks/gestures/native/useNative.ts +++ b/packages/react-native-gesture-handler/src/v3/hooks/gestures/native/useNative.ts @@ -1,8 +1,11 @@ import { BaseGestureConfig, ExcludeInternalConfigProps, + SingleGesture, SingleGestureName, WithSharedValue, + GestureStateChangeEvent, + GestureUpdateEvent, } from '../../../types'; import { useGesture } from '../../useGesture'; import { cloneConfig } from '../../utils'; @@ -31,3 +34,13 @@ export function useNative(config: NativeViewGestureConfig) { return useGesture(SingleGestureName.Native, nativeConfig); } + +export type NativeGestureStateChangeEvent = + GestureStateChangeEvent; +export type NativeGestureUpdateEvent = + GestureUpdateEvent; + +export type NativeGesture = SingleGesture< + NativeViewHandlerData, + NativeViewGestureProperties +>; diff --git a/packages/react-native-gesture-handler/src/v3/hooks/gestures/pan/usePan.ts b/packages/react-native-gesture-handler/src/v3/hooks/gestures/pan/usePan.ts index 323533ce8c..7cd81de845 100644 --- a/packages/react-native-gesture-handler/src/v3/hooks/gestures/pan/usePan.ts +++ b/packages/react-native-gesture-handler/src/v3/hooks/gestures/pan/usePan.ts @@ -2,9 +2,12 @@ import { StylusData } from '../../../../handlers/gestureHandlerCommon'; import { BaseGestureConfig, ExcludeInternalConfigProps, + SingleGesture, HandlerData, SingleGestureName, WithSharedValue, + GestureStateChangeEvent, + GestureUpdateEvent, } from '../../../types'; import { useGesture } from '../../useGesture'; import { @@ -174,3 +177,9 @@ export function usePan(config: PanGestureConfig) { panConfig ); } + +export type PanGestureStateChangeEvent = + GestureStateChangeEvent; +export type PanGestureUpdateEvent = GestureUpdateEvent; + +export type PanGesture = SingleGesture; diff --git a/packages/react-native-gesture-handler/src/v3/hooks/gestures/pinch/usePinch.ts b/packages/react-native-gesture-handler/src/v3/hooks/gestures/pinch/usePinch.ts index 1bbe9a9294..26f55ef749 100644 --- a/packages/react-native-gesture-handler/src/v3/hooks/gestures/pinch/usePinch.ts +++ b/packages/react-native-gesture-handler/src/v3/hooks/gestures/pinch/usePinch.ts @@ -1,8 +1,11 @@ import { BaseGestureConfig, ExcludeInternalConfigProps, + SingleGesture, HandlerData, SingleGestureName, + GestureUpdateEvent, + GestureStateChangeEvent, } from '../../../types'; import { useGesture } from '../../useGesture'; import { cloneConfig, getChangeEventCalculator } from '../../utils'; @@ -45,3 +48,12 @@ export function usePinch(config: PinchGestureConfig) { return useGesture(SingleGestureName.Pinch, pinchConfig); } + +export type PinchGestureStateChangeEvent = + GestureStateChangeEvent; +export type PinchGestureUpdateEvent = GestureUpdateEvent; + +export type PinchGesture = SingleGesture< + PinchHandlerData, + PinchGestureProperties +>; diff --git a/packages/react-native-gesture-handler/src/v3/hooks/gestures/rotation/useRotation.ts b/packages/react-native-gesture-handler/src/v3/hooks/gestures/rotation/useRotation.ts index 1dd10b2adb..3893cafb10 100644 --- a/packages/react-native-gesture-handler/src/v3/hooks/gestures/rotation/useRotation.ts +++ b/packages/react-native-gesture-handler/src/v3/hooks/gestures/rotation/useRotation.ts @@ -1,8 +1,11 @@ import { BaseGestureConfig, ExcludeInternalConfigProps, + SingleGesture, HandlerData, SingleGestureName, + GestureStateChangeEvent, + GestureUpdateEvent, } from '../../../types'; import { useGesture } from '../../useGesture'; import { cloneConfig, getChangeEventCalculator } from '../../utils'; @@ -49,3 +52,13 @@ export function useRotation(config: RotationGestureConfig) { return useGesture(SingleGestureName.Rotation, rotationConfig); } + +export type RotationGestureStateChangeEvent = + GestureStateChangeEvent; +export type RotationGestureUpdateEvent = + GestureUpdateEvent; + +export type RotationGesture = SingleGesture< + RotationHandlerData, + RotationGestureProperties +>; diff --git a/packages/react-native-gesture-handler/src/v3/hooks/gestures/tap/useTap.ts b/packages/react-native-gesture-handler/src/v3/hooks/gestures/tap/useTap.ts index 04c1e0670e..74387c08b3 100644 --- a/packages/react-native-gesture-handler/src/v3/hooks/gestures/tap/useTap.ts +++ b/packages/react-native-gesture-handler/src/v3/hooks/gestures/tap/useTap.ts @@ -1,6 +1,9 @@ import { BaseGestureConfig, ExcludeInternalConfigProps, + GestureStateChangeEvent, + GestureUpdateEvent, + SingleGesture, SingleGestureName, WithSharedValue, } from '../../../types'; @@ -55,3 +58,9 @@ export function useTap(config: TapGestureConfig) { tapConfig ); } + +export type TapGestureStateChangeEvent = + GestureStateChangeEvent; +export type TapGestureUpdateEvent = GestureUpdateEvent; + +export type TapGesture = SingleGesture;