Skip to content

Commit 0c8ff63

Browse files
sgnycknitt
authored andcommitted
Zero-cost bindings to ToastAndroid (#407)
1 parent bc9422c commit 0c8ff63

3 files changed

Lines changed: 68 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: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
---
2+
id: apis/ToastAndroid
3+
title: ToastAndroid
4+
wip: true
5+
---
6+
7+
```reason
8+
type message = string;
9+
type duration;
10+
type gravity;
11+
12+
[@bs.module "react-native"] [@bs.scope "ToastAndroid"]
13+
external short: duration = "SHORT";
14+
15+
[@bs.module "react-native"] [@bs.scope "ToastAndroid"]
16+
external long: duration = "LONG";
17+
18+
[@bs.module "react-native"] [@bs.scope "ToastAndroid"]
19+
external top: gravity = "TOP";
20+
21+
[@bs.module "react-native"] [@bs.scope "ToastAndroid"]
22+
external bottom: gravity = "BOTTOM";
23+
24+
[@bs.module "react-native"] [@bs.scope "ToastAndroid"]
25+
external center: gravity = "CENTER";
26+
27+
[@bs.module "react-native"] [@bs.scope "ToastAndroid"]
28+
external show: (message, duration) => unit = "";
29+
30+
[@bs.module "react-native"] [@bs.scope "ToastAndroid"]
31+
external showWithGravity: (message, duration, gravity) => unit = "";
32+
33+
[@bs.module "react-native"] [@bs.scope "ToastAndroid"]
34+
external showWithGravityAndOffset:
35+
(message, duration, gravity, ~xOffset: float, ~yOffset: float) => unit =
36+
"";
37+
38+
```
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
type message = string;
2+
type duration;
3+
type gravity;
4+
5+
[@bs.module "react-native"] [@bs.scope "ToastAndroid"]
6+
external short: duration = "SHORT";
7+
8+
[@bs.module "react-native"] [@bs.scope "ToastAndroid"]
9+
external long: duration = "LONG";
10+
11+
[@bs.module "react-native"] [@bs.scope "ToastAndroid"]
12+
external top: gravity = "TOP";
13+
14+
[@bs.module "react-native"] [@bs.scope "ToastAndroid"]
15+
external bottom: gravity = "BOTTOM";
16+
17+
[@bs.module "react-native"] [@bs.scope "ToastAndroid"]
18+
external center: gravity = "CENTER";
19+
20+
[@bs.module "react-native"] [@bs.scope "ToastAndroid"]
21+
external show: (message, duration) => unit = "";
22+
23+
[@bs.module "react-native"] [@bs.scope "ToastAndroid"]
24+
external showWithGravity: (message, duration, gravity) => unit = "";
25+
26+
[@bs.module "react-native"] [@bs.scope "ToastAndroid"]
27+
external showWithGravityAndOffset:
28+
(message, duration, gravity, ~xOffset: float, ~yOffset: float) => unit =
29+
"";

0 commit comments

Comments
 (0)