diff --git a/types/react-navigation/index.d.ts b/types/react-navigation/index.d.ts index b0f426862ef700..e0f74b1c2d01e5 100644 --- a/types/react-navigation/index.d.ts +++ b/types/react-navigation/index.d.ts @@ -491,6 +491,13 @@ export type LayoutEvent = { * BEGIN MANUAL DEFINITIONS OUTSIDE OF TYPEDEFINITION.JS */ + +// From navigators/NavigatorTypes.js +export type NavigatorType = +| 'react-navigation/STACK' +| 'react-navigation/TABS' +| 'react-navigation/DRAWER'; + // From addNavigatorHelpers.js export function addNavigationHelpers(navigation: NavigationProp): NavigationScreenProp; @@ -664,6 +671,30 @@ export function StackRouter( routeConfigs: NavigationRouteConfigMap, config: NavigationTabRouterConfig ): NavigationRouter + +/** + * Create Navigator + * + * @see https://github.com/react-community/react-navigation/blob/master/src/navigators/createNavigator.js + */ +export function createNavigator( + router: NavigationRouter, + routeConfigs?: NavigationRouteConfigMap, + navigatorConfig?: NavigatorConfig, + navigatorType?: NavigatorType +): (NavigationView: React.ComponentClass) => NavigationNavigator + +/** + * Create an HOC that injects the navigation and manages the navigation state + * in case it's not passed from above. + * This allows to use e.g. the StackNavigator and TabNavigator as root-level + * components. + * + * @see https://github.com/react-community/react-navigation/blob/master/src/createNavigationContainer.js + */ +export function createNavigationContainer( + Component: NavigationNavigator +): React.Component /** * END MANUAL DEFINITIONS OUTSIDE OF TYPEDEFINITION.JS */