Skip to content

Commit e6d55ad

Browse files
committed
bs-react-native-next: add ActionSheetIOS, AlertIOS.
1 parent 3b8c11b commit e6d55ad

4 files changed

Lines changed: 136 additions & 0 deletions

File tree

‎bs-react-native-next/src/ActionSheetIOS.bs.js‎

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
type options;
2+
[@bs.obj]
3+
external options:
4+
(
5+
~options: array(string),
6+
~cancelButtonIndex: int=?,
7+
~destructiveButtonIndex: int=?,
8+
~title: string=?,
9+
~message: string=?,
10+
~tintColor: Style.color=?,
11+
unit
12+
) =>
13+
options =
14+
"";
15+
16+
[@bs.module "react-native"] [@bs.scope "ActionSheetIOS"]
17+
external showActionSheetWithOptions: (options, int => unit) => unit =
18+
"showActionSheetWithOptions";
19+
20+
type shareOptions;
21+
[@bs.obj]
22+
external shareOptions:
23+
(
24+
~url: string=?,
25+
~message: string=?,
26+
~subject: string=?,
27+
~excludedActivityTypes: array(string)=?,
28+
unit
29+
) =>
30+
shareOptions =
31+
"";
32+
33+
type error = {. "stack": option(string)};
34+
35+
[@bs.module "react-native"] [@bs.scope "ActionSheetIOS"]
36+
external showShareActionSheetWithOptions:
37+
(shareOptions, error => unit, (bool, string) => unit) => unit =
38+
"showShareActionSheetWithOptions";

‎bs-react-native-next/src/AlertIOS.bs.js‎

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
type button;
2+
[@bs.obj]
3+
external button:
4+
(
5+
~text: string=?,
6+
~onPress: option(string) => unit=?,
7+
~style: [@bs.string] [ | `default | `cancel | `destructive]=?,
8+
unit
9+
) =>
10+
button =
11+
"";
12+
13+
[@bs.scope "AlertIOS"] [@bs.module "react-native"]
14+
external alert:
15+
(~title: string, ~message: string=?, ~buttons: array(button)=?, unit) =>
16+
unit =
17+
"alert";
18+
19+
[@bs.scope "AlertIOS"] [@bs.module "react-native"]
20+
external alertWithOKButton:
21+
(~title: string, ~message: string=?, ~callback: unit => unit=?, unit) => unit =
22+
"alert";
23+
24+
[@bs.scope "AlertIOS"] [@bs.module "react-native"]
25+
external prompt:
26+
(
27+
~title: string,
28+
~message: string=?,
29+
~buttons: array(button)=?,
30+
~_type: [@bs.string] [
31+
| `default
32+
| [@bs.as "plain-text"] `plainText
33+
| [@bs.as "secure-text"] `secureText
34+
| [@bs.as "login-password"] `loginPassword
35+
]
36+
=?,
37+
~defaultValue: string=?,
38+
~keyboardType: [@bs.string] [
39+
| `default
40+
| [@bs.as "number-pad"] `numberPad
41+
| [@bs.as "decimal-pad"] `decimalPad
42+
| `numeric
43+
| [@bs.as "email-address"] `emailAddress
44+
| [@bs.as "phone-pad"] `phonePad
45+
| [@bs.as "ascii-capable"] `asciiCapable
46+
| [@bs.as "numbers-and-punctuation"]
47+
`numbersAndPunctuation
48+
| `url
49+
| [@bs.as "name-phone-pad"] `namePhonePad
50+
| `twitter
51+
| [@bs.as "web-search"] `webSearch
52+
| [@bs.as "visible-password"] `visiblePassword
53+
]
54+
=?,
55+
unit
56+
) =>
57+
unit =
58+
"prompt";
59+
60+
[@bs.scope "AlertIOS"] [@bs.module "react-native"]
61+
external promptWithOKButton:
62+
(
63+
~title: string,
64+
~message: string=?,
65+
~callback: string => unit=?,
66+
~_type: [@bs.string] [
67+
| `default
68+
| [@bs.as "plain-text"] `plainText
69+
| [@bs.as "secure-text"] `secureText
70+
| [@bs.as "login-password"] `loginPassword
71+
]
72+
=?,
73+
~defaultValue: string=?,
74+
~keyboardType: [@bs.string] [
75+
| `default
76+
| [@bs.as "number-pad"] `numberPad
77+
| [@bs.as "decimal-pad"] `decimalPad
78+
| `numeric
79+
| [@bs.as "email-address"] `emailAddress
80+
| [@bs.as "phone-pad"] `phonePad
81+
| [@bs.as "ascii-capable"] `asciiCapable
82+
| [@bs.as "numbers-and-punctuation"]
83+
`numbersAndPunctuation
84+
| `url
85+
| [@bs.as "name-phone-pad"] `namePhonePad
86+
| `twitter
87+
| [@bs.as "web-search"] `webSearch
88+
| [@bs.as "visible-password"] `visiblePassword
89+
]
90+
=?,
91+
unit
92+
) =>
93+
unit =
94+
"prompt";

0 commit comments

Comments
 (0)