-
-
Notifications
You must be signed in to change notification settings - Fork 69
/
gmail-tester.d.ts
71 lines (63 loc) · 1.5 KB
/
gmail-tester.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
declare module "gmail-tester" {
export interface Attachment {
filename: string;
data: string;
mimeType: string;
}
export interface Email {
from: string;
receiver: string;
subject: string;
date: Date;
body?: {
html: string;
text: string;
};
attachments?: Attachment[];
}
export interface CheckInboxOptions {
include_body?: boolean;
from?: string;
to?: string;
subject?: string;
before?: Date;
after?: Date;
wait_time_sec?: number;
max_wait_time_sec?: number;
label?: string;
include_attachments?: boolean;
}
export interface GetMessagesOptions {
include_body?: boolean;
from?: string;
to?: string;
subject?: string;
before?: Date;
after?: Date;
}
export interface Credentials {
installed : {
client_id: string,
project_id: string,
auth_uri: string,
token_uri: string,
auth_provider_x509_cert_url: string,
client_secret: string,
redirect_uris: string[]
}
}
export function check_inbox(
credentials: string | Credentials,
token: string | Record<string, unknown>,
options: CheckInboxOptions
): Promise<Email[]>;
export function get_messages(
credentials: string | Credentials,
token: string | Record<string, unknown>,
options: GetMessagesOptions
): Promise<Email[]>;
export function refresh_access_token(
credentials: string | Credentials,
token: string | Record<string, unknown>,
): Promise<void>;
}