/**
 * 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 ReactNode } from 'react';
import type { Application } from './Application';
import type { RouteType } from './RouterManager';
export declare const ADMIN_SETTINGS_KEY = "admin.settings.";
export declare const ADMIN_SETTINGS_PATH = "/admin/settings/";
export declare const SNIPPET_PREFIX = "pm.";
export interface PluginSettingOptions {
    title: any;
    /**
     * @default Outlet
     */
    Component?: RouteType['Component'];
    componentLoader?: RouteType['componentLoader'];
    icon?: string | ReactNode;
    /**
     * sort, the smaller the number, the higher the priority
     * @default 0
     */
    sort?: number;
    aclSnippet?: string;
    link?: string;
    isTopLevel?: boolean;
    isPinned?: boolean;
    [index: string]: any;
}
export interface PluginSettingsPageType {
    label?: string | ReactNode;
    title: string | ReactNode;
    link?: string;
    key: string;
    icon: ReactNode;
    path: string;
    sort?: number;
    name?: string;
    isAllow?: boolean;
    topLevelName?: string;
    aclSnippet: string;
    children?: PluginSettingsPageType[];
    [index: string]: any;
}
/**
 * client-v1 兼容版插件设置管理器。
 *
 * 继续保留旧的 dotted-key 注册协议，与 client-v2 的新两层实现完全脱钩。
 *
 * @example
 * ```typescript
 * app.pluginSettingsManager.add('system.test', { title: 'Test', Component: DemoPage });
 * ```
 */
export declare class PluginSettingsManager {
    protected settings: Record<string, PluginSettingOptions>;
    protected aclSnippets: string[];
    app: Application;
    private cachedList;
    constructor(_pluginSettings: Record<string, PluginSettingOptions> | undefined, app: Application);
    /**
     * 渲染图标字符串为 Icon 组件。
     *
     * @param {PluginSettingOptions['icon']} icon 图标定义
     * @returns {ReactNode} 图标节点
     */
    protected renderIcon(icon: PluginSettingOptions['icon']): ReactNode;
    /**
     * 清理缓存。
     *
     * @returns {void}
     */
    clearCache(): void;
    /**
     * 设置 ACL snippets。
     *
     * @param {string[]} aclSnippets snippets 列表
     * @returns {void}
     */
    setAclSnippets(aclSnippets: string[]): void;
    /**
     * 获取 ACL snippet。
     *
     * @param {string} name settings 名称
     * @returns {string | null} snippet
     */
    getAclSnippet(name: string): string;
    /**
     * 获取 route name。
     *
     * @param {string} name settings 名称
     * @returns {string} route name
     */
    getRouteName(name: string): string;
    /**
     * 获取 route path。
     *
     * @param {string} name settings 名称
     * @returns {string} route path
     */
    getRoutePath(name: string): string;
    /**
     * 追加 settings 配置。
     *
     * @param {string} name dotted settings key
     * @param {PluginSettingOptions} options 配置项
     * @returns {void}
     */
    add(name: string, options: PluginSettingOptions): void;
    /**
     * 删除 settings 配置。
     *
     * @param {string} name settings 名称
     * @returns {void}
     */
    remove(name: string): void;
    /**
     * 判断 ACL 是否允许。
     *
     * @param {string} name settings 名称
     * @returns {boolean} 是否允许
     */
    hasAuth(name: string): boolean;
    /**
     * 获取内部原始设置。
     *
     * @param {string} name settings 名称
     * @returns {PluginSettingOptions | undefined} 原始设置
     */
    getSetting(name: string): PluginSettingOptions;
    /**
     * 判断配置是否存在且可访问。
     *
     * @param {string} name settings 名称
     * @returns {boolean} 是否存在
     */
    has(name: string): boolean;
    /**
     * 获取 settings 快照。
     *
     * @param {string} name settings 名称
     * @param {boolean} [filterAuth=true] 是否过滤 ACL
     * @returns {PluginSettingsPageType | null} settings 快照
     */
    get(name: string, filterAuth?: boolean): PluginSettingsPageType | null;
    /**
     * 获取顶级 settings 列表。
     *
     * @param {boolean} [filterAuth=true] 是否过滤 ACL
     * @returns {PluginSettingsPageType[]} 顶级列表
     */
    getList(filterAuth?: boolean): PluginSettingsPageType[];
    /**
     * 获取所有 ACL snippets。
     *
     * @returns {(string | null)[]} snippet 列表
     */
    getAclSnippets(): string[];
}
