update type definitions for minilog.

- node module
 - multi args
This commit is contained in:
Meowtec
2016-01-04 16:41:47 +08:00
parent 4461eb91e7
commit c2ab9dc353
2 changed files with 16 additions and 12 deletions

View File

@@ -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);

22
minilog/minilog.d.ts vendored
View File

@@ -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;
}
}
}
declare module 'minilog' {
export = Minilog;
}