Skip to content

Commit d4b0e46

Browse files
sgnyMoOx
authored andcommitted
Zero-cost bindings to SegmentedControlIOS (#425)
1 parent 02c9f69 commit d4b0e46

3 files changed

Lines changed: 196 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: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
---
2+
id: components/SegmentedControlIOS
3+
title: SegmentedControlIOS
4+
wip: true
5+
---
6+
7+
```reason
8+
type element;
9+
type ref = React.Ref.t(Js.nullable(element));
10+
11+
type change = {
12+
.
13+
"value": string,
14+
"selectedSegmentIndex": int,
15+
};
16+
17+
[@react.component] [@bs.module "react-native"]
18+
external make:
19+
(
20+
~ref: ref=?,
21+
~enabled: bool=?,
22+
~momentary: bool=?,
23+
~onChange: Event.syntheticEvent(change) => unit=?,
24+
~onValueChange: int => unit=?,
25+
~selectedIndex: int=?,
26+
~tintColor: string=?,
27+
~values: array(string)=?,
28+
// View props
29+
~accessibilityComponentType: [@bs.string] [
30+
| `none
31+
| `button
32+
| `radiobutton_checked
33+
| `radiobutton_unchecked
34+
]
35+
=?,
36+
~accessibilityElementsHidden: bool=?,
37+
~accessibilityHint: string=?,
38+
~accessibilityIgnoresInvertColors: bool=?,
39+
~accessibilityLabel: string=?,
40+
~accessibilityLiveRegion: [@bs.string] [ | `none | `polite | `assertive]=?,
41+
~accessibilityRole: [@bs.string] [
42+
| `none
43+
| `button
44+
| `link
45+
| `search
46+
| `image
47+
| `keyboardkey
48+
| `text
49+
| `adjustable
50+
| `header
51+
| `summary
52+
| `imagebutton
53+
]
54+
=?,
55+
~accessibilityStates: array(AccessibilityState.t)=?,
56+
~accessibilityTraits: array(AccessibilityTrait.t)=?,
57+
~accessibilityViewIsModal: bool=?,
58+
~accessible: bool=?,
59+
~collapsable: bool=?,
60+
~hitSlop: Types.insets=?,
61+
~importantForAccessibility: [@bs.string] [
62+
| `auto
63+
| `yes
64+
| `no
65+
| [@bs.as "no-hide-descendants"]
66+
`noHideDescendants
67+
]
68+
=?,
69+
~nativeID: string=?,
70+
~needsOffscreenAlphaCompositing: bool=?,
71+
~onAccessibilityTap: unit => unit=?,
72+
~onLayout: Event.layoutEvent => unit=?,
73+
~onMagicTap: unit => unit=?,
74+
// Gesture Responder props
75+
~onMoveShouldSetResponder: Event.pressEvent => bool=?,
76+
~onMoveShouldSetResponderCapture: Event.pressEvent => bool=?,
77+
~onResponderGrant: Event.pressEvent => unit=?,
78+
~onResponderMove: Event.pressEvent => unit=?,
79+
~onResponderReject: Event.pressEvent => unit=?,
80+
~onResponderRelease: Event.pressEvent => unit=?,
81+
~onResponderTerminate: Event.pressEvent => unit=?,
82+
~onResponderTerminationRequest: Event.pressEvent => unit=?,
83+
~onStartShouldSetResponder: Event.pressEvent => bool=?,
84+
~onStartShouldSetResponderCapture: Event.pressEvent => bool=?,
85+
~pointerEvents: [@bs.string] [
86+
| `auto
87+
| `none
88+
| [@bs.as "box-none"] `boxNone
89+
| [@bs.as "box-only"] `boxOnly
90+
]
91+
=?,
92+
~removeClippedSubviews: bool=?,
93+
~renderToHardwareTextureAndroid: bool=?,
94+
~shouldRasterizeIOS: bool=?,
95+
~style: Style.t=?,
96+
~testID: string=?,
97+
~children: React.element=?
98+
) =>
99+
React.element =
100+
"SegmentedControlIOS";
101+
102+
```
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
type element;
2+
type ref = React.Ref.t(Js.nullable(element));
3+
4+
type change = {
5+
.
6+
"value": string,
7+
"selectedSegmentIndex": int,
8+
};
9+
10+
[@react.component] [@bs.module "react-native"]
11+
external make:
12+
(
13+
~ref: ref=?,
14+
~enabled: bool=?,
15+
~momentary: bool=?,
16+
~onChange: Event.syntheticEvent(change) => unit=?,
17+
~onValueChange: int => unit=?,
18+
~selectedIndex: int=?,
19+
~tintColor: string=?,
20+
~values: array(string)=?,
21+
// View props
22+
~accessibilityComponentType: [@bs.string] [
23+
| `none
24+
| `button
25+
| `radiobutton_checked
26+
| `radiobutton_unchecked
27+
]
28+
=?,
29+
~accessibilityElementsHidden: bool=?,
30+
~accessibilityHint: string=?,
31+
~accessibilityIgnoresInvertColors: bool=?,
32+
~accessibilityLabel: string=?,
33+
~accessibilityLiveRegion: [@bs.string] [ | `none | `polite | `assertive]=?,
34+
~accessibilityRole: [@bs.string] [
35+
| `none
36+
| `button
37+
| `link
38+
| `search
39+
| `image
40+
| `keyboardkey
41+
| `text
42+
| `adjustable
43+
| `header
44+
| `summary
45+
| `imagebutton
46+
]
47+
=?,
48+
~accessibilityStates: array(AccessibilityState.t)=?,
49+
~accessibilityTraits: array(AccessibilityTrait.t)=?,
50+
~accessibilityViewIsModal: bool=?,
51+
~accessible: bool=?,
52+
~collapsable: bool=?,
53+
~hitSlop: Types.insets=?,
54+
~importantForAccessibility: [@bs.string] [
55+
| `auto
56+
| `yes
57+
| `no
58+
| [@bs.as "no-hide-descendants"]
59+
`noHideDescendants
60+
]
61+
=?,
62+
~nativeID: string=?,
63+
~needsOffscreenAlphaCompositing: bool=?,
64+
~onAccessibilityTap: unit => unit=?,
65+
~onLayout: Event.layoutEvent => unit=?,
66+
~onMagicTap: unit => unit=?,
67+
// Gesture Responder props
68+
~onMoveShouldSetResponder: Event.pressEvent => bool=?,
69+
~onMoveShouldSetResponderCapture: Event.pressEvent => bool=?,
70+
~onResponderGrant: Event.pressEvent => unit=?,
71+
~onResponderMove: Event.pressEvent => unit=?,
72+
~onResponderReject: Event.pressEvent => unit=?,
73+
~onResponderRelease: Event.pressEvent => unit=?,
74+
~onResponderTerminate: Event.pressEvent => unit=?,
75+
~onResponderTerminationRequest: Event.pressEvent => unit=?,
76+
~onStartShouldSetResponder: Event.pressEvent => bool=?,
77+
~onStartShouldSetResponderCapture: Event.pressEvent => bool=?,
78+
~pointerEvents: [@bs.string] [
79+
| `auto
80+
| `none
81+
| [@bs.as "box-none"] `boxNone
82+
| [@bs.as "box-only"] `boxOnly
83+
]
84+
=?,
85+
~removeClippedSubviews: bool=?,
86+
~renderToHardwareTextureAndroid: bool=?,
87+
~shouldRasterizeIOS: bool=?,
88+
~style: Style.t=?,
89+
~testID: string=?,
90+
~children: React.element=?
91+
) =>
92+
React.element =
93+
"SegmentedControlIOS";

0 commit comments

Comments
 (0)