/**
 * 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';
import type { Plugin, PluginOptions } from './Plugin';
export type PluginClass<Opts = any, TApp extends BaseApplication<any> = BaseApplication<any>> = new (options: PluginOptions<Opts>, app: TApp) => Plugin<PluginOptions<Opts>, TApp>;
export type PluginType<Opts = any, TApp extends BaseApplication<any> = BaseApplication<any>> = PluginClass<Opts, TApp> | [PluginClass<Opts, TApp>, PluginOptions<Opts>];
export type PluginClassLike<TApp extends BaseApplication<any> = BaseApplication<any>> = PluginClass<any, TApp>;
export type PluginTypeLike<TApp extends BaseApplication<any> = BaseApplication<any>> = PluginType<any, TApp>;
export type PluginData = {
    name: string;
    packageName: string;
    version: string;
    url: string;
    clientV2Url?: string;
    devMode?: 'esm';
    appDevDependencies?: string[];
    type: 'local' | 'upload' | 'npm';
};
export declare class PluginManager<TApp extends BaseApplication<any> = BaseApplication<any>> {
    protected _plugins: PluginType<any, TApp>[] | undefined;
    protected loadRemotePlugins: boolean | undefined;
    protected app: TApp;
    protected pluginInstances: Map<PluginClass<any, TApp>, Plugin<any, TApp>>;
    protected pluginsAliases: Record<string, Plugin<any, TApp>>;
    private initPlugins;
    constructor(_plugins: PluginType<any, TApp>[] | undefined, loadRemotePlugins: boolean | undefined, app: TApp);
    /**
     * @internal
     */
    init(_plugins: PluginType<any, TApp>[]): Promise<void>;
    protected getRemotePluginsRequestUrl(): string;
    private initStaticPlugins;
    protected initRemotePlugins(): Promise<void>;
    add<T = any>(plugin: PluginClass<T, TApp>, opts?: PluginOptions<T>): Promise<void>;
    get<T extends PluginClass<any, TApp>>(PluginClass: T): InstanceType<T>;
    get<T extends {}>(name: string): T;
    protected getInstance<T>(plugin: PluginClass<T, TApp>, opts?: PluginOptions<T>): Plugin<PluginOptions<T>, TApp>;
    /**
     * @internal
     */
    load(): Promise<void>;
}
