3.0.9 • Published 6 months ago

@types/vhost v3.0.9

Weekly downloads
4,120
License
MIT
Repository
github
Last release
6 months ago

Installation

npm install --save @types/vhost

Summary

This package contains type definitions for vhost (https://github.com/expressjs/vhost).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/vhost.

index.d.ts

// Type definitions for vhost 3.0
// Project: https://github.com/expressjs/vhost
// Definitions by: Vincenzo Chianese <https://github.com/XVincentX>
//                 Cambo <https://github.com/indentedspace>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped

import express = require('express');

declare namespace vhost {
    interface Request extends express.Request {
        vhost: {
            host: string;
            hostname: string;
            length: number;
            [key: number]: string;
        };
    }

    interface Handler {
        (req: Request, res: express.Response, next: express.NextFunction): void;
    }
}

declare function vhost(hostname: string | RegExp, handler: vhost.Handler): express.Handler;

export = vhost;

Additional Details

  • Last updated: Fri, 09 Jul 2021 01:01:20 GMT
  • Dependencies: @types/express
  • Global values: none

Credits

These definitions were written by Vincenzo Chianese, and Cambo.