diff --git a/types/socket.io/index.d.ts b/types/socket.io/index.d.ts index 2b5100abb2..6c12e444b0 100644 --- a/types/socket.io/index.d.ts +++ b/types/socket.io/index.d.ts @@ -696,6 +696,23 @@ declare namespace SocketIO { query: any; } + /** + * The interface describing a room + */ + interface Room { + sockets: {[id: string]: boolean }; + length: number; + } + + /** + * The interface describing a dictionary of rooms + * Where room is the name of the room + */ + + interface Rooms { + [room: string]: Room; + } + /** * The interface used when dealing with rooms etc */ @@ -708,9 +725,8 @@ declare namespace SocketIO { /** * A dictionary of all the rooms that we have in this namespace - * The rooms are made of a `sockets` key which is the dictionary of sockets per ID */ - rooms: {[room: string]: {sockets: {[id: string]: boolean }, length: number }}; + rooms: Rooms; /** * A dictionary of all the socket ids that we're dealing with, and all