/**
 * App Registry
 *
 * Central registry for managing SynOS apps.
 * Handles app registration, activation, deactivation, and lifecycle management.
 */
import type { SmartCanvasRuntime } from '../runtime';
import type { AppManifest, AppRegistration, AppRegistryEvent } from './types';
/**
 * Callback for app registry events.
 */
export type AppRegistryEventCallback = (event: AppRegistryEvent) => void;
/**
 * App registry for managing SynOS apps.
 */
export declare class AppRegistry {
    private apps;
    private eventListeners;
    private runtime;
    /**
     * Bind the registry to a runtime instance.
     * Must be called before apps can be activated.
     */
    bind(runtime: SmartCanvasRuntime): void;
    /**
     * Unbind from the current runtime.
     * Deactivates all active apps first.
     */
    unbind(): Promise<void>;
    /**
     * Register an app.
     *
     * Registration makes the app available but does not activate it.
     * Call activate() to start the app's runtime extensions.
     */
    register(manifest: AppManifest): AppRegistration;
    /**
     * Activate an app.
     *
     * Activating an app:
     * 1. Creates an AppContext for sandboxed runtime access
     * 2. Registers the app's actions with ExecutorRegistry
     * 3. Registers the app's widgets with WidgetRegistry
     * 4. Sets up the app's event handlers
     */
    activate(appId: string): Promise<void>;
    /**
     * Deactivate an app.
     *
     * Deactivating an app:
     * 1. Runs the cleanup function
     * 2. Unregisters all actions and widgets
     * 3. Removes event handlers
     */
    deactivate(appId: string): Promise<void>;
    /**
     * Unregister an app.
     *
     * The app must be inactive before it can be unregistered.
     */
    unregister(appId: string): Promise<void>;
    /**
     * Get an app registration.
     */
    get(appId: string): AppRegistration | undefined;
    /**
     * Check if an app is registered.
     */
    has(appId: string): boolean;
    /**
     * Check if an app is active.
     */
    isActive(appId: string): boolean;
    /**
     * List all registered apps.
     */
    list(): AppRegistration[];
    /**
     * List all active apps.
     */
    listActive(): AppRegistration[];
    /**
     * List all apps with editor modules.
     */
    listEditable(): AppRegistration[];
    /**
     * Subscribe to registry events.
     */
    subscribe(callback: AppRegistryEventCallback): () => void;
    /**
     * Emit an event to all listeners.
     */
    private emit;
    /**
     * Clean up all apps.
     */
    destroy(): Promise<void>;
}
/**
 * Default singleton instance of AppRegistry.
 */
export declare const appRegistry: AppRegistry;
