add typescript definition

This commit is contained in:
lei xia 2017-09-28 10:12:06 +08:00 committed by GitHub
parent 2468376539
commit 5c0f9c9eec

45
index.d.ts vendored Normal file
View File

@ -0,0 +1,45 @@
/**
* log4js typescript definition for version 2.3.4
* @name log4js-node
* @author xialeistudio<xialeistudio@gmail.com>
* @date 2017/9/26
* @version 0.0.1
*/
export declare function getLogger(category?: string): Logger;
export declare function configure(configuration: Configuration): void;
export declare interface Configuration {
appenders: { [index: string]: any };
categories: { [index: string]: { appenders: string[], level: string } };
}
export declare interface Logger {
new(dispatch: Function, name: string): Logger;
level: string;
log(...args: any[]): void;
isLevelEnabled(level: string): boolean;
_log(level: string, data: any): void;
addContext(key: string, value: any): void;
removeContext(key: string): void;
clearContext(): void;
trace(...args: any[]): void;
debug(...args: any[]): void;
info(...args: any[]): void;
warn(...args: any[]): void;
error(...args: any[]): void;
fatal(...args: any[]): void;
}