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

2.0.7 • Public • Published

Installation

npm install --save @types/mailgen

Summary

This package contains type definitions for mailgen (https://github.com/eladnava/mailgen#readme).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/mailgen.

index.d.ts

import Option = Mailgen.Option;
import Content = Mailgen.Content;
/**
 * Created by kiettv on 7/24/16.
 */
declare class Mailgen {
    constructor(opts: Option);

    cacheThemes(): void;

    generate(params: Content): any;

    generatePlaintext(params: Content): any;

    parseParams(params: any): any;
}

declare namespace Mailgen {
    interface Option {
        theme: string | CustomTheme;
        product: Product;
    }

    interface CustomTheme {
        path: string;
        plaintextPath?: string | undefined;
    }

    interface Product {
        name: string;
        link: string;
        logo?: string | undefined;
        logoHeight?: string | undefined;
        copyright?: string | undefined;
    }

    interface Content {
        body: ContentBody;
    }

    interface ContentBody {
        name?: string | undefined;
        greeting?: string | undefined;
        signature?: string | undefined;
        title?: string | undefined;
        intro?: string | string[] | undefined;
        action?: Action | Action[] | undefined;
        table?: Table | Table[] | undefined;
        dictionary?: any;
        goToAction?: GoToAction | undefined;
        outro?: string | string[] | undefined;
    }

    interface Table {
        data: any[];
        columns?: ColumnOptions[] | undefined;
    }

    interface ColumnOptions {
        customWidth: any;
        customAlignment: any;
    }

    interface GoToAction {
        text: string;
        link: string;
        description: string;
    }

    interface Action {
        instructions: string;
        button: Button;
    }

    interface Button {
        color: string;
        text: string;
        link: string;
    }
}

export = Mailgen;

Additional Details

  • Last updated: Tue, 07 Nov 2023 09:09:39 GMT
  • Dependencies: none

Credits

These definitions were written by Kiet Thanh Vo, Jordan Farrer, and Grzegorz Kawka-Osik.

Versions

Current Tags

Version History

Package Sidebar

Install

npm i @types/mailgen

Weekly Downloads

3,289

Version

2.0.7

License

MIT

Unpacked Size

6.42 kB

Total Files

5

Last publish

Collaborators

  • types