import type { Server as HttpServer } from "http"; import { Session, type AuditEntry } from "./session.js"; import type { DomSnapshot } from "../shared/types.js"; import { type ServerCommand } from "./security/protocol.js"; import type { SessionStore, RateLimiterAdapter } from "./adapters/types.js"; export interface PortalServerConfig { httpServer: HttpServer; corsOrigins?: string[]; sessionTtlMs?: number; maxSessionsPerUser?: number; debug?: boolean; sessionStore?: SessionStore; rateLimiter?: RateLimiterAdapter; socketAdapter?: "memory" | "redis"; redis?: { url: string; }; } export interface PortalServerEvents { "session:created": (info: ReturnType) => void; "session:destroyed": (sessionId: string, reason: string) => void; "session:dom": (sessionId: string, snapshot: DomSnapshot) => void; "session:scroll": (sessionId: string, position: { x: number; y: number; }) => void; "session:focus": (sessionId: string, selector: string) => void; "handoff:requested": (sessionId: string, reason: string) => void; error: (err: Error) => void; } export declare class PortalServer { private io; private sessions; readonly sessionStore: SessionStore; readonly rateLimiter: RateLimiterAdapter; private socketToSession; private userSessions; private config; private listeners; private cleanupInterval; constructor(config: PortalServerConfig); private log; on(event: K, callback: PortalServerEvents[K]): void; private emit; private setupSocketHandlers; sendCommand(sessionId: string, command: ServerCommand): boolean; private findSocketId; getSession(sessionId: string): Session | undefined; getAllSessions(): ReturnType[]; destroySession(sessionId: string, reason: string): void; validateSelector(sessionId: string, selector: string): boolean; getSnapshot(sessionId: string): DomSnapshot | null; startViewing(sessionId: string): boolean; stopViewing(sessionId: string): boolean; handoffToHuman(sessionId: string, reason: string): void; getAuditLog(sessionId: string): AuditEntry[]; private startCleanup; shutdown(): void; } //# sourceMappingURL=socket.d.ts.map