mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-06-05 06:40:35 +08:00
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:
committed by
Mohamed Hegazy
parent
aa3a5687b7
commit
7769c99d01
17
types/server-destroy/index.d.ts
vendored
Normal file
17
types/server-destroy/index.d.ts
vendored
Normal 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;
|
||||
7
types/server-destroy/server-destroy-tests.ts
Normal file
7
types/server-destroy/server-destroy-tests.ts
Normal 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(() => {});
|
||||
22
types/server-destroy/tsconfig.json
Normal file
22
types/server-destroy/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",
|
||||
"server-destroy-tests.ts"
|
||||
]
|
||||
}
|
||||
1
types/server-destroy/tslint.json
Normal file
1
types/server-destroy/tslint.json
Normal file
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user