/**
 * Statistics Types
 *
 * Type definitions for plugin statistics tracking.
 *
 * @since v1.23.0
 */
import type { PluginSourceType } from '../types/index.js';
/**
 * Update event record
 */
export interface UpdateEvent {
    /** When the update occurred */
    date: string;
    /** Version before update */
    fromVersion: string;
    /** Version after update */
    toVersion: string;
    /** Whether the update succeeded */
    success: boolean;
    /** Error message if failed */
    error?: string;
    /** Download time in milliseconds */
    downloadTimeMs?: number;
    /** Downloaded file size in bytes */
    fileSize?: number;
}
/**
 * Statistics for a single plugin
 */
export interface PluginStats {
    /** Plugin name (normalized) */
    pluginName: string;
    /** Source that provides updates */
    source: PluginSourceType;
    /** Current installed version */
    currentVersion: string;
    /** Last time update was checked */
    lastChecked?: string;
    /** Last time plugin was updated */
    lastUpdated?: string;
    /** Update history (most recent first) */
    updateHistory: UpdateEvent[];
    /** Number of errors encountered */
    errorCount: number;
    /** Number of successful downloads */
    downloadCount: number;
}
/**
 * Statistics for a plugin source
 */
export interface SourceStats {
    /** Source identifier */
    source: PluginSourceType;
    /** Number of plugins from this source */
    totalPlugins: number;
    /** Number of update checks performed */
    checksPerformed: number;
    /** Number of updates downloaded */
    updatesDownloaded: number;
    /** Number of failures */
    failures: number;
    /** Last check timestamp */
    lastCheck?: string;
    /** Average API response time in ms */
    averageResponseTimeMs?: number;
}
/**
 * Overall server statistics
 */
export interface ServerStats {
    /** Total number of plugins tracked */
    totalPlugins: number;
    /** Number of plugins with available updates */
    totalUpdatesAvailable: number;
    /** Total size of all plugins in bytes */
    totalSizeBytes: number;
    /** Last scan timestamp */
    lastScanDate?: string;
    /** Overall health score (0-100) */
    healthScore: number;
    /** Number of missing dependencies */
    missingDependencies: number;
    /** Number of conflicts detected */
    conflicts: number;
}
/**
 * Complete statistics store
 */
export interface StatsStore {
    /** Schema version */
    version: string;
    /** Last modified timestamp */
    lastUpdated: string;
    /** Per-plugin statistics */
    plugins: Record<string, PluginStats>;
    /** Per-source statistics */
    sources: Record<string, SourceStats>;
    /** Server-wide statistics */
    server: ServerStats;
}
/**
 * Recent error entry
 */
export interface RecentError {
    /** Plugin that encountered the error */
    pluginName: string;
    /** Error message */
    error: string;
    /** When the error occurred */
    date: string;
}
/**
 * Health score factors
 */
export interface HealthFactors {
    /** Number of outdated plugins (30+ days) */
    outdatedPlugins: number;
    /** Number of missing dependencies */
    missingDependencies: number;
    /** Number of conflicts */
    conflicts: number;
    /** Number of recent errors (last 7 days) */
    recentErrors: number;
    /** Base score before deductions */
    baseScore: number;
    /** Final calculated score */
    finalScore: number;
}
//# sourceMappingURL=stats-types.d.ts.map