mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-04 06:47:03 +00:00
Merge pull request #28192 from saenglert/master
[Socket.io] Added interfaces for Rooms and singular Room to increase readability
This commit is contained in:
Vendored
+18
-2
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user