From f45c277760c0754f2c331f0f3ce01062bd568074 Mon Sep 17 00:00:00 2001 From: Maximilien Mellen Date: Fri, 29 Mar 2019 17:31:54 +0100 Subject: [PATCH] Allow initializing tls.Server with no args --- types/node/test/tls.ts | 4 ++++ types/node/tls.d.ts | 1 + 2 files changed, 5 insertions(+) diff --git a/types/node/test/tls.ts b/types/node/test/tls.ts index 4b329c150f..bdfebce8bb 100644 --- a/types/node/test/tls.ts +++ b/types/node/test/tls.ts @@ -17,6 +17,10 @@ import { createSecureContext, SecureContext, ConnectionOptions, connect, getCiph const curve: string = DEFAULT_ECDH_CURVE; } +{ + const _server = createServer(); +} + { let _server = createServer({}); let _boolean: boolean; diff --git a/types/node/tls.d.ts b/types/node/tls.d.ts index bf46cb190e..ea4192d979 100644 --- a/types/node/tls.d.ts +++ b/types/node/tls.d.ts @@ -385,6 +385,7 @@ declare module "tls" { * Returns Error object, populating it with the reason, host and cert on failure. On success, returns undefined. */ function checkServerIdentity(host: string, cert: PeerCertificate): Error | undefined; + function createServer(secureConnectionListener?: (socket: TLSSocket) => void): Server; function createServer(options: TlsOptions, secureConnectionListener?: (socket: TLSSocket) => void): Server; function connect(options: ConnectionOptions, secureConnectListener?: () => void): TLSSocket; function connect(port: number, host?: string, options?: ConnectionOptions, secureConnectListener?: () => void): TLSSocket;