forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
response-time.d.ts
38 lines (31 loc) · 1.22 KB
/
response-time.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
30
31
32
33
34
35
36
37
38
// Type definitions for response-time 2.2.0
// Project: https://github.com/expressjs/response-time
// Definitions by: Uros Smolnik <https://github.com/urossmolnik/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/* =================== USAGE ===================
import responseTime = require('response-time');
app.use(responseTime());
=============================================== */
/// <reference path="../express/express.d.ts" />
declare module "response-time" {
import express = require('express');
/**
* Response time header for node.js
* Returns middleware that adds a X-Response-Time header to responses.
*/
function responseTime(options?: {
/**
* The fixed number of digits to include in the output, which is always in milliseconds, defaults to 3 (ex: 2.300ms).
*/
digits?: number;
/**
* The name of the header to set, defaults to X-Response-Time.
*/
header?: string;
/**
* Boolean to indicate if units of measurement suffix should be added to the output, defaults to true (ex: 2.300ms vs 2.300).
*/
suffix?: boolean;
}): express.RequestHandler;
export = responseTime;
}