diff --git a/packages/docs-gesture-handler/docs/gestures/force-touch-gesture.md b/packages/docs-gesture-handler/docs/gestures/force-touch-gesture.md index c30a224785..2ab6d859da 100644 --- a/packages/docs-gesture-handler/docs/gestures/force-touch-gesture.md +++ b/packages/docs-gesture-handler/docs/gestures/force-touch-gesture.md @@ -5,6 +5,10 @@ sidebar_label: Force touch gesture sidebar_position: 10 --- +:::warning +ForceTouch gesture is depracted and will be removed in the future version of Gesture Handler. +::: + import BaseEventData from './\_shared/base-gesture-event-data.md'; import BaseEventConfig from './\_shared/base-gesture-config.md'; import BaseContinuousEventConfig from './\_shared/base-continuous-gesture-config.md'; diff --git a/packages/react-native-gesture-handler/src/handlers/GestureHandlerEventPayload.ts b/packages/react-native-gesture-handler/src/handlers/GestureHandlerEventPayload.ts index 4ef670f1b4..a5a3e13c1e 100644 --- a/packages/react-native-gesture-handler/src/handlers/GestureHandlerEventPayload.ts +++ b/packages/react-native-gesture-handler/src/handlers/GestureHandlerEventPayload.ts @@ -7,6 +7,9 @@ export type FlingGestureHandlerEventPayload = { absoluteY: number; }; +/** + * @deprecated ForceTouch gesture is deprecated and will be removed in the future. + */ export type ForceTouchGestureHandlerEventPayload = { x: number; y: number; diff --git a/packages/react-native-gesture-handler/src/handlers/gestureHandlerTypesCompat.ts b/packages/react-native-gesture-handler/src/handlers/gestureHandlerTypesCompat.ts index 8e74b71241..050208ba2f 100644 --- a/packages/react-native-gesture-handler/src/handlers/gestureHandlerTypesCompat.ts +++ b/packages/react-native-gesture-handler/src/handlers/gestureHandlerTypesCompat.ts @@ -46,8 +46,14 @@ export type TapGestureHandlerGestureEvent = export type TapGestureHandlerStateChangeEvent = HandlerStateChangeEvent; +/** + * @deprecated ForceTouchGestureHandler is deprecated and will be removed in the future. + */ export type ForceTouchGestureHandlerGestureEvent = GestureEvent; +/** + * @deprecated ForceTouchGestureHandler is deprecated and will be removed in the future. + */ export type ForceTouchGestureHandlerStateChangeEvent = HandlerStateChangeEvent; @@ -84,6 +90,9 @@ export type PanGestureHandlerProperties = PanGestureHandlerProps; export type PinchGestureHandlerProperties = PinchGestureHandlerProps; export type RotationGestureHandlerProperties = RotationGestureHandlerProps; export type FlingGestureHandlerProperties = FlingGestureHandlerProps; +/** + * @deprecated ForceTouch gesture is deprecated and will be removed in the future. + */ export type ForceTouchGestureHandlerProperties = ForceTouchGestureHandlerProps; // Button props export type RawButtonProperties = RawButtonProps; diff --git a/packages/react-native-gesture-handler/src/handlers/gestures/forceTouchGesture.ts b/packages/react-native-gesture-handler/src/handlers/gestures/forceTouchGesture.ts index 7bd1ed73a7..e7122e7339 100644 --- a/packages/react-native-gesture-handler/src/handlers/gestures/forceTouchGesture.ts +++ b/packages/react-native-gesture-handler/src/handlers/gestures/forceTouchGesture.ts @@ -3,6 +3,9 @@ import { ForceTouchGestureConfig } from '../ForceTouchGestureHandler'; import type { ForceTouchGestureHandlerEventPayload } from '../GestureHandlerEventPayload'; import { GestureUpdateEvent } from '../gestureHandlerCommon'; +/** + * @deprecated ForceTouch gesture is deprecated and will be removed in the future. + */ export type ForceTouchGestureChangeEventPayload = { forceChange: number; }; @@ -26,6 +29,9 @@ function changeEventCalculator( return { ...current, ...changePayload }; } +/** + * @deprecated ForceTouch gesture is deprecated and will be removed in the future. + */ export class ForceTouchGesture extends ContinousBaseGesture< ForceTouchGestureHandlerEventPayload, ForceTouchGestureChangeEventPayload @@ -83,4 +89,7 @@ export class ForceTouchGesture extends ContinousBaseGesture< } } +/** + * @deprecated ForceTouch gesture is deprecated and will be removed in the future. + */ export type ForceTouchGestureType = InstanceType; diff --git a/packages/react-native-gesture-handler/src/handlers/gestures/gestureObjects.ts b/packages/react-native-gesture-handler/src/handlers/gestures/gestureObjects.ts index bf773fef60..0ed518a164 100644 --- a/packages/react-native-gesture-handler/src/handlers/gestures/gestureObjects.ts +++ b/packages/react-native-gesture-handler/src/handlers/gestures/gestureObjects.ts @@ -73,7 +73,9 @@ export const GestureObjects = { }, /** - * #### iOS only + * @deprecated ForceTouch gesture is deprecated and will be removed in the future. + * + * #### iOS only * A continuous gesture that recognizes force of a touch. It allows for tracking pressure of touch on some iOS devices. * @see https://docs.swmansion.com/react-native-gesture-handler/docs/gestures/force-touch-gesture */