mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
* Add types for winston-mail * added winston dependency Created a package.json file with winston dependency * Changed dependency in package.json Changed dependency in package.json to winston 2.3.9 and higher.
54 lines
1.2 KiB
TypeScript
54 lines
1.2 KiB
TypeScript
import winstonMail = require("winston-mail");
|
|
import winston = require("winston");
|
|
import { Transform } from "stream";
|
|
|
|
let mail: winstonMail.Mail = new winstonMail.Mail({ to: "test" });
|
|
|
|
winston.add(mail);
|
|
|
|
// $ExpectError
|
|
mail = new winstonMail.Mail({});
|
|
|
|
let mailOptions: winstonMail.MailTransportOptions = {
|
|
name: "test",
|
|
to: "test",
|
|
from: "test",
|
|
level: "test",
|
|
silent: true,
|
|
handleExceptions: true,
|
|
host: "test",
|
|
port: 10202,
|
|
username: "test",
|
|
password: "test",
|
|
subject: "test",
|
|
ssl: false,
|
|
tls: false,
|
|
unique: false,
|
|
filter: (obj: { level: string; message: string; meta: any }): boolean => {
|
|
return false;
|
|
},
|
|
html: true,
|
|
timeout: 5000,
|
|
authentication: ["test"],
|
|
formatter: (obj: { level: string; message: string; meta: any }): string => {
|
|
return "test";
|
|
}
|
|
};
|
|
|
|
mailOptions = {
|
|
to: "test",
|
|
ssl: { key: "test", ca: "test", cert: "test" },
|
|
tls: { ciphers: "test" }
|
|
};
|
|
|
|
mail = new winstonMail.Mail(mailOptions);
|
|
|
|
mailOptions = {
|
|
test: "test" // $ExpectError
|
|
};
|
|
|
|
let transport: winston.TransportInstance = new winstonMail.Mail({ to: "test" });
|
|
transport = winston.transports.Console;
|
|
|
|
mail.log("test", "test", "test", "test");
|