-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.d.ts
80 lines (74 loc) · 2.24 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
type Tostringable = string | null | boolean | undefined | number | bigint;
/**
* rlog-js
* @license MIT
*/
declare namespace Rlog {
interface CustomColorRule {
reg: string;
color: string;
}
class Config {
enableColorfulOutput: boolean;
logFilePath?: string;
timeFormat: string;
timezone: string;
blockedWordsList: string[];
customColorRules: CustomColorRule[];
setConfig(obj?: Partial<Config>): void;
setConfigGlobal(obj?: Partial<Config>): void;
screenLength: number;
}
class Toolkit {
constructor(config: Config);
config: Config;
screen: Screen;
async checkLogFile(path: string): Promise<void>;
colorizeString(str: string): string;
formatTime(): string | number;
encryptPrivacyContent(str: string): string;
colorizeType(variable: any): string;
padLines(str: string, width: number): string;
}
class Screen {
constructor(toolkit: Toolkit);
toolkit: Toolkit;
info(message: any, time?: Tostringable): void;
warning(message: any, time?: Tostringable): void;
error(message: any, time?: Tostringable): void;
success(message: any, time?: Tostringable): void;
exit(message: any, time?: Tostringable): void;
}
class File {
constructor(toolkit: Toolkit, config: Config, screen: Screen);
config: Config;
toolkit: Toolkit;
screen: Screen;
logStream: NodeJS.WriteStream;
init(): void;
writeLogToStream(text: string): Promise<void>;
wirteLog(text: string): void;
info(message: any, time?: Tostringable): void;
warning(message: any, time?: Tostringable): void;
error(message: any, time?: Tostringable): void;
success(message: any, time?: Tostringable): void;
exit(message: any, time?: Tostringable): void;
}
}
declare class Rlog {
constructor(config?: Partial<Rlog.Config>);
config: Rlog.Config;
toolkit: Rlog.Toolkit;
screen: Rlog.Screen;
file: Rlog.File;
info(...messages: any[]): void;
warning(...messages: any[]): void;
error(...messages: any[]): void;
success(...messages: any[]): void;
async exit(message: any): Promise<never>;
log(...messages: any[]): void;
progress(num: number, max: number): void;
onExit(callback: () => void): void;
exitListeners: (() => void)[];
}
export = Rlog;