2.0.5 • Published 6 months ago
@types/http-terminator v2.0.5
Installation
npm install --save @types/http-terminator
Summary
This package contains type definitions for http-terminator (https://github.com/gajus/http-terminator#readme).
Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/http-terminator.
index.d.ts
// Type definitions for http-terminator 2.0
// Project: https://github.com/gajus/http-terminator#readme
// Definitions by: Steve Ripberger <https://github.com/sripberger>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference types="node" />
import { Server as HttpServer } from 'http';
import { Server as HttpsServer } from 'https';
/**
* Terminator configuration interface.
*/
export interface HttpTerminatorConfig {
/**
* Number of milliseconds to allow for the active sockets to complete
* serving the response (default: 5000).
*/
gracefulTerminationTimeout?: number | undefined;
/**
* Intsance of http.Server or https.Server.
*/
server: HttpServer | HttpsServer;
}
/**
* Terminator interface.
*/
export interface HttpTerminator {
/**
* Terminates the HTTP server.
*/
terminate(): Promise<void>;
}
/**
* Creates an HttpTerminator.
* @param config Terminator configuration
* @returns The created HttpTerminator.
*/
export function createHttpTerminator(
config: HttpTerminatorConfig,
): HttpTerminator;
Additional Details
- Last updated: Thu, 08 Jul 2021 14:22:57 GMT
- Dependencies: @types/node
- Global values: none
Credits
These definitions were written by Steve Ripberger.