nexora
Version:
A lightweight, production-ready JavaScript library for building user interfaces, supporting JSX.
25 lines (24 loc) • 1.06 kB
TypeScript
import { RouterNameSpace, VNode } from '../../core';
/**
* Router provider component
* @description - The Router provider component is used to provide the router context to the application.
* @param value - The value of the router context.
* @param children - The children of the Router provider component.
* @returns The Router provider component.
*/
export declare function RouterProvider({ value, children }: RouterNameSpace.RouterProviderProps): VNode;
/**
* Use router hook
* @description - The useRouter hook is used to get the router context.
* @returns The router context.
*/
export declare function useRouter(): {
getRouterContext: () => RouterNameSpace.RouterContextType;
setRouterContext: (value: RouterNameSpace.RouterContextType | ((prev: RouterNameSpace.RouterContextType) => RouterNameSpace.RouterContextType)) => void;
};
/**
* Navigate to a new path
* @description - The navigate function is used to navigate to a new path.
* @param to - The path to navigate to.
*/
export declare function navigate(to: string): void;