Type definitions for the server-destroy npm package (#19452)

* Typings for server-destroy npm package

* Fix indentation of server-destroy typings

* Fix tsconfig of server-destroy typings
This commit is contained in:
Gyula Szalai
2017-08-31 02:07:58 +02:00
committed by Mohamed Hegazy
parent aa3a5687b7
commit 7769c99d01
4 changed files with 47 additions and 0 deletions

17
types/server-destroy/index.d.ts vendored Normal file
View File

@@ -0,0 +1,17 @@
// Type definitions for server-destroy 1.0
// Project: https://github.com/isaacs/server-destroy#readme
// Definitions by: Gyula Szalai <https://github.com/gyszalai>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference types="node" />
import * as http from "http";
declare module "http" {
interface Server {
destroy(callback?: () => void): void;
}
}
declare function enableDestroy(server: http.Server): void;
export = enableDestroy;

View File

@@ -0,0 +1,7 @@
import enableDestroy = require('server-destroy');
import { Server } from "http";
const server = {} as any as Server;
enableDestroy(server);
server.destroy();
server.destroy(() => {});

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",
"server-destroy-tests.ts"
]
}

View File

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