-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use @types/firefox-webext-browser for WebExtension types
- Loading branch information
Showing
21 changed files
with
66 additions
and
118 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,79 +1,6 @@ | ||
/// <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, | ||
} | ||
// https://github.com/thundernest/webext-docs/issues/56 | ||
var get: (accountId: string) => Promise<MailAccount?>; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.