@@ -22,7 +22,13 @@ module type ImageComponent = {
2222 type defaultSource =
2323 | URI defaultURISource
2424 | Required PackagerRe . required ;
25- module Event : {type error ; type progress = {loaded: float , total: float }; };
25+ module Event : {
26+ type error ;
27+ type progress = {
28+ loaded: float ,
29+ total: float
30+ };
31+ };
2632 let make :
2733 onError:: (Event . error => unit )? =>
2834 onLayout:: (RNEvent . NativeLayoutEvent . t => unit )? =>
@@ -42,7 +48,7 @@ module type ImageComponent = {
4248 onPartialLoad:: (unit => unit )? =>
4349 onProgress:: (Event . progress => unit )? =>
4450 array ReasonReact . reactElement =>
45- ReasonReact . component ReasonReact . stateless ReasonReact . noRetainedProps ;
51+ ReasonReact . component ReasonReact . stateless ReasonReact . noRetainedProps unit ;
4652};
4753
4854module CreateComponent (Impl : ViewRe . Impl ) : ImageComponent => {
@@ -56,11 +62,18 @@ module CreateComponent (Impl: ViewRe.Impl) :ImageComponent => {
5662 /*
5763 * Be careful not to refmt this away !!!
5864 * https://github.com/facebook/reason/issues/821 (resolved, not released yet)
59- *
65+ *
6066 * This is hot it should look (or to copy it in again ^^)
6167 * cache::[ | `default | `reload | `forceCache [@bs.as "force-cache"] | `onlyIfCached [@bs.as "only-if-cached"]] [@bs.string]? =>
6268 */
63- cache::[ | `default | `reload | `forceCache [@ bs . as "force-cache" ] | `onlyIfCached [@ bs . as "only-if-cached" ]] [@ bs . string ]? =>
69+ cache::
70+ [
71+ | `default
72+ | `reload
73+ | `forceCache [@ bs . as "force-cache" ]
74+ | `onlyIfCached [@ bs . as "only-if-cached" ]
75+ ]
76+ [@ bs . string ]? =>
6477 scale::float? =>
6578 width::float? =>
6679 height::float? =>
@@ -83,7 +96,10 @@ module CreateComponent (Impl: ViewRe.Impl) :ImageComponent => {
8396 module Event = {
8497 type t ;
8598 type error ;
86- type progress = {loaded: float , total: float };
99+ type progress = {
100+ loaded: float ,
101+ total: float
102+ };
87103 external progress : t => progress = "nativeEvent" [@@ bs . get ];
88104 };
89105 let encodeResizeMode x =>
@@ -105,8 +121,7 @@ module CreateComponent (Impl: ViewRe.Impl) :ImageComponent => {
105121 | ` auto => "auto"
106122 | ` resize => "resize"
107123 | ` scale => "scale"
108- };
109-
124+ };
110125 let encodeDefaultSource (x : defaultSource ) =>
111126 switch x {
112127 | URI x => rawImageSourceJS x
@@ -149,7 +164,7 @@ module CreateComponent (Impl: ViewRe.Impl) :ImageComponent => {
149164 "accessible" : from_opt (UtilsRN . optBoolToOptJsBoolean accessible),
150165 "blurRadius" : from_opt blurRadius,
151166 "capInsets" : from_opt capInsets,
152- "defaultSource" : from_opt (UtilsRN . option_map encodeDefaultSource defaultSource),
167+ "defaultSource" : from_opt (UtilsRN . option_map encodeDefaultSource defaultSource),
153168 "onPartialLoad" : from_opt onPartialLoad,
154169 "onProgress" :
155170 from_opt (UtilsRN . option_map (fun x y => x (Event . progress y)) onProgress)
@@ -160,4 +175,4 @@ module CreateComponent (Impl: ViewRe.Impl) :ImageComponent => {
160175module Image =
161176 CreateComponent {
162177 external view : ReasonReact . reactClass = "Image" [@@ bs . module "react-native" ];
163- };
178+ };
0 commit comments