# @types/swig-email-templates

> TypeScript definitions for swig-email-templates

Latest version **7.0.3** (published 2023-11-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install @types/swig-email-templates
pnpm add @types/swig-email-templates
yarn add @types/swig-email-templates
bun add @types/swig-email-templates
```

## Health

**Score 45/100 (D)** — status: abandoned.

Positive: has types; no vulnerabilities; high maintenance score; popular repo; extremely popular.

Warnings: low downloads; no esm support.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 7.0.3 |
| Published | 2023-11-07 |
| First published | 2016-05-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 5.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 51449 |
| Maintainers | types |

## Links

- npm: https://www.npmjs.com/package/@types/swig-email-templates
- Repository: https://github.com/DefinitelyTyped/DefinitelyTyped
- Homepage: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/swig-email-templates
- npm.io page: https://npm.io/package/@types/swig-email-templates

## Dependencies (2)

- [@types/swig](https://npm.io/package/@types/swig.md) *
- [@types/jquery](https://npm.io/package/@types/jquery.md) *

## Recent versions

- 7.0.3 (latest) — 2023-11-07
- 7.0.0 (ts4.0) — 2022-07-25
- 5.0.1 (ts3.6) — 2021-07-02
- 5.0.0 (ts2.4) — 2017-11-10
- 0.0.29 (ts2.0) — 2016-09-19
- 7.0.2 — 2023-10-18
- 7.0.1 — 2023-09-25
- 0.0.28 — 2016-07-14
- 0.0.27-alpha — 2016-07-08
- 0.0.25-alpha — 2016-07-04
- 0.0.24-alpha — 2016-07-02
- 0.0.23-alpha — 2016-07-02
- 0.0.22-alpha — 2016-07-01
- 0.0.21-alpha — 2016-05-25
- 0.0.20-alpha — 2016-05-20
- … 2 more at https://npm.io/package/@types/swig-email-templates/versions

## README

# 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](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/swig-email-templates/index.d.ts)
````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](https://npmjs.com/package/@types/jquery), [@types/swig](https://npmjs.com/package/@types/swig)

# Credits
These definitions were written by [Adam Babcock](https://github.com/mrhen), and [Satana Charuwichitratana](https://github.com/micksatana).

---
_Source: https://npm.io/package/@types/swig-email-templates · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
