mirror of
https://github.com/zhigang1992/react-navigation.git
synced 2026-03-06 22:39:41 +08:00
feat: export SwitchActions. closes #5916
This commit is contained in:
@@ -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
|
||||
|
||||
39
flow/react-navigation.js
vendored
39
flow/react-navigation.js
vendored
@@ -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,
|
||||
|
||||
3
src/react-navigation.js
vendored
3
src/react-navigation.js
vendored
@@ -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;
|
||||
},
|
||||
|
||||
23
typescript/react-navigation.d.ts
vendored
23
typescript/react-navigation.d.ts
vendored
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user