@dharshansr/gitgenius
Version:
AI-powered commit message generator with enhanced features
78 lines • 1.9 kB
TypeScript
export interface ErrorRecord {
id: string;
timestamp: string;
category: string;
message: string;
stack?: string;
context?: any;
resolved: boolean;
occurrences: number;
}
export interface ErrorStats {
totalErrors: number;
unresolvedErrors: number;
errorsByCategory: Record<string, number>;
errorsByDay: Record<string, number>;
mostCommonErrors: Array<{
message: string;
count: number;
}>;
}
export declare class ErrorTracker {
private static instance;
private configManager;
private errors;
private errorLogPath;
private constructor();
static getInstance(): ErrorTracker;
/**
* Load errors from persistent storage
*/
private loadErrors;
/**
* Save errors to persistent storage
*/
private saveErrors;
/**
* Generate error ID from message and category
*/
private generateErrorId;
/**
* Track an error
*/
trackError(category: string, message: string, error?: Error, context?: any): void;
/**
* Mark error as resolved
*/
resolveError(errorId: string): boolean;
/**
* Get all errors
*/
getAllErrors(includeResolved?: boolean): ErrorRecord[];
/**
* Get errors by category
*/
getErrorsByCategory(category: string, includeResolved?: boolean): ErrorRecord[];
/**
* Get recent errors
*/
getRecentErrors(count?: number, includeResolved?: boolean): ErrorRecord[];
/**
* Get error statistics
*/
getErrorStats(): ErrorStats;
/**
* Clear resolved errors
*/
clearResolvedErrors(): number;
/**
* Clear all errors
*/
clearAllErrors(): void;
/**
* Export errors to file
*/
exportErrors(filePath: string): void;
}
export declare const errorTracker: ErrorTracker;
//# sourceMappingURL=ErrorTracker.d.ts.map