import type { IncomingMessage } from 'http'; import { BaseService, SeeksRoute } from './BaseService'; import type { SocketClient, SocketResponseMessage } from '../app/SeeksSocket'; export interface SeeksSocketRoute extends SeeksRoute { __isSocketService?: boolean; clients?: Set; addClient?(client: SocketClient): void; removeClient?(client: SocketClient): void; authorizeConnection?(client: SocketClient, req: IncomingMessage): Promise | any; onConnected?(client: SocketClient, req: IncomingMessage): Promise | any; onDisconnected?(client: SocketClient, code: number, reason: string): Promise | any; onError?(client: SocketClient, error: Error): Promise | any; } export declare const isSocketService: (serviceInstance: any) => serviceInstance is SeeksSocketRoute; export declare class BaseSocketService extends BaseService implements SeeksSocketRoute { __isSocketService: boolean; clients: Set; authorizeConnection(client: SocketClient, req: IncomingMessage): Promise; onConnected(client: SocketClient, req: IncomingMessage): Promise; onDisconnected(client: SocketClient, code: number, reason: string): Promise; onError(client: SocketClient, error: Error): Promise; addClient(client: SocketClient): void; removeClient(client: SocketClient): void; getClients(): SocketClient[]; findClients(filterFn: (client: SocketClient) => boolean): SocketClient[]; sendToClient(client: SocketClient, message: SocketResponseMessage | string): boolean; broadcast(message: SocketResponseMessage | string, filterFn?: (client: SocketClient) => boolean): number; sendToUser(userId: string, message: SocketResponseMessage | string, userIdGetter?: (client: SocketClient) => string): number; }