@types/socket.io
Advanced tools
Comparing version 1.4.28 to 1.4.29
// Type definitions for socket.io 1.4.4 | ||
// Project: http://socket.io/ | ||
// Definitions by: PROGRE <https://github.com/progre/>, Damian Connolly <https://github.com/divillysausages/>, Florent Poujol <https://github.com/florentpoujol/> | ||
// Definitions by: PROGRE <https://github.com/progre/>, Damian Connolly <https://github.com/divillysausages/>, Florent Poujol <https://github.com/florentpoujol/>, KentarouTakeda <https://github.com/KentarouTakeda/> | ||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped | ||
@@ -475,3 +475,3 @@ | ||
*/ | ||
interface Socket { | ||
interface Socket extends NodeJS.EventEmitter{ | ||
@@ -513,25 +513,4 @@ /** | ||
*/ | ||
conn: { | ||
conn: EngineSocket; | ||
/** | ||
* The ID for this socket - matches Client.id | ||
*/ | ||
id: string; | ||
/** | ||
* The Engine.io Server for this socket | ||
*/ | ||
server: any; | ||
/** | ||
* The ready state for the client. Either 'opening', 'open', 'closing', or 'closed' | ||
*/ | ||
readyState: string; | ||
/** | ||
* The remote IP for this connection | ||
*/ | ||
remoteAddress: string; | ||
}; | ||
/** | ||
@@ -619,13 +598,2 @@ * The list of rooms that this Socket is currently in, where | ||
/** | ||
* Emits an event to this client. If the 'broadcast' flag was set, this will | ||
* emit to all other clients, except for this one | ||
* @param event The event that we want to emit | ||
* @param args Any number of optional arguments to pass with the event. If the | ||
* last argument is a function, it will be called as an ack. The ack should | ||
* take whatever data was sent with the packet | ||
* @return This Socket | ||
*/ | ||
emit( event: string, ...args: any[]): Socket; | ||
/** | ||
* Targets a room when broadcasting | ||
@@ -684,49 +652,2 @@ * @param room The name of the room that we're targeting | ||
/** | ||
* Adds a listener for a particular event. Calling multiple times will add | ||
* multiple listeners | ||
* @param event The event that we're listening for | ||
* @param fn The function to call when we get the event. Parameters depend on the | ||
* event in question | ||
* @return This Socket | ||
*/ | ||
on( event: string, fn: Function ): Socket; | ||
/** | ||
* @see on( event, fn ) | ||
*/ | ||
addListener( event: string, fn: Function ): Socket; | ||
/** | ||
* Adds a listener for a particular event that will be invoked | ||
* a single time before being automatically removed | ||
* @param event The event that we're listening for | ||
* @param fn The function to call when we get the event. Parameters depend on | ||
* the event in question | ||
* @return This Socket | ||
*/ | ||
once( event: string, fn: Function ): Socket; | ||
/** | ||
* Removes a listener for a particular type of event. This will either | ||
* remove a specific listener, or all listeners for this type of event | ||
* @param event The event that we want to remove the listener of | ||
* @param fn The function to remove, or null if we want to remove all functions | ||
* @return This Socket | ||
*/ | ||
removeListener( event: string, fn?: Function ): Socket; | ||
/** | ||
* Removes all event listeners on this object | ||
* @return This Socket | ||
*/ | ||
removeAllListeners( event?: string ): Socket; | ||
/** | ||
* Sets the maximum number of listeners this instance can have | ||
* @param n The max number of listeners we can add to this emitter | ||
* @return This Socket | ||
*/ | ||
setMaxListeners( n: number ): Socket; | ||
/** | ||
* Returns all the callbacks for a particular event | ||
@@ -816,25 +737,4 @@ * @param event The event that we're looking for the callbacks of | ||
*/ | ||
conn: { | ||
conn: EngineSocket; | ||
/** | ||
* The ID for this socket - matches Client.id | ||
*/ | ||
id: string; | ||
/** | ||
* The Engine.io Server for this socket | ||
*/ | ||
server: any; | ||
/** | ||
* The ready state for the client. Either 'opening', 'open', 'closing', or 'closed' | ||
*/ | ||
readyState: string; | ||
/** | ||
* The remote IP for this connection | ||
*/ | ||
remoteAddress: string; | ||
}; | ||
/** | ||
@@ -863,2 +763,42 @@ * The ID for this client. Regenerated at every connection | ||
} | ||
/** | ||
* A reference to the underlying engine.io Socket connection. | ||
*/ | ||
interface EngineSocket extends NodeJS.EventEmitter { | ||
/** | ||
* The ID for this socket - matches Client.id | ||
*/ | ||
id: string; | ||
/** | ||
* The Engine.io Server for this socket | ||
*/ | ||
server: any; | ||
/** | ||
* The ready state for the client. Either 'opening', 'open', 'closing', or 'closed' | ||
*/ | ||
readyState: string; | ||
/** | ||
* The remote IP for this connection | ||
*/ | ||
remoteAddress: string; | ||
/** | ||
* whether the transport has been upgraded | ||
*/ | ||
upgraded: boolean; | ||
/** | ||
* (http.IncomingMessage): request that originated the Socket | ||
*/ | ||
request: any; | ||
/** | ||
* (Transport): transport reference | ||
*/ | ||
transport: any; | ||
} | ||
} |
{ | ||
"name": "@types/socket.io", | ||
"version": "1.4.28", | ||
"version": "1.4.29", | ||
"description": "TypeScript definitions for socket.io", | ||
@@ -18,2 +18,6 @@ "license": "MIT", | ||
"url": "https://github.com/florentpoujol/" | ||
}, | ||
{ | ||
"name": "KentarouTakeda", | ||
"url": "https://github.com/KentarouTakeda/" | ||
} | ||
@@ -31,4 +35,4 @@ ], | ||
"peerDependencies": {}, | ||
"typesPublisherContentHash": "7fdd70c08839936946e997d55bc982c3b75deed970e40652279bb61bea220b89", | ||
"typesPublisherContentHash": "f7c8609cba072fae73201cd8c299f1db03cd06b17f12dbc4264737ad39c23931", | ||
"typeScriptVersion": "2.0" | ||
} |
@@ -11,3 +11,3 @@ # Installation | ||
Additional Details | ||
* Last updated: Thu, 16 Feb 2017 01:27:09 GMT | ||
* Last updated: Thu, 23 Mar 2017 00:16:54 GMT | ||
* Dependencies: node | ||
@@ -17,2 +17,2 @@ * Global values: none | ||
# Credits | ||
These definitions were written by PROGRE <https://github.com/progre/>, Damian Connolly <https://github.com/divillysausages/>, Florent Poujol <https://github.com/florentpoujol/>. | ||
These definitions were written by PROGRE <https://github.com/progre/>, Damian Connolly <https://github.com/divillysausages/>, Florent Poujol <https://github.com/florentpoujol/>, KentarouTakeda <https://github.com/KentarouTakeda/>. |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
22725
3
673