Skip to content
28 changes: 14 additions & 14 deletions packages/react-native-gesture-handler/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 } from './handlers/gestures/tapGesture';
export type { PanGestureType } from './handlers/gestures/panGesture';
export type { FlingGestureType } from './handlers/gestures/flingGesture';
export type { LongPressGestureType } from './handlers/gestures/longPressGesture';
export type { PinchGestureType } from './handlers/gestures/pinchGesture';
export type { RotationGestureType } from './handlers/gestures/rotationGesture';
export type { ForceTouchGestureType } from './handlers/gestures/forceTouchGesture';
export type { ManualGestureType } from './handlers/gestures/manualGesture';
export type { HoverGestureType } from './handlers/gestures/hoverGesture';
export type {
ComposedGestureType as ComposedGesture,
RaceGestureType as RaceGesture,
SimultaneousGestureType as SimultaneousGesture,
ExclusiveGestureType as ExclusiveGesture,
ComposedGestureType,
RaceGestureType,
SimultaneousGestureType,
ExclusiveGestureType,
} from './handlers/gestures/gestureComposition';
export type { GestureStateManagerType as GestureStateManager } from './handlers/gestures/gestureStateManager';
export { NativeViewGestureHandler } from './handlers/NativeViewGestureHandler';
Expand Down Expand Up @@ -168,7 +168,7 @@ export { NativeDetector } from './v3/NativeDetector/NativeDetector';
export * from './v3/hooks/useGesture';
export * from './v3/hooks/relations';

export { SingleGestureName } from './v3/types';
export { SingleGestureName, ComposedGesture } from './v3/types';

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

Expand Down
Original file line number Diff line number Diff line change
@@ -1,26 +1,67 @@
import { FlingGestureEvent, FlingGesture } from './useFling';
import { HoverGestureEvent, HoverGesture } from './useHover';
import { LongPressGestureEvent, LongPressGesture } from './useLongPress';
import { ManualGestureEvent, ManualGesture } from './useManual';
import { NativeGestureEvent, NativeGesture } from './useNative';
import { PanGestureEvent, PanGesture } from './usePan';
import { PinchGestureEvent, PinchGesture } from './usePinch';
import { RotationGestureEvent, RotationGesture } from './useRotation';
import { TapGestureEvent, TapGesture } from './useTap';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this imports only types, please use import type instead of only import

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, done in 704d604


export type { TapGestureConfig } from './useTap';
export type { TapGesture, TapGestureEvent };
export { useTap } from './useTap';

export type { FlingGestureConfig } from './useFling';
export type { FlingGesture, FlingGestureEvent };
export { useFling } from './useFling';

export type { LongPressGestureConfig } from './useLongPress';
export type { LongPressGesture, LongPressGestureEvent };
export { useLongPress } from './useLongPress';

export type { PinchGestureConfig } from './usePinch';
export type { PinchGesture, PinchGestureEvent };
export { usePinch } from './usePinch';

export type { RotationGestureConfig } from './useRotation';
export type { RotationGesture, RotationGestureEvent };
export { useRotation } from './useRotation';

export type { HoverGestureConfig } from './useHover';
export type { HoverGesture, HoverGestureEvent };
export { useHover } from './useHover';

export type { ManualGestureConfig } from './useManual';
export type { ManualGesture, ManualGestureEvent };
export { useManual } from './useManual';

export type { NativeViewGestureConfig } from './useNative';
export type { NativeGesture, NativeGestureEvent };
export { useNative } from './useNative';

export type { PanGestureConfig } from './usePan';
export type { PanGesture, PanGestureEvent };
export { usePan } from './usePan';

export type SingleGesture =
| TapGesture
| FlingGesture
| LongPressGesture
| PinchGesture
| RotationGesture
| HoverGesture
| ManualGesture
| NativeGesture
| PanGesture;

export type SingleGestureEvent =
| TapGestureEvent
| FlingGestureEvent
| LongPressGestureEvent
| PinchGestureEvent
| RotationGestureEvent
| HoverGestureEvent
| ManualGestureEvent
| NativeGestureEvent
| PanGestureEvent;
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import {
BaseGestureConfig,
ExcludeInternalConfigProps,
GestureEvents,
SingleGesture,
SingleGestureName,
} from '../../types';
import { useGesture } from '../useGesture';
Expand Down Expand Up @@ -51,3 +53,9 @@ export function useFling(config: FlingGestureConfig) {

return useGesture(SingleGestureName.Fling, flingConfig);
}

export type FlingGestureEvent = GestureEvents<FlingHandlerData>;
export type FlingGesture = SingleGesture<
FlingHandlerData,
FlingGestureProperties
>;
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import { HoverEffect } from '../../../handlers/gestures/hoverGesture';
import {
BaseGestureConfig,
ExcludeInternalConfigProps,
GestureEvents,
SingleGesture,
SingleGestureName,
} from '../../types';
import { useGesture } from '../useGesture';
Expand Down Expand Up @@ -44,3 +46,9 @@ export function useHover(config: HoverGestureConfig) {

return useGesture(SingleGestureName.Hover, hoverConfig);
}

export type HoverGestureEvent = GestureEvents<HoverHandlerData>;
export type HoverGesture = SingleGesture<
HoverHandlerData,
HoverGestureProperties
>;
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import {
BaseGestureConfig,
ExcludeInternalConfigProps,
GestureEvents,
SingleGesture,
SingleGestureName,
} from '../../types';
import { useGesture } from '../useGesture';
Expand Down Expand Up @@ -78,3 +80,9 @@ export function useLongPress(config: LongPressGestureConfig) {
longPressConfig
);
}

export type LongPressGestureEvent = GestureEvents<LongPressHandlerData>;
export type LongPressGesture = SingleGesture<
LongPressHandlerData,
LongPressGestureProperties
>;
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import {
BaseGestureConfig,
ExcludeInternalConfigProps,
GestureEvents,
SingleGesture,
SingleGestureName,
} from '../../types';
import { useGesture } from '../useGesture';
Expand All @@ -24,3 +26,9 @@ export function useManual(config: ManualGestureConfig) {

return useGesture(SingleGestureName.Manual, manualConfig);
}

export type ManualGestureEvent = GestureEvents<ManualHandlerData>;
export type ManualGesture = SingleGesture<
ManualHandlerData,
ManualGestureProperties
>;
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import {
BaseGestureConfig,
ExcludeInternalConfigProps,
GestureEvents,
SingleGesture,
SingleGestureName,
} from '../../types';
import { useGesture } from '../useGesture';
Expand Down Expand Up @@ -42,3 +44,9 @@ export function useNative(config: NativeViewGestureConfig) {

return useGesture(SingleGestureName.Native, nativeConfig);
}

export type NativeGestureEvent = GestureEvents<NativeViewHandlerData>;
export type NativeGesture = SingleGesture<
NativeViewHandlerData,
NativeViewGestureProperties
>;
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import { StylusData } from '../../../handlers/gestureHandlerCommon';
import {
BaseGestureConfig,
ExcludeInternalConfigProps,
GestureEvents,
SingleGesture,
SingleGestureName,
} from '../../types';
import { useGesture } from '../useGesture';
Expand Down Expand Up @@ -257,3 +259,6 @@ export function usePan(config: PanGestureConfig) {
panConfig
);
}

export type PanGestureEvent = GestureEvents<PanHandlerData>;
export type PanGesture = SingleGesture<PanHandlerData, PanGestureProperties>;
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import {
BaseGestureConfig,
ExcludeInternalConfigProps,
GestureEvents,
SingleGesture,
SingleGestureName,
} from '../../types';
import { useGesture } from '../useGesture';
Expand Down Expand Up @@ -30,3 +32,9 @@ export function usePinch(config: PinchGestureConfig) {

return useGesture(SingleGestureName.Pinch, pinchConfig);
}

export type PinchGestureEvent = GestureEvents<PinchHandlerData>;
export type PinchGesture = SingleGesture<
PinchHandlerData,
PinchGestureProperties
>;
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import {
BaseGestureConfig,
ExcludeInternalConfigProps,
GestureEvents,
SingleGesture,
SingleGestureName,
} from '../../types';
import { useGesture } from '../useGesture';
Expand Down Expand Up @@ -31,3 +33,9 @@ export function useRotation(config: RotationGestureConfig) {

return useGesture(SingleGestureName.Rotation, rotationConfig);
}

export type RotationGestureEvent = GestureEvents<RotationHandlerData>;
export type RotationGesture = SingleGesture<
RotationHandlerData,
RotationGestureProperties
>;
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import {
BaseGestureConfig,
ExcludeInternalConfigProps,
GestureEvents,
SingleGesture,
SingleGestureName,
} from '../../types';
import { useGesture } from '../useGesture';
Expand Down Expand Up @@ -107,3 +109,6 @@ export function useTap(config: TapGestureConfig) {
tapConfig
);
}

export type TapGestureEvent = GestureEvents<TapHandlerData>;
export type TapGesture = SingleGesture<TapHandlerData, TapGestureProperties>;