Add types for slack-winston (#18373)

This commit is contained in:
Elliot Blackburn 2017-07-25 16:16:14 +01:00 committed by Andy
parent 53c47fa7d0
commit 64140e7eac
4 changed files with 59 additions and 0 deletions

23
types/slack-winston/index.d.ts vendored Normal file
View File

@ -0,0 +1,23 @@
// 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
import * as winston from 'winston';
export interface SlackTransportOptions extends winston.WinstonModuleTransportOptions {
domain: string;
token: string;
webhook_url: string;
channel: string;
username?: string;
icon_emoji?: string;
message?: string;
queueDelay?: number;
}
export class Slack extends winston.Transport implements winston.TransportInstance {
constructor(options?: SlackTransportOptions);
}

View File

@ -0,0 +1,13 @@
import { Slack, SlackTransportOptions } from 'slack-winston';
const slackOptions: SlackTransportOptions = {
domain: "abc",
token: "abc",
webhook_url: "abc",
channel: "abc",
username: "abc",
icon_emoji: ":sparkles:",
level: 'alert',
};
const slackTransport = new Slack(slackOptions);

View File

@ -0,0 +1,22 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"slack-winston-tests.ts"
]
}

View File

@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }