|
| 1 | +module Make = (S: {type screenProps;}) => { |
| 2 | + type screenProps = S.screenProps; |
| 3 | + |
| 4 | + type contentComponentProps = { |
| 5 | + . |
| 6 | + "navigation": Navigation.t, |
| 7 | + "screenProps": screenProps, |
| 8 | + }; |
| 9 | + |
| 10 | + type contentComponent = React.component(contentComponentProps); |
| 11 | + |
| 12 | + [@bs.module "react-navigation"] |
| 13 | + external drawerItems: contentComponent = "DrawerItems"; |
| 14 | + |
| 15 | + type contentOptions; |
| 16 | + |
| 17 | + [@bs.obj] |
| 18 | + external contentOptions: |
| 19 | + ( |
| 20 | + ~activeTintColor: string=?, |
| 21 | + ~activeBackgroundColor: string=?, |
| 22 | + ~inactiveTintColor: string=?, |
| 23 | + ~inactiveBackgroundColor: string=?, |
| 24 | + ~itemsContainerStyle: ReactNative.Style.t=?, |
| 25 | + ~itemStyle: ReactNative.Style.t=?, |
| 26 | + ~labelStyle: ReactNative.Style.t=?, |
| 27 | + ~activeLabelStyle: ReactNative.Style.t=?, |
| 28 | + ~inactiveLabelStyle: ReactNative.Style.t=?, |
| 29 | + ~iconContainerStyle: ReactNative.Style.t=?, |
| 30 | + // TODO: more props |
| 31 | + unit |
| 32 | + ) => |
| 33 | + contentOptions = |
| 34 | + ""; |
| 35 | + |
| 36 | + type config; |
| 37 | + |
| 38 | + [@bs.obj] |
| 39 | + external config: |
| 40 | + ( |
| 41 | + ~mode: [@bs.string] [ | `card | `modal]=?, |
| 42 | + ~drawerWidth: float=?, |
| 43 | + ~drawerPosition: [@bs.string] [ | `left | `right]=?, |
| 44 | + ~contentComponent: contentComponent=?, |
| 45 | + ~contentOptions: contentOptions=?, |
| 46 | + ~useNativeAnimations: bool=?, |
| 47 | + ~drawerBackgroundColor: string=?, |
| 48 | + ~initialRouteName: string=?, |
| 49 | + ~backBehavior: [@bs.string] [ | `initialRoute | `none]=?, |
| 50 | + ~hideStatusBar: bool=?, |
| 51 | + // TODO: more props |
| 52 | + unit |
| 53 | + ) => |
| 54 | + config = |
| 55 | + ""; |
| 56 | + |
| 57 | + [@bs.module "react-navigation"] |
| 58 | + external make: Js.t('a) => Types.navigator = "createDrawerNavigator"; |
| 59 | + |
| 60 | + [@bs.module "react-navigation"] |
| 61 | + external makeWithConfig: (Js.t('a), config) => Types.navigator = |
| 62 | + "createDrawerNavigator"; |
| 63 | +}; |
0 commit comments