/** * Centralized error handling for ARK CLI */ export declare enum ErrorCode { INVALID_INPUT = "INVALID_INPUT", FILE_NOT_FOUND = "FILE_NOT_FOUND", PERMISSION_DENIED = "PERMISSION_DENIED", TEMPLATE_ERROR = "TEMPLATE_ERROR", VALIDATION_ERROR = "VALIDATION_ERROR", NETWORK_ERROR = "NETWORK_ERROR", DEPENDENCY_MISSING = "DEPENDENCY_MISSING", PROJECT_STRUCTURE_INVALID = "PROJECT_STRUCTURE_INVALID", GENERATION_FAILED = "GENERATION_FAILED", UNKNOWN_ERROR = "UNKNOWN_ERROR" } export declare class ArkError extends Error { readonly code: ErrorCode; readonly details?: Record; readonly suggestions?: string[]; constructor(message: string, code?: ErrorCode, details?: Record, suggestions?: string[]); } export declare class ValidationError extends ArkError { constructor(message: string, field?: string, suggestions?: string[]); } export declare class TemplateError extends ArkError { constructor(message: string, templatePath?: string, suggestions?: string[]); } export declare class ProjectStructureError extends ArkError { constructor(message: string, projectPath?: string, suggestions?: string[]); } export declare class ErrorHandler { /** * Format and display an error with helpful context */ static formatError(error: Error | ArkError): string; /** * Handle and exit with appropriate error code */ static handleAndExit(error: Error | ArkError): never; /** * Wrap async functions with error handling */ static catchAndHandle(fn: () => Promise, context?: string): Promise; /** * Validate required dependencies and throw helpful errors */ static validateDependency(command: string, purpose: string, installInstructions?: string): Promise; } /** * Input validation utilities with better error messages */ export declare class InputValidator { static validateName(name: string, type?: string): void; static validatePath(path: string, type?: string): void; static validateDirectory(dirPath: string, shouldExist?: boolean): void; }