import type { NavigatorState, StackState, StackEntry, TabState, RouterInstance } from './types'; import type { PathMatch } from './matchPath'; /** * Resets the internal key counter used for generating unique screen keys. * Called during provider initialization and in tests. */ export declare function resetKeyCounter(): void; /** * Builds the initial navigator state tree from the router config. * Creates nested StackState/TabState structures matching the route hierarchy. * * @param router - The router instance created by `createRouter`. * @returns The root navigator state tree. */ export declare function createInitialState(router: RouterInstance): NavigatorState; /** * Immutably appends a new entry to a stack's entries array. * * @param state - The current stack state. * @param entry - The new stack entry to push. * @returns A new stack state with the entry appended. */ export declare function pushStack(state: StackState, entry: StackEntry): StackState; /** * Immutably removes the top entry from a stack. * No-op if only one entry remains (prevents popping the root screen). * * @param state - The current stack state. * @returns A new stack state with the top entry removed, or the same state if at root. */ export declare function popStack(state: StackState): StackState; /** * Switches the active tab and marks it as rendered for lazy mounting. * * @param state - The current tab state. * @param key - The key of the tab to switch to. * @returns A new tab state with the active tab updated. */ export declare function switchTab(state: TabState, key: string): TabState; /** * Core navigation reducer. Walks the matched pattern's navigator path top-down, * switching tabs and pushing stack entries as needed to reach the target route. * * @param state - The current navigator state tree. * @param match - The matched route pattern with extracted params. * @returns A new navigator state reflecting the navigation. */ export declare function navigateToMatch(state: NavigatorState, match: PathMatch): NavigatorState; /** * Returns whether there is a poppable stack anywhere in the state tree. * Used by Android BackHandler to decide whether to handle or let the app exit. * * @param state - The current navigator state tree. * @returns `true` if going back would pop a stack entry. */ export declare function canGoBack(state: NavigatorState): boolean; /** * Pops the deepest nested stack that has more than one entry. * Traverses the state tree depth-first to find the innermost poppable stack. * * @param state - The current navigator state tree. * @returns A new navigator state with the deepest stack popped, or the same state if nothing to pop. */ export declare function goBackReducer(state: NavigatorState): NavigatorState; /** * Walks the state tree to find the path of the currently focused screen. * For stacks, follows the top entry; for tabs, follows the active tab. * Recurses into nested navigators. */ export declare function getActivePath(state: NavigatorState): string; //# sourceMappingURL=stateOps.d.ts.map