Adding stoppable typings

This commit is contained in:
Eric Byers
2017-09-08 16:14:07 -05:00
parent 10fc78ad77
commit b71e2304ff
4 changed files with 38 additions and 0 deletions

7
types/stoppable/index.d.ts vendored Normal file
View File

@@ -0,0 +1,7 @@
// Type definitions for stoppable 1.0
// Project: https://github.com/hunterloftis/stoppable
// Definitions by: Eric Byers <https://github.com/EricByers>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
export const stoppable: (server:http.Server, grace?:number) => http.Server;

View File

@@ -0,0 +1,8 @@
import http = require('http');
import stoppable = require('stoppable');
const server:http.Server = stoppable(http.createServer());
server.stop();
const server2:http.Server = stoppable(http.createServer(), 10000);
server2.stop();

View File

@@ -0,0 +1,22 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"stoppable-tests.ts"
]
}

View File

@@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }