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
- Last updated: Tue, 07 Nov 2023 15:11:36 GMT
- Dependencies: @types/jquery, @types/swig
Credits
These definitions were written by Adam Babcock, and Satana Charuwichitratana.