Added interfaces for Room and Rooms dictonaries

This commit is contained in:
Sascha Englert
2018-08-17 12:34:20 +02:00
parent cc3ef23fea
commit 9555e31a1c
+17 -2
View File
@@ -696,6 +696,22 @@ declare namespace SocketIO {
query: any;
}
/**
* The interface describing a room
*/
interface Room {
sockets: {[id: string]: boolean }
}
/**
* 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 +724,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