Skip to content

Commit e59b587

Browse files
author
Eric Byers
committed
Adding definition for console-stamp
1 parent dc9dabe commit e59b587

File tree

2 files changed

+67
-0
lines changed

2 files changed

+67
-0
lines changed

console-stamp/console-stamp-tests.ts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
/// <reference path="console-stamp.d.ts" />
2+
3+
import consoleStamp = require("console-stamp");
4+
5+
consoleStamp(console);
6+
7+
var options = {};
8+
consoleStamp(console, options);
9+
10+
var options2 = {
11+
metadata: function ():string {
12+
return 'string';
13+
},
14+
colors: {
15+
stamp: "yellow",
16+
label: "white",
17+
metadata: "green"
18+
},
19+
label: true
20+
};
21+
consoleStamp(console, options2);

console-stamp/console-stamp.d.ts

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
// Type definitions for console-stamp 0.2.0
2+
// Project: https://github.com/starak/node-console-stamp
3+
// Definitions by: Eric Byers <https://github.com/ericbyers/>
4+
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
5+
6+
declare module 'console-stamp' {
7+
8+
function consoleStamp(console:{}, options?: {
9+
/**
10+
* A string with date format based on Javascript Date Format
11+
*/
12+
pattern?: string
13+
14+
/**
15+
* If true it will show the label (LOG | INFO | WARN | ERROR)
16+
*/
17+
label?: boolean;
18+
19+
/**
20+
* An array containing the methods to include in the patch
21+
*/
22+
include?: any;
23+
24+
/**
25+
* An array containing the methods to exclude in the patch)
26+
*/
27+
exclude?: any;
28+
29+
/**
30+
* Types can be String, Object (interpreted with util.inspect), or Function. See the test-metadata.js for examples.
31+
* Note that metadata can still be sent as the third parameter (as in vesion 1.6) as a backward compatibillity feature, but this is deprecated.
32+
*/
33+
metadata?: any;
34+
35+
/**
36+
* An object representing a color theme. More info https://www.npmjs.com/package/colors
37+
*/
38+
colors?: {
39+
stamp?: any;
40+
label?: any;
41+
metadata?: any;
42+
};
43+
}): void;
44+
45+
export = consoleStamp;
46+
}

0 commit comments

Comments
 (0)