-
Notifications
You must be signed in to change notification settings - Fork 968
Expand file tree
/
Copy pathcommon.d.ts
More file actions
45 lines (42 loc) · 1.13 KB
/
common.d.ts
File metadata and controls
45 lines (42 loc) · 1.13 KB
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
type DebugNamespace = {
(...args: string[]): void;
namespace: string;
enabled: boolean;
useColors: boolean;
color: number | string;
destroy: () => boolean;
extend: (namespace: string, delimiter: string) => DebugNamespace;
};
type DebugType = {
(namespace: string): DebugNamespace;
debug: DebugType;
default: DebugNamespace;
coerce: <T>(val: T) => T;
disable: () => string;
enable: (namespaces: string) => void;
enabled: (name: string) => boolean;
humanize: (timeInMs:number)=>string;
/**
* Active `debug` instances.
*/
instances: DebugNamespace[];
/**
* The currently active debug mode names, and names to skip.
*/
names: string[];
skips: string[];
/**
* Map of special "%n" handling functions, for the debug "format" argument.
*
* Valid key names are a single, lower or upper-case letter, i.e. "n" and "N".
*/
formatters: {};
selectColor: (namespace: string) => number;
};
/**
* This is the common logic for both the Node.js and web browser
* implementations of `debug()`.
*/
import node = require("node");
import browser = require("browser");
declare function setup(env:typeof node|typeof browser ): DebugType;