[flow] Support custom navigators using Transitioner (#5801)

This commit is contained in:
Ashoat Tevosyan
2019-04-10 12:35:30 -04:00
parent 1f5c33bf99
commit b9ed39ffed

View File

@@ -238,6 +238,7 @@ declare module 'react-navigation' {
*/
index: number,
routes: Array<NavigationRoute>,
isTransitioning?: boolean,
};
declare export type NavigationRoute =
@@ -407,7 +408,9 @@ declare module 'react-navigation' {
NavigationSceneRendererProps & {
mode: HeaderMode,
router: NavigationRouter<NavigationState, NavigationStackScreenOptions>,
getScreenDetails: NavigationScene => NavigationScreenDetails<NavigationStackScreenOptions>,
getScreenDetails: NavigationScene => NavigationScreenDetails<
NavigationStackScreenOptions
>,
leftInterpolator: (props: NavigationSceneRendererProps) => {},
titleInterpolator: (props: NavigationSceneRendererProps) => {},
rightInterpolator: (props: NavigationSceneRendererProps) => {},
@@ -466,10 +469,10 @@ declare module 'react-navigation' {
disableKeyboardHandling?: boolean,
|};
declare export type StackNavigatorConfig = {|
declare export type StackNavigatorConfig = $Shape<{|
...NavigationStackViewConfig,
...NavigationStackRouterConfig,
|};
|}>;
/**
* Switch Navigator
@@ -658,7 +661,9 @@ declare module 'react-navigation' {
onWillBlur?: NavigationEventCallback,
onDidBlur?: NavigationEventCallback,
};
declare export var NavigationEvents: React$ComponentType<_NavigationEventsProps>;
declare export var NavigationEvents: React$ComponentType<
_NavigationEventsProps
>;
/**
* Navigation container
@@ -709,6 +714,7 @@ declare module 'react-navigation' {
isStale: boolean,
key: string,
route: NavigationRoute,
descriptor: ?NavigationDescriptor,
};
declare export type NavigationTransitionProps = $Shape<{
@@ -920,9 +926,9 @@ declare module 'react-navigation' {
router: NavigationRouter<S, O>,
};
declare type NavigationDescriptor = {
declare export type NavigationDescriptor = {
key: string,
state: NavigationLeafRoute | NavigationStateRoute,
state: NavigationRoute,
navigation: NavigationScreenProp<*>,
getComponent: () => React$ComponentType<{}>,
};
@@ -1037,7 +1043,9 @@ declare module 'react-navigation' {
*/
transitionConfig?: () => TransitionConfig,
} & NavigationNavigatorProps<NavigationStackScreenOptions, NavigationState>;
declare export var CardStackTransitioner: React$ComponentType<_CardStackTransitionerProps>;
declare export var CardStackTransitioner: React$ComponentType<
_CardStackTransitionerProps
>;
declare type _CardStackProps = {
screenProps?: {},
@@ -1108,7 +1116,9 @@ declare module 'react-navigation' {
truncatedTitle?: ?string,
width?: ?number,
};
declare export var HeaderBackButton: React$ComponentType<_HeaderBackButtonProps>;
declare export var HeaderBackButton: React$ComponentType<
_HeaderBackButtonProps
>;
declare type _DrawerViewProps = {
drawerLockMode?: 'unlocked' | 'locked-closed' | 'locked-open',