Add http2.Http2ServerRequest type to the auth() parameter (#42037)

This commit is contained in:
Ryo Ota 2020-02-04 02:12:36 +09:00 committed by GitHub
parent 2988d52315
commit 34fd07c37a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,14 +1,15 @@
// Type definitions for basic-auth 1.1
// Project: https://github.com/jshttp/basic-auth
// Definitions by: Clément Bourgeois <https://github.com/moonpyk>, Vesa Poikajärvi <https://github.com/vesse>
// Definitions by: Clément Bourgeois <https://github.com/moonpyk>, Vesa Poikajärvi <https://github.com/vesse>, Ryo Ota <https://github.com/nwtgck>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference types="node" />
import * as http from 'http';
import * as http2 from 'http2';
// See https://github.com/jshttp/basic-auth/blob/v1.1.0/index.js#L49
declare function auth(req: http.IncomingMessage): auth.BasicAuthResult | undefined;
declare function auth(req: http.IncomingMessage | http2.Http2ServerRequest): auth.BasicAuthResult | undefined;
declare namespace auth {
interface BasicAuthResult {