Updated ws types to be compatible with updated types in node (#45131)

The `types/ws` package is incompatible with the recent updates in `types/node`. You can see the issue described at https://github.com/slackapi/node-slack-sdk/issues/1024.

This change just references the `SecureContextOptions` from the built in `tls` module in node and properly adds the updated properties.
This commit is contained in:
Steve Gill 2020-06-03 18:02:21 -07:00 committed by GitHub
parent 6800e59a61
commit abbd83bc6f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

9
types/ws/index.d.ts vendored
View File

@ -19,6 +19,7 @@ import * as net from 'net';
import * as url from 'url';
import * as zlib from 'zlib';
import * as stream from 'stream';
import { SecureContextOptions } from 'tls';
// WebSocket socket.
declare class WebSocket extends events.EventEmitter {
@ -128,7 +129,7 @@ declare namespace WebSocket {
type VerifyClientCallbackAsync = (info: { origin: string; secure: boolean; req: http.IncomingMessage }
, callback: (res: boolean, code?: number, message?: string, headers?: http.OutgoingHttpHeaders) => void) => void;
interface ClientOptions {
interface ClientOptions extends SecureContextOptions {
protocol?: string;
followRedirects?: boolean;
handshakeTimeout?: number;
@ -143,12 +144,6 @@ declare namespace WebSocket {
family?: number;
checkServerIdentity?(servername: string, cert: CertMeta): boolean;
rejectUnauthorized?: boolean;
passphrase?: string;
ciphers?: string;
cert?: CertMeta;
key?: CertMeta;
pfx?: string | Buffer;
ca?: CertMeta;
maxPayload?: number;
}