-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdelivery.d.ts
More file actions
40 lines (33 loc) · 853 Bytes
/
delivery.d.ts
File metadata and controls
40 lines (33 loc) · 853 Bytes
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
export interface IFile {
filename: string;
}
export interface IData {
filename: string;
content: NodeJS.Buffer;
}
export interface IAttachment {
filename: string;
readable: NodeJS.ReadableStream;
}
export class Attachment implements IAttachment {
filename: string;
readable: NodeJS.ReadableStream;
constructor(filename: string);
}
export interface IMessage {
to: string;
subject: string;
text: string;
files: Array<IData>;
attach(attachment: IAttachment): Promise<void>;
}
export class Message implements IMessage {
to: string;
subject: string;
text: string;
files: Array<IData>;
constructor(to: string, subject: string, text: string);
attach(attachment: IAttachment): Promise<void>;
}
export function send(message: IMessage): Promise<void>;
export function canAttach(files: Array<IFile>): Promise<boolean>;