Installation
npm install --save @types/response-time
Summary
This package contains type definitions for response-time (https://github.com/expressjs/response-time).
Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/response-time.
import http = require("http");
import express = require("express");
export = responseTime;
declare function responseTime(
options?: responseTime.ResponseTimeOptions,
): (request: http.IncomingMessage, response: http.ServerResponse, callback: (err: any) => void) => any;
declare function responseTime(
fn: responseTime.ResponseTimeFunction,
): (request: http.IncomingMessage, response: http.ServerResponse, callback: (err: any) => void) => any;
declare function responseTime(
fn: (request: express.Request, response: express.Response, time: number) => any,
): express.RequestHandler;
declare namespace responseTime {
export interface ResponseTimeOptions {
digits?: number | undefined;
header?: string | undefined;
suffix?: boolean | undefined;
}
export interface ResponseTimeFunction {
(request: http.IncomingMessage, response: http.ServerResponse, time: number): any;
}
}
Additional Details
Credits
These definitions were written by Uros Smolnik, TonyYang, and Dan Manastireanu.