@@ -3,9 +3,8 @@ module Animation = {
33 type endResult = {. "finished": bool };
44 type endCallback = endResult => unit ;
55 [@ bs . send ]
6- external _start : (t , Js . undefined (endCallback )) => unit = "start" ;
7- let start = (t, ~callback=?, () ) =>
8- _start(t, Js . Undefined . fromOption(callback));
6+ external start : (t , ~endCallback : endCallback =?, unit ) => unit = "start" ;
7+
98 [@ bs . send ] external stop : t => unit = "" ;
109 [@ bs . send ] external reset : t => unit = "" ;
1110};
@@ -117,7 +116,7 @@ module Interpolation = {
117116
118117 type config ;
119118 [@ bs . obj ]
120- external makeConfig :
119+ external config :
121120 (
122121 ~inputRange : array (float ),
123122 ~outputRange : outputRange ,
@@ -160,16 +159,15 @@ module Value = {
160159 [@ bs . send ] external addListener : (t , callback ) => string = "addListener" ;
161160 [@ bs . send ] external removeListener : (t , string ) => unit = "removeListener" ;
162161 [@ bs . send ] external removeAllListeners : t => unit = "removeAllListeners" ;
162+
163163 [@ bs . send ]
164- external _resetAnimation : (t , Js . Undefined . t ( callback ) ) => unit =
164+ external resetAnimation : (t , ~ callback : callback =? , unit ) => unit =
165165 "resetAnimation" ;
166+
166167 [@ bs . send ]
167- external _stopAnimation : (t , Js . Undefined . t ( callback ) ) => unit =
168+ external stopAnimation : (t , ~ callback : callback =? , unit ) => unit =
168169 "stopAnimation" ;
169- let resetAnimation = (value, ~callback=?, () ) =>
170- _resetAnimation(value, Js . Undefined . fromOption(callback));
171- let stopAnimation = (value, ~callback=?, () ) =>
172- _stopAnimation(value, Js . Undefined . fromOption(callback));
170+
173171 include ValueAnimations ({
174172 type t = value (regular );
175173 type rawJsType = float ;
@@ -196,18 +194,19 @@ module ValueXY = {
196194 "top": Value . t ,
197195 };
198196 [@ bs . new ] [@ bs . scope "Animated" ] [@ bs . module "react-native" ]
199- external _create : jsValue => t = "ValueXY" ;
200- let create = (~x, ~y) => _create({"x" : x, "y" : y});
201- [@ bs . send ] external _setValue : (t , jsValue ) => unit = "setValue" ;
202- let setValue = (t, ~x, ~y) => _setValue(t, {"x" : x, "y" : y});
203- [@ bs . send ] external _setOffset : (t , jsValue ) => unit = "setOffset" ;
204- let setOffset = (t, ~x, ~y) => _setOffset(t, {"x" : x, "y" : y});
197+ external create : jsValue => t = "ValueXY" ;
198+
199+ [@ bs . send ] external setValue : (t , jsValue ) => unit = "" ;
200+ [@ bs . send ] external setOffset : (t , jsValue ) => unit = "" ;
205201 [@ bs . send ] external flattenOffset : t => unit = "flattenOffset" ;
206202 [@ bs . send ] external extractOffset : t => unit = "extractOffset" ;
207203 [@ bs . send ]
208- external resetAnimation : (t , option (callback )) => unit = "resetAnimation" ;
204+ external resetAnimation : (t , ~callback : callback =?, unit ) => unit =
205+ "resetAnimation" ;
206+
209207 [@ bs . send ]
210- external stopAnimation : (t , option (callback )) => unit = "stopAnimation" ;
208+ external stopAnimation : (t , ~callback : callback =?, unit ) => unit =
209+ "stopAnimation" ;
211210 [@ bs . send ] external addListener : (t , callback ) => string = "addListener" ;
212211 [@ bs . send ] external removeListener : (t , string ) => unit = "removeListener" ;
213212 [@ bs . send ] external removeAllListeners : t => unit = "removeAllListeners" ;
0 commit comments