forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathemail-templates.d.ts
54 lines (49 loc) · 1.36 KB
/
email-templates.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
// Type definitions for node-email-templates
// Project: https://github.com/niftylettuce/node-email-templates
// Definitions by: Cyril Schumacher <https://github.com/cyrilschumacher>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/**
* @summary Interface for result of email template.
* @interface
*/
interface EmailTemplateResults {
/**
* @summary HTML result.
* @type {string}
*/
html: string;
/**
* @summary Text result.
* @type {string}
*/
text: string;
}
/**
* @summary Interface for callback of email callback.
* @interface
*/
interface EmailTemplateCallback {
/**
* @summary Callback signature.
*/
(err: Object, results: EmailTemplateResults): void;
}
declare module "email-templates" {
/**
* @summary Email template class.
* @class
*/
export class EmailTemplate {
/**
* @summary Constructor.
* @param {string} templateDir The template directory.
*/
constructor(templateDir: string);
/**
* @summary Render a single template.
* @param {EmailTemplateCallback|Object} locals The variables or callback function.
* @param {EmailTemplateCallback} callback The callback function.
*/
render(locals: EmailTemplateCallback|Object, callback?: EmailTemplateCallback): void;
}
}