-
Notifications
You must be signed in to change notification settings - Fork 39
/
index.d.ts
109 lines (109 loc) · 2.78 KB
/
index.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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
/// <reference types="node" />
import { Writable } from "stream";
export declare type Compressor = (source: string, dest: string) => string;
export declare type Generator = (time: number | Date, index?: number) => string;
export interface Options {
compress?: boolean | string | Compressor;
encoding?: BufferEncoding;
history?: string;
immutable?: boolean;
initialRotation?: boolean;
interval?: string;
intervalBoundary?: boolean;
maxFiles?: number;
maxSize?: string;
mode?: number;
path?: string;
rotate?: number;
size?: string;
teeToStdout?: boolean;
}
interface Opts {
compress?: string | Compressor;
encoding?: BufferEncoding;
history?: string;
immutable?: boolean;
initialRotation?: boolean;
interval?: {
num: number;
unit: string;
};
intervalBoundary?: boolean;
maxFiles?: number;
maxSize?: number;
mode?: number;
path?: string;
rotate?: number;
size?: number;
teeToStdout?: boolean;
}
declare type Callback = (error?: Error) => void;
interface Chunk {
chunk: Buffer;
encoding: BufferEncoding;
next: Chunk;
}
export declare class RotatingFileStream extends Writable {
private createGzip;
private destroyer;
private error;
private exec;
private filename;
private finished;
private fsClose;
private fsCreateReadStream;
private fsCreateWriteStream;
private fsMkdir;
private fsOpen;
private fsReadFile;
private fsRename;
private fsStat;
private fsUnlink;
private fsWrite;
private fsWriteFile;
private generator;
private last;
private maxTimeout;
private next;
private opened;
private options;
private prev;
private rotatedName;
private rotation;
private size;
private stream;
private timer;
constructor(generator: Generator, options: Opts);
_destroy(error: Error, callback: Callback): void;
_final(callback: Callback): void;
_write(chunk: Buffer, encoding: BufferEncoding, callback: Callback): void;
_writev(chunks: Chunk[], callback: Callback): void;
private rewrite;
private init;
private makePath;
private reopen;
private reclose;
private now;
private rotate;
private findName;
private move;
private touch;
private classical;
private clear;
private intervalBoundsBig;
private intervalBounds;
private interval;
private compress;
private external;
private gzip;
private rotated;
private history;
private historyGather;
private historyRemove;
private historyCheckFiles;
private historyCheckSize;
private historyWrite;
private immutate;
}
export declare function createStream(filename: string | Generator, options?: Options): RotatingFileStream;
export {};