-
Notifications
You must be signed in to change notification settings - Fork 42
/
index.d.ts
67 lines (59 loc) · 1.6 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
import { Writable, WritableOptions } from "stream";
import {
PutObjectCommandInput,
PutObjectCommandOutput,
} from "@aws-sdk/client-s3";
export interface S3StreamLoggerOptions extends WritableOptions {
bucket?: string;
folder?: string;
tags?: Record<string, string>;
name_format?: string;
rotate_every?: number;
max_file_size?: number;
upload_every?: number;
buffer_size?: number;
server_side_encryption?: boolean;
acl?: string;
compress?: boolean;
storage_class?: string;
region?: string;
access_key_id?: string;
secret_access_key?: string;
config?: {
region?: string;
sslEnabled?: boolean;
credentials?: {
accessKeyId?: string;
secretAccessKey?: string;
};
};
}
export declare class S3StreamLogger extends Writable {
constructor(options: S3StreamLoggerOptions);
flushFile(cb?: (err: Error | null) => void): void;
putObject(
param: PutObjectCommandInput,
callback: (err: Error | null, data?: PutObjectCommandOutput) => void
): void;
private _upload(
forceNewFile: boolean,
cb?: (err: Error | null, data?: PutObjectCommandOutput) => void
): void;
private _prepareBuffer(
cb: (err: Error | null, buffer?: Buffer) => void
): void;
private _fileSize(): number;
private _newFile(): void;
private _restoreUnwritten(
unwritten: number,
objectName: string | null,
buffers: Buffer[] | undefined
): void;
public _write(
chunk: Buffer | string,
encoding: string,
callback: (err?: Error | null) => void
): void;
public _final(cb?: (err?: Error | null) => void): void;
}
export default S3StreamLogger;