import type { Context } from '../context.js'; export interface BackendInstance { url: string; weight?: number; healthy: boolean; connections: number; responseTime: number; } export interface LoadBalancerOptions { backends: BackendInstance[]; strategy?: 'round-robin' | 'least-connections' | 'weighted-round-robin' | 'least-response-time'; healthCheckInterval?: number; healthCheckTimeout?: number; maxRetries?: number; } export declare class LoadBalancer { private backends; private strategy; private currentIndex; private healthCheckInterval; private healthCheckTimeout; private maxRetries; private intervalId; constructor(options: LoadBalancerOptions); start(): void; stop(): void; getBackend(): Promise; private getRoundRobinBackend; private getLeastConnectionsBackend; private getWeightedRoundRobinBackend; private getLeastResponseTimeBackend; private startHealthChecks; private checkHealth; updateBackendStats(backend: BackendInstance, responseTime: number, success: boolean): void; getStats(): { backends: { url: string; healthy: boolean; connections: number; responseTime: number; weight: number | undefined; }[]; strategy: string; totalConnections: number; }; } export declare function loadBalancerPlugin(options: LoadBalancerOptions): (ctx: Context, next: () => Promise) => Promise; //# sourceMappingURL=loadBalancer.d.ts.map