import { WebSocket } from 'ws'; import { Server as HttpServer } from 'http'; import type { pino } from 'pino'; import type { SessionStore } from '../../store/session-store.interface.js'; import type { WSConnectionState, WSMessage } from '../../types/websocket.js'; export interface WSServerOptions { server: HttpServer; path?: string; maxPayload?: number; heartbeatInterval?: number; connectionTimeout?: number; } export interface ConnectionEntry { connectionId: string; ws: WebSocket; state: WSConnectionState; } export interface AuthenticationParams { connectionId: string; userId: string; sessionId: string; roles?: string[]; permissions?: string[]; scopes?: string[]; } export interface ConnectionStats { total: number; authenticated: number; unauthenticated: number; uniqueUsers: number; uniqueSessions: number; connectionsByUser: Array<{ userId: string; count: number; }>; } export interface WSServerStats { totalConnections: number; authenticatedConnections: number; unauthenticatedConnections: number; subscriptions: number; } export interface RateLimitConfig { maxConnections: number; maxMessagesPerMinute: number; windowMs: number; } export interface SecurityValidationOptions { allowedOrigins?: string[]; maxPayloadSize?: number; requireSecure?: boolean; } export interface HealthMonitorOptions { heartbeatInterval: number; connectionTimeout: number; maxStaleAge: number; } export interface EventHandlerOptions { maxSubscriptionsPerConnection?: number; broadcastBufferSize?: number; } export interface MiddlewareContext { connectionId: string; ws: WebSocket; state: WSConnectionState; message?: WSMessage; logger: pino.Logger; } export type MiddlewareFunction = (context: MiddlewareContext, next: () => Promise) => Promise; export interface ErrorRecoveryStrategy { shouldReconnect: boolean; retryDelay?: number; maxRetries?: number; } export interface WSComponentDependencies { logger: pino.Logger; sessionStore: SessionStore; } export interface ConnectionVerificationInfo { origin: string; secure: boolean; req: { headers: Record; socket: { remoteAddress?: string; }; }; } export type ConnectionVerificationCallback = (result: boolean, code?: number, message?: string) => void; export type MessageFilter = (state: WSConnectionState) => boolean; export interface SessionManagementOptions { sessionTimeout?: number; maxSessionsPerUser?: number; persistSessions?: boolean; cleanupInterval?: number; batchSize?: number; flushInterval?: number; } //# sourceMappingURL=types.d.ts.map