Skip to content

Commit d2173f6

Browse files
authored
reason-react-native: add AccessibilityInfo API (#587)
1 parent d214b93 commit d2173f6

File tree

3 files changed

+136
-0
lines changed

3 files changed

+136
-0
lines changed
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: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
---
2+
id: apis/AccessibilityInfo
3+
title: AccessibilityInfo
4+
wip: true
5+
---
6+
7+
```reason
8+
type announcementResult = {
9+
.
10+
"announcement": string,
11+
"success": bool,
12+
};
13+
14+
[@bs.scope "AccessibilityInfo"] [@bs.module "react-native"]
15+
external isBoldTextEnabled: unit => Js.Promise.t(bool) = "";
16+
17+
[@bs.scope "AccessibilityInfo"] [@bs.module "react-native"]
18+
external isGrayscaleEnabled: unit => Js.Promise.t(bool) = "";
19+
20+
[@bs.scope "AccessibilityInfo"] [@bs.module "react-native"]
21+
external isInvertColorsEnabled: unit => Js.Promise.t(bool) = "";
22+
23+
[@bs.scope "AccessibilityInfo"] [@bs.module "react-native"]
24+
external isReduceMotionEnabled: unit => Js.Promise.t(bool) = "";
25+
26+
[@bs.scope "AccessibilityInfo"] [@bs.module "react-native"]
27+
external isReduceTransparencyEnabled: unit => Js.Promise.t(bool) = "";
28+
29+
[@bs.scope "AccessibilityInfo"] [@bs.module "react-native"]
30+
external isScreenReaderEnabled: unit => Js.Promise.t(bool) = "";
31+
32+
[@bs.scope "AccessibilityInfo"] [@bs.module "react-native"]
33+
external setAccessibilityFocus: NativeTypes.nodeHandle => unit = "";
34+
35+
[@bs.scope "AccessibilityInfo"] [@bs.module "react-native"]
36+
external announceForAccessibility: string => unit = "";
37+
38+
[@bs.scope "AccessibilityInfo"] [@bs.module "react-native"]
39+
external addEventListener:
40+
(
41+
[@bs.string]
42+
[
43+
| `boldTextChanged(bool => unit)
44+
| `grayscaleChanged(bool => unit)
45+
| `invertColorsChanged(bool => unit)
46+
| `reduceMotionChanged(bool => unit)
47+
| `screenReaderChanged(bool => unit)
48+
| `reduceTransparencyChanged(bool => unit)
49+
| `announcementFinished(announcementResult => unit)
50+
]
51+
) =>
52+
unit =
53+
"";
54+
55+
[@bs.scope "AccessibilityInfo"] [@bs.module "react-native"]
56+
external removeEventListener:
57+
(
58+
[@bs.string]
59+
[
60+
| `boldTextChanged(bool => unit)
61+
| `grayscaleChanged(bool => unit)
62+
| `invertColorsChanged(bool => unit)
63+
| `reduceMotionChanged(bool => unit)
64+
| `screenReaderChanged(bool => unit)
65+
| `reduceTransparencyChanged(bool => unit)
66+
| `announcementFinished(announcementResult => unit)
67+
]
68+
) =>
69+
unit =
70+
"";
71+
72+
```
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
type announcementResult = {
2+
.
3+
"announcement": string,
4+
"success": bool,
5+
};
6+
7+
[@bs.scope "AccessibilityInfo"] [@bs.module "react-native"]
8+
external isBoldTextEnabled: unit => Js.Promise.t(bool) = "";
9+
10+
[@bs.scope "AccessibilityInfo"] [@bs.module "react-native"]
11+
external isGrayscaleEnabled: unit => Js.Promise.t(bool) = "";
12+
13+
[@bs.scope "AccessibilityInfo"] [@bs.module "react-native"]
14+
external isInvertColorsEnabled: unit => Js.Promise.t(bool) = "";
15+
16+
[@bs.scope "AccessibilityInfo"] [@bs.module "react-native"]
17+
external isReduceMotionEnabled: unit => Js.Promise.t(bool) = "";
18+
19+
[@bs.scope "AccessibilityInfo"] [@bs.module "react-native"]
20+
external isReduceTransparencyEnabled: unit => Js.Promise.t(bool) = "";
21+
22+
[@bs.scope "AccessibilityInfo"] [@bs.module "react-native"]
23+
external isScreenReaderEnabled: unit => Js.Promise.t(bool) = "";
24+
25+
[@bs.scope "AccessibilityInfo"] [@bs.module "react-native"]
26+
external setAccessibilityFocus: NativeTypes.nodeHandle => unit = "";
27+
28+
[@bs.scope "AccessibilityInfo"] [@bs.module "react-native"]
29+
external announceForAccessibility: string => unit = "";
30+
31+
[@bs.scope "AccessibilityInfo"] [@bs.module "react-native"]
32+
external addEventListener:
33+
(
34+
[@bs.string]
35+
[
36+
| `boldTextChanged(bool => unit)
37+
| `grayscaleChanged(bool => unit)
38+
| `invertColorsChanged(bool => unit)
39+
| `reduceMotionChanged(bool => unit)
40+
| `screenReaderChanged(bool => unit)
41+
| `reduceTransparencyChanged(bool => unit)
42+
| `announcementFinished(announcementResult => unit)
43+
]
44+
) =>
45+
unit =
46+
"";
47+
48+
[@bs.scope "AccessibilityInfo"] [@bs.module "react-native"]
49+
external removeEventListener:
50+
(
51+
[@bs.string]
52+
[
53+
| `boldTextChanged(bool => unit)
54+
| `grayscaleChanged(bool => unit)
55+
| `invertColorsChanged(bool => unit)
56+
| `reduceMotionChanged(bool => unit)
57+
| `screenReaderChanged(bool => unit)
58+
| `reduceTransparencyChanged(bool => unit)
59+
| `announcementFinished(announcementResult => unit)
60+
]
61+
) =>
62+
unit =
63+
"";

0 commit comments

Comments
 (0)