Neverending Puppy Marathon

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

    4.0.2 • 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

    // Type definitions for nodemailer-express-handlebars 4.0
    // Project: https://github.com/yads/nodemailer-express-handlebars
    // Definitions by: Gabriel de Oliveira <https://github.com/th3rius>
    // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
    
    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 { TemplateOptions, HbsTransporter, NodemailerExpressHandlebarsOptions };
    }
    
    export = hbs;

    Additional Details

    Credits

    These definitions were written by Gabriel de Oliveira.

    Keywords

    none

    Install

    npm i @types/nodemailer-express-handlebars

    DownloadsWeekly Downloads

    5,943

    Version

    4.0.2

    License

    MIT

    Unpacked Size

    5.58 kB

    Total Files

    4

    Last publish

    Collaborators

    • types