Skip to content

Commit

Permalink
TS updates (#1625)
Browse files Browse the repository at this point in the history
* Update index.d.ts

Added missing handleExceptions boolean in LoggerOptions

* Add :any to logmethod and loglevelmethod

It is valid for a user to pass `logger.info({some:object})` or the same `logger.log('info',{some:object})` (or even an array or error) and unfortunately that means we need to add an any type to this declaration.

* Added Logger return method to declarations

(forgot previously)
  • Loading branch information
tagyoureit authored and DABH committed May 14, 2019
1 parent 8423c03 commit 4e939b3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,17 +56,19 @@ declare namespace winston {
[optionName: string]: any;
}

interface LogMethod {
interface LogMethod {
(level: string, message: string, callback: LogCallback): Logger;
(level: string, message: string, meta: any, callback: LogCallback): Logger;
(level: string, message: string, ...meta: any[]): Logger;
(entry: LogEntry): Logger;
(level: string, message: any): Logger;
}

interface LeveledLogMethod {
(message: string, callback: LogCallback): Logger;
(message: string, meta: any, callback: LogCallback): Logger;
(message: string, ...meta: any[]): Logger;
(message: any): Logger;
(infoObject: object): Logger;
}

Expand Down

0 comments on commit 4e939b3

Please sign in to comment.