/**
 * Baasix Plugin Manager Service
 *
 * Manages the lifecycle of plugins including:
 * - Plugin registration and validation
 * - Dependency resolution and loading order
 * - Schema, route, hook, and service registration
 * - Lifecycle management (init, ready, shutdown)
 */
import type { Express, BaasixPlugin, LoadedPlugin, ExpressPluginContext, PluginManagerOptions, PluginType, PluginSchemaDefinition, IHooksManager } from "../types/index.js";
type PluginContext = ExpressPluginContext;
/**
 * PluginManager singleton class
 */
export declare class PluginManager {
    private static instance;
    /** Registered plugins by name */
    private plugins;
    /** Plugins grouped by type */
    private pluginsByType;
    /** Plugin services registry */
    private services;
    /** Plugin context */
    private context;
    /** Options */
    private options;
    /** Whether plugins have been initialized */
    private initialized;
    /** Whether plugins are ready */
    private ready;
    private constructor();
    /**
     * Get the singleton instance
     */
    static getInstance(): PluginManager;
    /**
     * Reset the singleton (for testing)
     */
    static resetInstance(): void;
    /**
     * Set plugin manager options
     */
    setOptions(options: PluginManagerOptions): void;
    /**
     * Log a message if verbose mode is enabled
     */
    private log;
    /**
     * Register plugins from the startServer options
     */
    registerPlugins(plugins: BaasixPlugin[]): void;
    /**
     * Register a single plugin
     */
    private registerPlugin;
    /**
     * Validate plugin dependencies
     */
    private validateDependencies;
    /**
     * Sort plugins by dependencies (topological sort)
     */
    private sortByDependencies;
    /**
     * Get all schemas from plugins
     */
    getPluginSchemas(): PluginSchemaDefinition[];
    /**
     * Initialize plugin context
     */
    setContext(context: Omit<PluginContext, "services" | "config" | "getPluginService">): void;
    /**
     * Initialize plugin services
     */
    initializeServices(): Promise<void>;
    /**
     * Register plugin routes with Express app
     */
    registerRoutes(app: Express, authMiddleware: any): void;
    /**
     * Register a single route
     */
    private registerRoute;
    /**
     * Register plugin hooks with HooksManager
     */
    registerHooks(hooksManager: IHooksManager): void;
    /**
     * Register plugin middleware with Express app
     */
    registerMiddleware(app: Express): void;
    /**
     * Call onInit for all plugins
     */
    initPlugins(): Promise<void>;
    /**
     * Call onReady for all plugins
     */
    readyPlugins(): Promise<void>;
    /**
     * Call onShutdown for all plugins (in reverse order)
     */
    shutdownPlugins(): Promise<void>;
    /**
     * Get a plugin by name
     */
    getPlugin(name: string): LoadedPlugin | undefined;
    /**
     * Get all plugins of a specific type
     */
    getPluginsByType(type: PluginType): LoadedPlugin[];
    /**
     * Get all loaded plugins
     */
    getAllPlugins(): LoadedPlugin[];
    /**
     * Get a plugin service
     */
    getService(serviceName: string): any;
    /**
     * Check if a plugin is registered
     */
    hasPlugin(name: string): boolean;
    /**
     * Get plugin count
     */
    getPluginCount(): number;
    /**
     * Get a summary of loaded plugins
     */
    getSummary(): {
        total: number;
        byType: Record<PluginType, number>;
    };
}
export default PluginManager;
//# sourceMappingURL=PluginManager.d.ts.map