From 4c0c558430b6a5f407e3c0a0daa8bf94be66590f Mon Sep 17 00:00:00 2001 From: "Fred K. Schott" Date: Thu, 10 Nov 2016 16:37:21 -0800 Subject: [PATCH 1/2] winston: add missing transport properties --- winston/index.d.ts | 65 +++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 61 insertions(+), 4 deletions(-) diff --git a/winston/index.d.ts b/winston/index.d.ts index 6fccfe514c..bf98f07944 100644 --- a/winston/index.d.ts +++ b/winston/index.d.ts @@ -11,6 +11,8 @@ /// Winston v2.2.x ///****************** +import {Agent} from 'http'; + declare var winston: winston.Winston; export = winston; @@ -159,6 +161,15 @@ declare namespace winston { } export interface TransportInstance extends TransportStatic, NodeJS.EventEmitter { + silent: boolean; + raw: boolean; + name: string; + formatter?: Function; + level?: string; + handleExceptions: boolean; + exceptionsLevel: string; + humanReadableUnhandledException: boolean; + formatQuery(query: (string | Object)): (string | Object); normalizeQuery(options: QueryOptions): QueryOptions; formatResults(results: (Object | Array), options?: Object): (Object | Array); @@ -166,23 +177,69 @@ declare namespace winston { } export interface ConsoleTransportInstance extends TransportInstance { + json: boolean; + colorize: boolean; + prettyPrint: boolean; + timestamp: boolean; + showLevel: boolean; + label: string|null; + logstash: boolean; + depth: string|null; + align: boolean; + stderrLevels: {[key: string]: LeveledLogMethod;} + eol: string; + stringify?: (obj: Object) => string; + new (options?: ConsoleTransportOptions): ConsoleTransportInstance; } - export interface DailyRotateFileTransportInstance extends TransportInstance { - new (options?: DailyRotateFileTransportOptions): DailyRotateFileTransportInstance; - } - export interface FileTransportInstance extends TransportInstance { + json: boolean; + logstash: boolean; + colorize: boolean; + maxsize: number|null; + rotationFormat: boolean; + zippedArchive: boolean; + maxFiles: number|null; + prettyPrint: boolean; + label: string|null; + timestamp: boolean; + eol: string; + tailable: boolean; + depth: string|null; + showLevel: boolean; + maxRetries: number; + stringify?: (obj: Object) => string; + new (options?: FileTransportOptions): FileTransportInstance; close(): void; } export interface HttpTransportInstance extends TransportInstance { + name: string; + ssl: boolean; + host: string; + port: number; + auth?: {username: string, password: string}; + path: string; + agent?: Agent|null; + new (options?: HttpTransportOptions): HttpTransportInstance; } export interface MemoryTransportInstance extends TransportInstance { + errorOutput: GenericTextTransportOptions[]; + writeOutput: GenericTextTransportOptions[]; + + json: boolean; + colorize: boolean; + prettyPrint: boolean; + timestamp: boolean; + showLevel: boolean; + label: string|null; + depth: string|null; + stringify?: (obj: Object) => string; + new (options?: MemoryTransportOptions): MemoryTransportInstance; } From 447629b22957ba91ddac9abe667e5c6cfad24dfb Mon Sep 17 00:00:00 2001 From: "Fred K. Schott" Date: Fri, 11 Nov 2016 09:54:08 -0800 Subject: [PATCH 2/2] add back missing DailyRotateFileTransportInstance definition --- winston/index.d.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/winston/index.d.ts b/winston/index.d.ts index bf98f07944..0b10766d10 100644 --- a/winston/index.d.ts +++ b/winston/index.d.ts @@ -193,6 +193,10 @@ declare namespace winston { new (options?: ConsoleTransportOptions): ConsoleTransportInstance; } + export interface DailyRotateFileTransportInstance extends TransportInstance { + new (options?: DailyRotateFileTransportOptions): DailyRotateFileTransportInstance; + } + export interface FileTransportInstance extends TransportInstance { json: boolean; logstash: boolean;