/**
 * This file is part of the NocoBase (R) project.
 * Copyright (c) 2020-2024 NocoBase Co., Ltd.
 * Authors: NocoBase Team.
 *
 * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
 * For more information, please refer to: https://www.nocobase.com/agreement.
 */
import React, { ComponentType } from 'react';
import { type BrowserRouterProps, type HashRouterProps, type MemoryRouterProps, type RouteObject } from 'react-router-dom';
import type { BaseApplication } from './BaseApplication';
import { Router } from '@remix-run/router';
export interface BrowserRouterOptions extends Omit<BrowserRouterProps, 'children'> {
    type?: 'browser';
}
export interface HashRouterOptions extends Omit<HashRouterProps, 'children'> {
    type?: 'hash';
}
export interface MemoryRouterOptions extends Omit<MemoryRouterProps, 'children'> {
    type?: 'memory';
}
export type RouterOptions = (HashRouterOptions | BrowserRouterOptions | MemoryRouterOptions) & {
    renderComponent?: RenderComponentType;
    routes?: Record<string, RouteType>;
};
export type RenderableComponentType<T = any> = React.JSXElementConstructor<T> | React.ExoticComponent<T>;
export type ComponentTypeAndString<T = any> = RenderableComponentType<T> | string;
export type ComponentLoaderResult = {
    default?: ComponentTypeAndString;
    Component?: ComponentTypeAndString;
} | ComponentTypeAndString;
export type ComponentLoader = () => Promise<ComponentLoaderResult>;
export interface RouteType extends Omit<RouteObject, 'children' | 'Component'> {
    Component?: ComponentTypeAndString;
    componentLoader?: ComponentLoader;
    skipAuthCheck?: boolean;
    authCheck?: boolean;
}
export type RenderComponentType = (Component: ComponentTypeAndString, props?: any) => React.ReactNode;
export type RouterComponentType = React.FC<{
    BaseLayout?: ComponentType;
}>;
export declare class RouterManager<TApp extends BaseApplication<any> = BaseApplication<any>> {
    protected routes: Record<string, RouteType>;
    protected options: RouterOptions;
    app: TApp;
    router: Router;
    get basename(): string;
    get state(): import("@remix-run/router").RouterState;
    get navigate(): {
        (to: number): Promise<void>;
        (to: import("react-router").To, opts?: import("@remix-run/router").RouterNavigateOptions): Promise<void>;
    };
    constructor(options: RouterOptions, app: TApp);
    protected resolveLoadedComponent(moduleOrComponent: ComponentLoaderResult): ComponentTypeAndString | undefined;
    protected createRouteLazyComponent(componentLoader: ComponentLoader): ComponentType;
    /**
     * @internal
     */
    getRoutesTree(): RouteObject[];
    getRoutes(): Record<string, RouteType>;
    setType(type: RouterOptions['type']): void;
    getBasename(): string;
    setBasename(basename: string): void;
    matchRoutes(pathname: string): import("@remix-run/router").AgnosticRouteMatch<string, RouteType>[];
    isSkippedAuthCheckRoute(pathname: string): boolean;
    /**
     * @internal
     */
    getRouterComponent(children?: React.ReactNode): RouterComponentType;
    add(name: string, route: RouteType): void;
    get(name: string): RouteType;
    has(name: string): boolean;
    remove(name: string): void;
}
