@@ -55,6 +55,8 @@ module Yoga.React.Native.Reanimated
5555 , fadeInDuration
5656 , fadeOutDuration
5757 , readValue
58+ , StyleInterp
59+ , useInterpolatedStyle
5860 ) where
5961
6062import Prelude
@@ -103,6 +105,22 @@ foreign import useAnimatedStyleImpl :: (Unit -> Style) -> Effect Style
103105useAnimatedStyle :: (Unit -> Style) -> Hook UseAnimatedStyle Style
104106useAnimatedStyle updater = unsafeHook (useAnimatedStyleImpl updater)
105107
108+-- | Style interpolation config for useInterpolatedStyle.
109+-- | Each entry maps a CSS property name to an interpolation range.
110+type StyleInterp =
111+ { prop :: String
112+ , inputRange :: Array Number
113+ , outputRange :: Array Number
114+ , extrapolation :: ExtrapolationType
115+ }
116+
117+foreign import useInterpolatedStyleImpl :: SharedValue Number -> Array StyleInterp -> Effect Style
118+
119+-- | Hook that interpolates a shared value into style properties inside a worklet.
120+-- | Use this instead of useAnimatedStyle when you need .value reads to be tracked.
121+useInterpolatedStyle :: SharedValue Number -> Array StyleInterp -> Hook UseAnimatedStyle Style
122+useInterpolatedStyle sv styleMap = unsafeHook (useInterpolatedStyleImpl sv styleMap)
123+
106124-- Shared value operations
107125
108126foreign import readSharedValue :: forall a. SharedValue a -> Effect a