@types/swig-email-templates
TypeScript icon, indicating that this package has built-in type declarations

7.0.3 • Public • Published

Installation

npm install --save @types/swig-email-templates

Summary

This package contains type definitions for swig-email-templates (https://github.com/andrewrk/swig-email-templates).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/swig-email-templates.

index.d.ts

/// <reference types="jquery" />

import swig = require("swig");

type SwigRender<T> = (file: string, context: T, callback: (err: any, html: string, text: string) => any) => any;

interface SwigEmailTemplatesOptions extends swig.SwigOptions {
    root?: string | undefined;
    juice?: any;
    rewriteUrl?: ((href: string) => string) | undefined;
    rewrite?: (($: JQueryStatic) => void) | undefined;
}

declare class EmailTemplates {
    constructor(options?: SwigEmailTemplatesOptions);

    generateText(templatePath: string, context: any, html: string, cb: (error: any, text: string | null) => void): void;
    generateSubject(templatePath: string, context: any, cb: (error: any, text: string | null) => void): void;
    rewriteUrls($: JQueryStatic, rewrite: (href: string) => void): void;
    render(
        templatePath: string,
        context: any,
        cb: (error: any, inlinedHTML?: string, text?: string, subject?: string) => void,
    ): void;
    /** @async */
    render(templatePath: string, context: any): Promise<{ html?: string; text?: string; subject?: string }>;
}

export = EmailTemplates;

Additional Details

Credits

These definitions were written by Adam Babcock, and Satana Charuwichitratana.

Readme

Keywords

none

Package Sidebar

Install

npm i @types/swig-email-templates

Weekly Downloads

287

Version

7.0.3

License

MIT

Unpacked Size

5.25 kB

Total Files

5

Last publish

Collaborators

  • types