-
Notifications
You must be signed in to change notification settings - Fork 0
/
socket.io-externs.js
68 lines (55 loc) · 1.29 KB
/
socket.io-externs.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
/**
* @type {Object}
* @const
*/
var io = {};
/**
* @param {string} uri
* @param {?Object.<string, string>=} options
* @return {Socket}
*/
io.connect = function(uri, options) {};
/** @constructor*/
var Socket = function() {};
/**
* @type {Object.<string,SocketNamespace>}
*/
Socket.prototype.namespaces;
/**
* @param {function()=} fn
*/
Socket.prototype.connect = function(fn) {};
/**
* @param {string} event
* @param {function(...)} handler
*/
Socket.prototype.on = function(event, handler) {};
/**
* @param {string} name Name of event to emit
* @param {...} args Variable number of arguments for pass to event
*/
Socket.prototype.emit = function(name, args) {};
/** @constructor*/
var SocketNamespace = function() {};
/**
* @type {Socket}
*/
SocketNamespace.prototype.socket;
/**
* @param {string} event
* @param {function(...)} handler
*/
SocketNamespace.prototype.on = function(event, handler) {};
/**
* @param {string} name Name of event to emit
* @param {...} args Variable number of arguments for pass to event
*/
SocketNamespace.prototype.emit = function(name, args) {};
/**
* Method for disconnecting the channel
*/
SocketNamespace.prototype.disconnect = function() {};
/**
* @param {Object} data Packet data
*/
SocketNamespace.prototype.packet = function(data) {};