Skip to content

Commit a0a6a55

Browse files
sgnycknitt
authored andcommitted
Zero-cost bindings to TimePickerAndroid (#405)
* Zero-cost bindings to TimePickerAndroid * fix response type
1 parent e9911dd commit a0a6a55

3 files changed

Lines changed: 69 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: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
---
2+
id: apis/NetInfo
3+
title: NetInfo
4+
wip: true
5+
---
6+
7+
```reason
8+
type options;
9+
10+
[@bs.obj]
11+
external options:
12+
(
13+
~hour: int=?,
14+
~minute: int=?,
15+
~is24Hour: bool=?,
16+
~mode: [@bs.string] [ | `clock | `spinner | `default ]=?
17+
unit
18+
) =>
19+
options =
20+
"";
21+
22+
type response = {
23+
.
24+
"action": string,
25+
"hour": int,
26+
"minute": int
27+
};
28+
29+
30+
[@bs.module "react-native"] [@bs.scope "TimePickerAndroid"]
31+
external open_: options => Js.Promise.t(response) = "open";
32+
33+
[@bs.module "react-native"] [@bs.scope "TimePickerAndroid"]
34+
external timeSetAction: string = "";
35+
36+
[@bs.module "react-native"] [@bs.scope "TimePickerAndroid"]
37+
external dismissedAction: string = "";
38+
39+
```
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
type options;
2+
3+
[@bs.obj]
4+
external options:
5+
(
6+
~hour: int=?,
7+
~minute: int=?,
8+
~is24Hour: bool=?,
9+
~mode: [@bs.string] [ | `clock | `spinner | `default]=?,
10+
unit
11+
) =>
12+
options =
13+
"";
14+
15+
type response = {
16+
.
17+
"action": string,
18+
"hour": int,
19+
"minute": int,
20+
};
21+
22+
[@bs.module "react-native"] [@bs.scope "TimePickerAndroid"]
23+
external open_: options => Js.Promise.t(response) = "open";
24+
25+
[@bs.module "react-native"] [@bs.scope "TimePickerAndroid"]
26+
external timeSetAction: string = "";
27+
28+
[@bs.module "react-native"] [@bs.scope "TimePickerAndroid"]
29+
external dismissedAction: string = "";

0 commit comments

Comments
 (0)