diff --git a/src/components/Lightbox/pager/ImageItem/ImageItem.android.tsx b/src/components/Lightbox/pager/ImageItem/ImageItem.android.tsx index 931a12bd13..62e28523a7 100644 --- a/src/components/Lightbox/pager/ImageItem/ImageItem.android.tsx +++ b/src/components/Lightbox/pager/ImageItem/ImageItem.android.tsx @@ -6,6 +6,7 @@ import { type PanGesture, } from 'react-native-gesture-handler' import Animated, { + type AnimatableValue, runOnJS, type SharedValue, useAnimatedReaction, @@ -460,7 +461,7 @@ function clampTranslation( return clampedValue } -function withClampedSpring(value: any) { +function withClampedSpring(value: T): T { 'worklet' return withSpring(value, {overshootClamping: true}) } diff --git a/src/components/Lightbox/pager/ImagePager.tsx b/src/components/Lightbox/pager/ImagePager.tsx index 80fa346f03..1c8836a0fd 100644 --- a/src/components/Lightbox/pager/ImagePager.tsx +++ b/src/components/Lightbox/pager/ImagePager.tsx @@ -13,6 +13,7 @@ import {SystemBars} from 'react-native-edge-to-edge' import {Gesture} from 'react-native-gesture-handler' import PagerView from 'react-native-pager-view' import Animated, { + type AnimatableValue, type AnimatedRef, cancelAnimation, interpolate, @@ -735,7 +736,10 @@ function interpolateTransform( } } -function withClampedSpring(value: any, config: WithSpringConfig) { +function withClampedSpring( + value: T, + config: WithSpringConfig, +): T { 'worklet' return withSpring(value, {...config, overshootClamping: true}) } diff --git a/src/components/Lightbox/types.ts b/src/components/Lightbox/types.ts index c3aca3d859..19789fdc62 100644 --- a/src/components/Lightbox/types.ts +++ b/src/components/Lightbox/types.ts @@ -6,6 +6,7 @@ * */ +import {type Component} from 'react' import {type TransformsStyle} from 'react-native' import { type AnimatedRef, @@ -28,7 +29,7 @@ export type ImageSource = { thumbUri: string thumbDimensions: Dimensions | null thumbRect: MeasuredDimensions | null - thumbRef?: AnimatedRef | null + thumbRef?: AnimatedRef | null thumbBorderRadius?: number alt?: string type: 'image' | 'circle-avi' | 'rect-avi'