-
Notifications
You must be signed in to change notification settings - Fork 37
/
Copy pathWebExtensions.d.ts
79 lines (69 loc) · 2.12 KB
/
WebExtensions.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
72
73
74
75
76
77
78
79
/// <reference types="firefox-webext-browser" />
declare module browser {
interface Event<EventListener> {
readonly addListener(listener: EventListener),
readonly removeListener(listener: EventListener),
readonly hasListener(listener: EventListener),
}
declare module accounts {
interface MailAccount {
id: string,
identities: MailIdentity[],
name: string,
type: string,
}
interface MailIdentity {
email: string,
}
const list: () => Promise<MailAccount[]>;
const get: (accountId: string) => Promise<MailAccount?>;
}
declare module folder {
interface MailFolder {
accountId: string,
type?: string | undefined,
}
}
declare module messages {
interface MessagePart {
body?: string,
contentType?: string,
headers?: { [x: string]: string[] },
name?: string,
partNam?: string,
parts?: MessagePart[],
size?: number,
}
const getFull: (messageId: number) => MessagePart;
const getRaw: (messageId: number) => string;
}
declare module messageDisplay {
interface MessageHeader {
author: string,
bccList: string[],
ccList: string[],
date: Date,
flagged: boolean,
folder: folder.MailFolder,
id: number,
junk: boolean,
junkScore: number,
read: boolean,
recipients: string[],
subject: string,
tags: string[],
}
const getDisplayedMessage: (tabId: number) => Promise<MessageHeader>;
const onMessageDisplayed: Event<(tabId: messenger.tabs.Tab, message: MessageHeader) => void>,
const onMessagesDisplayed: Event<(tabId: messenger.tabs.Tab, message: MessageHeader[]) => void>,
}
}
declare module messenger {
declare module tabs {
interface Tab {
id: number,
windowID: number,
url?: string,
}
}
}