@@ -18,153 +18,155 @@ export opaque type StyleSheetStyle: number = number;
18
18
export type ColorValue = null | string ;
19
19
export type DimensionValue = null | number | string | AnimatedNode ;
20
20
21
- export type LayoutStyle = {
22
- + display ? : 'none' | 'flex' ,
23
- + width ? : DimensionValue ,
24
- + height ? : DimensionValue ,
25
- + bottom ? : DimensionValue ,
26
- + end ? : DimensionValue ,
27
- + left ? : DimensionValue ,
28
- + right ? : DimensionValue ,
29
- + start ? : DimensionValue ,
30
- + top ? : DimensionValue ,
31
- + minWidth ? : DimensionValue ,
32
- + maxWidth ? : DimensionValue ,
33
- + minHeight ? : DimensionValue ,
34
- + maxHeight ? : DimensionValue ,
35
- + margin ? : DimensionValue ,
36
- + marginBottom ? : DimensionValue ,
37
- + marginEnd ? : DimensionValue ,
38
- + marginHorizontal ? : DimensionValue ,
39
- + marginLeft ? : DimensionValue ,
40
- + marginRight ? : DimensionValue ,
41
- + marginStart ? : DimensionValue ,
42
- + marginTop ? : DimensionValue ,
43
- + marginVertical ? : DimensionValue ,
44
- + padding ? : DimensionValue ,
45
- + paddingBottom ? : DimensionValue ,
46
- + paddingEnd ? : DimensionValue ,
47
- + paddingHorizontal ? : DimensionValue ,
48
- + paddingLeft ? : DimensionValue ,
49
- + paddingRight ? : DimensionValue ,
50
- + paddingStart ? : DimensionValue ,
51
- + paddingTop ? : DimensionValue ,
52
- + paddingVertical ? : DimensionValue ,
53
- + borderWidth ? : number ,
54
- + borderBottomWidth ? : number ,
55
- + borderEndWidth ? : number ,
56
- + borderLeftWidth ? : number ,
57
- + borderRightWidth ? : number ,
58
- + borderStartWidth ? : number ,
59
- + borderTopWidth ? : number ,
60
- + position ? : 'absolute' | 'relative' ,
61
- + flexDirection ? : 'row' | 'row-reverse' | 'column' | 'column-reverse' ,
62
- + flexWrap ? : 'wrap' | 'nowrap' ,
63
- + justifyContent ?:
21
+ export type LayoutStyle = $ReadOnly < { |
22
+ display ? : 'none' | 'flex' ,
23
+ width ? : DimensionValue ,
24
+ height ? : DimensionValue ,
25
+ bottom ? : DimensionValue ,
26
+ end ? : DimensionValue ,
27
+ left ? : DimensionValue ,
28
+ right ? : DimensionValue ,
29
+ start ? : DimensionValue ,
30
+ top ? : DimensionValue ,
31
+ minWidth ? : DimensionValue ,
32
+ maxWidth ? : DimensionValue ,
33
+ minHeight ? : DimensionValue ,
34
+ maxHeight ? : DimensionValue ,
35
+ margin ? : DimensionValue ,
36
+ marginBottom ? : DimensionValue ,
37
+ marginEnd ? : DimensionValue ,
38
+ marginHorizontal ? : DimensionValue ,
39
+ marginLeft ? : DimensionValue ,
40
+ marginRight ? : DimensionValue ,
41
+ marginStart ? : DimensionValue ,
42
+ marginTop ? : DimensionValue ,
43
+ marginVertical ? : DimensionValue ,
44
+ padding ? : DimensionValue ,
45
+ paddingBottom ? : DimensionValue ,
46
+ paddingEnd ? : DimensionValue ,
47
+ paddingHorizontal ? : DimensionValue ,
48
+ paddingLeft ? : DimensionValue ,
49
+ paddingRight ? : DimensionValue ,
50
+ paddingStart ? : DimensionValue ,
51
+ paddingTop ? : DimensionValue ,
52
+ paddingVertical ? : DimensionValue ,
53
+ borderWidth ? : number ,
54
+ borderBottomWidth ? : number ,
55
+ borderEndWidth ? : number ,
56
+ borderLeftWidth ? : number ,
57
+ borderRightWidth ? : number ,
58
+ borderStartWidth ? : number ,
59
+ borderTopWidth ? : number ,
60
+ position ? : 'absolute' | 'relative' ,
61
+ flexDirection ? : 'row' | 'row-reverse' | 'column' | 'column-reverse' ,
62
+ flexWrap ? : 'wrap' | 'nowrap' ,
63
+ justifyContent ?:
64
64
| 'flex-start'
65
65
| 'flex-end'
66
66
| 'center'
67
67
| 'space-between'
68
68
| 'space-around'
69
69
| 'space-evenly' ,
70
- + alignItems ? : 'flex-start' | 'flex-end' | 'center' | 'stretch' | 'baseline' ,
71
- + alignSelf ?:
70
+ alignItems ? : 'flex-start' | 'flex-end' | 'center' | 'stretch' | 'baseline' ,
71
+ alignSelf ?:
72
72
| 'auto'
73
73
| 'flex-start'
74
74
| 'flex-end'
75
75
| 'center'
76
76
| 'stretch'
77
77
| 'baseline' ,
78
- + alignContent ?:
78
+ alignContent ?:
79
79
| 'flex-start'
80
80
| 'flex-end'
81
81
| 'center'
82
82
| 'stretch'
83
83
| 'space-between'
84
84
| 'space-around' ,
85
- + overflow ? : 'visible' | 'hidden' | 'scroll' ,
86
- + flex ? : number ,
87
- + flexGrow ? : number ,
88
- + flexShrink ? : number ,
89
- + flexBasis ? : number | string ,
90
- + aspectRatio ? : number ,
91
- + zIndex ? : number ,
92
- + direction ? : 'inherit' | 'ltr' | 'rtl' ,
93
- } ;
85
+ overflow ? : 'visible' | 'hidden' | 'scroll' ,
86
+ flex ? : number ,
87
+ flexGrow ? : number ,
88
+ flexShrink ? : number ,
89
+ flexBasis ? : number | string ,
90
+ aspectRatio ? : number ,
91
+ zIndex ? : number ,
92
+ direction ? : 'inherit' | 'ltr' | 'rtl' ,
93
+ | } > ;
94
94
95
- export type TransformStyle = {
96
- + transform ?: $ReadOnlyArray <
97
- | { + perspective : number | AnimatedNode }
98
- | { + rotate : string }
99
- | { + rotateX : string }
100
- | { + rotateY : string }
101
- | { + rotateZ : string }
102
- | { + scale : number | AnimatedNode }
103
- | { + scaleX : number | AnimatedNode }
104
- | { + scaleY : number | AnimatedNode }
105
- | { + translateX : number | AnimatedNode }
106
- | { + translateY : number | AnimatedNode }
107
- | {
95
+ export type TransformStyle = $ReadOnly < { |
96
+ transform ?: $ReadOnlyArray <
97
+ | { | + perspective : number | AnimatedNode | }
98
+ | { | + rotate : string | }
99
+ | { | + rotateX : string | }
100
+ | { | + rotateY : string | }
101
+ | { | + rotateZ : string | }
102
+ | { | + scale : number | AnimatedNode | }
103
+ | { | + scaleX : number | AnimatedNode | }
104
+ | { | + scaleY : number | AnimatedNode | }
105
+ | { | + translateX : number | AnimatedNode | }
106
+ | { | + translateY : number | AnimatedNode | }
107
+ | { |
108
108
+ translate : [ number | AnimatedNode , number | AnimatedNode ] | AnimatedNode ,
109
- }
110
- | { + skewX : string }
111
- | { + skewY : string }
109
+ | }
110
+ | { | + skewX : string | }
111
+ | { | + skewY : string | }
112
112
// TODO: what is the actual type it expects?
113
- | { + matrix : $ReadOnlyArray < number | AnimatedNode > | AnimatedNode } ,
113
+ | { |
114
+ + matrix : $ReadOnlyArray < number | AnimatedNode > | AnimatedNode ,
115
+ | } ,
114
116
> ,
115
- } ;
117
+ | } > ;
116
118
117
- export type ShadowStyle = {
118
- + shadowColor ? : ColorValue ,
119
- + shadowOffset ?: {
120
- + width ?: number ,
121
- + height ? : number ,
122
- } ,
123
- + shadowOpacity ? : number | AnimatedNode ,
124
- + shadowRadius ? : number ,
125
- } ;
119
+ export type ShadowStyle = $ReadOnly < { |
120
+ shadowColor ? : ColorValue ,
121
+ shadowOffset ?: $ReadOnly < { |
122
+ width ?: number ,
123
+ height ? : number ,
124
+ | } > ,
125
+ shadowOpacity ? : number | AnimatedNode ,
126
+ shadowRadius ? : number ,
127
+ | } > ;
126
128
127
- export type ViewStyle = {
129
+ export type ViewStyle = $ReadOnly < { |
128
130
...$Exact < LayoutStyle > ,
129
131
...$Exact < ShadowStyle > ,
130
132
...$Exact < TransformStyle > ,
131
- + backfaceVisibility ? : 'visible' | 'hidden' ,
132
- + backgroundColor ? : ColorValue ,
133
- + borderColor ? : ColorValue ,
134
- + borderBottomColor ? : ColorValue ,
135
- + borderEndColor ? : ColorValue ,
136
- + borderLeftColor ? : ColorValue ,
137
- + borderRightColor ? : ColorValue ,
138
- + borderStartColor ? : ColorValue ,
139
- + borderTopColor ? : ColorValue ,
140
- + borderRadius ? : number ,
141
- + borderBottomEndRadius ? : number ,
142
- + borderBottomLeftRadius ? : number ,
143
- + borderBottomRightRadius ? : number ,
144
- + borderBottomStartRadius ? : number ,
145
- + borderTopEndRadius ? : number ,
146
- + borderTopLeftRadius ? : number ,
147
- + borderTopRightRadius ? : number ,
148
- + borderTopStartRadius ? : number ,
149
- + borderStyle ? : 'solid' | 'dotted' | 'dashed' ,
150
- + borderWidth ? : number ,
151
- + borderBottomWidth ? : number ,
152
- + borderEndWidth ? : number ,
153
- + borderLeftWidth ? : number ,
154
- + borderRightWidth ? : number ,
155
- + borderStartWidth ? : number ,
156
- + borderTopWidth ? : number ,
157
- + opacity ? : number | AnimatedNode ,
158
- + elevation ? : number ,
159
- } ;
133
+ backfaceVisibility ? : 'visible' | 'hidden' ,
134
+ backgroundColor ?: ColorValue ,
135
+ borderColor ?: ColorValue ,
136
+ borderBottomColor ?: ColorValue ,
137
+ borderEndColor ?: ColorValue ,
138
+ borderLeftColor ?: ColorValue ,
139
+ borderRightColor ?: ColorValue ,
140
+ borderStartColor ?: ColorValue ,
141
+ borderTopColor ?: ColorValue ,
142
+ borderRadius ?: number ,
143
+ borderBottomEndRadius ?: number ,
144
+ borderBottomLeftRadius ?: number ,
145
+ borderBottomRightRadius ?: number ,
146
+ borderBottomStartRadius ?: number ,
147
+ borderTopEndRadius ?: number ,
148
+ borderTopLeftRadius ?: number ,
149
+ borderTopRightRadius ?: number ,
150
+ borderTopStartRadius ?: number ,
151
+ borderStyle ?: 'solid' | 'dotted' | 'dashed' ,
152
+ borderWidth ?: number ,
153
+ borderBottomWidth ?: number ,
154
+ borderEndWidth ?: number ,
155
+ borderLeftWidth ?: number ,
156
+ borderRightWidth ?: number ,
157
+ borderStartWidth ?: number ,
158
+ borderTopWidth ?: number ,
159
+ opacity ?: number | AnimatedNode ,
160
+ elevation ?: number ,
161
+ | } > ;
160
162
161
- export type TextStyle = {
163
+ export type TextStyle = $ReadOnly < { |
162
164
...$Exact < ViewStyle > ,
163
- + color ? : ColorValue ,
164
- + fontFamily ? : string ,
165
- + fontSize ? : number ,
166
- + fontStyle ? : 'normal' | 'italic' ,
167
- + fontWeight ?:
165
+ color ? : ColorValue ,
166
+ fontFamily ?: string ,
167
+ fontSize ?: number ,
168
+ fontStyle ?: 'normal' | 'italic' ,
169
+ fontWeight ?:
168
170
| 'normal'
169
171
| 'bold'
170
172
| '100'
@@ -176,37 +178,40 @@ export type TextStyle = {
176
178
| '700'
177
179
| '800'
178
180
| '900' ,
179
- + fontVariant ?: $ReadOnlyArray <
181
+ fontVariant ?: $ReadOnlyArray <
180
182
| 'small-caps'
181
183
| 'oldstyle-nums'
182
184
| 'lining-nums'
183
185
| 'tabular-nums'
184
186
| 'proportional-nums' ,
185
187
> ,
186
- + textShadowOffset ?: { + width ? : number , + height ? : number } ,
187
- + textShadowRadius ? : number ,
188
- + textShadowColor ? : ColorValue ,
189
- + letterSpacing ? : number ,
190
- + lineHeight ? : number ,
191
- + textAlign ? : 'auto' | 'left' | 'right' | 'center' | 'justify' ,
192
- + textAlignVertical ? : 'auto' | 'top' | 'bottom' | 'center' ,
193
- + includeFontPadding ? : boolean ,
194
- + textDecorationLine ?:
188
+ textShadowOffset ?: $ReadOnly < { |
189
+ width ?: number ,
190
+ height ?: number ,
191
+ | } > ,
192
+ textShadowRadius ? : number ,
193
+ textShadowColor ? : ColorValue ,
194
+ letterSpacing ? : number ,
195
+ lineHeight ? : number ,
196
+ textAlign ? : 'auto' | 'left' | 'right' | 'center' | 'justify' ,
197
+ textAlignVertical ? : 'auto' | 'top' | 'bottom' | 'center' ,
198
+ includeFontPadding ? : boolean ,
199
+ textDecorationLine ?:
195
200
| 'none'
196
201
| 'underline'
197
202
| 'line-through'
198
203
| 'underline line-through' ,
199
- + textDecorationStyle ? : 'solid' | 'double' | 'dotted' | 'dashed' ,
200
- + textDecorationColor ? : ColorValue ,
201
- + writingDirection ? : 'auto' | 'ltr' | 'rtl' ,
202
- } ;
204
+ textDecorationStyle ? : 'solid' | 'double' | 'dotted' | 'dashed' ,
205
+ textDecorationColor ? : ColorValue ,
206
+ writingDirection ? : 'auto' | 'ltr' | 'rtl' ,
207
+ | } > ;
203
208
204
- export type ImageStyle = {
209
+ export type ImageStyle = $ReadOnly < { |
205
210
...$Exact < ViewStyle > ,
206
- + resizeMode ? : 'contain' | 'cover' | 'stretch' | 'center' | 'repeat' ,
207
- + tintColor ? : ColorValue ,
208
- + overlayColor ? : string ,
209
- } ;
211
+ resizeMode ? : 'contain' | 'cover' | 'stretch' | 'center' | 'repeat' ,
212
+ tintColor ?: ColorValue ,
213
+ overlayColor ?: string ,
214
+ | } > ;
210
215
211
216
export type Style = {
212
217
...$Exact < TextStyle > ,
0 commit comments