@endernoke/wax
Version:
Routing framework for Ink
34 lines • 768 B
TypeScript
import type { Router, RouteParams } from "../types/index.js";
/**
* Hook to access the router instance with navigation methods
*
* @example
* ```tsx
* const router = useRouter();
* router.push('/chat/123');
* router.back();
* ```
*/
export declare function useRouter(): Router;
/**
* Hook to get the current pathname
*
* @example
* ```tsx
* const pathname = usePathname();
* // pathname = "/chat/123"
* ```
*/
export declare function usePathname(): string;
/**
* Hook to get the current route parameters
*
* @example
* ```tsx
* // In route: /chat/[id]
* const params = useParams<{ id: string }>();
* // params.id = "123"
* ```
*/
export declare function useParams<T extends RouteParams = RouteParams>(): T;
//# sourceMappingURL=index.d.ts.map