提交 | 用户 | age
|
28c484
|
1 |
import Loggers from '@/utils/logger'; |
S |
2 |
|
|
3 |
// 声明全局变量来扩展 window 对象 |
|
4 |
declare global { |
|
5 |
interface Window { |
|
6 |
Logger: typeof Loggers; |
|
7 |
} |
|
8 |
class Logger extends Loggers {} |
|
9 |
|
|
10 |
// let Logger: typeof Loggers; |
|
11 |
// type Level = 'LOG' | 'DEBUG' | 'INFO' | 'WARN' | 'ERROR' | 'FATAL'; |
|
12 |
// class Logger { |
|
13 |
// private static level: Level; |
|
14 |
// |
|
15 |
// static setLevel(newLevel: Level): void; |
|
16 |
// |
|
17 |
// static shouldLog(level: Level): boolean; |
|
18 |
// |
|
19 |
// static log(message: string | object): void; |
|
20 |
// |
|
21 |
// static debug(message: string | object): void; |
|
22 |
// |
|
23 |
// static info(message: string | object): void; |
|
24 |
// |
|
25 |
// static warn(message: string | object): void; |
|
26 |
// |
|
27 |
// static error(message: string | object, error?: Error): void; |
|
28 |
// |
|
29 |
// static fatal(message: string | object, error?: Error): void; |
|
30 |
// } |
|
31 |
} |
|
32 |
|
|
33 |
// 让 TypeScript 知道这个文件是一个模块 |
|
34 |
// export {} |