mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-06-05 14:59:37 +08:00
Adding stoppable typings
This commit is contained in:
7
types/stoppable/index.d.ts
vendored
Normal file
7
types/stoppable/index.d.ts
vendored
Normal 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;
|
||||
8
types/stoppable/stoppable-tests.ts
Normal file
8
types/stoppable/stoppable-tests.ts
Normal 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();
|
||||
22
types/stoppable/tsconfig.json
Normal file
22
types/stoppable/tsconfig.json
Normal 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"
|
||||
]
|
||||
}
|
||||
1
types/stoppable/tslint.json
Normal file
1
types/stoppable/tslint.json
Normal file
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user