@types/nodemailer-express-handlebars
TypeScript icon, indicating that this package has built-in type declarations

4.0.5 • Public • Published

Installation

npm install --save @types/nodemailer-express-handlebars

Summary

This package contains type definitions for nodemailer-express-handlebars (https://github.com/yads/nodemailer-express-handlebars).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/nodemailer-express-handlebars.

index.d.ts

import { create } from "express-handlebars";
import { SentMessageInfo, Transporter } from "nodemailer";
import * as Mail from "nodemailer/lib/mailer";

declare function hbs(options: hbs.NodemailerExpressHandlebarsOptions): Mail.PluginFunction;

declare namespace hbs {
    type Exphbs = ReturnType<typeof create>;

    type ExphbsOptions = Parameters<typeof create>[0];

    interface TemplateOptions {
        template?: string | undefined;
        context?: any;
    }

    type HbsTransporter = Transporter & {
        sendMail(
            mailOptions: Mail.Options & TemplateOptions,
            callback: (err: Error | null, info: SentMessageInfo) => void,
        ): void;
        sendMail(mailOptions: Mail.Options & TemplateOptions): Promise<SentMessageInfo>;
    };

    interface NodemailerExpressHandlebarsOptions {
        viewEngine: Exphbs | ExphbsOptions;
        viewPath: string;
        extName?: string | undefined;
    }

    export { HbsTransporter, NodemailerExpressHandlebarsOptions, TemplateOptions };
}

export = hbs;

Additional Details

Credits

These definitions were written by Gabriel de Oliveira.

Readme

Keywords

none

Package Sidebar

Install

npm i @types/nodemailer-express-handlebars

Weekly Downloads

11,955

Version

4.0.5

License

MIT

Unpacked Size

5.03 kB

Total Files

5

Last publish

Collaborators

  • types