mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
Add types for slack-winston (#18373)
This commit is contained in:
parent
53c47fa7d0
commit
64140e7eac
23
types/slack-winston/index.d.ts
vendored
Normal file
23
types/slack-winston/index.d.ts
vendored
Normal 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);
|
||||
}
|
||||
13
types/slack-winston/slack-winston-tests.ts
Normal file
13
types/slack-winston/slack-winston-tests.ts
Normal 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);
|
||||
22
types/slack-winston/tsconfig.json
Normal file
22
types/slack-winston/tsconfig.json
Normal 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"
|
||||
]
|
||||
}
|
||||
1
types/slack-winston/tslint.json
Normal file
1
types/slack-winston/tslint.json
Normal file
@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Loading…
Reference in New Issue
Block a user