/**
 * 💾 Interfaces pour le système de cache optimisé
 * Utilisé par CacheService
 */

export interface CacheEntry<T = any> {
  data: T;
  timestamp: number;
  ttl: number;
  accessCount: number;
  lastAccessed: number;
  key: string;
}

export interface CacheConfig {
  defaultTtl: number;
  maxSize: number;
  cleanupInterval: number;
  enableMetrics: boolean;
}

export interface CacheStats {
  totalEntries: number;
  hitCount: number;
  missCount: number;
  evictionCount: number;
  hitRatio: number;
  memoryUsage: number;
  oldestEntry?: number;
  newestEntry?: number;
}

export interface CacheKey {
  generate(...parts: (string | number | object)[]): string;
  validate(key: string): boolean;
}

export enum CacheStrategy {
  LRU = 'lru',
  FIFO = 'fifo',
  TTL_ONLY = 'ttl_only'
}

export interface CacheOptions {
  ttl?: number;
  strategy?: CacheStrategy;
  tags?: string[];
  priority?: number;
}