Skip to content

Commit e9b1182

Browse files
Slessimattberther
authored andcommitted
fix types for usage with esModuleInterop
1 parent 0fdb94e commit e9b1182

File tree

1 file changed

+61
-55
lines changed

1 file changed

+61
-55
lines changed

index.d.ts

Lines changed: 61 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,63 @@
1-
import * as Transport from 'winston-transport';
2-
declare namespace DailyRotateFile {
3-
interface DailyRotateFileTransportOptions extends Transport.TransportStreamOptions {
4-
json?: boolean;
5-
eol?: string;
6-
7-
/**
8-
* A string representing the moment.js date format to be used for rotating. The meta characters used in this string will dictate the frequency of the file rotation. For example, if your datePattern is simply 'HH' you will end up with 24 log files that are picked up and appended to every day. (default 'YYYY-MM-DD')
9-
*/
10-
datePattern?: string;
11-
12-
/**
13-
* A boolean to define whether or not to gzip archived log files. (default 'false')
14-
*/
15-
zippedArchive?: boolean;
16-
17-
/**
18-
* Filename to be used to log to. This filename can include the %DATE% placeholder which will include the formatted datePattern at that point in the filename. (default: 'winston.log.%DATE%)
19-
*/
20-
filename?: string;
21-
22-
/**
23-
* The directory name to save log files to. (default: '.')
24-
*/
25-
dirname?: string;
26-
27-
/**
28-
* Write directly to a custom stream and bypass the rotation capabilities. (default: null)
29-
*/
30-
stream?: NodeJS.WritableStream;
31-
32-
/**
33-
* Maximum size of the file after which it will rotate. This can be a number of bytes, or units of kb, mb, and gb. If using the units, add 'k', 'm', or 'g' as the suffix. The units need to directly follow the number. (default: null)
34-
*/
35-
maxSize?: string | number;
36-
37-
/**
38-
* Maximum number of logs to keep. If not set, no logs will be removed. This can be a number of files or number of days. If using days, add 'd' as the suffix. (default: null)
39-
*/
40-
maxFiles?: string | number;
41-
42-
/**
43-
* An object resembling https://nodejs.org/api/fs.html#fs_fs_createwritestream_path_options indicating additional options that should be passed to the file stream. (default: `{ flags: 'a' }`)
44-
*/
45-
options?: string | object;
46-
}
1+
declare module "winston-daily-rotate-file" {
2+
import * as Transport from "winston-transport";
3+
4+
namespace DailyRotateFile {
5+
interface DailyRotateFileTransportOptions extends Transport.TransportStreamOptions {
6+
json?: boolean;
7+
eol?: string;
8+
9+
/**
10+
* A string representing the moment.js date format to be used for rotating. The meta characters used in this string will dictate the frequency of the file rotation. For example, if your datePattern is simply 'HH' you will end up with 24 log files that are picked up and appended to every day. (default 'YYYY-MM-DD')
11+
*/
12+
datePattern?: string;
13+
14+
/**
15+
* A boolean to define whether or not to gzip archived log files. (default 'false')
16+
*/
17+
zippedArchive?: boolean;
18+
19+
/**
20+
* Filename to be used to log to. This filename can include the %DATE% placeholder which will include the formatted datePattern at that point in the filename. (default: 'winston.log.%DATE%)
21+
*/
22+
filename?: string;
23+
24+
/**
25+
* The directory name to save log files to. (default: '.')
26+
*/
27+
dirname?: string;
28+
29+
/**
30+
* Write directly to a custom stream and bypass the rotation capabilities. (default: null)
31+
*/
32+
stream?: NodeJS.WritableStream;
33+
34+
/**
35+
* Maximum size of the file after which it will rotate. This can be a number of bytes, or units of kb, mb, and gb. If using the units, add 'k', 'm', or 'g' as the suffix. The units need to directly follow the number. (default: null)
36+
*/
37+
maxSize?: string | number;
38+
39+
/**
40+
* Maximum number of logs to keep. If not set, no logs will be removed. This can be a number of files or number of days. If using days, add 'd' as the suffix. (default: null)
41+
*/
42+
maxFiles?: string | number;
43+
44+
/**
45+
* An object resembling https://nodejs.org/api/fs.html#fs_fs_createwritestream_path_options indicating additional options that should be passed to the file stream. (default: `{ flags: 'a' }`)
46+
*/
47+
options?: string | object;
48+
}
4749
}
48-
49-
declare class DailyRotateFile extends Transport {
50-
filename: string;
51-
dirname: string;
52-
logStream: NodeJS.WritableStream;
53-
options: DailyRotateFile.DailyRotateFileTransportOptions;
54-
constructor (options?: DailyRotateFile.DailyRotateFileTransportOptions);
50+
51+
interface DailyRotateFileTransportInstance extends Transport {
52+
filename: string;
53+
dirname: string;
54+
logStream: NodeJS.WritableStream;
55+
options: DailyRotateFile.DailyRotateFileTransportOptions;
56+
57+
new (options?: DailyRotateFile.DailyRotateFileTransportOptions): DailyRotateFileTransportInstance;
5558
}
56-
57-
export = DailyRotateFile;
59+
60+
const DailyRotateFile: DailyRotateFileTransportInstance;
61+
62+
export = DailyRotateFile;
63+
}

0 commit comments

Comments
 (0)