Merge pull request #865 from AndrewGaspar/socketio

Updated socket.io to have better function typing on SocketNamespace.on
This commit is contained in:
Boris Yankov
2013-08-16 08:00:51 -07:00
2 changed files with 11 additions and 1 deletions
+10
View File
@@ -0,0 +1,10 @@
import io = require('socket.io');
var socketManager = io.listen(80);
socketManager.sockets.on('connection', socket => {
socket.emit('news', { hello: 'world' });
socket.on('my other event', data => {
console.log(data);
});
});
+1 -1
View File
@@ -40,7 +40,7 @@ interface SocketNamespace {
json: any;
volatile: any;
in(room: string): SocketNamespace;
on(evt: string, fn: Function): SocketNamespace;
on(evt: string, fn: (socket: Socket) => void): SocketNamespace;
to(room: string): SocketNamespace;
except(id: any): SocketNamespace;
send(data: any): any;