/**
 * Proxy service types and interfaces
 */

export interface ProxyInfo {
  host: string;
  port: number;
  protocol: 'http' | 'https'; // Simplified to only support HTTP/HTTPS
  username?: string;
  password?: string;
  isWorking?: boolean;
  successRate?: number;
  lastChecked?: Date;
  lastUsed?: Date;
  responseTime?: number;
  source?: string;
  country?: string;
  error?: string;
  // Tracking properties
  working?: number; // Number of successful checks
  total?: number; // Total number of checks
  averageResponseTime?: number; // Average response time in milliseconds
  firstSeen?: Date; // When the proxy was first added
}

export interface ProxyManagerConfig {
  enabled?: boolean;
  cachePrefix?: string;
  ttl?: number;
  enableMetrics?: boolean;
  webshare?: {
    apiKey: string;
    apiUrl: string;
  };
}

export interface ProxySyncConfig {
  intervalMs?: number;
  enableAutoSync?: boolean;
}

export interface ProxyStats {
  total: number;
  working: number;
  failed: number;
  lastUpdate: Date | null;
}
