@types/winston
Advanced tools
Comparing version 2.3.0 to 2.3.1
// Type definitions for winston 2.3 | ||
// Project: https://github.com/flatiron/winston | ||
// Definitions by: bonnici <https://github.com/bonnici>, Peter Harris <https://github.com/codeanimal> | ||
// Definitions by: bonnici <https://github.com/bonnici>, Peter Harris <https://github.com/codeanimal>, DABH <https://github.com/DABH> | ||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped | ||
@@ -12,20 +12,17 @@ | ||
declare var winston: winston.Winston; | ||
export = winston; | ||
declare namespace winston { | ||
export interface AbstractConfigLevels { | ||
interface AbstractConfigSetLevels { | ||
[key: string]: number; | ||
} | ||
export interface AbstractConfigColors { | ||
interface AbstractConfigSetColors { | ||
[key: string]: string; | ||
} | ||
export interface AbstractConfig { | ||
levels: AbstractConfigLevels; | ||
colors: AbstractConfigColors; | ||
interface AbstractConfigSet { | ||
levels: AbstractConfigSetLevels; | ||
colors: AbstractConfigSetColors; | ||
} | ||
export interface CliConfigLevels extends AbstractConfigLevels { | ||
interface CliConfigSetLevels extends AbstractConfigSetLevels { | ||
error: number; | ||
@@ -43,3 +40,3 @@ warn: number; | ||
export interface CliConfigColors extends AbstractConfigColors { | ||
interface CliConfigSetColors extends AbstractConfigSetColors { | ||
error: string; | ||
@@ -56,3 +53,3 @@ warn: string; | ||
} | ||
export interface NpmConfigLevels extends AbstractConfigLevels { | ||
interface NpmConfigSetLevels extends AbstractConfigSetLevels { | ||
error: number; | ||
@@ -65,3 +62,3 @@ warn: number; | ||
} | ||
export interface NpmConfigColors extends AbstractConfigColors { | ||
interface NpmConfigSetColors extends AbstractConfigSetColors { | ||
error: string; | ||
@@ -74,3 +71,3 @@ warn: string; | ||
} | ||
export interface SyslogConfigLevels extends AbstractConfigLevels { | ||
interface SyslogConfigSetLevels extends AbstractConfigSetLevels { | ||
emerg: number; | ||
@@ -85,3 +82,3 @@ alert: number; | ||
} | ||
export interface SyslogConfigColors extends AbstractConfigColors { | ||
interface SyslogConfigSetColors extends AbstractConfigSetColors { | ||
emerg: string; | ||
@@ -97,9 +94,4 @@ alert: string; | ||
export interface Winston { | ||
config: { | ||
cli: {levels: CliConfigLevels, colors: CliConfigColors}, | ||
npm: {levels: NpmConfigLevels, colors: NpmConfigColors}, | ||
syslog: {levels: SyslogConfigLevels, colors: SyslogConfigColors} | ||
}; | ||
interface Winston { | ||
config: winston.Config; | ||
transports: winston.Transports; | ||
@@ -136,4 +128,4 @@ Transport: winston.TransportStatic; | ||
profile(id: string, msg?: string, meta?: any, callback?: (err: Error, level: string, msg: string, meta: any) => void): winston.LoggerInstance; | ||
addColors(target: AbstractConfigColors): any; | ||
setLevels(target: AbstractConfigLevels): any; | ||
addColors(target: AbstractConfigSetColors): any; | ||
setLevels(target: AbstractConfigSetLevels): any; | ||
cli(): winston.LoggerInstance; | ||
@@ -144,7 +136,17 @@ close(): void; | ||
export type CLILoggingLevel = 'error' | 'warn' | 'help' | 'data' | 'info' | 'debug' | 'prompt' | 'verbose' | 'input' | 'silly'; | ||
export type NPMLoggingLevel = 'error' | 'warn' | 'info' | 'verbose' | 'debug' | 'silly'; | ||
export type SyslogLoggingLevel = 'emerg' | 'alert' | 'crit' | 'error' | 'warning' | 'notice' | 'info' | 'debug'; | ||
type CLILoggingLevel = 'error' | 'warn' | 'help' | 'data' | 'info' | 'debug' | 'prompt' | 'verbose' | 'input' | 'silly'; | ||
type NPMLoggingLevel = 'error' | 'warn' | 'info' | 'verbose' | 'debug' | 'silly'; | ||
type SyslogLoggingLevel = 'emerg' | 'alert' | 'crit' | 'error' | 'warning' | 'notice' | 'info' | 'debug'; | ||
export interface ExceptionProcessInfo { | ||
interface Config { | ||
allColors: AbstractConfigSetColors; | ||
cli: {levels: CliConfigSetLevels, colors: CliConfigSetColors}; | ||
npm: {levels: NpmConfigSetLevels, colors: NpmConfigSetColors}; | ||
syslog: {levels: SyslogConfigSetLevels, colors: SyslogConfigSetColors}; | ||
addColors(colors: AbstractConfigSetColors): void; | ||
colorize(level: number, message?: string): string; | ||
} | ||
interface ExceptionProcessInfo { | ||
pid: number; | ||
@@ -160,3 +162,3 @@ uid?: number; | ||
export interface ExceptionOsInfo { | ||
interface ExceptionOsInfo { | ||
loadavg: [number, number, number]; | ||
@@ -166,3 +168,3 @@ uptime: number; | ||
export interface ExceptionTrace { | ||
interface ExceptionTrace { | ||
column: number; | ||
@@ -176,32 +178,28 @@ file: string; | ||
export interface ExceptionAllInfo { | ||
interface ExceptionAllInfo { | ||
date: Date; | ||
process: ExceptionProcessInfo; | ||
os: ExceptionOsInfo; | ||
trace: Array<ExceptionTrace>; | ||
stack: Array<string>; | ||
trace: ExceptionTrace[]; | ||
stack: string[]; | ||
} | ||
export interface Exception { | ||
interface Exception { | ||
getAllInfo(err: Error): ExceptionAllInfo; | ||
getProcessInfo(): ExceptionProcessInfo; | ||
getOsInfo(): ExceptionOsInfo; | ||
getTrace(err: Error): Array<ExceptionTrace>; | ||
getTrace(err: Error): ExceptionTrace[]; | ||
} | ||
export interface MetadataRewriter { | ||
(level: string, msg: string, meta: any): any; | ||
} | ||
type MetadataRewriter = (level: string, msg: string, meta: any) => any; | ||
export interface MetadataFilter { | ||
(level: string, msg: string, meta: any): string | { msg: any; meta: any; }; | ||
} | ||
type MetadataFilter = (level: string, msg: string, meta: any) => string | { msg: any; meta: any; }; | ||
export interface LoggerStatic { | ||
interface LoggerStatic { | ||
new (options?: LoggerOptions): LoggerInstance; | ||
} | ||
export interface LoggerInstance extends NodeJS.EventEmitter { | ||
rewriters: Array<MetadataRewriter>; | ||
filters: Array<MetadataFilter>; | ||
interface LoggerInstance extends NodeJS.EventEmitter { | ||
rewriters: MetadataRewriter[]; | ||
filters: MetadataFilter[]; | ||
transports: {[key: string]: TransportInstance}; | ||
@@ -244,3 +242,3 @@ | ||
configure(options: LoggerOptions): void; | ||
setLevels(target: AbstractConfigLevels): any; | ||
setLevels(target: AbstractConfigSetLevels): any; | ||
cli(): LoggerInstance; | ||
@@ -251,3 +249,3 @@ | ||
export interface LoggerOptions { | ||
interface LoggerOptions { | ||
transports?: TransportInstance[]; | ||
@@ -259,3 +257,3 @@ rewriters?: MetadataRewriter[]; | ||
level?: string; | ||
levels?: AbstractConfigLevels; | ||
levels?: AbstractConfigSetLevels; | ||
@@ -273,11 +271,10 @@ /** | ||
export interface TransportStatic { | ||
new (options?: TransportOptions): TransportInstance; | ||
interface TransportStatic { | ||
new(options?: TransportOptions): TransportInstance; | ||
} | ||
export interface TransportInstance extends TransportStatic, NodeJS.EventEmitter { | ||
interface TransportInstance extends TransportStatic, NodeJS.EventEmitter { | ||
silent: boolean; | ||
raw: boolean; | ||
name: string; | ||
formatter?: Function; | ||
level?: string; | ||
@@ -289,8 +286,9 @@ handleExceptions: boolean; | ||
formatQuery(query: (string | Object)): (string | Object); | ||
formatter?(options?: any): string; | ||
normalizeQuery(options: QueryOptions): QueryOptions; | ||
formatResults(results: (Object | Array<any>), options?: Object): (Object | Array<any>); | ||
formatResults(results: (Object | any[]), options?: Object): (Object | any[]); | ||
logException(msg: string, meta: Object, callback: () => void): void; | ||
} | ||
export interface ConsoleTransportInstance extends TransportInstance { | ||
interface ConsoleTransportInstance extends TransportInstance { | ||
json: boolean; | ||
@@ -305,14 +303,14 @@ colorize: boolean; | ||
align: boolean; | ||
stderrLevels: { [key: string]: LeveledLogMethod; } | ||
stderrLevels: { [key: string]: LeveledLogMethod; }; | ||
eol: string; | ||
stringify?: (obj: Object) => string; | ||
new (options?: ConsoleTransportOptions): ConsoleTransportInstance; | ||
new(options?: ConsoleTransportOptions): ConsoleTransportInstance; | ||
stringify?(obj: Object): string; | ||
} | ||
export interface DailyRotateFileTransportInstance extends TransportInstance { | ||
new (options?: DailyRotateFileTransportOptions): DailyRotateFileTransportInstance; | ||
interface DailyRotateFileTransportInstance extends TransportInstance { | ||
new(options?: DailyRotateFileTransportOptions): DailyRotateFileTransportInstance; | ||
} | ||
export interface FileTransportInstance extends TransportInstance { | ||
interface FileTransportInstance extends TransportInstance { | ||
json: boolean; | ||
@@ -333,9 +331,9 @@ logstash: boolean; | ||
maxRetries: number; | ||
stringify?: (obj: Object) => string; | ||
new (options?: FileTransportOptions): FileTransportInstance; | ||
close(): void; | ||
new(options?: FileTransportOptions): FileTransportInstance; | ||
stringify?(obj: Object): string; | ||
} | ||
export interface HttpTransportInstance extends TransportInstance { | ||
interface HttpTransportInstance extends TransportInstance { | ||
name: string; | ||
@@ -349,6 +347,6 @@ ssl: boolean; | ||
new (options?: HttpTransportOptions): HttpTransportInstance; | ||
new(options?: HttpTransportOptions): HttpTransportInstance; | ||
} | ||
export interface MemoryTransportInstance extends TransportInstance { | ||
interface MemoryTransportInstance extends TransportInstance { | ||
errorOutput: GenericTextTransportOptions[]; | ||
@@ -364,20 +362,20 @@ writeOutput: GenericTextTransportOptions[]; | ||
depth: string|null; | ||
stringify?: (obj: Object) => string; | ||
new (options?: MemoryTransportOptions): MemoryTransportInstance; | ||
new(options?: MemoryTransportOptions): MemoryTransportInstance; | ||
stringify?(obj: Object): string; | ||
} | ||
export interface WebhookTransportInstance extends TransportInstance { | ||
new (options?: WebhookTransportOptions): WebhookTransportInstance; | ||
interface WebhookTransportInstance extends TransportInstance { | ||
new(options?: WebhookTransportOptions): WebhookTransportInstance; | ||
} | ||
export interface WinstonModuleTrasportInstance extends TransportInstance { | ||
new (options?: WinstonModuleTransportOptions): WinstonModuleTrasportInstance; | ||
interface WinstonModuleTrasportInstance extends TransportInstance { | ||
new(options?: WinstonModuleTransportOptions): WinstonModuleTrasportInstance; | ||
} | ||
export interface ContainerStatic { | ||
new (options: LoggerOptions): ContainerInstance; | ||
interface ContainerStatic { | ||
new(options: LoggerOptions): ContainerInstance; | ||
} | ||
export interface ContainerInstance extends ContainerStatic { | ||
interface ContainerInstance extends ContainerStatic { | ||
get(id: string, options?: LoggerOptions): LoggerInstance; | ||
@@ -392,3 +390,3 @@ add(id: string, options: LoggerOptions): LoggerInstance; | ||
export interface Transports { | ||
interface Transports { | ||
File: FileTransportInstance; | ||
@@ -403,5 +401,6 @@ Console: ConsoleTransportInstance; | ||
export type TransportOptions = ConsoleTransportOptions | DailyRotateFileTransportOptions | FileTransportOptions | HttpTransportOptions | MemoryTransportOptions | WebhookTransportOptions | WinstonModuleTransportOptions; | ||
type TransportOptions = ConsoleTransportOptions | DailyRotateFileTransportOptions | FileTransportOptions | ||
| HttpTransportOptions | MemoryTransportOptions | WebhookTransportOptions | WinstonModuleTransportOptions; | ||
export interface GenericTransportOptions { | ||
interface GenericTransportOptions { | ||
level?: string; | ||
@@ -411,9 +410,10 @@ silent?: boolean; | ||
name?: string; | ||
formatter?: Function; | ||
handleExceptions?: boolean; | ||
exceptionsLevel?: string; | ||
humanReadableUnhandledException?: boolean; | ||
formatter?(options?: any): string; | ||
} | ||
export interface GenericTextTransportOptions { | ||
interface GenericTextTransportOptions { | ||
json?: boolean; | ||
@@ -423,10 +423,11 @@ colorize?: boolean; | ||
prettyPrint?: boolean; | ||
timestamp?: (Function | boolean); | ||
showLevel?: boolean; | ||
label?: string; | ||
depth?: number; | ||
stringify?: Function; | ||
timestamp?(): any | boolean; | ||
stringify?(obj: any): string; | ||
} | ||
export interface GenericNetworkTransportOptions { | ||
interface GenericNetworkTransportOptions { | ||
host?: string; | ||
@@ -441,3 +442,3 @@ port?: number; | ||
export interface ConsoleTransportOptions extends GenericTransportOptions, GenericTextTransportOptions { | ||
interface ConsoleTransportOptions extends GenericTransportOptions, GenericTextTransportOptions { | ||
logstash?: boolean; | ||
@@ -447,3 +448,3 @@ debugStdout?: boolean; | ||
export interface DailyRotateFileTransportOptions extends GenericTransportOptions, GenericTextTransportOptions { | ||
interface DailyRotateFileTransportOptions extends GenericTransportOptions, GenericTextTransportOptions { | ||
logstash?: boolean; | ||
@@ -464,3 +465,3 @@ maxsize?: number; | ||
export interface FileTransportOptions extends GenericTransportOptions, GenericTextTransportOptions { | ||
interface FileTransportOptions extends GenericTransportOptions, GenericTextTransportOptions { | ||
logstash?: boolean; | ||
@@ -483,10 +484,10 @@ maxsize?: number; | ||
export interface HttpTransportOptions extends GenericTransportOptions, GenericNetworkTransportOptions { | ||
interface HttpTransportOptions extends GenericTransportOptions, GenericNetworkTransportOptions { | ||
ssl?: boolean; | ||
} | ||
export interface MemoryTransportOptions extends GenericTransportOptions, GenericTextTransportOptions { | ||
interface MemoryTransportOptions extends GenericTransportOptions, GenericTextTransportOptions { | ||
} | ||
export interface WebhookTransportOptions extends GenericTransportOptions, GenericNetworkTransportOptions { | ||
interface WebhookTransportOptions extends GenericTransportOptions, GenericNetworkTransportOptions { | ||
method?: string; | ||
@@ -500,7 +501,7 @@ ssl?: { | ||
export interface WinstonModuleTransportOptions extends GenericTransportOptions { | ||
interface WinstonModuleTransportOptions extends GenericTransportOptions { | ||
[optionName: string]: any; | ||
} | ||
export interface QueryOptions { | ||
interface QueryOptions { | ||
rows?: number; | ||
@@ -515,6 +516,7 @@ limit?: number; | ||
export interface ProfileHandler { | ||
interface ProfileHandler { | ||
logger: LoggerInstance; | ||
start: Date; | ||
done: (msg: string) => LoggerInstance; | ||
done(msg: string): LoggerInstance; | ||
} | ||
@@ -534,5 +536,6 @@ | ||
interface LogCallback { | ||
(error?: any, level?: string, msg?: string, meta?: any): void; | ||
} | ||
type LogCallback = (error?: any, level?: string, msg?: string, meta?: any) => void; | ||
} | ||
declare const winston: winston.Winston; | ||
export = winston; |
{ | ||
"name": "@types/winston", | ||
"version": "2.3.0", | ||
"version": "2.3.1", | ||
"description": "TypeScript definitions for winston", | ||
@@ -14,2 +14,6 @@ "license": "MIT", | ||
"url": "https://github.com/codeanimal" | ||
}, | ||
{ | ||
"name": "DABH", | ||
"url": "https://github.com/DABH" | ||
} | ||
@@ -27,4 +31,4 @@ ], | ||
"peerDependencies": {}, | ||
"typesPublisherContentHash": "ac1d97546ab1fc0f71cc991fdf9658a2ce1bd0568c5637086e8f2ab16a5912bf", | ||
"typesPublisherContentHash": "8f547495c3a408889c3a7c9ffdcc1a108423f7597c058bed03665234ac804ccf", | ||
"typeScriptVersion": "2.0" | ||
} |
@@ -8,6 +8,6 @@ # Installation | ||
# Details | ||
Files were exported from https://www.github.com/DefinitelyTyped/DefinitelyTyped/tree/master/winston | ||
Files were exported from https://www.github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/winston | ||
Additional Details | ||
* Last updated: Thu, 23 Mar 2017 21:34:58 GMT | ||
* Last updated: Wed, 19 Apr 2017 21:19:05 GMT | ||
* Dependencies: http, node | ||
@@ -17,2 +17,2 @@ * Global values: none | ||
# Credits | ||
These definitions were written by bonnici <https://github.com/bonnici>, Peter Harris <https://github.com/codeanimal>. | ||
These definitions were written by bonnici <https://github.com/bonnici>, Peter Harris <https://github.com/codeanimal>, DABH <https://github.com/DABH>. |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
18645
4
0
436