File tree Expand file tree Collapse file tree
reason-react-native/src/apis Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -91,6 +91,8 @@ function reset(prim) {
9191 return /* () */ 0 ;
9292}
9393
94+ var StyleProp = /* module */ [ ] ;
95+
9496var make = ReactNative . Animated . createAnimatedComponent ( ReactNative . Image ) ;
9597
9698var $$Image = /* module */ [
@@ -124,6 +126,7 @@ exports.decay = decay;
124126exports . start = start ;
125127exports . stop = stop ;
126128exports . reset = reset ;
129+ exports . StyleProp = StyleProp ;
127130exports . $$Image = $$Image ;
128131exports . ScrollView = ScrollView ;
129132exports . $$Text = $$Text ;
Original file line number Diff line number Diff line change @@ -268,9 +268,25 @@ let stop = Animation.stop;
268268
269269let reset = Animation.reset;
270270
271- // Unsafe, unfortunately, but allows us to pass animated values everywhere.
272- // May be refined later.
273- external animatedStyle: value('a) => 'b = "%identity";
271+ module StyleProp = {
272+ // methods to allow use of Animated values with Style props
273+
274+ // these methods should not be used to get the current value
275+
276+ // for angle, Color.t, and size expressed as percentage,
277+ // interpolated values are needed where the outputRange is
278+ // an appropriate array of strings
279+
280+ external float: value('a) => float = "%identity";
281+ external angle: value(calculated) => Transform.angle = "%identity";
282+ external size: value('a) => Style.size = "%identity";
283+ external margin: value('a) => Style.margin = "%identity";
284+ external color: value(calculated) => Color.t = "%identity";
285+
286+ // UNSAFE: allows to pass animated values everywhere,
287+ // use of more precise methods above is recommended
288+ external unsafeAny: value('a) => 'b = "%identity";
289+ };
274290
275291module Image = {
276292 include Image;
Original file line number Diff line number Diff line change @@ -261,9 +261,25 @@ let stop = Animation.stop;
261261
262262let reset = Animation . reset;
263263
264- // Unsafe, unfortunately, but allows us to pass animated values everywhere.
265- // May be refined later.
266- external animatedStyle : value (' a ) => ' b = "% identity " ;
264+ module StyleProp = {
265+ // methods to allow use of Animated values with Style props
266+
267+ // these methods should not be used to get the current value
268+
269+ // for angle, Color.t, and size expressed as percentage,
270+ // interpolated values are needed where the outputRange is
271+ // an appropriate array of strings
272+
273+ external float : value (' a ) => float = "% identity " ;
274+ external angle : value (calculated ) => Transform . angle = "% identity " ;
275+ external size : value (' a ) => Style . size = "% identity " ;
276+ external margin : value (' a ) => Style . margin = "% identity " ;
277+ external color : value (calculated ) => Color . t = "% identity " ;
278+
279+ // UNSAFE: allows to pass animated values everywhere,
280+ // use of more precise methods above is recommended
281+ external unsafeAny : value (' a ) => ' b = "% identity " ;
282+ };
267283
268284module Image = {
269285 include Image ;
You can’t perform that action at this time.
0 commit comments