Merge pull request #28192 from saenglert/master

[Socket.io] Added interfaces for Rooms and singular Room to increase readability
This commit is contained in:
Benjamin Lichtman
2018-08-17 10:10:40 -07:00
committed by GitHub
+18 -2
View File
@@ -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