-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.d.ts
29 lines (25 loc) · 919 Bytes
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
/**
* Allow terminating an HTTP server in an orderly fashion
*/
import { Server } from 'http';
interface enableTerminateSignature {
/** Adds the `terminate` function to the provided server instance */
(server: Server, opts?: Options): Server;
default: enableTerminateSignature;
}
declare var enableTerminate: enableTerminateSignature;
export = enableTerminate;
interface Options {
timeout?: number;
}
declare module 'http' {
export interface Server {
/**
* Terminates the server in an orderly fashion by
* - closing keep-alive connections that are not being used by any HTTP request.
* - waiting for running HTTP requests to finish before closing their connections.
* - closing connections with running HTTP requests after the provided timeout
*/
terminate(cb: (err: Error, terminatedByTimeout: boolean) => any): Server;
}
}