UNPKG

@types/connect-timeout

Version:
58 lines (47 loc) 1.72 kB
# Installation > `npm install --save @types/connect-timeout` # Summary This package contains type definitions for connect-timeout (https://github.com/expressjs/timeout). # Details Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/connect-timeout. ## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/connect-timeout/index.d.ts) ````ts /// <reference types="express" /> declare namespace Express { export interface Request { /** * @summary Clears the timeout on the request. */ clearTimeout(): void; /** * @summary true if timeout fired; false otherwise. */ timedout: 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. */ respond?: boolean | undefined; } } /** * @summary Returns middleware that times out in time milliseconds. time can also be a string accepted by the ms module. On timeout, req will emit "timeout". */ function e(time: number | string, options?: e.TimeoutOptions): express.RequestHandler; export = e; } ```` ### Additional Details * Last updated: Mon, 05 May 2025 21:33:58 GMT * Dependencies: [@types/express](https://npmjs.com/package/@types/express) # Credits These definitions were written by [Cyril Schumacher](https://github.com/cyrilschumacher).