-
Notifications
You must be signed in to change notification settings - Fork 121
/
Copy pathindex.d.ts
95 lines (79 loc) · 2.04 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
// Type definitions for mailgen 2.0
// Definitions by: Kiet Thanh Vo <https://github.com/vothanhkiet>, Jordan Farrer <https://github.com/jordanfarrer>, Grzegorz Kawka-Osik <https://github.com/grzegorzkawkaosik>
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;
/**
* To change the default text direction
* @default ltr
*/
textDirection?: 'ltr' | 'rtl' | string;
}
interface CustomTheme {
path: string;
plaintextPath?: string;
}
interface Product {
name: string;
link: string;
logo?: string;
logoHeight?: string;
copyright?: string;
}
interface Content {
body: ContentBody;
}
interface ContentBody {
name?: string;
greeting?: string | boolean;
signature?: string | boolean;
title?: string;
intro?: string | string[];
action?: Action | Action[];
table?: Table | Table[];
dictionary?: any;
goToAction?: GoToAction;
outro?: string | string[];
}
interface Table {
title?: string,
data: any[];
columns?: ColumnOptions;
}
interface ColumnOptions {
customWidth?: Record<string, string>;
customAlignment?: Record<string, string>;
}
interface GoToAction {
text: string;
link: string;
description: string;
}
interface Action {
instructions: string;
button: Button;
}
interface Button {
color?: string;
fallback?: boolean | Fallback;
text: string;
link: string;
}
interface Fallback {
text?: string;
}
}
export = Mailgen;