Merge pull request #7473 from meowtec/fix-minimap

update type definitions for minilog.
This commit is contained in:
Masahiro Wakame
2016-01-11 16:26:25 +09:00
2 changed files with 16 additions and 12 deletions
+3 -3
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);
+13 -9
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;
}