Skip to content

Commit

Permalink
fix(types): added rejections (ExceptionHandler) to Logger interface
Browse files Browse the repository at this point in the history
  • Loading branch information
svaj committed Jun 7, 2021
1 parent 2625f60 commit 62c6c28
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,20 @@ declare namespace winston {

new(logger: Logger): ExceptionHandler;
}
interface RejectionHandler {
logger: Logger;
handlers: Map<any, any>;
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;
Expand Down Expand Up @@ -83,6 +97,7 @@ declare namespace winston {
defaultMeta?: any;
transports?: Transport[] | Transport;
handleExceptions?: boolean;
handleRejections?: boolean;
exceptionHandlers?: any;
}

Expand All @@ -93,6 +108,7 @@ declare namespace winston {
level: string;
transports: Transport[];
exceptions: ExceptionHandler;
rejections: RejectionHandler;
profilers: object;
exitOnError: Function | boolean;
defaultMeta?: any;
Expand Down

0 comments on commit 62c6c28

Please sign in to comment.