gx
chenyc
2025-02-12 ea42ff3ebee1eeb3fb29423aa848a249441db81c
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
110
111
112
113
114
115
116
117
// Type definitions for winston 3.0
// Project: https://github.com/winstonjs/winston
 
/// <reference types="node" />
 
import { Agent } from 'http';
 
import * as Transport from 'winston-transport';
 
declare namespace winston {
  interface ConsoleTransportOptions extends Transport.TransportStreamOptions {
    consoleWarnLevels?: string[];
    stderrLevels?: string[];
    debugStdout?: boolean;
    eol?: string;
    forceConsole?: boolean;
  }
 
  interface ConsoleTransportInstance extends Transport {
    name: string;
    stderrLevels: string[];
    eol: string;
 
    new (options?: ConsoleTransportOptions): ConsoleTransportInstance;
  }
 
  interface FileTransportOptions extends Transport.TransportStreamOptions {
    filename?: string;
    dirname?: string;
    options?: object;
    maxsize?: number;
    stream?: NodeJS.WritableStream;
    rotationFormat?: Function;
    zippedArchive?: boolean;
    maxFiles?: number;
    eol?: string;
    tailable?: boolean;
    lazy?: boolean;
  }
 
  interface FileTransportInstance extends Transport {
    name: string;
    filename: string;
    dirname: string;
    options: object;
    maxsize: number | null;
    rotationFormat: Function | boolean;
    zippedArchive: boolean;
    maxFiles: number | null;
    eol: string;
    tailable: boolean;
    lazy: boolean;
 
    new (options?: FileTransportOptions): FileTransportInstance;
  }
 
  interface HttpTransportOptions extends Transport.TransportStreamOptions {
    ssl?: any;
    host?: string;
    port?: number;
    auth?: {
      username?: string | undefined;
      password?: string | undefined;
      bearer?: string | undefined;
    };
    path?: string;
    agent?: Agent;
    headers?: object;
    batch?: boolean;
    batchInterval?: number;
    batchCount?: number;
    replacer?: (key: string, value: any) => any;
    maximumDepth?: number;
  }
 
  interface HttpTransportInstance extends Transport {
    name: string;
    ssl: boolean;
    host: string;
    maximumDepth: number;
    port: number;
    auth?: {
      username?: string | undefined;
      password?: string | undefined;
      bearer?: string | undefined;
    };
    path: string;
    agent?: Agent | null;
 
    new (options?: HttpTransportOptions): HttpTransportInstance;
  }
 
  interface StreamTransportOptions extends Transport.TransportStreamOptions {
    stream: NodeJS.WritableStream;
    eol?: string;
  }
 
  interface StreamTransportInstance extends Transport {
    eol: string;
 
    new (options?: StreamTransportOptions): StreamTransportInstance;
  }
 
  interface Transports {
    FileTransportOptions: FileTransportOptions;
    File: FileTransportInstance;
    ConsoleTransportOptions: ConsoleTransportOptions;
    Console: ConsoleTransportInstance;
    HttpTransportOptions: HttpTransportOptions;
    Http: HttpTransportInstance;
    StreamTransportOptions: StreamTransportOptions;
    Stream: StreamTransportInstance;
  }
}
 
declare const winston: winston.Transports;
export = winston;