Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 4268ebd

Browse files
cknittMoOx
authored andcommitted
Avoid Types module (#2)
1 parent 5e946bc commit 4268ebd

File tree

11 files changed

+29
-30
lines changed

11 files changed

+29
-30
lines changed

‎src/AppContainer.re‎

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
type persistNavigationState = Types.navigationState => Js.Promise.t(unit);
2-
type loadNavigationState =
3-
unit => Js.Promise.t(option(Types.navigationState));
1+
type persistNavigationState = NavigationState.t => Js.Promise.t(unit);
2+
type loadNavigationState = unit => Js.Promise.t(option(NavigationState.t));
43

54
type appContainerProps('screenProps) = {
65
.
@@ -12,11 +11,11 @@ type appContainerProps('screenProps) = {
1211

1312
module Make = (S: {
1413
type screenProps;
15-
let navigator: Types.navigator;
14+
let navigator: Navigator.t;
1615
}) => {
1716
[@bs.module "react-navigation"]
1817
external make:
19-
Types.navigator => React.component(appContainerProps(S.screenProps)) =
18+
Navigator.t => React.component(appContainerProps(S.screenProps)) =
2019
"createAppContainer";
2120

2221
[@bs.obj]

‎src/DrawerNavigator.re‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ external config:
5353
"";
5454

5555
[@bs.module "react-navigation"]
56-
external make: Js.t('a) => Types.navigator = "createDrawerNavigator";
56+
external make: Js.t('a) => Navigator.t = "createDrawerNavigator";
5757

5858
[@bs.module "react-navigation"]
59-
external makeWithConfig: (Js.t('a), config) => Types.navigator =
59+
external makeWithConfig: (Js.t('a), config) => Navigator.t =
6060
"createDrawerNavigator";

‎src/Navigation.re‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ external navigationContext: React.Context.t(t) = "NavigationContext";
55

66
let useNavigation = () => React.useContext(navigationContext);
77

8-
[@bs.get] external state: t => Types.navigationState = "";
8+
[@bs.get] external state: t => NavigationState.t = "";
99

1010
[@bs.send] external navigate: (t, string) => unit = "";
1111
[@bs.send]
File renamed without changes.

‎src/NavigationState.re‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
type t = {
2+
.
3+
"index": int,
4+
"routeName": string,
5+
"routes": option(array(t)),
6+
"isDrawerOpen": bool,
7+
};
8+
9+
type persistNavigationState = t => Js.Promise.t(unit);
10+
type loadNavigationState = unit => Js.Promise.t(option(t));

‎src/Navigator.bs.js‎

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. */

‎src/Navigator.re‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
type props;
2+
3+
type t = React.component(props);

‎src/StackNavigator.re‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ external config:
2222
"";
2323

2424
[@bs.module "react-navigation"]
25-
external make: Js.t('a) => Types.navigator = "createStackNavigator";
25+
external make: Js.t('a) => Navigator.t = "createStackNavigator";
2626

2727
[@bs.module "react-navigation"]
28-
external makeWithConfig: (Js.t('a), config) => Types.navigator =
28+
external makeWithConfig: (Js.t('a), config) => Navigator.t =
2929
"createStackNavigator";

‎src/SwitchNavigator.re‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ external config:
1717
"";
1818

1919
[@bs.module "react-navigation"]
20-
external make: Js.t('a) => Types.navigator = "createSwitchNavigator";
20+
external make: Js.t('a) => Navigator.t = "createSwitchNavigator";
2121

2222
[@bs.module "react-navigation"]
23-
external makeWithConfig: (Js.t('a), config) => Types.navigator =
23+
external makeWithConfig: (Js.t('a), config) => Navigator.t =
2424
"createSwitchNavigator";

‎src/TabNavigator.re‎

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,19 +42,18 @@ external config:
4242

4343
module MaterialTop = {
4444
[@bs.module "react-navigation"]
45-
external make: Js.t('a) => Types.navigator =
46-
"createMaterialTopTabNavigator";
45+
external make: Js.t('a) => Navigator.t = "createMaterialTopTabNavigator";
4746

4847
[@bs.module "react-navigation"]
49-
external makeWithConfig: (Js.t('a), config) => Types.navigator =
48+
external makeWithConfig: (Js.t('a), config) => Navigator.t =
5049
"createMaterialTopTabNavigator";
5150
};
5251

5352
module Bottom = {
5453
[@bs.module "react-navigation"]
55-
external make: Js.t('a) => Types.navigator = "createBottomTabNavigator";
54+
external make: Js.t('a) => Navigator.t = "createBottomTabNavigator";
5655

5756
[@bs.module "react-navigation"]
58-
external makeWithConfig: (Js.t('a), config) => Types.navigator =
57+
external makeWithConfig: (Js.t('a), config) => Navigator.t =
5958
"createBottomTabNavigator";
6059
};

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /