import type { CommandResult } from '../types'; /** * 基础命令抽象类 * 所有命令都继承自此类 */ export declare abstract class BaseCommand { protected readonly name: string; protected readonly description: string; constructor(name: string, description: string); /** * 执行命令 */ abstract execute(...args: unknown[]): Promise; /** * 获取命令名称 */ getName(): string; /** * 获取命令描述 */ getDescription(): string; /** * 验证命令参数 */ protected validateArgs(args: unknown[], expectedTypes: string[]): CommandResult | null; /** * 创建成功结果 */ protected createSuccessResult(message?: string): CommandResult; /** * 创建错误结果 */ protected createErrorResult(error: string, exitCode?: number): CommandResult; /** * 处理异步操作的错误 */ protected handleAsyncOperation(operation: () => Promise, errorMessage?: string): Promise<{ success: boolean; result?: T; error?: string; }>; /** * 安全地执行可能抛出异常的操作 */ protected safeExecute(operation: () => T, errorMessage?: string): { success: boolean; result?: T; error?: string; }; } //# sourceMappingURL=base-command.d.ts.map