import React, { ReactElement } from 'react'; import { ViewProps } from 'react-native'; import { RNINavigatorViewProps } from '../native_components/RNINavigatorView'; import { NavigatorConstantsObject } from '../native_modules/RNINavigatorViewModule'; import type { NavCommandPopOptions, NavCommandPushOptions, RouteTransitionConfig } from '../types/NavigationCommands'; import type { NavRouteItem, NavRouteStackItem, NavRouteStackPartialItem } from '../types/NavRouteItem'; import type { RenderNavItem } from '../types/NavTypes'; import type { NavRouteConfigItem } from '../types/NavRouteConfigItem'; import type { OnUIConstantsDidChangeEventObject } from '../types/RNINavigatorViewEvents'; export declare type SetRoutesTransformCallback = (currentRoutes: readonly NavRouteStackPartialItem[]) => Array; export declare type NavRoutesConfigMap = { [k: string]: NavRouteConfigItem; }; /** `NavigatorView` comp. props */ declare type NavigatorViewBaseProps = Partial> & { routes: NavRoutesConfigMap; initialRoutes: Array; sharedRouteProps?: object; renderNavBarLeftItem?: RenderNavItem; renderNavBarRightItem?: RenderNavItem; renderNavBarTitleItem?: RenderNavItem; renderNavBarBackground?: () => ReactElement; }; export declare type NavigatorViewProps = ViewProps & NavigatorViewBaseProps; /** `NavigatorView` comp. state */ declare type NavigatorViewState = Partial> & { activeRoutes: Array; transitionConfigPushOverride?: RouteTransitionConfig; transitionConfigPopOverride?: RouteTransitionConfig; }; export declare class NavigatorView extends React.PureComponent { /** A ref to the `RNINavigatorView` native component. */ nativeRef: React.Component; /** Unique identifier for this navigator */ private navigatorID; private navStatus; private emitter; /** Used for `removeRouteBatchedFromState`*/ private routesToRemove; /** Queue for nav. commands: only 1 command is called at a time */ private queue; private routeRefMap; constructor(props: NavigatorViewProps); componentWillUnmount(): void; private verifyProps; private isValidRouteKey; private getInitialRoutes; /** Creates a dict of the current native routes based on `state.activeRoutes` */ private getNativeRoutes; /** returns the current js/react routes sorted by `routeID` */ private getRoutesToRender; /** get route config with the matching `routeKey` */ private getRouteConfig; private getLastRouteTransitionDuration; private setNavStatus; /** used to set/reset the transition override for the current route */ private configureTransitionOverride; /** * Returns a promise that will resolve once all the routes in `routeItems` are added/initialized * from the native-side. * * If the route item in `routeItems` has a native route, then wait for them to be created * and initialized with data (e.g. wait for the `onNavRouteViewAdded` event). * * For each react/js route in `routeItems`, wait for it to be added as a subview in the * native side (e.g. wait for the `onNavRouteViewAdded` event). * * note: This promise will reject if the events fail to fire within `TIMEOUT_MOUNT` ms. */ private waitForRoutesToBeAdded; /** * Returns a promise that will resolve once all the routes in `routeItems` are removed * from from the native-side (i.e. wait for `onNavRouteDidPop`). */ private waitForRoutesToBeRemoved; private syncRoutesFromNative; /** Remove route from `state.activeRoutes` in batches a few ms apart. */ private removeRouteBatchedFromState; private _handleGetRefToNavigator; getActiveRoutes: () => NavRouteStackItem[]; push: (routeItem: Readonly, options?: NavCommandPushOptions | undefined) => Promise; pop: (options?: Readonly | undefined) => Promise; popToRoot: (options?: Readonly | undefined) => Promise; removeRoute: (routeIndex: number, animated?: boolean) => Promise; removeRoutes: (routeIndices: readonly number[], animated?: boolean) => Promise; replaceRoute: (prevRouteIndex: number, routeItem: Readonly, animated?: boolean) => Promise; insertRoute: (routeItem: Readonly, atIndex: number, animated?: boolean) => Promise; setRoutes: (transform: SetRoutesTransformCallback, animated?: boolean) => Promise; setNavigationBarHidden: (isHidden: boolean, animated: boolean) => Promise; replacePreviousRoute: (routeItem: Readonly, animated?: boolean) => Promise; replaceCurrentRoute: (routeItem: Readonly, animated?: boolean) => Promise; removePreviousRoute: (animated?: boolean) => Promise; removeAllPrevRoutes: (animated?: boolean) => Promise; sendCustomCommandToNative: (commandKey: string, commandData?: Readonly | null) => Promise; getNavigatorConstants: () => Promise; dismissModal: (animated?: boolean) => Promise; private _handleRouteViewWrapperRef; private _handleOnNavRouteViewAdded; private _handleOnSetNativeRoutes; private _handleOnNativeCommandRequest; private _handleOnCustomCommandFromNative; private _handleOnNavRouteWillPop; private _handleOnNavRouteDidPop; private _handleOnUIConstantsDidChange; private _handleOnNavRouteDidShow; private _renderRoutes; render(): JSX.Element; } export {};