@types/websocket
Advanced tools
Comparing version 1.0.3 to 1.0.4
@@ -301,8 +301,14 @@ // Type definitions for websocket 1.0 | ||
export interface IMessage { | ||
type: string; | ||
utf8Data?: string | undefined; | ||
binaryData?: Buffer | undefined; | ||
export interface IUtf8Message { | ||
type: 'utf8'; | ||
utf8Data: string; | ||
} | ||
export interface IBinaryMessage { | ||
type: 'binary'; | ||
binaryData: Buffer; | ||
} | ||
export type Message = IUtf8Message | IBinaryMessage; | ||
export interface IBufferList extends events.EventEmitter { | ||
@@ -504,3 +510,3 @@ encoding: string; | ||
// Events | ||
on(event: 'message', cb: (data: IMessage) => void): this; | ||
on(event: 'message', cb: (data: Message) => void): this; | ||
on(event: 'frame', cb: (frame: frame) => void): this; | ||
@@ -512,3 +518,3 @@ on(event: 'close', cb: (code: number, desc: string) => void): this; | ||
on(event: 'pong', cb: (binaryPayload: Buffer) => void): this; | ||
addListener(event: 'message', cb: (data: IMessage) => void): this; | ||
addListener(event: 'message', cb: (data: Message) => void): this; | ||
addListener(event: 'frame', cb: (frame: frame) => void): this; | ||
@@ -515,0 +521,0 @@ addListener(event: 'close', cb: (code: number, desc: string) => void): this; |
{ | ||
"name": "@types/websocket", | ||
"version": "1.0.3", | ||
"version": "1.0.4", | ||
"description": "TypeScript definitions for websocket", | ||
@@ -45,4 +45,4 @@ "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/websocket", | ||
}, | ||
"typesPublisherContentHash": "3dc14ce50d8295e8c501297f08102e2cc0fcfca201e11a8344f8b2dd2b04a796", | ||
"typesPublisherContentHash": "379b1bf138da081eca343964253ac97e0b7afbfe9c38d1d2351d9400885c95a3", | ||
"typeScriptVersion": "3.6" | ||
} |
@@ -11,3 +11,3 @@ # Installation | ||
### Additional Details | ||
* Last updated: Fri, 02 Jul 2021 18:05:34 GMT | ||
* Last updated: Wed, 28 Jul 2021 00:31:32 GMT | ||
* Dependencies: [@types/node](https://npmjs.com/package/@types/node) | ||
@@ -14,0 +14,0 @@ * Global values: none |
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
32883
678