import { BackendManager } from "./BackendManager";
import { ViewManager } from "../view-manager/ViewManager";
import { IPCBridge } from "../ipc";
import { PackageManager } from "../package-manager/PackageManager";
import { AppChannelManager } from "../appbus/AppChannelManager";
import { AppInstance } from "@edenapp/types";
import { CommandRegistry, EdenEmitter } from "../ipc";
/**
 * Events emitted by the ProcessManager
 */
interface ProcessNamespaceEvents {
    launched: {
        instance: AppInstance;
    };
    stopped: {
        appId: string;
    };
    error: {
        appId: string;
        error: any;
    };
    exited: {
        appId: string;
        code: number;
    };
}
/**
 * ProcessManager
 *
 * Handles app lifecycle (launch, stop) and coordination between workers and views.
 */
export declare class ProcessManager extends EdenEmitter<ProcessNamespaceEvents> {
    private backendManager;
    private viewManager;
    private packageManager;
    private appChannelManager;
    private runningApps;
    private appsDirectory;
    private processHandler;
    constructor(backendManager: BackendManager, viewManager: ViewManager, ipcBridge: IPCBridge, packageManager: PackageManager, appChannelManager: AppChannelManager, appsDirectory: string, commandRegistry: CommandRegistry);
    /**
     * Setup event handlers
     */
    private setupEventHandlers;
    /**
     * Launch an app
     */
    launchApp(appId: string, bounds?: {
        x: number;
        y: number;
        width: number;
        height: number;
    }, launchArgs?: string[]): Promise<{
        success: boolean;
        instanceId: string;
        appId: string;
    }>;
    /**
     * Stop a running app
     */
    stopApp(appId: string): Promise<void>;
    /**
     * Get list of running apps
     * @param showHidden - If true, includes overlay apps and daemons (hidden by default)
     */
    getRunningApps(showHidden?: boolean): AppInstance[];
    /**
     * Get app instance
     */
    getAppInstance(appId: string): AppInstance | undefined;
    /**
     * Sync running app IDs with the IPC bridge
     */
    private syncRunningAppsState;
    /**
     * Handle app error
     */
    private handleAppError;
    /**
     * Handle app exit (called when backend crashes or exits unexpectedly)
     * Note: If stopApp() was called, the instance is already removed so this is a no-op
     */
    private handleAppExit;
    /**
     * Shutdown all apps
     */
    shutdown(): Promise<void>;
    /**
     * Reload a running app
     */
    reloadApp(appId: string): Promise<void>;
}
export {};
//# sourceMappingURL=ProcessManager.d.ts.map