From a02930b1d80a56fefcf158feafe729ea1ecc9f2c Mon Sep 17 00:00:00 2001 From: Francisco Hanna Date: Mon, 13 Jul 2020 21:09:12 -0300 Subject: [PATCH] Update statusLevels type Update statusLevels to accept Boolean or StatusLevel object --- index.d.ts | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/index.d.ts b/index.d.ts index e708216..4d5d400 100644 --- a/index.d.ts +++ b/index.d.ts @@ -26,6 +26,12 @@ export type RouteFilter = (req: Request, res: Response) => boolean; export type ErrorRouteFilter = (req: Request, res: Response, err: Error) => boolean; export type MessageTemplate = string | ((req: Request, res: Response) => string); +export interface StatusLevels { + error?: string; + success?: string; + warn?: string; +}; + export interface BaseLoggerOptions { baseMeta?: object; bodyBlacklist?: string[]; @@ -48,12 +54,8 @@ export interface BaseLoggerOptions { responseWhitelist?: string[]; headerBlacklist?: string[]; skip?: RouteFilter; - statusLevels?: { - error?: string; - success?: string; - warn?: string; - }; -} + statusLevels?: Boolean | StatusLevels; +} export interface LoggerOptionsWithTransports extends BaseLoggerOptions { transports: Transport[];