import { Router } from 'express';
export interface PluginManifest {
    id: string;
    name: string;
    version: string;
    author: string;
    description: string;
    icon?: string;
    type: 'float';
    float: {
        defaultWidth: number;
        defaultHeight: number;
        minWidth?: number;
        minHeight?: number;
        resizable?: boolean;
        scope: {
            allowed: PluginScope[];
            default: PluginScope;
        };
        clickable: {
            allowed: boolean[];
            default: boolean;
        };
    };
    permissions: string[];
    backend?: {
        entry: string;
    };
    frontend: {
        entry: string;
    };
}
export type PluginScope = 'global' | 'dashboard' | 'project' | 'project:specific';
export interface PluginUserConfig {
    scope?: PluginScope;
    clickable?: boolean;
    projectIds?: string[];
    floatPosition?: {
        x: number;
        y: number;
    };
    floatSize?: {
        w: number;
        h: number;
    };
}
export interface PluginRegistryEntry {
    id: string;
    version: string;
    enabled: boolean;
    installedAt: string;
    userConfig: PluginUserConfig;
}
export interface LoadedPlugin {
    manifest: PluginManifest;
    registry: PluginRegistryEntry;
    router?: Router;
    dir: string;
}
declare class PluginManager {
    private plugins;
    /** Auto-install bundled plugins from package's plugins/ dir on first run */
    installBundled(): void;
    /** Scan plugins dir, load manifests and backend routers */
    loadAll(): void;
    getAll(): LoadedPlugin[];
    get(id: string): LoadedPlugin | undefined;
    getRegistry(): PluginRegistryEntry[];
    /** Install a plugin from extracted directory */
    install(sourceDir: string): PluginManifest;
    /** Uninstall a plugin */
    uninstall(id: string): void;
    /** Update user config for a plugin */
    updateUserConfig(id: string, config: Partial<PluginUserConfig>): PluginRegistryEntry | null;
    /** Toggle plugin enabled/disabled */
    setEnabled(id: string, enabled: boolean): void;
    /** Get plugin data dir (creates if missing) */
    getDataDir(id: string): string;
    /** Read plugin private data */
    readData(id: string): Record<string, unknown>;
    /** Write plugin private data. Refuses non-plain-object payloads — arrays
     * or primitives written here would break the readData contract (which
     * returns `Record<string, unknown>`) and corrupt downstream callers. */
    writeData(id: string, data: Record<string, unknown>): void;
    /** Get frontend dir for serving static files */
    getFrontendDir(id: string): string | null;
}
export declare const pluginManager: PluginManager;
export {};
//# sourceMappingURL=plugin-manager.d.ts.map