UNPKG

1.47 kBTypeScriptView Raw
1// Type definitions for debug 4.1
2// Project: https://github.com/visionmedia/debug
3// Definitions by: Seon-Wook Park <https://github.com/swook>
4// Gal Talmor <https://github.com/galtalmor>
5// John McLaughlin <https://github.com/zamb3zi>
6// Brasten Sager <https://github.com/brasten>
7// Nicolas Penin <https://github.com/npenin>
8// Kristian Brünn <https://github.com/kristianmitk>
9// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
10
11declare var debug: debug.Debug & { debug: debug.Debug; default: debug.Debug };
12
13export = debug;
14export as namespace debug;
15
16declare namespace debug {
17 interface Debug {
18 (namespace: string): Debugger;
19 coerce: (val: any) => any;
20 disable: () => string;
21 enable: (namespaces: string) => void;
22 enabled: (namespaces: string) => boolean;
23 log: (...args: any[]) => any;
24
25 names: RegExp[];
26 skips: RegExp[];
27
28 formatters: Formatters;
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 enabled: boolean;
44 log: (...args: any[]) => any;
45 namespace: string;
46 destroy: () => boolean;
47 extend: (namespace: string, delimiter?: string) => Debugger;
48 }
49}