import type { MiddlewareHandler } from "./types.js"; /** * Connection tracking for throttling */ interface ConnectionInfo { clientIp: string; connectedAt: number; } /** * Configuration for connection throttling */ export interface ConnectionThrottleConfig { /** Enable connection throttling */ enabled: boolean; /** Maximum concurrent connections globally */ maxGlobal: number; /** Maximum concurrent connections per IP */ maxPerIp: number; } /** * Connection throttling middleware * Limits concurrent connections globally and per-IP to prevent resource exhaustion */ export declare function connectionThrottle(config?: Partial): MiddlewareHandler; /** * Get connection stats for monitoring */ export declare function getConnectionStats(activeConnections: Map, connectionsPerIp: Map>): { totalConnections: number; uniqueIps: number; topIps: Array<{ ip: string; count: number; }>; }; export {};