@@ -5,48 +5,16 @@ wip: true
55---
66
77``` reason
8- let pct = num => num->Js.Float.toString ++ "%" ;
8+ type size ;
99
10- module Margin = {
11- type t;
10+ external pt: float => size = "%identity";
1211
13- external pt: float => t = "%identity";
14- let pct: float => t = pct->Obj.magic;
15- let auto: t = "auto"->Obj.magic;
16- };
12+ let pct: float => size;
1713
18- module Size = {
19- type t;
14+ type margin = size;
2015
21- external pt: float => t = "%identity";
22- let pct: float => t = pct->Obj.magic;
23- };
24-
25- type color;
26- external color: string => color = "%identity";
27-
28- module Transform = {
29- type angle;
30-
31- let deg: float => angle =
32- num => (num->Js.Float.toString ++ "deg")->Obj.magic;
33- let rad: float => angle =
34- num => (num->Js.Float.toString ++ "rad")->Obj.magic;
35-
36- type t;
37- [@bs.obj] external perspective: (~perspective: float) => t = "";
38- [@bs.obj] external rotate: (~rotate: angle) => t = "";
39- [@bs.obj] external rotateX: (~rotateX: angle) => t = "";
40- [@bs.obj] external rotateY: (~rotateY: angle) => t = "";
41- [@bs.obj] external rotateZ: (~rotateZ: angle) => t = "";
42- [@bs.obj] external scale: (~scale: float) => t = "";
43- [@bs.obj] external scaleX: (~scaleX: float) => t = "";
44- [@bs.obj] external scaleY: (~scaleY: float) => t = "";
45- [@bs.obj] external translateX: (~translateX: float) => t = "";
46- [@bs.obj] external translateY: (~translateY: float) => t = "";
47- [@bs.obj] external skewX: (~skewX: angle) => t = "";
48- [@bs.obj] external skewY: (~skewY: angle) => t = "";
49- };
16+ [@bs.inline "auto"]
17+ let auto: margin;
5018
5119type offset;
5220[@bs.obj] external offset: (~height: float, ~width: float) => offset = "";
@@ -85,38 +53,38 @@ external style:
8553 =?,
8654 ~aspectRatio: float=?,
8755 ~backfaceVisibility: [@bs.string] [ | `visible | `hidden]=?,
88- ~backgroundColor: color =?,
89- ~borderBottomColor: color =?,
56+ ~backgroundColor: Color.t =?,
57+ ~borderBottomColor: Color.t =?,
9058 ~borderBottomEndRadius: float=?,
9159 ~borderBottomLeftRadius: float=?,
9260 ~borderBottomRightRadius: float=?,
9361 ~borderBottomStartRadius: float=?,
9462 ~borderBottomWidth: float=?,
95- ~borderColor: color =?,
96- ~borderEndColor: color =?,
63+ ~borderColor: Color.t =?,
64+ ~borderEndColor: Color.t =?,
9765 ~borderEndWidth: float=?,
98- ~borderLeftColor: color =?,
66+ ~borderLeftColor: Color.t =?,
9967 ~borderLeftWidth: float=?,
10068 ~borderRadius: float=?,
101- ~borderRightColor: color =?,
69+ ~borderRightColor: Color.t =?,
10270 ~borderRightWidth: float=?,
103- ~borderStartColor: color =?,
71+ ~borderStartColor: Color.t =?,
10472 ~borderStartWidth: float=?,
10573 ~borderStyle: [@bs.string] [ | `solid | `dotted | `dashed]=?,
106- ~borderTopColor: color =?,
74+ ~borderTopColor: Color.t =?,
10775 ~borderTopEndRadius: float=?,
10876 ~borderTopLeftRadius: float=?,
10977 ~borderTopRightRadius: float=?,
11078 ~borderTopStartRadius: float=?,
11179 ~borderTopWidth: float=?,
11280 ~borderWidth: float=?,
113- ~bottom: Size.t =?,
81+ ~bottom: size =?,
11482 ~direction: [@bs.string] [ | [@bs.as "inherit"] `inherit_ | `ltr | `ltr]=?,
11583 ~display: [@bs.string] [ | `none | `flex]=?,
11684 ~elevation: float=?,
11785 ~_end: float=?,
11886 ~flex: float=?,
119- ~flexBasis: Margin.t =?,
87+ ~flexBasis: size =?,
12088 ~flexDirection: [@bs.string] [
12189 | `row
12290 | [@bs.as "row-reverse"] `rowReverse
@@ -127,7 +95,7 @@ external style:
12795 ~flexGrow: float=?,
12896 ~flexShrink: float=?,
12997 ~flexWrap: [@bs.string] [ | `wrap | `nowrap]=?,
130- ~height: Size.t =?,
98+ ~height: size =?,
13199 ~justifyContent: [@bs.string] [
132100 | [@bs.as "flex-start"] `flexStart
133101 | [@bs.as "flex-end"] `flexEnd
@@ -137,46 +105,46 @@ external style:
137105 | [@bs.as "space-evenly"] `spaceEvenly
138106 ]
139107 =?,
140- ~left: Size.t =?,
141- ~margin: Margin.t =?,
142- ~marginBottom: Margin.t =?,
143- ~marginEnd: Margin.t =?,
144- ~marginHorizontal: Margin.t =?,
145- ~marginLeft: Margin.t =?,
146- ~marginRight: Margin.t =?,
147- ~marginStart: Margin.t =?,
148- ~marginTop: Margin.t =?,
149- ~marginVertical: Margin.t =?,
150- ~maxHeight: Size.t =?,
151- ~maxWidth: Size.t =?,
152- ~minHeight: Size.t =?,
153- ~minWidth: Size.t =?,
108+ ~left: size =?,
109+ ~margin: size =?,
110+ ~marginBottom: size =?,
111+ ~marginEnd: size =?,
112+ ~marginHorizontal: size =?,
113+ ~marginLeft: size =?,
114+ ~marginRight: size =?,
115+ ~marginStart: size =?,
116+ ~marginTop: size =?,
117+ ~marginVertical: size =?,
118+ ~maxHeight: size =?,
119+ ~maxWidth: size =?,
120+ ~minHeight: size =?,
121+ ~minWidth: size =?,
154122 ~opacity: float=?,
155123 ~overflow: [@bs.string] [ | `visible | `hidden | `scroll]=?,
156- ~padding: Size.t =?,
157- ~paddingBottom: Size.t =?,
158- ~paddingEnd: Size.t =?,
159- ~paddingHorizontal: Size.t =?,
160- ~paddingLeft: Size.t =?,
161- ~paddingRight: Size.t =?,
162- ~paddingStart: Size.t =?,
163- ~paddingTop: Size.t =?,
164- ~paddingVertical: Size.t =?,
124+ ~padding: size =?,
125+ ~paddingBottom: size =?,
126+ ~paddingEnd: size =?,
127+ ~paddingHorizontal: size =?,
128+ ~paddingLeft: size =?,
129+ ~paddingRight: size =?,
130+ ~paddingStart: size =?,
131+ ~paddingTop: size =?,
132+ ~paddingVertical: size =?,
165133 ~position: [@bs.string] [ | `absolute | `relative]=?,
166- ~right: Size.t =?,
167- ~start: Size.t =?,
168- ~top: Size.t =?,
169- ~width: Size.t =?,
134+ ~right: size =?,
135+ ~start: size =?,
136+ ~top: size =?,
137+ ~width: size =?,
170138 ~zIndex: int=?,
171139 // Shadow Props (https://facebook.github.io/react-native/docs/shadow-props)
172- ~shadowColor: color =?,
140+ ~shadowColor: Color.t =?,
173141 ~shadowOffset: offset=?,
174142 ~shadowOpacity: float=?,
175143 ~shadowRadius: float=?,
176144 // Transform Props (https://facebook.github.io/react-native/docs/transforms#props)
177145 ~transform: array(Transform.t)=?, // all other transform props are deprecated
178146 // Text Style Props (https://facebook.github.io/react-native/docs/text-style-props)
179- ~color: color =?,
147+ ~color: Color.t =?,
180148 ~fontFamily: string=?,
181149 ~fontSize: float=?,
182150 ~fontStyle: [@bs.string] [ | `normal | `italic]=?,
@@ -200,7 +168,7 @@ external style:
200168 ~lineHeight: float=?,
201169 ~textAlign: [@bs.string] [ | `auto | `left | `right | `center | `justify]=?,
202170 ~textAlignVertical: [@bs.string] [ | `auto | `top | `bottom | `center]=?,
203- ~textDecorationColor: color =?,
171+ ~textDecorationColor: Color.t =?,
204172 ~textDecorationLine: [@bs.string] [
205173 | `none
206174 | `underline
@@ -216,7 +184,7 @@ external style:
216184 | `dashed
217185 ]
218186 =?,
219- ~textShadowColor: color =?,
187+ ~textShadowColor: Color.t =?,
220188 ~textShadowOffset: offset=?,
221189 ~textShadowRadius: float=?,
222190 ~textTransform: [@bs.string] [
@@ -236,8 +204,8 @@ external style:
236204 | `center
237205 ]
238206 =?,
239- ~overlayColor: color =?,
240- ~tintColor: color =?,
207+ ~overlayColor: Color.t =?,
208+ ~tintColor: Color.t =?,
241209 unit
242210 ) =>
243211 t =
0 commit comments