forked from megahertz/electron-log
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathelectron-log.d.ts
75 lines (66 loc) · 1.86 KB
/
electron-log.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
export type LogLevel = "error" | "warn" | "info" | "verbose" | "debug" |
"silly";
export type LevelOption = LogLevel | false;
export type IFormat = (msg: ILogMessage) => void;
export type FOpenFlags = "r" | "r+" | "rs+" | "w" | "wx" | "w+" | "wx+" |
"a" | "ax" | "a+" | "ax+";
declare interface ITransports {
console: IConsoleTransport;
file: IFileTransport;
logS: ILogSTransport;
rendererConsole: IConsoleTransport;
}
declare interface IElectronLog {
transports: ITransports;
error(...params: any[]): void;
warn(...params: any[]): void;
info(...params: any[]): void;
verbose(...params: any[]): void;
debug(...params: any[]): void;
silly(...params: any[]): void;
log(...params: any[]): void;
}
export interface ILogMessage {
data: any[];
date: Date;
level: LogLevel;
}
export interface IConsoleTransport {
(msg: ILogMessage): void;
level: LevelOption;
format: IFormat | string;
}
export interface IFileTransport {
(msg: ILogMessage): void;
appName?: string;
file?: string;
format: IFormat | string;
level: LevelOption;
maxSize: number;
streamConfig?: {
flags?: FOpenFlags;
encoding?: string;
fd?: number;
mode?: number;
autoClose?: boolean;
start?: number;
};
findLogPath(appName: string): string;
}
export interface ILogSTransport {
(msg: ILogMessage): void;
client: object;
depth: number;
level: LevelOption;
url?: string;
}
export declare function error(...params: any[]): void;
export declare function warn(...params: any[]): void;
export declare function info(...params: any[]): void;
export declare function verbose(...params: any[]): void;
export declare function debug(...params: any[]): void;
export declare function silly(...params: any[]): void;
export declare function log(...params: any[]): void;
export declare const transports: ITransports;
declare const _d: IElectronLog;
export default _d;