forked from jbaroudi/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconnect-timeout.d.ts
39 lines (33 loc) · 1.08 KB
/
connect-timeout.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
39
// Type definitions for connect-timeout
// Project: https://github.com/expressjs/timeout
// Definitions by: Cyril Schumacher <https://github.com/cyrilschumacher>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../express/express.d.ts" />
declare module Express {
export interface Request {
/**
* @summary Clears the timeout on the request.
*/
clearTimeout(): void;
/**
*
* @return {boolean} true if timeout fired; false otherwise.
*/
timedout(event: string, message: string): boolean;
}
}
declare module "connect-timeout" {
import express = require("express");
/**
* @summary Interface for timeout options.
* @interface
*/
interface TimeoutOptions extends Object {
/**
* @summary Controls if this module will "respond" in the form of forwarding an error.
* @type {boolean}
*/
respond: boolean;
}
export default function timeout(timeout: string, options?: TimeoutOptions): express.RequestHandler;
}