import "reflect-metadata";
import { PermissionRegistry } from "./PermissionRegistry";
/**
 * CommandRegistry
 *
 * Central registry for namespaced command handlers.
 * Similar to FastAPI's APIRouter pattern - allows multiple managers
 * to register their own command handlers under namespaces.
 */
export type CommandHandler<TArgs = any, TResult = any> = (args: TArgs) => Promise<TResult> | TResult;
export interface CommandMetadata {
    namespace: string;
    command: string;
    handler: CommandHandler;
    target: any;
    permission?: string;
    methodName: string;
}
export declare class CommandRegistry {
    private permissionRegistry;
    private handlers;
    constructor(permissionRegistry: PermissionRegistry);
    /**
     * Register a command handler under a namespace
     * @param namespace - The namespace (e.g., "app", "view")
     * @param command - The command name (e.g., "launch", "update-bounds")
     * @param handler - The handler function
     * @param target - The instance that owns the handler (for proper `this` binding)
     * @param methodName - The original method name for metadata lookup
     */
    register(namespace: string, command: string, handler: CommandHandler, target: any, methodName?: string): void;
    /**
     * Register multiple handlers from a manager instance
     * @param manager - The manager instance to register handlers from
     */
    registerManager(manager: any): void;
    /**
     * Execute a command by its full name
     * @param fullCommand - The full command name (e.g., "process/launch")
     * @param args - The command arguments
     * @param appId - Optional app ID for permission checking
     * @returns The command result
     */
    execute<TResult = any>(fullCommand: string, args: any, appId?: string): Promise<TResult>;
    /**
     * Check if a command is registered
     */
    has(fullCommand: string): boolean;
    /**
     * Get all registered command names
     */
    getCommands(): string[];
    /**
     * Get commands for a specific namespace
     */
    getNamespaceCommands(namespace: string): string[];
    /**
     * Clear all handlers (useful for testing)
     */
    clear(): void;
}
/**
 * Get manager metadata (namespace and handlers)
 */
export declare function getManagerMetadata(instance: any): {
    namespace: string;
    handlers: Map<string, string>;
} | undefined;
/**
 * Set manager namespace
 */
export declare function setManagerNamespace(target: any, namespace: string): void;
/**
 * Add command handler to manager metadata
 */
export declare function addCommandHandler(target: any, command: string, methodName: string): void;
//# sourceMappingURL=CommandRegistry.d.ts.map