import type { Dwn } from '@enbox/dwn-sdk-js'; import type { ServerWebSocket } from 'bun'; import type { ActivityLog } from '../admin/activity-log.js'; import type { AdminConnectionSnapshot } from '../admin/types.js'; import type { AdminStore } from '../admin/admin-store.js'; import type { DwnServerConfig } from '../config.js'; import type { MessageProcessedHook } from '../message-processed-hook.js'; import type { RateLimiter } from '../rate-limiter.js'; import type { RegistrationStore } from '../registration/registration-store.js'; import type { WsData } from '../http-api.js'; import { SocketConnection } from './socket-connection.js'; /** * Interface for managing `WebSocket` connections as they arrive. */ export interface ConnectionManager { /** connect handler invoked when a new WebSocket connection is established. */ connect(socket: ServerWebSocket): Promise; /** closes all of the connections */ closeAll(): Promise; /** Closes local-node connections authenticated with the given pairing token. */ closeLocalNodeConnectionsByToken(token: string): Promise; /** Returns the number of active connections. */ getConnectionCount(): number; /** Returns the total number of active subscriptions across all connections. */ getSubscriptionCount(): number; /** Returns serializable snapshots of all active connections. */ getConnectionSnapshots(): AdminConnectionSnapshot[]; } /** * A Simple In Memory ConnectionManager implementation. * It uses a `Map` to manage connections. */ export declare class InMemoryConnectionManager implements ConnectionManager { private readonly dwn; private readonly connections; private readonly maxInFlight?; private readonly activityLog?; private readonly adminStore?; private readonly registrationStore?; private readonly serverConfig?; private readonly tenantRateLimiter?; private readonly messageProcessedHooks?; constructor(dwn: Dwn, connections?: Map, SocketConnection>, maxInFlight?: number, activityLog?: ActivityLog, adminStore?: AdminStore, registrationStore?: RegistrationStore, serverConfig?: DwnServerConfig, tenantRateLimiter?: RateLimiter, messageProcessedHooks?: MessageProcessedHook[]); connect(socket: ServerWebSocket): Promise; closeAll(): Promise; closeLocalNodeConnectionsByToken(token: string): Promise; getConnectionCount(): number; getSubscriptionCount(): number; getConnectionSnapshots(): AdminConnectionSnapshot[]; } //# sourceMappingURL=connection-manager.d.ts.map