diff --git a/types/http-graceful-shutdown/http-graceful-shutdown-tests.ts b/types/http-graceful-shutdown/http-graceful-shutdown-tests.ts index 17bc81ce1d..2445635c67 100644 --- a/types/http-graceful-shutdown/http-graceful-shutdown-tests.ts +++ b/types/http-graceful-shutdown/http-graceful-shutdown-tests.ts @@ -1,5 +1,6 @@ import GracefulShutdown = require('http-graceful-shutdown'); import * as http from "http"; +import * as https from "https"; const opts: GracefulShutdown.Options = { signals: "SIGINT SIGTERM", @@ -14,8 +15,16 @@ const opts: GracefulShutdown.Options = { } }; -const server = http.createServer((req, res) => { +const httpServer = http.createServer((req, res) => { res.end(); }); -GracefulShutdown(server, opts); +const httpsServer = https.createServer({ + key: new Buffer('foo'), + cert: new Buffer('bar') +}, (req, res) => { + res.end(); +}); + +GracefulShutdown(httpServer, opts); +GracefulShutdown(httpsServer, opts); diff --git a/types/http-graceful-shutdown/index.d.ts b/types/http-graceful-shutdown/index.d.ts index f8269adea7..ba34246290 100644 --- a/types/http-graceful-shutdown/index.d.ts +++ b/types/http-graceful-shutdown/index.d.ts @@ -5,9 +5,10 @@ /// -import { Server } from "http"; +import { Server as HttpServer } from "http"; +import { Server as HttpsServer } from "https"; -declare function GracefulShutdown(server: Server, options?: GracefulShutdown.Options): void; +declare function GracefulShutdown(server: HttpServer | HttpsServer, options?: GracefulShutdown.Options): void; declare namespace GracefulShutdown { interface Options {