import type { Route, Router } from '@esmx/router'; import type { RouterContextValue } from './types'; /** * React Context for router state. * Contains the router instance and current route. * Using null as default to detect missing provider. */ export declare const RouterContext: import("react").Context; /** * React Context for RouterView depth tracking. * Used for nested routing to determine which matched route to render. */ export declare const RouterViewDepthContext: import("react").Context; /** * Get the router context value. * @throws {Error} If used outside of RouterProvider * @internal */ export declare function useRouterContext(): RouterContextValue; /** * Get the router instance for navigation. * Must be used within a RouterProvider. * * @returns Router instance with navigation methods * @throws {Error} If used outside of RouterProvider * * @example * ```tsx * import { useRouter } from '@esmx/router-react'; * * function NavigationButton() { * const router = useRouter(); * * const handleClick = () => { * router.push('/dashboard'); * }; * * return ; * } * ``` */ export declare function useRouter(): Router; /** * Get the current route information. * Returns a reactive route object that updates when navigation occurs. * Must be used within a RouterProvider. * * @returns Current route object with path, params, query, etc. * @throws {Error} If used outside of RouterProvider * * @example * ```tsx * import { useRoute } from '@esmx/router-react'; * * function CurrentPath() { * const route = useRoute(); * * return ( *
*

Path: {route.path}

*

Params: {JSON.stringify(route.params)}

*

Query: {JSON.stringify(route.query)}

*
* ); * } * ``` */ export declare function useRoute(): Route; /** * Get the current RouterView depth. * Used internally by RouterView for nested routing. * * @returns Current depth level (0 for root, 1 for first nested, etc.) * * @example * ```tsx * import { useRouterViewDepth } from '@esmx/router-react'; * * function DebugView() { * const depth = useRouterViewDepth(); * return
Current depth: {depth}
; * } * ``` */ export declare function useRouterViewDepth(): number;