@casoon/auditmysite
Version:
Professional website analysis suite with robust accessibility testing, Core Web Vitals performance monitoring, SEO analysis, and content optimization insights. Features isolated browser contexts, retry mechanisms, and comprehensive API endpoints for profe
83 lines • 2.01 kB
TypeScript
/**
* 🔧 Base Command Class
*
* Abstract base class for all CLI commands.
* Implements the Command Pattern for better separation of concerns.
*/
export interface CommandArgs {
[key: string]: any;
}
export interface CommandResult {
success: boolean;
message?: string;
data?: any;
exitCode?: number;
}
export declare abstract class BaseCommand {
protected name: string;
protected description: string;
constructor(name: string, description: string);
/**
* Execute the command
*/
abstract execute(args: CommandArgs): Promise<CommandResult>;
/**
* Validate command arguments
*/
protected validate(args: CommandArgs): {
valid: boolean;
errors: string[];
};
/**
* Get command name
*/
getName(): string;
/**
* Get command description
*/
getDescription(): string;
/**
* Format error messages
*/
protected formatError(error: Error | string): string;
/**
* Create success result
*/
protected success(message?: string, data?: any): CommandResult;
/**
* Create error result
*/
protected error(message: string, exitCode?: number): CommandResult;
/**
* Log progress message
*/
protected logProgress(message: string): void;
/**
* Log success message
*/
protected logSuccess(message: string): void;
/**
* Log warning message
*/
protected logWarning(message: string): void;
/**
* Log error message
*/
protected logError(message: string): void;
/**
* Format duration in human-readable format
*/
protected formatDuration(ms: number): string;
/**
* Parse sitemap URL and validate
*/
protected validateSitemapUrl(url: string): {
valid: boolean;
error?: string;
};
/**
* Extract domain from URL for reporting
*/
protected extractDomain(url: string): string;
}
//# sourceMappingURL=base-command.d.ts.map