/**
 * 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 FlowEngine, FlowModel, type ViewParam } from '@nocobase/flow-engine';
import { BaseLayoutRouteCoordinator, type BaseLayoutRouteCoordinatorOptions, type RoutePageMeta } from './BaseLayoutRouteCoordinator';
import type { LayoutDefinition } from '../../layout-manager/types';
export type BaseLayoutStructure = {
    subModels?: Record<string, FlowModel[]>;
};
export type GetLayoutModelOptions<TModel extends FlowModel = BaseLayoutModel> = {
    required?: boolean;
    create?: boolean;
    props?: any;
    use?: new (...args: any[]) => TModel;
};
export type LayoutRouteMatch = {
    type: 'root';
    pathname: string;
    basePathname: string;
    relativePath: string;
} | {
    type: 'page';
    pathname: string;
    basePathname: string;
    relativePath: string;
    pageUid: string;
    tabUid?: string;
    viewStack: ViewParam[];
} | {
    type: 'notFound';
    pathname: string;
    basePathname: string;
    relativePath: string;
};
export interface LayoutRouteLike {
    id?: string;
    name?: string;
    pathname?: string;
    state?: unknown;
    params?: Record<string, string | undefined>;
    layoutRouteName?: string;
    layoutBasePathname?: string;
}
/**
 * 通用 Layout 运行时模型。
 *
 * 该模型封装页面路由桥接、弹窗路由、page tab 路由、布局容器和移动端状态，
 * Admin、Embed 等具体 Layout 只需要继承并实现各自的渲染和专属业务能力。
 */
export declare class BaseLayoutModel<TStructure extends BaseLayoutStructure = BaseLayoutStructure> extends FlowModel<TStructure> {
    isMobileLayout: boolean;
    currentLayoutRoute: LayoutRouteMatch | null;
    protected routeCoordinator?: BaseLayoutRouteCoordinator;
    private activePageUid;
    private currentRouteState?;
    private layoutContentElement;
    private readonly routePageMetaMap;
    private contextBindingsActive;
    constructor(options: any);
    registerRoutePage(pageUid: string, meta: RoutePageMeta): import("..").RouteModel<import("@nocobase/flow-engine").DefaultStructure>;
    updateRoutePage(pageUid: string, meta: Partial<RoutePageMeta>): void;
    unregisterRoutePage(pageUid: string): void;
    setLayoutContentElement(element: HTMLElement | null): void;
    setIsMobileLayout(isMobileLayout: boolean): void;
    getCurrentRouteByPageUid(pageUid: string): any;
    get layout(): LayoutDefinition;
    getCoordinator(): BaseLayoutRouteCoordinator;
    protected createRouteCoordinator(): BaseLayoutRouteCoordinator;
    protected getRouteCoordinatorOptions(): BaseLayoutRouteCoordinatorOptions;
    protected getPageUidFromRoute(route: any): any;
    isLayoutContentRoute(routeLike: LayoutRouteLike): boolean;
    resolveLayoutRoute(routeLike: LayoutRouteLike): LayoutRouteMatch;
    getPageUidFromLayoutRoute(match: LayoutRouteMatch | null | undefined): string;
    syncLayoutRoute(routeLike: LayoutRouteLike): LayoutRouteMatch;
    clearLayoutRoute(routeLike?: LayoutRouteLike): void;
    protected onMount(): void;
    protected onUnmount(): void;
    private setupContextBindings;
    private teardownRuntime;
    private getCurrentRouteByActivePage;
    private getCurrentCoordinatorRouteLike;
    private restoreCurrentLayoutRouteFromRouterContext;
    private shouldIgnoreStaleLayoutRouteCleanup;
    private getRouterContextRouteLike;
    private isRouteLikeOwnedByCurrentLayout;
}
/**
 * 按固定 UID 获取或创建 Layout host model。
 */
export declare function getLayoutModel<TModel extends FlowModel = BaseLayoutModel>(flowEngine: FlowEngine, uid: string, options?: GetLayoutModelOptions<TModel>): TModel;
