UNPKG

1.35 kBTypeScriptView Raw
1declare var debug: debug.Debug & { debug: debug.Debug; default: debug.Debug };
2
3export = debug;
4export as namespace debug;
5
6declare namespace debug {
7 interface Debug {
8 (namespace: string): Debugger;
9 coerce: (val: any) => any;
10 disable: () => string;
11 enable: (namespaces: string) => void;
12 enabled: (namespaces: string) => boolean;
13 formatArgs: (this: Debugger, args: any[]) => void;
14 log: (...args: any[]) => any;
15 selectColor: (namespace: string) => string | number;
16 humanize: typeof import("ms");
17
18 names: RegExp[];
19 skips: RegExp[];
20
21 formatters: Formatters;
22
23 inspectOpts?: {
24 hideDate?: boolean | number | null;
25 colors?: boolean | number | null;
26 depth?: boolean | number | null;
27 showHidden?: boolean | number | null;
28 };
29 }
30
31 type IDebug = Debug;
32
33 interface Formatters {
34 [formatter: string]: (v: any) => string;
35 }
36
37 type IDebugger = Debugger;
38
39 interface Debugger {
40 (formatter: any, ...args: any[]): void;
41
42 color: string;
43 diff: number;
44 enabled: boolean;
45 log: (...args: any[]) => any;
46 namespace: string;
47 destroy: () => boolean;
48 extend: (namespace: string, delimiter?: string) => Debugger;
49 }
50}