forked from jbaroudi/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
logrotate-stream.d.ts
46 lines (38 loc) · 1.21 KB
/
logrotate-stream.d.ts
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
46
// Type definitions for logrotate-stream 0.2.5
// Project: https://github.com/dstokes/logrotate-stream
// Definitions by: Rogier Schouten <https://github.com/rogierschouten>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../node/node.d.ts" />
declare module "logrotate-stream" {
import stream = require("stream");
// wrapper to be able to use "export =" while also exporting the Options interface
module logrotateStream {
/**
* Options object for the exported function.
*/
export interface Options {
/**
* The file log file to write data to.
*/
file: string;
/**
* The max file size of a log before rotation occurs. Supports 1024, 1k, 1m, 1g
*/
size: string;
/**
* The number of rotated log files to keep (including the primary log file). Additional logs are deleted no rotation.
*/
keep: number;
/**
* Optionally compress rotated files with gzip.
*/
compress?: boolean;
}
}
/**
* Create a rotating log stream.
* @returns a writable stream to a rotating log file
*/
function logrotateStream(opts: logrotateStream.Options): stream.Writable;
export = logrotateStream;
}