@@ -55,6 +55,8 @@ module Yoga.React.Native.Reanimated
55 , fadeInDuration
55 , fadeInDuration
56 , fadeOutDuration
56 , fadeOutDuration
57 , readValue
57 , readValue
59+ , useInterpolatedStyle
60import Prelude
62import Prelude
@@ -103,6 +105,22 @@ foreign import useAnimatedStyleImpl :: (Unit -> Style) -> Effect Style
103useAnimatedStyle :: (Unit -> Style) -> Hook UseAnimatedStyle Style
105useAnimatedStyle :: (Unit -> Style) -> Hook UseAnimatedStyle Style
104useAnimatedStyle updater = unsafeHook (useAnimatedStyleImpl updater)
106useAnimatedStyle updater = unsafeHook (useAnimatedStyleImpl updater)
108+-- | Style interpolation config for useInterpolatedStyle.
109+-- | Each entry maps a CSS property name to an interpolation range.
112+ , inputRange :: Array Number
113+ , outputRange :: Array Number
114+ , extrapolation :: ExtrapolationType
117+foreign import useInterpolatedStyleImpl :: SharedValue Number -> Array StyleInterp -> Effect Style
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)
106-- Shared value operations
124-- Shared value operations
108foreign import readSharedValue :: forall a. SharedValue a -> Effect a
126foreign import readSharedValue :: forall a. SharedValue a -> Effect a