Skip to content

Commit

Permalink
Zero-cost AccessibilityState and AccessibilityTrait. (facebook#364)
Browse files Browse the repository at this point in the history
  • Loading branch information
cknitt authored and MoOx committed Apr 13, 2019
1 parent 41d184d commit 5999c90
Show file tree
Hide file tree
Showing 26 changed files with 163 additions and 106 deletions.
4 changes: 2 additions & 2 deletions bs-react-native-next/src/components/ActivityIndicator.re
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ external make:
| `imagebutton
]
=?,
~accessibilityStates: array(Types.AccessibilityState.t)=?,
~accessibilityTraits: array(Types.AccessibilityTrait.t)=?,
~accessibilityStates: array(AccessibilityState.t)=?,
~accessibilityTraits: array(AccessibilityTrait.t)=?,
~accessibilityViewIsModal: bool=?,
~accessible: bool=?,
~collapsable: bool=?,
Expand Down
4 changes: 2 additions & 2 deletions bs-react-native-next/src/components/FlatList.re
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,8 @@ external make:
| `imagebutton
]
=?,
~accessibilityStates: array(Types.AccessibilityState.t)=?,
~accessibilityTraits: array(Types.AccessibilityTrait.t)=?,
~accessibilityStates: array(AccessibilityState.t)=?,
~accessibilityTraits: array(AccessibilityTrait.t)=?,
~accessibilityViewIsModal: bool=?,
~accessible: bool=?,
~collapsable: bool=?,
Expand Down
4 changes: 2 additions & 2 deletions bs-react-native-next/src/components/KeyboardAvoidingView.re
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ external make:
| `imagebutton
]
=?,
~accessibilityStates: array(Types.AccessibilityState.t)=?,
~accessibilityTraits: array(Types.AccessibilityTrait.t)=?,
~accessibilityStates: array(AccessibilityState.t)=?,
~accessibilityTraits: array(AccessibilityTrait.t)=?,
~accessibilityViewIsModal: bool=?,
~accessible: bool=?,
~collapsable: bool=?,
Expand Down
4 changes: 2 additions & 2 deletions bs-react-native-next/src/components/Picker.re
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ external make:
| `imagebutton
]
=?,
~accessibilityStates: array(Types.AccessibilityState.t)=?,
~accessibilityTraits: array(Types.AccessibilityTrait.t)=?,
~accessibilityStates: array(AccessibilityState.t)=?,
~accessibilityTraits: array(AccessibilityTrait.t)=?,
~accessibilityViewIsModal: bool=?,
~accessible: bool=?,
~collapsable: bool=?,
Expand Down
4 changes: 2 additions & 2 deletions bs-react-native-next/src/components/RefreshControl.re
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ external make:
| `imagebutton
]
=?,
~accessibilityStates: array(Types.AccessibilityState.t)=?,
~accessibilityTraits: array(Types.AccessibilityTrait.t)=?,
~accessibilityStates: array(AccessibilityState.t)=?,
~accessibilityTraits: array(AccessibilityTrait.t)=?,
~accessibilityViewIsModal: bool=?,
~accessible: bool=?,
~collapsable: bool=?,
Expand Down
4 changes: 2 additions & 2 deletions bs-react-native-next/src/components/SafeAreaView.re
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ external make:
| `imagebutton
]
=?,
~accessibilityStates: array(Types.AccessibilityState.t)=?,
~accessibilityTraits: array(Types.AccessibilityTrait.t)=?,
~accessibilityStates: array(AccessibilityState.t)=?,
~accessibilityTraits: array(AccessibilityTrait.t)=?,
~accessibilityViewIsModal: bool=?,
~accessible: bool=?,
~collapsable: bool=?,
Expand Down
4 changes: 2 additions & 2 deletions bs-react-native-next/src/components/ScrollView.re
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ external make:
| `imagebutton
]
=?,
~accessibilityStates: array(Types.AccessibilityState.t)=?,
~accessibilityTraits: array(Types.AccessibilityTrait.t)=?,
~accessibilityStates: array(AccessibilityState.t)=?,
~accessibilityTraits: array(AccessibilityTrait.t)=?,
~accessibilityViewIsModal: bool=?,
~accessible: bool=?,
~collapsable: bool=?,
Expand Down
4 changes: 2 additions & 2 deletions bs-react-native-next/src/components/SectionList.re
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,8 @@ external make:
| `imagebutton
]
=?,
~accessibilityStates: array(Types.AccessibilityState.t)=?,
~accessibilityTraits: array(Types.AccessibilityTrait.t)=?,
~accessibilityStates: array(AccessibilityState.t)=?,
~accessibilityTraits: array(AccessibilityTrait.t)=?,
~accessibilityViewIsModal: bool=?,
~accessible: bool=?,
~collapsable: bool=?,
Expand Down
4 changes: 2 additions & 2 deletions bs-react-native-next/src/components/Switch.re
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ external make:
| `imagebutton
]
=?,
~accessibilityStates: array(Types.AccessibilityState.t)=?,
~accessibilityTraits: array(Types.AccessibilityTrait.t)=?,
~accessibilityStates: array(AccessibilityState.t)=?,
~accessibilityTraits: array(AccessibilityTrait.t)=?,
~accessibilityViewIsModal: bool=?,
~accessible: bool=?,
~collapsable: bool=?,
Expand Down
4 changes: 2 additions & 2 deletions bs-react-native-next/src/components/TextInput.re
Original file line number Diff line number Diff line change
Expand Up @@ -226,8 +226,8 @@ external make:
| `imagebutton
]
=?,
~accessibilityStates: array(Types.AccessibilityState.t)=?,
~accessibilityTraits: array(Types.AccessibilityTrait.t)=?,
~accessibilityStates: array(AccessibilityState.t)=?,
~accessibilityTraits: array(AccessibilityTrait.t)=?,
~accessibilityViewIsModal: bool=?,
~accessible: bool=?,
~collapsable: bool=?,
Expand Down
2 changes: 1 addition & 1 deletion bs-react-native-next/src/components/TouchableHighlight.re
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ external make:
| `imagebutton
]
=?,
~accessibilityStates: array(Types.AccessibilityState.t)=?,
~accessibilityStates: array(AccessibilityState.t)=?,
~delayLongPress: int=?,
~delayPressIn: int=?,
~delayPressOut: int=?,
Expand Down
2 changes: 1 addition & 1 deletion bs-react-native-next/src/components/TouchableOpacity.re
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ external make:
| `imagebutton
]
=?,
~accessibilityStates: array(Types.AccessibilityState.t)=?,
~accessibilityStates: array(AccessibilityState.t)=?,
~delayLongPress: int=?,
~delayPressIn: int=?,
~delayPressOut: int=?,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ external make:
| `imagebutton
]
=?,
~accessibilityStates: array(Types.AccessibilityState.t)=?,
~accessibilityStates: array(AccessibilityState.t)=?,
~delayLongPress: int=?,
~delayPressIn: int=?,
~delayPressOut: int=?,
Expand Down
4 changes: 2 additions & 2 deletions bs-react-native-next/src/components/View.re
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ external make:
| `imagebutton
]
=?,
~accessibilityStates: array(Types.AccessibilityState.t)=?,
~accessibilityTraits: array(Types.AccessibilityTrait.t)=?,
~accessibilityStates: array(AccessibilityState.t)=?,
~accessibilityTraits: array(AccessibilityTrait.t)=?,
~accessibilityViewIsModal: bool=?,
~accessible: bool=?,
~collapsable: bool=?,
Expand Down
4 changes: 2 additions & 2 deletions bs-react-native-next/src/components/VirtualizedList.re
Original file line number Diff line number Diff line change
Expand Up @@ -181,8 +181,8 @@ external make:
| `imagebutton
]
=?,
~accessibilityStates: array(Types.AccessibilityState.t)=?,
~accessibilityTraits: array(Types.AccessibilityTrait.t)=?,
~accessibilityStates: array(AccessibilityState.t)=?,
~accessibilityTraits: array(AccessibilityTrait.t)=?,
~accessibilityViewIsModal: bool=?,
~accessible: bool=?,
~collapsable: bool=?,
Expand Down
4 changes: 2 additions & 2 deletions bs-react-native-next/src/components/VirtualizedSectionList.re
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,8 @@ external make:
| `imagebutton
]
=?,
~accessibilityStates: array(Types.AccessibilityState.t)=?,
~accessibilityTraits: array(Types.AccessibilityTrait.t)=?,
~accessibilityStates: array(AccessibilityState.t)=?,
~accessibilityTraits: array(AccessibilityTrait.t)=?,
~accessibilityViewIsModal: bool=?,
~accessible: bool=?,
~collapsable: bool=?,
Expand Down
1 change: 1 addition & 0 deletions bs-react-native-next/src/types/AccessibilityState.bs.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */
7 changes: 7 additions & 0 deletions bs-react-native-next/src/types/AccessibilityState.re
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
type t = string;

[@bs.inline]
let selected = "selected";

[@bs.inline]
let disabled = "disabled";
7 changes: 7 additions & 0 deletions bs-react-native-next/src/types/AccessibilityState.rei
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
type t;

[@bs.inline "selected"]
let selected: t;

[@bs.inline "disabled"]
let disabled: t;
1 change: 1 addition & 0 deletions bs-react-native-next/src/types/AccessibilityTrait.bs.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */
52 changes: 52 additions & 0 deletions bs-react-native-next/src/types/AccessibilityTrait.re
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
type t = string;

[@bs.inline]
let none = "none";

[@bs.inline]
let button = "button";

[@bs.inline]
let link = "link";

[@bs.inline]
let header = "header";

[@bs.inline]
let search = "search";

[@bs.inline]
let image = "image";

[@bs.inline]
let selected = "selected";

[@bs.inline]
let plays = "plays";

[@bs.inline]
let key = "key";

[@bs.inline]
let text = "text";

[@bs.inline]
let summary = "summary";

[@bs.inline]
let disabled = "disabled";

[@bs.inline]
let frequentUpdates = "frequentUpdates";

[@bs.inline]
let startsMedia = "startsMedia";

[@bs.inline]
let adjustable = "adjustable";

[@bs.inline]
let allowsDirectInteraction = "allowsDirectInteraction";

[@bs.inline]
let pageTurn = "pageTurn";
52 changes: 52 additions & 0 deletions bs-react-native-next/src/types/AccessibilityTrait.rei
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
type t;

[@bs.inline "none"]
let none: t;

[@bs.inline "button"]
let button: t;

[@bs.inline "link"]
let link: t;

[@bs.inline "header"]
let header: t;

[@bs.inline "search"]
let search: t;

[@bs.inline "image"]
let image: t;

[@bs.inline "selected"]
let selected: t;

[@bs.inline "plays"]
let plays: t;

[@bs.inline "key"]
let key: t;

[@bs.inline "text"]
let text: t;

[@bs.inline "summary"]
let summary: t;

[@bs.inline "disabled"]
let disabled: t;

[@bs.inline "frequentUpdates"]
let frequentUpdates: t;

[@bs.inline "startsMedia"]
let startsMedia: t;

[@bs.inline "adjustable"]
let adjustable: t;

[@bs.inline "allowsDirectInteraction"]
let allowsDirectInteraction: t;

[@bs.inline "pageTurn"]
let pageTurn: t;
1 change: 1 addition & 0 deletions bs-react-native-next/src/types/Types.bs.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */
13 changes: 13 additions & 0 deletions bs-react-native-next/src/types/Types.re
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[@bs.deriving abstract]
type insets = {
left: float,
right: float,
top: float,
bottom: float,
};

[@bs.deriving abstract]
type point = {
x: float,
y: float,
};
31 changes: 0 additions & 31 deletions bs-react-native-next/src/utils/Types.bs.js

This file was deleted.

46 changes: 0 additions & 46 deletions bs-react-native-next/src/utils/Types.re

This file was deleted.

0 comments on commit 5999c90

Please sign in to comment.