Skip to content

Commit 1b8d992

Browse files
sgnyMoOx
authored andcommitted
Zero-cost bindings to DrawerLayoutAndroid (#432)
* Zero-cost bindings to DrawerLayoutAndroid * Update DrawerLayoutAndroid.md
1 parent 2b0035b commit 1b8d992

3 files changed

Lines changed: 232 additions & 0 deletions

File tree

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */
Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
---
2+
id: components/DrawerLayoutAndroid
3+
title: DrawerLayoutAndroid
4+
wip: true
5+
---
6+
7+
```reason
8+
type element;
9+
type ref = React.Ref.t(Js.nullable(element));
10+
11+
type drawerPosition;
12+
13+
[@bs.module "react-native"] [@bs.scope ("DrawerConsts", "DrawerPosition")]
14+
external left: drawerPosition = "Left";
15+
16+
[@bs.module "react-native"] [@bs.scope ("DrawerConsts", "DrawerPosition")]
17+
external right: drawerPosition = "Right";
18+
19+
type drawerSlideEvent = Event.syntheticEvent({. "offset": float});
20+
21+
[@react.component] [@bs.module "react-native"]
22+
external make:
23+
(
24+
~ref: ref=?,
25+
~renderNavigationView: unit => React.element,
26+
~onDrawerClose: unit => unit=?,
27+
~drawerPosition: drawerPosition=?,
28+
~drawerWidth: float=?,
29+
~keyboardDismissMode: [@bs.string] [ | `none | [@bs.as "on-drag"] `onDrag]
30+
=?,
31+
~drawerLockMode: [@bs.string] [
32+
| [@bs.as "unlocked"] `unlocked
33+
| [@bs.as "locked-closed"] `lockedClosed
34+
| [@bs.as "locked-open"] `lockedOpen
35+
]
36+
=?,
37+
~onDrawerOpen: unit => unit=?,
38+
~onDrawerSlide: drawerSlideEvent => unit=?,
39+
~onDrawerStateChanged: [ | `Idle | `Dragging | `Settling] => unit=?,
40+
~drawerBackgroundColor: Style.color=?,
41+
~statusBarBackgroundColor: Style.color=?,
42+
// View props
43+
~accessibilityComponentType: [@bs.string] [
44+
| `none
45+
| `button
46+
| `radiobutton_checked
47+
| `radiobutton_unchecked
48+
]
49+
=?,
50+
~accessibilityElementsHidden: bool=?,
51+
~accessibilityHint: string=?,
52+
~accessibilityIgnoresInvertColors: bool=?,
53+
~accessibilityLabel: string=?,
54+
~accessibilityLiveRegion: [@bs.string] [ | `none | `polite | `assertive]=?,
55+
~accessibilityRole: [@bs.string] [
56+
| `none
57+
| `button
58+
| `link
59+
| `search
60+
| `image
61+
| `keyboardkey
62+
| `text
63+
| `adjustable
64+
| `header
65+
| `summary
66+
| `imagebutton
67+
]
68+
=?,
69+
~accessibilityStates: array(AccessibilityState.t)=?,
70+
~accessibilityTraits: array(AccessibilityTrait.t)=?,
71+
~accessibilityViewIsModal: bool=?,
72+
~accessible: bool=?,
73+
~collapsable: bool=?,
74+
~hitSlop: Types.edgeInsets=?,
75+
~importantForAccessibility: [@bs.string] [
76+
| `auto
77+
| `yes
78+
| `no
79+
| [@bs.as "no-hide-descendants"]
80+
`noHideDescendants
81+
]
82+
=?,
83+
~nativeID: string=?,
84+
~needsOffscreenAlphaCompositing: bool=?,
85+
~onAccessibilityTap: unit => unit=?,
86+
~onLayout: Event.layoutEvent => unit=?,
87+
~onMagicTap: unit => unit=?,
88+
// Gesture Responder props
89+
~onMoveShouldSetResponder: Event.pressEvent => bool=?,
90+
~onMoveShouldSetResponderCapture: Event.pressEvent => bool=?,
91+
~onResponderGrant: Event.pressEvent => unit=?,
92+
~onResponderMove: Event.pressEvent => unit=?,
93+
~onResponderReject: Event.pressEvent => unit=?,
94+
~onResponderRelease: Event.pressEvent => unit=?,
95+
~onResponderTerminate: Event.pressEvent => unit=?,
96+
~onResponderTerminationRequest: Event.pressEvent => unit=?,
97+
~onStartShouldSetResponder: Event.pressEvent => bool=?,
98+
~onStartShouldSetResponderCapture: Event.pressEvent => bool=?,
99+
~pointerEvents: [@bs.string] [
100+
| `auto
101+
| `none
102+
| [@bs.as "box-none"] `boxNone
103+
| [@bs.as "box-only"] `boxOnly
104+
]
105+
=?,
106+
~removeClippedSubviews: bool=?,
107+
~renderToHardwareTextureAndroid: bool=?,
108+
~shouldRasterizeIOS: bool=?,
109+
~style: Style.t=?,
110+
~testID: string=?,
111+
~children: React.element=?
112+
) =>
113+
React.element =
114+
"DrawerLayoutAndroid";
115+
116+
[@bs.send] external openDrawer: (element, unit) => unit = "";
117+
118+
[@bs.send] external closeDrawer: (element, unit) => unit = "";
119+
120+
```
Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
type element;
2+
type ref = React.Ref.t(Js.nullable(element));
3+
4+
type drawerPosition;
5+
6+
[@bs.module "react-native"] [@bs.scope ("DrawerConsts", "DrawerPosition")]
7+
external left: drawerPosition = "Left";
8+
9+
[@bs.module "react-native"] [@bs.scope ("DrawerConsts", "DrawerPosition")]
10+
external right: drawerPosition = "Right";
11+
12+
type drawerSlideEvent = Event.syntheticEvent({. "offset": float});
13+
14+
[@react.component] [@bs.module "react-native"]
15+
external make:
16+
(
17+
~ref: ref=?,
18+
~renderNavigationView: unit => React.element,
19+
~onDrawerClose: unit => unit=?,
20+
~drawerPosition: drawerPosition=?,
21+
~drawerWidth: float=?,
22+
~keyboardDismissMode: [@bs.string] [ | `none | [@bs.as "on-drag"] `onDrag]
23+
=?,
24+
~drawerLockMode: [@bs.string] [
25+
| [@bs.as "unlocked"] `unlocked
26+
| [@bs.as "locked-closed"] `lockedClosed
27+
| [@bs.as "locked-open"] `lockedOpen
28+
]
29+
=?,
30+
~onDrawerOpen: unit => unit=?,
31+
~onDrawerSlide: drawerSlideEvent => unit=?,
32+
~onDrawerStateChanged: [ | `Idle | `Dragging | `Settling] => unit=?,
33+
~drawerBackgroundColor: Style.color=?,
34+
~statusBarBackgroundColor: Style.color=?,
35+
// View props
36+
~accessibilityComponentType: [@bs.string] [
37+
| `none
38+
| `button
39+
| `radiobutton_checked
40+
| `radiobutton_unchecked
41+
]
42+
=?,
43+
~accessibilityElementsHidden: bool=?,
44+
~accessibilityHint: string=?,
45+
~accessibilityIgnoresInvertColors: bool=?,
46+
~accessibilityLabel: string=?,
47+
~accessibilityLiveRegion: [@bs.string] [ | `none | `polite | `assertive]=?,
48+
~accessibilityRole: [@bs.string] [
49+
| `none
50+
| `button
51+
| `link
52+
| `search
53+
| `image
54+
| `keyboardkey
55+
| `text
56+
| `adjustable
57+
| `header
58+
| `summary
59+
| `imagebutton
60+
]
61+
=?,
62+
~accessibilityStates: array(AccessibilityState.t)=?,
63+
~accessibilityTraits: array(AccessibilityTrait.t)=?,
64+
~accessibilityViewIsModal: bool=?,
65+
~accessible: bool=?,
66+
~collapsable: bool=?,
67+
~hitSlop: Types.edgeInsets=?,
68+
~importantForAccessibility: [@bs.string] [
69+
| `auto
70+
| `yes
71+
| `no
72+
| [@bs.as "no-hide-descendants"]
73+
`noHideDescendants
74+
]
75+
=?,
76+
~nativeID: string=?,
77+
~needsOffscreenAlphaCompositing: bool=?,
78+
~onAccessibilityTap: unit => unit=?,
79+
~onLayout: Event.layoutEvent => unit=?,
80+
~onMagicTap: unit => unit=?,
81+
// Gesture Responder props
82+
~onMoveShouldSetResponder: Event.pressEvent => bool=?,
83+
~onMoveShouldSetResponderCapture: Event.pressEvent => bool=?,
84+
~onResponderGrant: Event.pressEvent => unit=?,
85+
~onResponderMove: Event.pressEvent => unit=?,
86+
~onResponderReject: Event.pressEvent => unit=?,
87+
~onResponderRelease: Event.pressEvent => unit=?,
88+
~onResponderTerminate: Event.pressEvent => unit=?,
89+
~onResponderTerminationRequest: Event.pressEvent => unit=?,
90+
~onStartShouldSetResponder: Event.pressEvent => bool=?,
91+
~onStartShouldSetResponderCapture: Event.pressEvent => bool=?,
92+
~pointerEvents: [@bs.string] [
93+
| `auto
94+
| `none
95+
| [@bs.as "box-none"] `boxNone
96+
| [@bs.as "box-only"] `boxOnly
97+
]
98+
=?,
99+
~removeClippedSubviews: bool=?,
100+
~renderToHardwareTextureAndroid: bool=?,
101+
~shouldRasterizeIOS: bool=?,
102+
~style: Style.t=?,
103+
~testID: string=?,
104+
~children: React.element=?
105+
) =>
106+
React.element =
107+
"DrawerLayoutAndroid";
108+
109+
[@bs.send] external openDrawer: (element, unit) => unit = "";
110+
111+
[@bs.send] external closeDrawer: (element, unit) => unit = "";

0 commit comments

Comments
 (0)