From 158f15220cde76a27003c59f1ace360aa096599e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elan=20Ruusam=C3=A4e?= Date: Fri, 4 Sep 2020 17:33:43 +0300 Subject: [PATCH] Add TypeScript typing for RejectionHandler --- index.d.ts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/index.d.ts b/index.d.ts index 027379c39..de31fbdb2 100644 --- a/index.d.ts +++ b/index.d.ts @@ -34,6 +34,21 @@ declare namespace winston { new(logger: Logger): ExceptionHandler; } + interface RejectionHandler { + logger: Logger; + handlers: Map; + catcher: Function | boolean; + + handle(...transports: Transport[]): void; + unhandle(...transports: Transport[]): void; + getAllInfo(err: string | Error): object; + getProcessInfo(): object; + getOsInfo(): object; + getTrace(err: Error): object; + + new(logger: Logger): RejectionHandler; + } + interface QueryOptions { rows?: number; limit?: number; @@ -93,6 +108,7 @@ declare namespace winston { level: string; transports: Transport[]; exceptions: ExceptionHandler; + rejections: RejectionHandler; profilers: object; exitOnError: Function | boolean; defaultMeta?: any;