software-mansion / react-native-gesture-handler

Declarative API exposing platform native touch and gesture system to React Native.
https://docs.swmansion.com/react-native-gesture-handler/
MIT License
5.85k stars 954 forks source link

Minor TS changes #2872

Closed m-bert closed 3 weeks ago

m-bert commented 3 weeks ago

Description

This PR is a successor of #2867 - it solves problems that were present in mentioned PR, namely:

  1. changes type of offset properties of Pan into number | [number, number], so that it is impossible to assign to them something else than number or array with 2 numbers
  2. adds type cast in withPrevAndCurrent function (used in jest)

Test plan

Try to assign something else than number or array of two numbers to any of changed properties - error should appear.