Skip to content

Commit d688e7e

Browse files
sgnycknitt
authored andcommitted
Zero-cost bindings to DatePickerAndroid (#406)
* Zero-cost DatePickerAndroid bindings * Zero-cost bindings to DatePickerAndroid
1 parent e3bd971 commit d688e7e

3 files changed

Lines changed: 80 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: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
---
2+
id: apis/DatePickerAndroid
3+
title: DatePickerAndroid
4+
wip: true
5+
---
6+
7+
```reason
8+
type options;
9+
10+
type date;
11+
12+
external calendarDate: Js.Date.t => date = "%identity";
13+
external timestamp: float => date = "%identity";
14+
15+
[@bs.obj]
16+
external options:
17+
(
18+
~date: date=?,
19+
~minDate: date=?,
20+
~maxDate: date=?,
21+
~mode: [@bs.string] [ | `calendar | `spinner | `default]=?,
22+
unit
23+
) =>
24+
options =
25+
"";
26+
27+
type response = {
28+
.
29+
"action": string,
30+
"year": int,
31+
"month": int,
32+
"day": int,
33+
};
34+
35+
[@bs.module "react-native"] [@bs.scope "DatePickerAndroid"]
36+
external open_: options => Js.Promise.t(response) = "open";
37+
38+
[@bs.module "react-native"] [@bs.scope "DatePickerAndroid"]
39+
external dateSetAction: string = "";
40+
41+
[@bs.module "react-native"] [@bs.scope "DatePickerAndroid"]
42+
external dismissedAction: string = "";
43+
44+
```
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
type options;
2+
3+
type date;
4+
5+
external calendarDate: Js.Date.t => date = "%identity";
6+
external timestamp: float => date = "%identity";
7+
8+
[@bs.obj]
9+
external options:
10+
(
11+
~date: date=?,
12+
~minDate: date=?,
13+
~maxDate: date=?,
14+
~mode: [@bs.string] [ | `calendar | `spinner | `default]=?,
15+
unit
16+
) =>
17+
options =
18+
"";
19+
20+
type response = {
21+
.
22+
"action": string,
23+
"year": int,
24+
"month": int,
25+
"day": int,
26+
};
27+
28+
[@bs.module "react-native"] [@bs.scope "DatePickerAndroid"]
29+
external open_: options => Js.Promise.t(response) = "open";
30+
31+
[@bs.module "react-native"] [@bs.scope "DatePickerAndroid"]
32+
external dateSetAction: string = "";
33+
34+
[@bs.module "react-native"] [@bs.scope "DatePickerAndroid"]
35+
external dismissedAction: string = "";

0 commit comments

Comments
 (0)