-
Notifications
You must be signed in to change notification settings - Fork 12
/
index.d.ts
47 lines (39 loc) · 1.37 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
import { Models, Client } from 'postmark';
declare module 'nodemailer-postmark-transport' {
type Callback<T> = (error: (Error | null), result: (T | null)) => void;
export interface SentMessageInfo {
messageId?: string;
accepted: Array<Models.MessageSendingResponse>;
rejected: Array<Models.MessageSendingResponse>;
originalResults: Array<Models.MessageSendingResponse>;
}
export interface PostmarkTransportOptions {
auth?: { apiKey: string; };
postmarkOptions?: Models.ClientOptions.Configuration
}
export class PostmarkTransport {
name: string;
version: string;
canSendBatch: boolean;
client: Client;
send(mail: any, callback?: Callback<SentMessageInfo>): Promise<SentMessageInfo>;
sendBatch(mail: any[], callback?: Callback<SentMessageInfo>): Promise<SentMessageInfo>;
}
export default function (options?: PostmarkTransportOptions): PostmarkTransport;
}
declare module "nodemailer" {
export function createTransport(transport: PostmarkTransport): Transporter<SentMessageInfo>;
}
declare module "nodemailer/lib/mailer" {
interface Hash<T> { [key: string]: T; }
export interface Options {
messageStream?: string;
metadata?: Hash<string>;
tag?: string;
trackLinks?: Models.LinkTrackingOptions;
trackOpens?: boolean;
templateId?: number;
templateAlias?: string;
templateModel?: object;
}
}