DefinitelyTyped/types/connect-timeout/index.d.ts
Dimitri Benin dfeadbd5ac [cookie-parser] finish incomplete typings (#18191)
* [cookie-parser] finish incomplete typings

* [cookie-parser] bump compiler version as suggested by travis output

* [cookie-parser] revert compiler bump

* [cookie-parser] restrict compiler version in failing packages

* [cookie-parser] fix indentation
2017-07-24 10:04:09 -07:00

44 lines
1.1 KiB
TypeScript

// Type definitions for connect-timeout
// Project: https://github.com/expressjs/timeout
// Definitions by: Cyril Schumacher <https://github.com/cyrilschumacher>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.2
/// <reference types="express" />
declare namespace 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");
namespace e {
/**
* @summary Interface for timeout options.
* @interface
*/
interface TimeoutOptions {
/**
* @summary Controls if this module will "respond" in the form of forwarding an error.
* @type {boolean}
*/
respond?: boolean;
}
}
function e(timeout: string, options?: e.TimeoutOptions): express.RequestHandler;
export = e;
}