mirror of
https://github.com/zhigang1992/react-navigation.git
synced 2026-03-06 22:39:41 +08:00
Export GestureContexts and add missing type for withOrientation, fix header back button title prop type
This commit is contained in:
9
src/react-navigation.js
vendored
9
src/react-navigation.js
vendored
@@ -121,6 +121,15 @@ module.exports = {
|
||||
return require('react-navigation-drawer').createDrawerNavigator;
|
||||
},
|
||||
|
||||
// Gesture contexts
|
||||
|
||||
get StackGestureContext() {
|
||||
return require('react-navigation-stack').StackGestureContext;
|
||||
},
|
||||
get DrawerGestureContext() {
|
||||
return require('react-navigation-drawer').DrawerGestureContext;
|
||||
},
|
||||
|
||||
// Routers and Actions
|
||||
|
||||
get DrawerRouter() {
|
||||
|
||||
18
typescript/react-navigation.d.ts
vendored
18
typescript/react-navigation.d.ts
vendored
@@ -33,6 +33,8 @@
|
||||
|
||||
declare module 'react-navigation' {
|
||||
import * as React from 'react';
|
||||
import { PanGestureHandler } from 'react-native-gesture-handler';
|
||||
|
||||
import {
|
||||
Animated,
|
||||
TextStyle,
|
||||
@@ -1331,7 +1333,7 @@ declare module 'react-navigation' {
|
||||
export interface HeaderBackButtonProps {
|
||||
onPress?: () => void;
|
||||
pressColorAndroid?: string;
|
||||
title?: string;
|
||||
title?: string | null;
|
||||
titleStyle?: StyleProp<TextStyle>;
|
||||
tintColor?: string;
|
||||
truncatedTitle?: string;
|
||||
@@ -1352,6 +1354,18 @@ declare module 'react-navigation' {
|
||||
T extends React.ComponentType<any>
|
||||
> = T extends React.ComponentType<infer P> ? P : never;
|
||||
|
||||
export interface NavigationOrientationInjectedProps {
|
||||
isLandscape: boolean;
|
||||
}
|
||||
|
||||
export function withOrientation<P extends NavigationOrientationInjectedProps>(
|
||||
Component: React.ComponentType<P>
|
||||
): React.ComponentType<Omit<P, keyof NavigationOrientationInjectedProps>>;
|
||||
|
||||
export interface NavigationInjectedProps<P = NavigationParams> {
|
||||
navigation: NavigationScreenProp<NavigationRoute<P>, P>;
|
||||
}
|
||||
|
||||
export interface NavigationInjectedProps<P = NavigationParams> {
|
||||
navigation: NavigationScreenProp<NavigationRoute<P>, P>;
|
||||
}
|
||||
@@ -1428,4 +1442,6 @@ declare module 'react-navigation' {
|
||||
export const SafeAreaView: React.ComponentClass<SafeAreaViewProps>;
|
||||
|
||||
export const NavigationContext: React.Context<NavigationScreenProp<NavigationRoute>>;
|
||||
export const StackGestureContext: React.Context<React.Ref<PanGestureHandler>>;
|
||||
export const DrawerGestureContext: React.Context<React.Ref<PanGestureHandler>>;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user