Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@types/ws

Package Overview
Dependencies
Maintainers
1
Versions
77
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@types/ws - npm Package Compare versions

Comparing version 3.2.1 to 4.0.0

31

ws/index.d.ts

@@ -1,2 +0,2 @@

// Type definitions for ws 3.2
// Type definitions for ws 4.0
// Project: https://github.com/websockets/ws

@@ -6,2 +6,3 @@ // Definitions by: Paul Loyd <https://github.com/loyd>

// Margus Lamp <https://github.com/mlamp>
// Philippe D'Alva <https://github.com/TitaneBoy>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped

@@ -25,6 +26,4 @@

bufferedAmount: number;
bytesReceived: number;
extensions: {};
extensions: string;
protocol: string;
protocolVersion: number;
readyState: number;

@@ -39,3 +38,3 @@ url: string;

onopen: (event: { target: WebSocket }) => void;
onerror: (err: Error) => void;
onerror: (event: {error: any, message: string, type: string, target: WebSocket }) => void;
onclose: (event: { wasClean: boolean; code: number; reason: string; target: WebSocket }) => void;

@@ -48,10 +47,6 @@ onmessage: (event: { data: WebSocket.Data; type: string; target: WebSocket }) => void;

close(code?: number, data?: string): void;
pause(): void;
resume(): void;
ping(data?: any, mask?: boolean, failSilently?: boolean): void;
pong(data?: any, mask?: boolean, failSilently?: boolean): void;
ping(data?: any, mask?: boolean, cb?: (err: Error) => void): void;
pong(data?: any, mask?: boolean, cb?: (err: Error) => void): void;
send(data: any, cb?: (err: Error) => void): void;
send(data: any, options: { mask?: boolean; binary?: boolean }, cb?: (err: Error) => void): void;
stream(options: { mask?: boolean; binary?: boolean }, cb?: (err: Error, final: boolean) => void): void;
stream(cb?: (err: Error, final: boolean) => void): void;
send(data: any, options: { mask?: boolean; binary?: boolean; compress?: boolean; fin?: boolean }, cb?: (err: Error) => void): void;
terminate(): void;

@@ -65,3 +60,3 @@

}) => void): void;
addEventListener(method: 'error', cb?: (err: Error) => void): void;
addEventListener(method: 'error', cb?: (event: {error: any, message: any, type: string, target: WebSocket }) => void): void;
addEventListener(method: 'open', cb?: (event: { target: WebSocket }) => void): void;

@@ -75,3 +70,3 @@ addEventListener(method: string, listener?: () => void): void;

}) => void): void;
removeEventListener(method: 'error', cb?: (err: Error) => void): void;
removeEventListener(method: 'error', cb?: (event: {error: any, message: any, type: string, target: WebSocket }) => void): void;
removeEventListener(method: 'open', cb?: (event: { target: WebSocket }) => void): void;

@@ -82,4 +77,4 @@ removeEventListener(method: string, listener?: () => void): void;

on(event: 'close', listener: (code: number, reason: string) => void): this;
on(event: 'error', listener: (err: Error) => void): this;
on(event: 'headers', listener: (headers: {}, request: http.IncomingMessage) => void): this;
on(event: 'error', listener: (event: {error: any, message: any, type: string, target: WebSocket }) => void): this;
on(event: 'upgrade', listener: (request: http.IncomingMessage) => void): this;
on(event: 'message', listener: (data: WebSocket.Data) => void): this;

@@ -93,3 +88,3 @@ on(event: 'open' , listener: () => void): this;

addListener(event: 'error', listener: (err: Error) => void): this;
addListener(event: 'headers', listener: (headers: {}, request: http.IncomingMessage) => void): this;
addListener(event: 'upgrade', listener: (request: http.IncomingMessage) => void): this;
addListener(event: 'message', listener: (data: WebSocket.Data) => void): this;

@@ -103,3 +98,3 @@ addListener(event: 'open' , listener: () => void): this;

removeListener(event: 'error', listener: (err: Error) => void): this;
removeListener(event: 'headers', listener: (headers: {}, request: http.IncomingMessage) => void): this;
removeListener(event: 'upgrade', listener: (request: http.IncomingMessage) => void): this;
removeListener(event: 'message', listener: (data: WebSocket.Data) => void): this;

@@ -106,0 +101,0 @@ removeListener(event: 'open' , listener: () => void): this;

{
"name": "@types/ws",
"version": "3.2.1",
"version": "4.0.0",
"description": "TypeScript definitions for ws",

@@ -21,2 +21,7 @@ "license": "MIT",

"githubUsername": "mlamp"
},
{
"name": "Philippe D'Alva",
"url": "https://github.com/TitaneBoy",
"githubUsername": "TitaneBoy"
}

@@ -31,6 +36,7 @@ ],

"dependencies": {
"@types/events": "*",
"@types/node": "*"
},
"typesPublisherContentHash": "29ef5d867a8940f9bf875a1ed9ed40b96c307c2b9497f6febed4398ca40287b8",
"typesPublisherContentHash": "dcf842dc3ab2a896b721a1f5e6eaff590564a9fd8845d036498c2911ea0d4a6b",
"typeScriptVersion": "2.0"
}

@@ -11,3 +11,3 @@ # Installation

Additional Details
* Last updated: Thu, 30 Nov 2017 21:46:01 GMT
* Last updated: Fri, 12 Jan 2018 18:52:17 GMT
* Dependencies: events, http, https, net, node

@@ -17,2 +17,2 @@ * Global values: none

# Credits
These definitions were written by Paul Loyd <https://github.com/loyd>, Matt Silverlock <https://github.com/elithrar>, Margus Lamp <https://github.com/mlamp>.
These definitions were written by Paul Loyd <https://github.com/loyd>, Matt Silverlock <https://github.com/elithrar>, Margus Lamp <https://github.com/mlamp>, Philippe D'Alva <https://github.com/TitaneBoy>.
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc