@types/morgan
Advanced tools
Comparing version 1.9.5 to 1.9.6
@@ -10,8 +10,15 @@ // Type definitions for morgan 1.9 | ||
import http = require('http'); | ||
import http = require("http"); | ||
type Handler<Request extends http.IncomingMessage, Response extends http.ServerResponse> = (req: Request, res: Response, callback: (err?: Error) => void) => void; | ||
type Handler<Request extends http.IncomingMessage, Response extends http.ServerResponse> = ( | ||
req: Request, | ||
res: Response, | ||
callback: (err?: Error) => void, | ||
) => void; | ||
declare namespace morgan { | ||
type FormatFn<Request extends http.IncomingMessage = http.IncomingMessage, Response extends http.ServerResponse = http.ServerResponse> = ( | ||
type FormatFn< | ||
Request extends http.IncomingMessage = http.IncomingMessage, | ||
Response extends http.ServerResponse = http.ServerResponse, | ||
> = ( | ||
tokens: TokenIndexer<Request, Response>, | ||
@@ -22,3 +29,6 @@ req: Request, | ||
type TokenCallbackFn<Request extends http.IncomingMessage = http.IncomingMessage, Response extends http.ServerResponse = http.ServerResponse> = ( | ||
type TokenCallbackFn< | ||
Request extends http.IncomingMessage = http.IncomingMessage, | ||
Response extends http.ServerResponse = http.ServerResponse, | ||
> = ( | ||
req: Request, | ||
@@ -29,3 +39,6 @@ res: Response, | ||
interface TokenIndexer<Request extends http.IncomingMessage = http.IncomingMessage, Response extends http.ServerResponse = http.ServerResponse> { | ||
interface TokenIndexer< | ||
Request extends http.IncomingMessage = http.IncomingMessage, | ||
Response extends http.ServerResponse = http.ServerResponse, | ||
> { | ||
[tokenName: string]: TokenCallbackFn<Request, Response>; | ||
@@ -53,3 +66,3 @@ } | ||
*/ | ||
(format: 'combined', options?: Options<Request, Response>): Handler<Request, Response>; | ||
(format: "combined", options?: Options<Request, Response>): Handler<Request, Response>; | ||
/*** | ||
@@ -61,3 +74,3 @@ * Standard Apache common log output. | ||
*/ | ||
(format: 'common', options?: Options<Request, Response>): Handler<Request, Response>; | ||
(format: "common", options?: Options<Request, Response>): Handler<Request, Response>; | ||
/** | ||
@@ -70,3 +83,3 @@ * Concise output colored by response status for development use. The | ||
*/ | ||
(format: 'dev', options?: Options<Request, Response>): Handler<Request, Response>; | ||
(format: "dev", options?: Options<Request, Response>): Handler<Request, Response>; | ||
@@ -79,3 +92,3 @@ /*** | ||
*/ | ||
(format: 'short', options?: Options<Request, Response>): Handler<Request, Response>; | ||
(format: "short", options?: Options<Request, Response>): Handler<Request, Response>; | ||
@@ -88,3 +101,3 @@ /*** | ||
*/ | ||
(format: 'tiny', options?: Options<Request, Response>): Handler<Request, Response>; | ||
(format: "tiny", options?: Options<Request, Response>): Handler<Request, Response>; | ||
@@ -125,3 +138,6 @@ /*** | ||
*/ | ||
function token<Request extends http.IncomingMessage = http.IncomingMessage, Response extends http.ServerResponse = http.ServerResponse>( | ||
function token< | ||
Request extends http.IncomingMessage = http.IncomingMessage, | ||
Response extends http.ServerResponse = http.ServerResponse, | ||
>( | ||
name: string, | ||
@@ -135,4 +151,7 @@ callback: TokenCallbackFn<Request, Response>, | ||
*/ | ||
// eslint-disable-next-line @definitelytyped/no-unnecessary-generics | ||
function format<Request extends http.IncomingMessage = http.IncomingMessage, Response extends http.ServerResponse = http.ServerResponse>(name: string, fmt: string): Morgan<Request, Response>; | ||
function format< | ||
Request extends http.IncomingMessage = http.IncomingMessage, | ||
Response extends http.ServerResponse = http.ServerResponse, | ||
> // eslint-disable-next-line @definitelytyped/no-unnecessary-generics | ||
(name: string, fmt: string): Morgan<Request, Response>; | ||
@@ -142,3 +161,6 @@ /** | ||
*/ | ||
function format<Request extends http.IncomingMessage = http.IncomingMessage, Response extends http.ServerResponse = http.ServerResponse>( | ||
function format< | ||
Request extends http.IncomingMessage = http.IncomingMessage, | ||
Response extends http.ServerResponse = http.ServerResponse, | ||
>( | ||
name: string, | ||
@@ -151,4 +173,7 @@ fmt: FormatFn<Request, Response>, | ||
*/ | ||
// eslint-disable-next-line @definitelytyped/no-unnecessary-generics | ||
function compile<Request extends http.IncomingMessage = http.IncomingMessage, Response extends http.ServerResponse = http.ServerResponse>(format: string): FormatFn<Request, Response>; | ||
function compile< | ||
Request extends http.IncomingMessage = http.IncomingMessage, | ||
Response extends http.ServerResponse = http.ServerResponse, | ||
> // eslint-disable-next-line @definitelytyped/no-unnecessary-generics | ||
(format: string): FormatFn<Request, Response>; | ||
@@ -201,3 +226,6 @@ interface StreamOptions { | ||
*/ | ||
declare function morgan<Request extends http.IncomingMessage = http.IncomingMessage, Response extends http.ServerResponse = http.ServerResponse>( | ||
declare function morgan< | ||
Request extends http.IncomingMessage = http.IncomingMessage, | ||
Response extends http.ServerResponse = http.ServerResponse, | ||
>( | ||
format: string, | ||
@@ -213,4 +241,7 @@ options?: morgan.Options<Request, Response>, | ||
*/ | ||
declare function morgan<Request extends http.IncomingMessage = http.IncomingMessage, Response extends http.ServerResponse = http.ServerResponse>( | ||
format: 'combined', | ||
declare function morgan< | ||
Request extends http.IncomingMessage = http.IncomingMessage, | ||
Response extends http.ServerResponse = http.ServerResponse, | ||
>( | ||
format: "combined", | ||
options?: morgan.Options<Request, Response>, | ||
@@ -225,4 +256,7 @@ ): Handler<Request, Response>; | ||
*/ | ||
declare function morgan<Request extends http.IncomingMessage = http.IncomingMessage, Response extends http.ServerResponse = http.ServerResponse>( | ||
format: 'common', | ||
declare function morgan< | ||
Request extends http.IncomingMessage = http.IncomingMessage, | ||
Response extends http.ServerResponse = http.ServerResponse, | ||
>( | ||
format: "common", | ||
options?: morgan.Options<Request, Response>, | ||
@@ -239,4 +273,7 @@ ): Handler<Request, Response>; | ||
*/ | ||
declare function morgan<Request extends http.IncomingMessage = http.IncomingMessage, Response extends http.ServerResponse = http.ServerResponse>( | ||
format: 'dev', | ||
declare function morgan< | ||
Request extends http.IncomingMessage = http.IncomingMessage, | ||
Response extends http.ServerResponse = http.ServerResponse, | ||
>( | ||
format: "dev", | ||
options?: morgan.Options<Request, Response>, | ||
@@ -251,4 +288,7 @@ ): Handler<Request, Response>; | ||
*/ | ||
declare function morgan<Request extends http.IncomingMessage = http.IncomingMessage, Response extends http.ServerResponse = http.ServerResponse>( | ||
format: 'short', | ||
declare function morgan< | ||
Request extends http.IncomingMessage = http.IncomingMessage, | ||
Response extends http.ServerResponse = http.ServerResponse, | ||
>( | ||
format: "short", | ||
options?: morgan.Options<Request, Response>, | ||
@@ -263,4 +303,7 @@ ): Handler<Request, Response>; | ||
*/ | ||
declare function morgan<Request extends http.IncomingMessage = http.IncomingMessage, Response extends http.ServerResponse = http.ServerResponse>( | ||
format: 'tiny', | ||
declare function morgan< | ||
Request extends http.IncomingMessage = http.IncomingMessage, | ||
Response extends http.ServerResponse = http.ServerResponse, | ||
>( | ||
format: "tiny", | ||
options?: morgan.Options<Request, Response>, | ||
@@ -276,3 +319,6 @@ ): Handler<Request, Response>; | ||
*/ | ||
declare function morgan<Request extends http.IncomingMessage = http.IncomingMessage, Response extends http.ServerResponse = http.ServerResponse>( | ||
declare function morgan< | ||
Request extends http.IncomingMessage = http.IncomingMessage, | ||
Response extends http.ServerResponse = http.ServerResponse, | ||
>( | ||
format: morgan.FormatFn<Request, Response>, | ||
@@ -279,0 +325,0 @@ options?: morgan.Options<Request, Response>, |
{ | ||
"name": "@types/morgan", | ||
"version": "1.9.5", | ||
"version": "1.9.6", | ||
"description": "TypeScript definitions for morgan", | ||
@@ -35,4 +35,4 @@ "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/morgan", | ||
}, | ||
"typesPublisherContentHash": "807416d481c4584df944c5a403c05dbda7877c94ff5e461127fc8a9e784e2399", | ||
"typeScriptVersion": "4.3" | ||
"typesPublisherContentHash": "60315abadd5b525e9d39c8f511a5c38b578fb77f6492892ec8d0fd00f1250671", | ||
"typeScriptVersion": "4.5" | ||
} |
@@ -11,3 +11,3 @@ # Installation | ||
### Additional Details | ||
* Last updated: Tue, 22 Aug 2023 18:04:27 GMT | ||
* Last updated: Wed, 27 Sep 2023 09:42:16 GMT | ||
* Dependencies: [@types/node](https://npmjs.com/package/@types/node) | ||
@@ -14,0 +14,0 @@ * Global values: none |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
14084
279