-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.d.ts
43 lines (38 loc) · 1.45 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
import { AxiosInstance } from 'axios';
declare module '@splitmedialabs/supermailer-node' {
type JSONValue = string | number | boolean | { [x: string]: JSONValue } | Array<JSONValue>;
export interface SupermailerConstructor {
apiKey: string;
apiUrl: string;
namespace: string;
}
interface SendTransactionalArgs {
templateGroup: string;
recipientEmail: string;
language: string;
templateData: Record<string, string>;
recipientName?: string;
forceSend?: boolean;
}
export default class Supermailer {
api: AxiosInstance;
constructor(config: SupermailerConstructor);
emails: {
sendTransactional: (payload: SendTransactionalArgs) => Promise<JSONValue>;
};
Recipient: (email: String) => {
data: { [x: string]: JSONValue };
create: () => Promise<JSONValue>;
delete: () => Promise<JSONValue>;
logs: (offset: number, limit: number) => Promise<JSONValue>;
read: () => Promise<JSONValue>;
update: () => Promise<JSONValue>;
addBoolean: (name: string, value: null | boolean) => boolean | null;
addDate: (name: string, value: null | string | Date) => string | null;
addEvent: (name: string, value: null | string) => string | null;
addNumber: (name: string, value: null | number) => number | null;
addString: (name: string, value: null | string) => number | null;
addData: (obj: Record<string, unknown>) => { [x: string]: JSONValue };
};
}
}