mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-05-16 19:09:18 +08:00
update type definitions for minilog.
- node module - multi args
This commit is contained in:
@@ -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
22
minilog/minilog.d.ts
vendored
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user