Break slack-winston dependency on winston (#41386)

slack-winston is nearly unused and seems abandoned, but has a dependency
on the deprecated @types/winston. This is causing problems for DT
automation, so I just inlined all the winston types that slack-winston
uses. Since this package is unlikely to change, I don't think this is a
problem.
This commit is contained in:
Nathan Shively-Sanders
2020-01-03 14:31:03 -08:00
committed by GitHub
parent 98f5d66f4f
commit 6b8d40a95f
2 changed files with 33 additions and 10 deletions
+33 -4
View File
@@ -4,9 +4,7 @@
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.3
import Transport = require("winston-transport");
export interface SlackTransportOptions extends Transport.TransportStreamOptions {
export interface SlackTransportOptions {
domain: string;
token: string;
webhook_url: string;
@@ -16,8 +14,39 @@ export interface SlackTransportOptions extends Transport.TransportStreamOptions
icon_emoji?: string;
message?: string;
queueDelay?: number;
// from winston-transport TransportStreamOptions
format?: Format;
level?: string;
silent?: boolean;
handleExceptions?: boolean;
log?(info: any, next: () => void): any;
logv?(info: any, next: () => void): any;
close?(): void;
}
export class Slack extends Transport {
export class Slack {
constructor(options?: SlackTransportOptions);
format?: Format;
level?: string;
silent?: boolean;
handleExceptions?: boolean;
log?(info: any, next: () => void): any;
logv?(info: any, next: () => void): any;
close?(): void;
}
export class Format {
constructor(opts?: object);
options?: object;
transform: (info: TransformableInfo, opts?: any) => TransformableInfo | boolean;
}
export interface TransformableInfo {
level: string;
message: string;
[key: string]: any;
}
-6
View File
@@ -1,6 +0,0 @@
{
"private": true,
"dependencies": {
"@types/winston": "^2.3.9"
}
}