feat: export SwitchActions. closes #5916

This commit is contained in:
satyajit.happy
2019-05-18 15:41:31 +02:00
parent 338d5c2364
commit a3092ab17d
4 changed files with 56 additions and 15 deletions

View File

@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
## [3.11.0]
## New Features
- Export `SwitchActions`
## [3.10.2]
## Fixes

View File

@@ -181,6 +181,14 @@ declare module 'react-navigation' {
+key?: string,
|};
declare export type NavigationJumpToAction = {|
+type: 'Navigation/JUMP_TO',
+preserveFocus: boolean,
+routeName: string,
+key: string,
+params?: NavigationParams,
|};
declare export type NavigationOpenDrawerAction = {|
+type: 'Navigation/OPEN_DRAWER',
+key?: string,
@@ -213,6 +221,7 @@ declare module 'react-navigation' {
| NavigationResetAction
| NavigationReplaceAction
| NavigationCompleteTransitionAction
| NavigationJumpToAction
| NavigationOpenDrawerAction
| NavigationCloseDrawerAction
| NavigationToggleDrawerAction
@@ -401,9 +410,7 @@ 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) => {},
@@ -662,9 +669,7 @@ declare module 'react-navigation' {
onWillBlur?: NavigationEventCallback,
onDidBlur?: NavigationEventCallback,
};
declare export var NavigationEvents: React$ComponentType<
_NavigationEventsProps
>;
declare export var NavigationEvents: React$ComponentType<_NavigationEventsProps>;
/**
* Navigation container
@@ -902,6 +907,16 @@ declare module 'react-navigation' {
}) => NavigationCompleteTransitionAction,
};
declare export var SwitchActions: {
JUMP_TO: 'Navigation/JUMP_TO',
jumpTo: (payload: {
routeName: string,
key: string,
params?: NavigationParams,
}) => NavigationJumpToAction,
};
declare export var DrawerActions: {
OPEN_DRAWER: 'Navigation/OPEN_DRAWER',
CLOSE_DRAWER: 'Navigation/CLOSE_DRAWER',
@@ -1042,9 +1057,7 @@ 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?: {},
@@ -1115,9 +1128,7 @@ 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',
@@ -1207,9 +1218,7 @@ declare module 'react-navigation' {
labelStyle?: TextStyleProp,
iconStyle?: ViewStyleProp,
};
declare export var MaterialTopTabBar: React$ComponentType<
_MaterialTopTabBarProps
>;
declare export var MaterialTopTabBar: React$ComponentType<_MaterialTopTabBarProps>;
declare type _BottomTabBarButtonComponentProps = {
onPress: () => void,

View File

@@ -70,6 +70,9 @@ module.exports = {
get SwitchRouter() {
return require('@react-navigation/core').SwitchRouter;
},
get SwitchActions() {
return require('@react-navigation/core').SwitchActions;
},
get createConfigGetter() {
return require('@react-navigation/core').StackAcreateConfigGetterctions;
},

View File

@@ -396,6 +396,20 @@ declare module 'react-navigation' {
key?: string;
}
export interface NavigationJumpToActionPayload {
routeName: string;
key: string;
params?: NavigationParams;
}
export interface NavigationJumpToAction {
type: 'Navigation/JUMP_TO';
preserveFocus: boolean;
routeName: string;
key: string;
params?: NavigationParams;
}
export interface NavigationOpenDrawerAction {
key?: string;
type: 'Navigation/OPEN_DRAWER';
@@ -1228,6 +1242,15 @@ declare module 'react-navigation' {
): NavigationCompleteTransitionAction;
}
/**
* SwitchActions
*/
export namespace SwitchActions {
const JUMP_TO: 'Navigation/JUMP_TO';
function jumpTo(options: NavigationJumpToActionPayload): NavigationJumpToAction;
}
/**
* Transitioner
* @desc From react-navigation/src/views/Transitioner.js