/**
 * 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 type { BaseApplication } from './BaseApplication';
type AppLike = Pick<BaseApplication<any>, 'getPublicPath'> & {
    router?: {
        getBasename?: () => string | undefined;
    };
};
type LocationLike = {
    pathname: string;
    search?: string;
    hash?: string;
};
/**
 * The runtime URL segment under which the modern (v2) client is served.
 * Injected by the server as `window.__nocobase_modern_client_prefix__`. Falls
 * back to the trailing segment of `window.__nocobase_public_path__`, then to
 * the default `v`. Returns a bare segment (no slashes).
 */
export declare function getModernClientPrefix(): string;
/**
 * Strip the trailing modern-client prefix segment from a public path,
 * recovering the app root public path (e.g. `/nocobase/v/` -> `/nocobase/`).
 */
export declare function stripModernClientPrefix(publicPath?: string): string;
export declare function getV2EffectiveBasePath(app: AppLike): string;
declare function getDefaultV2AdminRedirectPath(app: AppLike): string;
/**
 * 将当前 v2 页面地址转换为根相对 redirect 路径。
 *
 * @param app 当前 v2 应用实例
 * @param locationLike 当前路由地址
 * @returns 根相对的 v2 redirect
 */
export declare function getCurrentV2RedirectPath(app: AppLike, locationLike: LocationLike): string;
/**
 * 构造跳转到 v2 登录页的完整 href。
 *
 * @param app 当前 v2 应用实例
 * @param targetPath 登录后回跳地址
 * @returns 指向 v2 登录页的 href
 */
export declare function buildV2SigninHref(app: AppLike, targetPath: string): string;
/**
 * 通过整页跳转进入 v2 登录页。
 *
 * @param app 当前 v2 应用实例
 * @param targetPath 登录后回跳地址
 * @param options 跳转选项
 */
export declare function redirectToV2Signin(app: AppLike, targetPath: string, options?: {
    replace?: boolean;
}): void;
/**
 * 解析并校验服务端返回的 v2 登录页地址。
 *
 * @param value 服务端返回的 redirect
 * @param app 当前 v2 应用实例
 * @returns 合法时返回完整同源 URL,否则返回 null
 */
export declare function resolveV2SigninRedirect(value: string | undefined | null, app: AppLike): string;
export { getDefaultV2AdminRedirectPath };
