import type { ComponentProps, ComponentType, ForwardRefExoticComponent, PropsWithoutRef, ReactNode, RefAttributes } from 'react'; import type { EventMapBase, NavigationState } from '../react-navigation/native'; import type { PickPartial } from '../types'; import type { ScreenProps } from '../useScreens'; import { Protected } from '../views/Protected'; import { type GuardedRedirects } from './GuardContext'; export declare function useFilterScreenChildren, TState extends NavigationState = NavigationState, TEventMap extends EventMapBase = EventMapBase>(children: ReactNode, { isCustomNavigator, contextKey, }?: { isCustomNavigator?: boolean; /** Used for sending developer hints */ contextKey?: string; }): { screens: (ScreenProps & { name: string; })[]; children: any[]; guardedRedirects: GuardedRedirects; }; /** * Returns a navigator that automatically injects matched routes and renders nothing when there are no children. * Return type with `children` prop optional. * * Enables use of other built-in React Navigation navigators and other navigators built with the React Navigation custom navigator API. * * @deprecated Use `integrateWithRouter` instead. * * @param Nav - The navigator component to wrap. * @param processScreens - A function that processes the screens before passing them to the navigator. * It must preserve every screen name exactly once because guards are associated with the original * screen names. * * @example * ```tsx app/_layout.tsx * import { ParamListBase, TabNavigationState } from "@react-navigation/native"; * import { * createMaterialTopTabNavigator, * MaterialTopTabNavigationOptions, * MaterialTopTabNavigationEventMap, * } from "@react-navigation/material-top-tabs"; * import { withLayoutContext } from "expo-router"; * * const MaterialTopTabs = createMaterialTopTabNavigator(); * * const ExpoRouterMaterialTopTabs = withLayoutContext< * MaterialTopTabNavigationOptions, * typeof MaterialTopTabs.Navigator, * TabNavigationState, * MaterialTopTabNavigationEventMap * >(MaterialTopTabs.Navigator); * export default function TabLayout() { * return ; * } * ``` */ export declare function withLayoutContext, T extends ComponentType = ComponentType, TState extends NavigationState = NavigationState, TEventMap extends EventMapBase = EventMapBase>(Nav: T, processScreens?: (screens: (ScreenProps & { name: string; })[]) => (ScreenProps & { name: string; })[]): ForwardRefExoticComponent, "children">> & RefAttributes> & { Screen: (props: ScreenProps) => null; Protected: typeof Protected; };