http-graceful-shutdown: Provides its own types (#39597)

This commit is contained in:
Alexander T
2019-11-04 12:51:39 -08:00
committed by Nathan Shively-Sanders
parent 19cf2b6621
commit 2af5c1a61c
5 changed files with 6 additions and 77 deletions
+6
View File
@@ -1590,6 +1590,12 @@
"sourceRepoURL": "https://github.com/sindresorhus/html-tags",
"asOfVersion": "3.0.0"
},
{
"libraryName": "http-graceful-shutdown",
"typingsPackageName": "http-graceful-shutdown",
"sourceRepoURL": "https://github.com/sebhildebrandt/http-graceful-shutdown",
"asOfVersion": "2.3.0"
},
{
"libraryName": "http-status",
"typingsPackageName": "http-status",
@@ -1,30 +0,0 @@
import GracefulShutdown = require('http-graceful-shutdown');
import * as http from "http";
import * as https from "https";
const opts: GracefulShutdown.Options = {
signals: "SIGINT SIGTERM",
timeout: 1337,
development: false,
onShutdown: (signal) => {
console.log('fake shutdown handler', signal);
return Promise.resolve();
},
finally: () => {
console.log('fake finally handler');
}
};
const httpServer = http.createServer((req, res) => {
res.end();
});
const httpsServer = https.createServer({
key: new Buffer('foo'),
cert: new Buffer('bar')
}, (req, res) => {
res.end();
});
GracefulShutdown(httpServer, opts);
GracefulShutdown(httpsServer, opts);
-23
View File
@@ -1,23 +0,0 @@
// Type definitions for http-graceful-shutdown 2.1
// Project: https://github.com/sebhildebrandt/http-graceful-shutdown
// Definitions by: Dave Lee <https://github.com/dlee-nvisia>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference types="node" />
import { Server as HttpServer } from "http";
import { Server as HttpsServer } from "https";
declare function GracefulShutdown(server: HttpServer | HttpsServer, options?: GracefulShutdown.Options): void;
declare namespace GracefulShutdown {
interface Options {
signals?: string;
timeout?: number;
development?: boolean;
onShutdown?: (signal: string) => Promise<void>;
finally?: () => void;
}
}
export = GracefulShutdown;
@@ -1,23 +0,0 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"http-graceful-shutdown-tests.ts"
]
}
-1
View File
@@ -1 +0,0 @@
{ "extends": "dtslint/dt.json" }