Skip to content

Commit 1d00148

Browse files
authored
add transformOrigin (#812)
1 parent 1153b72 commit 1d00148

File tree

2 files changed

+26
-2
lines changed

2 files changed

+26
-2
lines changed

src/apis/Style.res

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,15 @@ type transform
4646

4747
external unsafeTransform: Js.t<'a> => transform = "%identity"
4848

49+
@unboxed
50+
type transformOrigin =
51+
| @as("top") Top
52+
| @as("bottom") Bottom
53+
| @as("left") Left
54+
| @as("right") Right
55+
| @as("center") Center
56+
| Size(size)
57+
4958
type resizeMode = [#cover | #contain | #stretch | #repeat | #center]
5059

5160
type fontStyle = [#normal | #italic]
@@ -243,7 +252,10 @@ type shadowIOSStyle = {
243252
}
244253

245254
// Transform Props (https://reactnative.dev/docs/transforms#props)
246-
type transformStyle = {transform?: array<transform>}
255+
type transformStyle = {
256+
transform?: array<transform>,
257+
transformOrigin?: array<transformOrigin>,
258+
}
247259

248260
// View styles https://reactnative.dev/docs/view-style-props
249261
type viewCoreStyle = {

src/apis/Style.resi

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,15 @@ type transform
4141

4242
external unsafeTransform: Js.t<'a> => transform = "%identity"
4343

44+
@unboxed
45+
type transformOrigin =
46+
| @as("top") Top
47+
| @as("bottom") Bottom
48+
| @as("left") Left
49+
| @as("right") Right
50+
| @as("center") Center
51+
| Size(size)
52+
4453
type resizeMode = [#cover | #contain | #stretch | #repeat | #center]
4554

4655
type fontStyle = [#normal | #italic]
@@ -231,7 +240,10 @@ type shadowIOSStyle = {
231240
}
232241

233242
// Transform Props (https://reactnative.dev/docs/transforms#props)
234-
type transformStyle = {transform?: array<transform>}
243+
type transformStyle = {
244+
transform?: array<transform>,
245+
transformOrigin?: array<transformOrigin>,
246+
}
235247

236248
// View styles https://reactnative.dev/docs/view-style-props
237249
type viewCoreStyle = {

0 commit comments

Comments
 (0)