Skip to content

Commit

Permalink
[flow] Support custom navigators using Transitioner (react-navigation…
Browse files Browse the repository at this point in the history
  • Loading branch information
Ashoat authored and brentvatne committed Apr 10, 2019
1 parent a726515 commit e542c84
Showing 1 changed file with 18 additions and 8 deletions.
26 changes: 18 additions & 8 deletions flow/react-navigation.js
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,7 @@ declare module 'react-navigation' {
*/
index: number,
routes: Array<NavigationRoute>,
isTransitioning?: boolean,
};

declare export type NavigationRoute =
Expand Down Expand Up @@ -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) => {},
Expand Down Expand Up @@ -466,10 +469,10 @@ declare module 'react-navigation' {
disableKeyboardHandling?: boolean,
|};

declare export type StackNavigatorConfig = {|
declare export type StackNavigatorConfig = $Shape<{|
...NavigationStackViewConfig,
...NavigationStackRouterConfig,
|};
|}>;

/**
* Switch Navigator
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -709,6 +714,7 @@ declare module 'react-navigation' {
isStale: boolean,
key: string,
route: NavigationRoute,
descriptor: ?NavigationDescriptor,
};

declare export type NavigationTransitionProps = $Shape<{
Expand Down Expand Up @@ -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<{}>,
};
Expand Down Expand Up @@ -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?: {},
Expand Down Expand Up @@ -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',
Expand Down

0 comments on commit e542c84

Please sign in to comment.