import "./screen_router.css"; import React from "react"; import { useRender } from "@base-ui/react/use-render"; import { type StyleProps } from "./style_props"; /** Provided by Dialog, MDD, or a standalone ScreenRouter. */ export interface ScreenRouterContextValue { currentPath: string; navigate: (path: string, options?: { replace?: boolean; }) => void; goBack: () => void; canGoBack: boolean; params: Record; } export declare const ScreenRouterContext: React.Context; /** The route registry and stack paths; not for consumers. */ export interface ScreenRouterInternalContextValue { stackPaths: string[]; routePatterns: string[]; registerRoute: (pattern: string) => void; unregisterRoute: (pattern: string) => void; } export declare const ScreenRouterInternalContext: React.Context; export declare function useScreenRouter(): ScreenRouterContextValue; interface RouteRegistry { routePatterns: string[]; registerRoute: (pattern: string) => void; unregisterRoute: (pattern: string) => void; } /** Shared by all routers. */ export declare function useRouteRegistry(): RouteRegistry; interface NavigationStackResult { routerValue: ScreenRouterContextValue; internalValue: ScreenRouterInternalContextValue; /** Back to `initialRoute`; called when the container closes. */ resetStack: () => void; } /** Used by Dialog and ScreenRouter; MDD has its own section-based stack. */ export declare function useNavigationStack(initialRoute: string, routeRegistry: RouteRegistry): NavigationStackResult; export declare function useScreenActive(): boolean; export interface ScreenProps extends StyleProps { /** `""` for the default screen. */ route: string; children: React.ReactNode | ((params: Record) => React.ReactNode); testID?: string; ref?: React.Ref; render?: useRender.RenderProp; } /** Registers its route on mount; renders when the route is in the stack — the top one `display: flex`, * those behind `display: none` (keeping scroll) — and unmounts when out of it. Works in Dialog, * MasterDetailDialog or a standalone ScreenRouter. */ export declare function Screen(props: ScreenProps): React.JSX.Element | null; export interface ScreenRouterProps { initialRoute?: string; children: React.ReactNode; } /** Standalone flat-stack router for containers needing navigation without Dialog or MDD chrome. */ export declare function ScreenRouter(props: ScreenRouterProps): React.JSX.Element; export {};