Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add forceConsole to ConsoleTransportOptions #2496

Merged
merged 1 commit into from
Aug 8, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading