huangyinfeng
4 天以前 db42d08c39ae6129e2b95cd24c0d57c6769282e5
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
import Loggers from '@/utils/logger';
 
// 声明全局变量来扩展 window 对象
declare global {
  interface Window {
    Logger: typeof Loggers;
  }
  class Logger extends Loggers {}
 
  // let Logger: typeof Loggers;
  // type Level = 'LOG' | 'DEBUG' | 'INFO' | 'WARN' | 'ERROR' | 'FATAL';
  // class Logger {
  //   private static level: Level;
  //
  //   static setLevel(newLevel: Level): void;
  //
  //   static shouldLog(level: Level): boolean;
  //
  //   static log(message: string | object): void;
  //
  //   static debug(message: string | object): void;
  //
  //   static info(message: string | object): void;
  //
  //   static warn(message: string | object): void;
  //
  //   static error(message: string | object, error?: Error): void;
  //
  //   static fatal(message: string | object, error?: Error): void;
  // }
}
 
// 让 TypeScript 知道这个文件是一个模块
// export {}