1 | import type { NavigationAction, NavigationState, ParamListBase } from '@react-navigation/routers';
|
2 | import * as React from 'react';
|
3 | import type { NavigationHelpers } from './types';
|
4 | export declare type ListenerMap = {
|
5 | action: ChildActionListener;
|
6 | focus: FocusedNavigationListener;
|
7 | };
|
8 | export declare type KeyedListenerMap = {
|
9 | getState: GetStateListener;
|
10 | beforeRemove: ChildBeforeRemoveListener;
|
11 | };
|
12 | export declare type AddListener = <T extends keyof ListenerMap>(type: T, listener: ListenerMap[T]) => void;
|
13 | export declare type AddKeyedListener = <T extends keyof KeyedListenerMap>(type: T, key: string, listener: KeyedListenerMap[T]) => void;
|
14 | export declare type ChildActionListener = (action: NavigationAction, visitedNavigators?: Set<string>) => boolean;
|
15 | export declare type FocusedNavigationCallback<T> = (navigation: NavigationHelpers<ParamListBase>) => T;
|
16 | export declare type FocusedNavigationListener = <T>(callback: FocusedNavigationCallback<T>) => {
|
17 | handled: boolean;
|
18 | result: T;
|
19 | };
|
20 | export declare type GetStateListener = () => NavigationState;
|
21 | export declare type ChildBeforeRemoveListener = (action: NavigationAction) => boolean;
|
22 |
|
23 |
|
24 |
|
25 | declare const NavigationBuilderContext: React.Context<{
|
26 | onAction?: ((action: NavigationAction, visitedNavigators?: Set<string> | undefined) => boolean) | undefined;
|
27 | addListener?: AddListener | undefined;
|
28 | addKeyedListener?: AddKeyedListener | undefined;
|
29 | onRouteFocus?: ((key: string) => void) | undefined;
|
30 | onDispatchAction: (action: NavigationAction, noop: boolean) => void;
|
31 | onOptionsChange: (options: object) => void;
|
32 | stackRef?: React.MutableRefObject<string | undefined> | undefined;
|
33 | }>;
|
34 | export default NavigationBuilderContext;
|