Separating this diff out since there are some significant changes to useAnimatedGestureHandler here, which is a hook from react-native-reanimated.
In fact this hook does not return a function. However, the TypeScript types for react-native-gesture-handler requires that onGestureEvent takes a function. As a result, in the linked code you can see that react-native-reanimated types the return of useAnimatedGestureHandler as a function, even though it is not. We do the same here.
I'll annotate some of the changes in this diff inline.
Depends on D10003