/**
 * 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 { FlowEngine, type FlowContext, type ViewParam } from '@nocobase/flow-engine';
import { RouteModel } from '../models/base/RouteModel';
import type { LayoutDefinition } from '../../layout-manager/types';
export interface RoutePageMeta {
    active: boolean;
    refreshDesktopRoutes?: () => Promise<unknown>;
    layoutContentElement?: HTMLElement | null;
}
export interface BaseLayoutRouteCoordinatorOptions {
    layout?: LayoutDefinition;
    layoutContext?: FlowContext;
    basePathname?: string;
}
interface RouteLike {
    layoutRouteName?: string;
    params?: {
        name?: string;
    };
    pathname?: string;
    state?: unknown;
    pageUid?: string;
    layoutBasePathname?: string;
    layoutRoute?: {
        type: string;
        pageUid?: string;
        basePathname?: string;
    } | null;
}
/**
 * 通用 Layout 路由协调器。
 *
 * 负责把当前路由路径解析为 v2 view stack，并驱动 RouteModel 上的弹窗、抽屉和 page tab 状态。
 * Admin、Embed 等布局只需要提供当前 Layout 的基准路径，即可复用同一套 view 编排逻辑。
 */
export declare class BaseLayoutRouteCoordinator {
    protected readonly flowEngine: FlowEngine;
    protected readonly layout: LayoutDefinition | undefined;
    private readonly layoutContext?;
    private basePathname;
    private readonly runtimes;
    private layoutContentElement;
    private lastNonNullLayoutContentElement;
    constructor(flowEngine: FlowEngine, options?: BaseLayoutRouteCoordinatorOptions);
    setLayoutContentElement(element: HTMLElement | null): void;
    registerPage(pageUid: string, meta: RoutePageMeta): RouteModel<import("@nocobase/flow-engine").DefaultStructure>;
    syncPageMeta(pageUid: string, meta: Partial<RoutePageMeta>): void;
    unregisterPage(pageUid: string): void;
    syncRoute(routeLike: RouteLike): void;
    cleanupPage(pageUid: string): void;
    destroy(): void;
    protected getCurrentRouteByPageUid(pageUid: string): any;
    private setRuntimeActive;
    private notifyRuntimeActiveChange;
    private syncRuntimeWithPathname;
    private syncViewListVisibility;
    private shouldStepNavigate;
    private scheduleInitialDeepLinkReplay;
    private stepNavigate;
    private replayActiveRuntimeViewsAfterLayoutContentElementChange;
    private invalidatePendingRuntimeViewOpens;
    private resetRuntimeViewStateForLayoutContentElementChange;
    private markPendingOpenViews;
    private clearPendingOpenViews;
    private handleOpenViews;
    private openViews;
    private ensureRouteModelContext;
    private getOrCreateRouteModel;
}
/**
 * 将 pathname 解析结果和 pageUid 对齐，便于测试里复用。
 */
export declare function toViewStack(pathname: string, options?: BaseLayoutRouteCoordinatorOptions): ViewParam[];
export {};
