From b9df812b67a22d459e85511962ac507a80f67f29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dawid=20Ma=C5=82ecki?= Date: Fri, 17 Jan 2025 07:27:42 -0800 Subject: [PATCH] Added types in TouchHistoryMath (#48730) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/48730 Changelog: [General][Changed] - Added types in TouchHistoryMath Reviewed By: rshest Differential Revision: D68271085 fbshipit-source-id: b5ce3134d7bd7cb23b94761079d1d7753aaa97c1 --- .../Libraries/Interaction/TouchHistoryMath.js | 26 +++++++++++++++++++ .../__snapshots__/public-api-test.js.snap | 2 +- 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/packages/react-native/Libraries/Interaction/TouchHistoryMath.js b/packages/react-native/Libraries/Interaction/TouchHistoryMath.js index 331737a054667a..ff51f8f3073301 100644 --- a/packages/react-native/Libraries/Interaction/TouchHistoryMath.js +++ b/packages/react-native/Libraries/Interaction/TouchHistoryMath.js @@ -151,6 +151,32 @@ const TouchHistoryMath = { }, noCentroid: -1, +} as { + centroidDimension: ( + touchHistory: TouchHistoryMath, + touchesChangedAfter: number, + isXAxis: boolean, + ofCurrent: boolean, + ) => number, + currentCentroidXOfTouchesChangedAfter: ( + touchHistory: TouchHistoryMath, + touchesChangedAfter: number, + ) => number, + currentCentroidYOfTouchesChangedAfter: ( + touchHistory: TouchHistoryMath, + touchesChangedAfter: number, + ) => number, + previousCentroidXOfTouchesChangedAfter: ( + touchHistory: TouchHistoryMath, + touchesChangedAfter: number, + ) => number, + previousCentroidYOfTouchesChangedAfter: ( + touchHistory: TouchHistoryMath, + touchesChangedAfter: number, + ) => number, + currentCentroidX: (touchHistory: TouchHistoryMath) => number, + currentCentroidY: (touchHistory: TouchHistoryMath) => number, + noCentroid: number, }; module.exports = TouchHistoryMath; diff --git a/packages/react-native/Libraries/__tests__/__snapshots__/public-api-test.js.snap b/packages/react-native/Libraries/__tests__/__snapshots__/public-api-test.js.snap index 28bfe0a27f00dd..e4d1ea8fccacfb 100644 --- a/packages/react-native/Libraries/__tests__/__snapshots__/public-api-test.js.snap +++ b/packages/react-native/Libraries/__tests__/__snapshots__/public-api-test.js.snap @@ -5539,7 +5539,7 @@ exports[`public API should not change unintentionally Libraries/Interaction/Touc ) => number, currentCentroidX: (touchHistory: TouchHistoryMath) => number, currentCentroidY: (touchHistory: TouchHistoryMath) => number, - noCentroid: $FlowFixMe, + noCentroid: number, }; declare module.exports: TouchHistoryMath; "