/**
 * 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 { BaseApplication, type BaseApplicationOptions, type ComponentAndProps, type WebSocketClientOptions } from '@nocobase/client-v2';
import { APIClientOptions } from '@nocobase/sdk';
import { i18n as i18next } from 'i18next';
import type { ComponentType } from 'react';
import { APIClient } from '../api-client';
import type { CollectionFieldInterfaceFactory } from '../data-source';
import { CollectionFieldInterfaceComponentOption } from '../data-source/collection-field-interface/CollectionFieldInterface';
import { DataSourceManager, type DataSourceManagerOptions } from '../data-source/data-source/DataSourceManager';
import { PluginManager, type PluginType } from './PluginManager';
import type { PluginClass } from './PluginManager';
import { PluginSettingOptions, PluginSettingsManager } from './PluginSettingsManager';
import { RouterManager, type RouterOptions } from './RouterManager';
import { SchemaInitializer, SchemaInitializerManager } from './schema-initializer';
import { SchemaSettings, SchemaSettingsItemType, SchemaSettingsManager } from './schema-settings';
/**
 * Reference: https://ant.design/components/cascader-cn#option
 */
interface VariableOption {
    value: string | number;
    label?: React.ReactNode;
    disabled?: boolean;
    children?: VariableOption[];
}
interface Variable {
    name: string;
    useOption: () => {
        option: VariableOption;
        visible?: boolean;
    };
    useCtx: () => any | ((param: {
        variableName: string;
    }) => Promise<any>);
}
export type { ComponentAndProps };
export type DevDynamicImport = (packageName: string) => Promise<{
    default: PluginClass;
}>;
export interface ApplicationOptions extends BaseApplicationOptions<PluginType> {
    apiClient?: APIClientOptions | APIClient;
    ws?: WebSocketClientOptions | boolean;
    i18n?: i18next;
    providers?: (ComponentType | ComponentAndProps)[];
    plugins?: PluginType[];
    components?: Record<string, ComponentType>;
    scopes?: Record<string, any>;
    router?: RouterOptions;
    pluginSettings?: Record<string, PluginSettingOptions>;
    schemaSettings?: SchemaSettings[];
    schemaInitializers?: SchemaInitializer[];
    dataSourceManager?: DataSourceManagerOptions;
}
export declare class Application extends BaseApplication<ApplicationOptions, PluginManager, RouterManager, APIClient, PluginSettingsManager> {
    devDynamicImport?: DevDynamicImport;
    schemaInitializerManager: SchemaInitializerManager;
    schemaSettingsManager: SchemaSettingsManager;
    dataSourceManager: DataSourceManager;
    globalVars: Record<string, any>;
    globalVarCtxs: Record<string, any>;
    loading: boolean;
    hasLoadError: boolean;
    locales: any;
    private readonly variables;
    protected initRequireJs(): void;
    protected defineObservableState(): void;
    protected createApiClient(options: ApplicationOptions): APIClient;
    protected createI18n(options: ApplicationOptions): i18next;
    protected createRouterManager(options: ApplicationOptions): RouterManager;
    protected createPluginManager(options: ApplicationOptions): PluginManager;
    protected createPluginSettingsManager(options: ApplicationOptions): PluginSettingsManager;
    protected getDefaultComponents(): {
        DataBlockProvider: import("react").FC<Partial<import("../data-source").AllDataBlockProps>>;
        SchemaInitializerActionModal: import("react").FC<import("./schema-initializer").SchemaInitializerActionModalProps>;
        SchemaInitializerActionModalInternal: () => import("react").JSX.Element;
        SchemaInitializerChildren: import("react").FC<{
            children: import("./schema-initializer").SchemaInitializerItemType[];
        }>;
        SchemaInitializerChild: import("react").FC<import("./schema-initializer").SchemaInitializerItemType>;
        SchemaInitializerDivider: () => import("react").JSX.Element;
        SchemaInitializerItem: import("react").MemoExoticComponent<import("react").ForwardRefExoticComponent<import("./schema-initializer").SchemaInitializerItemProps & import("react").RefAttributes<any>>>;
        SchemaInitializerItemGroup: import("react").FC<import("./schema-initializer").SchemaInitializerItemGroupProps>;
        SchemaInitializerItemGroupInternal: () => import("react").JSX.Element;
        SchemaInitializerItemInternal: () => import("react").JSX.Element;
        SchemaInitializerItems: import("react").FC<{
            options?: import("./schema-initializer").SchemaInitializerOptions<import("antd").ButtonProps, {}>;
            items?: import("./schema-initializer").SchemaInitializerItemType<any>[];
        }>;
        SchemaInitializerSelect: import("react").FC<import("./schema-initializer").SchemaInitializerSelectItemProps>;
        SchemaInitializerSelectInternal: () => import("react").JSX.Element;
        SchemaInitializerSubMenu: import("react").FC<import("./schema-initializer").SchemaInitializerSubMenuProps>;
        SchemaInitializerSubMenuInternal: () => import("react").JSX.Element;
        SchemaInitializerSwitch: import("react").FC<import("./schema-initializer").SchemaInitializerSwitchItemProps>;
        SchemaInitializerSwitchInternal: () => import("react").JSX.Element;
        CollectionField: import("react").ForwardRefExoticComponent<Omit<Partial<any>, "ref"> & import("react").RefAttributes<unknown>>;
    };
    protected initializeExtendedState(): void;
    protected addCustomProviders(): void;
    protected getRootFallback(): import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
    getCollectionManager(dataSource?: string): import("../data-source").CollectionManager;
    load(): Promise<void>;
    loadWebSocket(): Promise<void>;
    addScopes(scopes: Record<string, any>): void;
    addFieldInterfaces(fieldInterfaceClasses?: CollectionFieldInterfaceFactory[]): void;
    addFieldInterfaceGroups(groups: Record<string, {
        label: string;
        order?: number;
    }>): void;
    addFieldInterfaceComponentOption(fieldName: string, componentOption: CollectionFieldInterfaceComponentOption): void;
    /**
     * 为指定的字段接口添加操作符选项
     *
     * @param name 字段接口的名称
     * @param operatorOption 要添加的操作符选项
     */
    addFieldInterfaceOperator(name: string, operatorOption: any): void;
    addGlobalVar(key: string, value: any, varCtx?: any): void;
    getGlobalVar(key: string): any;
    getGlobalVarCtx(key: string): any;
    addUserCenterSettingsItem(item: SchemaSettingsItemType & {
        aclSnippet?: string;
    }): void;
    registerVariable(variable: Variable): void;
    getVariables(): Variable[];
}
