import React from 'react';

type RoutingMode = 'path' | 'virtual';

/**
 * This type represents a generic router interface that Clerk relies on to interact with the host router.
 */
type ClerkHostRouter = {
    readonly mode: RoutingMode;
    readonly name: string;
    pathname: () => string;
    push: (path: string) => void;
    replace: (path: string) => void;
    searchParams: () => URLSearchParams;
    shallowPush: (path: string) => void;
};
/**
 * Internal Clerk router, used by Clerk components to interact with the host's router.
 */
type ClerkRouter = {
    /**
     * The basePath the router is currently mounted on.
     */
    basePath: string;
    /**
     * Creates a child router instance scoped to the provided base path.
     */
    child: (childBasePath: string) => ClerkRouter;
    /**
     * Matches the provided path against the router's current path. If index is provided, matches against the root route of the router.
     */
    match: (path?: string, index?: boolean) => boolean;
    /**
     * Mode of the router instance, path-based or virtual
     */
    readonly mode: RoutingMode;
    /**
     * Name of the router instance
     */
    readonly name: string;
    /**
     * Navigates to the provided path via a history push
     */
    push: ClerkHostRouter['push'];
    /**
     * Navigates to the provided path via a history replace
     */
    replace: ClerkHostRouter['replace'];
    /**
     * If supported by the host router, navigates to the provided path without triggering a full navigation
     */
    shallowPush: ClerkHostRouter['shallowPush'];
    /**
     * Returns the current pathname (including the base path)
     */
    pathname: ClerkHostRouter['pathname'];
    /**
     * Returns the current search params
     */
    searchParams: ClerkHostRouter['searchParams'];
};
/**
 * Factory function to create an instance of ClerkRouter with the provided host router.
 *
 * @param router host router instance to be used by the router
 * @param basePath base path of the router, navigation and matching will be scoped to this path
 * @returns A ClerkRouter instance
 */
declare function createClerkRouter(router: ClerkHostRouter, basePath?: string): ClerkRouter;

/**
 * React-specific binding's for interacting with Clerk's router interface.
 */

declare const ClerkRouterContext: React.Context<ClerkRouter | null>;
declare function useClerkRouter(): ClerkRouter;
/**
 * Construct a Clerk Router using the provided host router. The router instance is accessible using `useClerkRouter()`.
 */
declare function Router({ basePath, children, router, }: {
    children: React.ReactNode;
    basePath?: string;
    router: ClerkHostRouter;
}): React.JSX.Element;
type RouteProps = {
    path?: string;
    index?: boolean;
};
/**
 * Used to conditionally render its children based on whether or not the current path matches the provided path.
 */
declare function Route({ path, children, index }: RouteProps & {
    children: React.ReactNode;
}): React.ReactNode;

export { type ClerkHostRouter, type ClerkRouter, ClerkRouterContext, Route, Router, type RoutingMode, createClerkRouter, useClerkRouter };
