Skip to content

Commit

Permalink
Add forceConsole to ConsoleTransportOptions (#2496)
Browse files Browse the repository at this point in the history
Fixes #2495
  • Loading branch information
neilenns authored Aug 8, 2024
1 parent 62acaad commit 4ff0538
Showing 1 changed file with 17 additions and 8 deletions.
25 changes: 17 additions & 8 deletions lib/winston/transports/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,25 @@

/// <reference types="node" />

import {Agent} from "http";
import { Agent } from 'http';

import * as Transport from 'winston-transport';

declare namespace winston {
interface ConsoleTransportOptions extends Transport.TransportStreamOptions {
consoleWarnLevels?: string[],
consoleWarnLevels?: string[];
stderrLevels?: string[];
debugStdout?: boolean;
eol?: string;
forceConsole?: boolean;
}

interface ConsoleTransportInstance extends Transport {
name: string;
stderrLevels: string[];
eol: string;

new(options?: ConsoleTransportOptions): ConsoleTransportInstance;
new (options?: ConsoleTransportOptions): ConsoleTransportInstance;
}

interface FileTransportOptions extends Transport.TransportStreamOptions {
Expand Down Expand Up @@ -50,14 +51,18 @@ declare namespace winston {
tailable: boolean;
lazy: boolean;

new(options?: FileTransportOptions): FileTransportInstance;
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 };
auth?: {
username?: string | undefined;
password?: string | undefined;
bearer?: string | undefined;
};
path?: string;
agent?: Agent;
headers?: object;
Expand All @@ -74,11 +79,15 @@ declare namespace winston {
host: string;
maximumDepth: number;
port: number;
auth?: { username?: string | undefined, password?: string | undefined, bearer?: string | undefined };
auth?: {
username?: string | undefined;
password?: string | undefined;
bearer?: string | undefined;
};
path: string;
agent?: Agent | null;

new(options?: HttpTransportOptions): HttpTransportInstance;
new (options?: HttpTransportOptions): HttpTransportInstance;
}

interface StreamTransportOptions extends Transport.TransportStreamOptions {
Expand All @@ -89,7 +98,7 @@ declare namespace winston {
interface StreamTransportInstance extends Transport {
eol: string;

new(options?: StreamTransportOptions): StreamTransportInstance;
new (options?: StreamTransportOptions): StreamTransportInstance;
}

interface Transports {
Expand Down

0 comments on commit 4ff0538

Please sign in to comment.