mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-13 13:30:28 +00:00
Add navigationContext to react-native Navigator
react-native\Libraries\CustomComponents\Navigator\Navigator.js
var Navigator = React.createClass({
...
componentWillMount: function() {
// TODO(t7489503): Don't need this once ES6 Class landed.
this.__defineGetter__('navigationContext', this._getNavigationContext);
this._subRouteFocus = [];
...
...
}
react-native\Libraries\CustomComponents\Navigator\Navigation\NavigationContext.js
class NavigationContext {
...
}
This commit is contained in:
Vendored
+15
@@ -3247,6 +3247,19 @@ declare namespace __React {
|
||||
debugOverlay?: boolean
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Class that contains the info and methods for app navigation.
|
||||
*/
|
||||
export interface NavigationContext {
|
||||
parent: NavigationContext,
|
||||
top: NavigationContext,
|
||||
currentRoute: any,
|
||||
appendChild(childContext: NavigationContext): void;
|
||||
addListener(eventType: string, listener: () => void, useCapture?: boolean): NativeEventSubscription;
|
||||
emit(eventType: string, data: any, didEmitCallback?: () => void): void;
|
||||
dispose(): void;
|
||||
}
|
||||
|
||||
/**
|
||||
* Use Navigator to transition between different scenes in your app.
|
||||
@@ -3262,6 +3275,8 @@ declare namespace __React {
|
||||
NavigationBar: NavigatorStatic.NavigationBarStatic;
|
||||
BreadcrumbNavigationBar: NavigatorStatic.BreadcrumbNavigationBarStatic
|
||||
|
||||
navigationContext: NavigationContext;
|
||||
|
||||
getContext( self: any ): NavigatorStatic;
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user