import { HistoryNavigator, LocationChangeEvent, NavigateOptions } from "./HistoryNavigator";
import { PathMatch, PathMatcher } from "./PathMatcher";
export type LazyImportFn = () => Promise<any>;
export interface ComponentRoute {
    path: string;
    Component: React.ComponentType<any>;
}
export interface LazyComponentRoute {
    path: string;
    LazyComponent: LazyImportFn;
}
export type Route = ComponentRoute | LazyComponentRoute;
export interface RouteMatch extends PathMatch<Route> {
    state: any;
}
export interface NavigationPrompt {
    message: string;
    when?: boolean;
}
export declare abstract class BaseRouter {
    index?: string;
    matcher: PathMatcher<Route>;
    constructor(routes: Route[], index?: string);
    abstract getTopRouter(): Router;
    match(path: string): PathMatch<Route> | null;
    abstract navigate(path: string, options?: NavigateOptions): void;
}
export declare class Router extends BaseRouter {
    prompt?: NavigationPrompt;
    observer?: (event: LocationChangeEvent) => void;
    navigator: HistoryNavigator;
    constructor(routes: Route[], updateState: (route: RouteMatch | null) => void);
    getTopRouter(): Router;
    /**
     * Subsequent navigations will preserve the given params in the query string.
     * Use null to clear the sticky params.
     * @param params
     */
    setStickyParams(params: Record<string, string> | null): void;
    withObserver(observer?: ((event: LocationChangeEvent) => void) | undefined): this;
    start(): void;
    stop(): void;
    navigate(path: string, options?: NavigateOptions): void;
}
export declare class NestedRouter extends BaseRouter {
    parent: BaseRouter;
    basePath: string;
    constructor(parent: BaseRouter, basePath: string, routes: Route[]);
    getTopRouter(): Router;
    navigate(path: string, options?: NavigateOptions | undefined): void;
}
export interface RouterContext {
    location: Location;
    route: Route;
    router: BaseRouter;
    params: Record<string, string>;
    state: any;
    /**
     * The path that matched the route. For wildcard `/*` paths this does not include the wildcard part.
     * You can get the wildcard path from `remainingPath`.
     */
    matchedRoutePath: string;
    remainingPath?: string;
    navigate: (path: string, options?: NavigateOptions) => void;
}
declare const ReactRouterContext: import("react").Context<RouterContext | undefined>;
export { ReactRouterContext };
export declare function useRouterContext(): RouterContext;
export declare function useNavigate(): (path: string, options?: NavigateOptions) => void;
type UseParamsReturn<T> = T extends string ? string : Record<string, string>;
export declare function useParams<T>(arg?: T): UseParamsReturn<T>;
export declare function useLocation(): Location;
export declare function useNavigationPrompt(prompt: NavigationPrompt): void;
//# sourceMappingURL=Router.d.ts.map