feat: add vhost types (#43467)

* feat: add vhost types

* refactor: lints
This commit is contained in:
Vincenzo Chianese 2020-03-31 12:49:40 -05:00 committed by GitHub
parent 8b65eec5a8
commit e21346be33
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 40 additions and 0 deletions

10
types/vhost/index.d.ts vendored Normal file
View File

@ -0,0 +1,10 @@
// Type definitions for vhost 3.0
// Project: https://github.com/expressjs/vhost
// Definitions by: Vincenzo Chianese <https://github.com/DefinitelyTyped>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
import express = require('express');
declare function vhost(hostname: string, handler: express.Handler): string;
export = vhost;

24
types/vhost/tsconfig.json Normal file
View File

@ -0,0 +1,24 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictFunctionTypes": true,
"esModuleInterop": true,
"strictNullChecks": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"vhost-tests.ts"
]
}

1
types/vhost/tslint.json Normal file
View File

@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }

View File

@ -0,0 +1,5 @@
import vhost from 'vhost';
import { Request, Response, NextFunction } from 'express';
vhost('hostname', (_req: Request, _res: Response, _next: NextFunction) => {
});