Skip to content

Commit e542c84

Browse files
Ashoatbrentvatne
authored andcommitted
[flow] Support custom navigators using Transitioner (react-navigation#5801)
1 parent a726515 commit e542c84

File tree

1 file changed

+18
-8
lines changed

1 file changed

+18
-8
lines changed

flow/react-navigation.js

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,7 @@ declare module 'react-navigation' {
238238
*/
239239
index: number,
240240
routes: Array<NavigationRoute>,
241+
isTransitioning?: boolean,
241242
};
242243

243244
declare export type NavigationRoute =
@@ -407,7 +408,9 @@ declare module 'react-navigation' {
407408
NavigationSceneRendererProps & {
408409
mode: HeaderMode,
409410
router: NavigationRouter<NavigationState, NavigationStackScreenOptions>,
410-
getScreenDetails: NavigationScene => NavigationScreenDetails<NavigationStackScreenOptions>,
411+
getScreenDetails: NavigationScene => NavigationScreenDetails<
412+
NavigationStackScreenOptions
413+
>,
411414
leftInterpolator: (props: NavigationSceneRendererProps) => {},
412415
titleInterpolator: (props: NavigationSceneRendererProps) => {},
413416
rightInterpolator: (props: NavigationSceneRendererProps) => {},
@@ -466,10 +469,10 @@ declare module 'react-navigation' {
466469
disableKeyboardHandling?: boolean,
467470
|};
468471

469-
declare export type StackNavigatorConfig = {|
472+
declare export type StackNavigatorConfig = $Shape<{|
470473
...NavigationStackViewConfig,
471474
...NavigationStackRouterConfig,
472-
|};
475+
|}>;
473476

474477
/**
475478
* Switch Navigator
@@ -658,7 +661,9 @@ declare module 'react-navigation' {
658661
onWillBlur?: NavigationEventCallback,
659662
onDidBlur?: NavigationEventCallback,
660663
};
661-
declare export var NavigationEvents: React$ComponentType<_NavigationEventsProps>;
664+
declare export var NavigationEvents: React$ComponentType<
665+
_NavigationEventsProps
666+
>;
662667

663668
/**
664669
* Navigation container
@@ -709,6 +714,7 @@ declare module 'react-navigation' {
709714
isStale: boolean,
710715
key: string,
711716
route: NavigationRoute,
717+
descriptor: ?NavigationDescriptor,
712718
};
713719

714720
declare export type NavigationTransitionProps = $Shape<{
@@ -920,9 +926,9 @@ declare module 'react-navigation' {
920926
router: NavigationRouter<S, O>,
921927
};
922928

923-
declare type NavigationDescriptor = {
929+
declare export type NavigationDescriptor = {
924930
key: string,
925-
state: NavigationLeafRoute | NavigationStateRoute,
931+
state: NavigationRoute,
926932
navigation: NavigationScreenProp<*>,
927933
getComponent: () => React$ComponentType<{}>,
928934
};
@@ -1037,7 +1043,9 @@ declare module 'react-navigation' {
10371043
*/
10381044
transitionConfig?: () => TransitionConfig,
10391045
} & NavigationNavigatorProps<NavigationStackScreenOptions, NavigationState>;
1040-
declare export var CardStackTransitioner: React$ComponentType<_CardStackTransitionerProps>;
1046+
declare export var CardStackTransitioner: React$ComponentType<
1047+
_CardStackTransitionerProps
1048+
>;
10411049

10421050
declare type _CardStackProps = {
10431051
screenProps?: {},
@@ -1108,7 +1116,9 @@ declare module 'react-navigation' {
11081116
truncatedTitle?: ?string,
11091117
width?: ?number,
11101118
};
1111-
declare export var HeaderBackButton: React$ComponentType<_HeaderBackButtonProps>;
1119+
declare export var HeaderBackButton: React$ComponentType<
1120+
_HeaderBackButtonProps
1121+
>;
11121122

11131123
declare type _DrawerViewProps = {
11141124
drawerLockMode?: 'unlocked' | 'locked-closed' | 'locked-open',

0 commit comments

Comments
 (0)