UNPKG

use-react-native-navigation

Version:

A utility library for a easier use of react-native-navigation library.

87 lines 3.08 kB
/// <reference types="react" /> import { Options, Layout, LayoutRoot } from 'react-native-navigation'; export declare type NavigationCommandType = 'SET_ROOT' | 'SET_NEW_STACK_ROOT' | 'PUSH' | 'POP' | 'POP_TO' | 'POP_TO_ROOT' | 'SHOW_MODAL' | 'MANUAL_DISMISS_MODAL' | 'MANUAL_DISMISS_ALL_MODALS' | 'SHOW_OVERLAY' | 'DISMISS_OVERLAY'; export declare type NavigationStatus = { /** * Whether the current componentId is still being set. * There may be some delay in setting the latest componentId as * it relies on `componentDidAppear` and `componentDidDisappear` events. */ updating: boolean; /** * Current componentId visible to the user. */ currentComponentId: null | string; /** * Previous componentId that was visible to the user. * This is useful for overlay and modal dismiss events. */ previousComponentId: null | string; /** * When modal is shown, save the componentId of the * visible screen. */ previousStackComponentIds: string[]; /** * Custom navigation command emitted on each action. */ commandType: NavigationCommandType | null; }; export declare class NavigationStore { status: NavigationStatus; updateNavigationStatus(status: Partial<NavigationStatus>): void; /** * A wrapper for Navigation.setRoot. */ setRoot(layout: LayoutRoot): Promise<any>; /** * A wrapper for Navigation.setStackRoot. */ setStackRoot<P>(toId: string, layout: Layout<P>): Promise<any>; /** * A wrapper for Navigation.push. */ push<P>(toId: string, layout: Layout<P>): Promise<any>; /** * A wrapper for Navigation.pop. */ pop(onId: string, mergeOptions?: Options): Promise<any>; /** * A wrapper for Navigation.popTo. */ popTo(toId: string, mergeOptions?: Options): Promise<any>; /** * A wrapper for Navigation.popToRoot. */ popToRoot(onId: string, mergeOptions?: Options): Promise<any>; /** * A wrapper for Navigation.showModal. */ showModal<P>(layout: Layout<P>): Promise<any>; /** * A wrapper for Navigation.dismissModal. */ dismissModal(onId: string, mergeOptions?: Options): Promise<any>; /** * A wrapper for Navigation.dismissAllModals. */ dismissAllModals(mergeOptions?: Options): Promise<any>; /** * A wrapper for Navigation.showOverlay. */ showOverlay<P>(layout: Layout<P>): Promise<any>; /** * A wrapper for Navigation.dismissOverlay. */ dismissOverlay(onId: string): Promise<any>; private handleNavigationError; onPreviousStackComponentShown(stackList: string[]): { lastStackComponentId: string; updatedStackList: string[]; }; onAllStackComponentsDismissed(stackList: string[]): string; } export declare const navigationStore: NavigationStore; export declare const NavigationStoreContext: import("react").Context<NavigationStore>; export declare const useNavigationStore: () => NavigationStore; //# sourceMappingURL=navigation.store.d.ts.map