From c2ab9dc3530cdacb78592e99092c725ffe32a02e Mon Sep 17 00:00:00 2001 From: Meowtec Date: Mon, 4 Jan 2016 16:41:47 +0800 Subject: [PATCH] update type definitions for minilog. - node module - multi args --- minilog/minilog-tests.ts | 6 +++--- minilog/minilog.d.ts | 22 +++++++++++++--------- 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/minilog/minilog-tests.ts b/minilog/minilog-tests.ts index 3a9bb0f4de..477c646fa8 100644 --- a/minilog/minilog-tests.ts +++ b/minilog/minilog-tests.ts @@ -12,10 +12,10 @@ var log = Minilog('app'); Minilog.enable(); log - .debug('debug message') - .info('info message') + .debug('debug message 1', 'debug message 2') + .info('info message', [1, 2, 3]) .warn('warning') - .error('this is an error message'); + .error('this is an error message', new Error()); Minilog.pipe(Minilog.backends.console.formatWithStack) .pipe(Minilog.backends.console); diff --git a/minilog/minilog.d.ts b/minilog/minilog.d.ts index d9d1695bf2..b8301277a0 100644 --- a/minilog/minilog.d.ts +++ b/minilog/minilog.d.ts @@ -5,11 +5,11 @@ //These type definitions are not complete, although basic usage should be typed. interface Minilog { - debug(msg: any): Minilog; - info(msg: any): Minilog; - log(msg: any): Minilog; - warn(msg: any): Minilog; - error(msg: any): Minilog; + debug(...msg: any[]): Minilog; + info(...msg: any[]): Minilog; + log(...msg: any[]): Minilog; + warn(...msg: any[]): Minilog; + error(...msg: any[]): Minilog; } declare function Minilog(namespace: string): Minilog; @@ -47,8 +47,8 @@ declare module Minilog { test(name:any, level:any): boolean; /** - * specifies the behavior when a log line doesn't match either the whitelist or the blacklist. - The default is true (= "allow by default") - lines that do not match the whitelist or the blacklist are not filtered (e.g. ). + * specifies the behavior when a log line doesn't match either the whitelist or the blacklist. + The default is true (= "allow by default") - lines that do not match the whitelist or the blacklist are not filtered (e.g. ). If you want to flip the default so that lines are filtered unless they are on the whitelist, set this to false (= "deny by default"). */ defaultResult: boolean; @@ -58,7 +58,7 @@ declare module Minilog { */ enabled: boolean; } - + export interface MinilogBackends { array: any; @@ -95,4 +95,8 @@ declare module Minilog { mixin(dest: any): void; } -} \ No newline at end of file +} + +declare module 'minilog' { + export = Minilog; +}