-
Notifications
You must be signed in to change notification settings - Fork 20
/
index.d.ts
87 lines (51 loc) · 1.81 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
import { Stream } from "stream";
declare namespace types {
export type LEVEL = "debug" | "info" | "warn" | "error" | "disable" | "success";
export type SETTING = "bold" | "italic" | "dim" | "underscore" | "reverse" | "strikethrough";
export type COLOR = "black" | "red" | "green" | "yellow" | "blue" | "magenta" | "cyan" | "white";
}
type ticketObject = {
font?: types.COLOR,
bg?: types.COLOR,
}
type settingObject = {
[key in types.SETTING]?: boolean;
};
declare class Logger {
command: string;
lastCommand: string;
level: any;
noColor: boolean;
setLevel(level: types.LEVEL): void;
createNamedLogger(name: string): Logger;
setLogStream(stream: Stream): Logger;
setLevelNoColor(): void;
setLevelColor(): void;
isLevelValid(level: types.LEVEL): boolean;
isAllowedLevel(level: types.LEVEL): boolean;
checkSetting(setting: settingObject): string;
joint(): Logger;
append(...args: any[]): Logger;
reset(): Logger;
setDate(callback: Function): void;
getDate(): string;
color(ticket: types.COLOR): Logger;
bgColor(ticket: types.COLOR): Logger;
bold(): Logger;
dim(): Logger;
underscore(): Logger;
strikethrough(): Logger;
reverse(): Logger;
italic(): Logger;
fontColorLog(ticket: types.COLOR, text: string, setting?: settingObject): void;
bgColorLog(ticket: types.COLOR, text: string, setting?: settingObject): void;
colorLog(ticketObj: ticketObject, text: string, setting?: settingObject): void;
log(...args: any[]): Logger;
error(...args: any[]): void;
warn(...args: any[]): void;
info(...args: any[]): void;
debug(...args: any[]): void;
success(...args: any[]): void;
}
declare const logger: Logger;
export = logger;