DefinitelyTyped/types/slack-winston/index.d.ts
Nathan Shively-Sanders 6b8d40a95f
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.
2020-01-03 14:31:03 -08:00

53 lines
1.2 KiB
TypeScript

// Type definitions for slack-winston 0.0
// Project: https://github.com/niftylettuce/slack-winston
// Definitions by: Elliot Blackburn <https://github.com/BlueHatbRit>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.3
export interface SlackTransportOptions {
domain: string;
token: string;
webhook_url: string;
channel: string;
username?: string;
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 {
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;
}