2.0.5 • Published 6 months ago

@types/http-terminator v2.0.5

Weekly downloads
3,659
License
MIT
Repository
github
Last release
6 months ago

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.

2.0.3

8 months ago

2.0.5

6 months ago

2.0.4

7 months ago

2.0.2

3 years ago

2.0.1

4 years ago

2.0.0

4 years ago