import { Socket } from "socket.io-client"; export interface RoomsSocketConfig { serverUrl: string; mountPath: string; transports: string[]; appId: string; token?: string; } export type TSocketRoom = string; export type TJsonStr = string; type RoomsSocketEventsMap = { listen: { connect: () => Promise | void; update_model: (msg: { room: string; data: TJsonStr; }) => Promise | void; error: (error: Error) => Promise | void; }; emit: { join: (room: string) => void; leave: (room: string) => void; }; }; type TEvent = keyof RoomsSocketEventsMap["listen"]; type THandler = RoomsSocketEventsMap["listen"][E]; export type RoomsSocket = ReturnType; export declare function RoomsSocket({ config }: { config: RoomsSocketConfig; }): { socket: Socket<{ connect: () => Promise | void; update_model: (msg: { room: string; data: TJsonStr; }) => Promise | void; error: (error: Error) => Promise | void; }, { join: (room: string) => void; leave: (room: string) => void; }>; subscribeToRoom: (room: TSocketRoom, handlers: Partial<{ [k in TEvent]: THandler; }>) => () => void; updateConfig: (config: Partial) => void; updateModel: (room: string, data: any) => Promise; disconnect: () => void; }; export {};