[
{
"namespace": "mailTabs",
"types": [
{
"id": "MailTab",
"type": "object",
"properties": {
"id": {
"type": "integer"
},
"windowId": {
"type": "integer"
},
"active": {
"type": "boolean"
},
"sortType": {
"type": "string",
"description": "**Note:** ``sortType`` and ``sortOrder`` depend on each other, so both should be present, or neither.",
"optional": true,
"enum": [
"none",
"date",
"subject",
"author",
"id",
"thread",
"priority",
"status",
"size",
"flagged",
"unread",
"recipient",
"location",
"tags",
"junkStatus",
"attachments",
"account",
"custom",
"received",
"correspondent"
]
},
"sortOrder": {
"type": "string",
"description": "**Note:** ``sortType`` and ``sortOrder`` depend on each other, so both should be present, or neither.",
"optional": true,
"enum": ["none", "ascending", "descending"]
},
"viewType": {
"type": "string",
"optional": true,
"enum": ["ungrouped", "groupedByThread", "groupedBySortType"]
},
"layout": {
"type": "string",
"enum": ["standard", "wide", "vertical"]
},
"folderPaneVisible": {
"type": "boolean",
"optional": true
},
"messagePaneVisible": {
"type": "boolean",
"optional": true
},
"displayedFolder": {
"$ref": "folders.MailFolder",
"optional": true,
"description": "The accountsRead permission is required for this property to be included."
}
}
},
{
"id": "QuickFilterTextDetail",
"type": "object",
"properties": {
"text": {
"type": "string",
"description": "String to match against the ``recipients``, ``author``, ``subject``, or ``body``."
},
"recipients": {
"type": "boolean",
"description": "Shows messages where ``text`` matches the recipients.",
"optional": true
},
"author": {
"type": "boolean",
"description": "Shows messages where ``text`` matches the author.",
"optional": true
},
"subject": {
"type": "boolean",
"description": "Shows messages where ``text`` matches the subject.",
"optional": true
},
"body": {
"type": "boolean",
"description": "Shows messages where ``text`` matches the message body.",
"optional": true
}
}
}
],
"functions": [
{
"name": "query",
"type": "function",
"description": "Gets all mail tabs that have the specified properties, or all mail tabs if no properties are specified.",
"async": "callback",
"parameters": [
{
"type": "object",
"name": "queryInfo",
"optional": true,
"default": {},
"properties": {
"active": {
"type": "boolean",
"optional": true,
"description": "Whether the tabs are active in their windows."
},
"currentWindow": {
"type": "boolean",
"optional": true,
"description": "Whether the tabs are in the current window."
},
"lastFocusedWindow": {
"type": "boolean",
"optional": true,
"description": "Whether the tabs are in the last focused window."
},
"windowId": {
"type": "integer",
"optional": true,
"minimum": -2,
"description": "The ID of the parent window, or :ref:`windows.WINDOW_ID_CURRENT` for the current window."
}
}
},
{
"type": "function",
"name": "callback",
"optional": true,
"parameters": [
{
"type": "array",
"items": {
"$ref": "MailTab"
}
}
]
}
]
},
{
"name": "get",
"type": "function",
"description": "Get the properties of a mail tab.",
"async": "callback",
"parameters": [
{
"name": "tabId",
"type": "integer",
"description": "ID of the requested mail tab. Throws if the requested tab is not a mail tab."
},
{
"type": "function",
"name": "callback",
"optional": true,
"parameters": [
{
"$ref": "MailTab"
}
]
}
]
},
{
"name": "getCurrent",
"type": "function",
"description": "Get the properties of the active mail tab, if the active tab is a mail tab. Returns undefined otherwise.",
"async": "callback",
"parameters": [
{
"type": "function",
"name": "callback",
"optional": true,
"parameters": [
{
"$ref": "MailTab",
"optional": true
}
]
}
]
},
{
"name": "update",
"type": "function",
"description": "Modifies the properties of a mail tab. Properties that are not specified in ``updateProperties`` are not modified.",
"async": true,
"parameters": [
{
"name": "tabId",
"type": "integer",
"description": "Defaults to the active tab of the current window.",
"optional": true,
"minimum": 1
},
{
"name": "updateProperties",
"type": "object",
"properties": {
"displayedFolder": {
"$ref": "folders.MailFolder",
"description": "Sets the folder displayed in the tab. The extension must have the accountsRead permission to do this. The previous message selection in the given folder will be restored.",
"optional": true
},
"sortType": {
"type": "string",
"description": "Sorts the list of messages. ``sortOrder`` must also be given.",
"optional": true,
"enum": [
"none",
"date",
"subject",
"author",
"id",
"thread",
"priority",
"status",
"size",
"flagged",
"unread",
"recipient",
"location",
"tags",
"junkStatus",
"attachments",
"account",
"custom",
"received",
"correspondent"
]
},
"sortOrder": {
"type": "string",
"description": "Sorts the list of messages. ``sortType`` must also be given.",
"optional": true,
"enum": ["none", "ascending", "descending"]
},
"viewType": {
"type": "string",
"optional": true,
"enum": ["ungrouped", "groupedByThread", "groupedBySortType"]
},
"layout": {
"type": "string",
"description": "Sets the arrangement of the folder pane, message list pane, and message display pane. Note that setting this applies it to all mail tabs.",
"optional": true,
"enum": ["standard", "wide", "vertical"]
},
"folderPaneVisible": {
"type": "boolean",
"description": "Shows or hides the folder pane.",
"optional": true
},
"messagePaneVisible": {
"type": "boolean",
"description": "Shows or hides the message display pane.",
"optional": true
}
}
}
]
},
{
"name": "getSelectedMessages",
"type": "function",
"description": "Lists the selected messages in the current folder.",
"permissions": ["messagesRead"],
"async": "callback",
"parameters": [
{
"name": "tabId",
"type": "integer",
"description": "Defaults to the active tab of the current window.",
"optional": true,
"minimum": 1
},
{
"type": "function",
"name": "callback",
"optional": true,
"parameters": [
{
"$ref": "messages.MessageList"
}
]
}
]
},
{
"name": "setSelectedMessages",
"type": "function",
"description": "Selects none, one or multiple messages.",
"permissions": ["messagesRead", "accountsRead"],
"async": true,
"parameters": [
{
"name": "tabId",
"type": "integer",
"description": "Defaults to the active tab of the current window.",
"optional": true,
"minimum": 1
},
{
"name": "messageIds",
"type": "array",
"description": "The IDs of the messages, which should be selected. The mailTab will switch to the folder of the selected messages. Throws if they belong to different folders. Array can be empty to deselect any currently selected message.",
"items": {
"type": "integer"
}
}
]
},
{
"name": "setQuickFilter",
"type": "function",
"description": "Sets the Quick Filter user interface based on the options specified.",
"async": true,
"parameters": [
{
"name": "tabId",
"type": "integer",
"description": "Defaults to the active tab of the current window.",
"optional": true,
"minimum": 1
},
{
"name": "properties",
"type": "object",
"properties": {
"show": {
"type": "boolean",
"description": "Shows or hides the Quick Filter bar.",
"optional": true
},
"unread": {
"type": "boolean",
"description": "Shows only unread messages.",
"optional": true
},
"flagged": {
"type": "boolean",
"description": "Shows only flagged messages.",
"optional": true
},
"contact": {
"type": "boolean",
"description": "Shows only messages from people in the address book.",
"optional": true
},
"tags": {
"optional": true,
"choices": [
{
"type": "boolean"
},
{
"$ref": "messages.TagsDetail"
}
],
"description": "Shows only messages with tags on them."
},
"attachment": {
"type": "boolean",
"description": "Shows only messages with attachments.",
"optional": true
},
"text": {
"$ref": "QuickFilterTextDetail",
"description": "Shows only messages matching the supplied text.",
"optional": true
}
}
}
]
}
],
"events": [
{
"name": "onDisplayedFolderChanged",
"type": "function",
"description": "Fired when the displayed folder changes in any mail tab.",
"permissions": ["accountsRead"],
"parameters": [
{
"name": "tab",
"$ref": "tabs.Tab"
},
{
"name": "displayedFolder",
"$ref": "folders.MailFolder"
}
]
},
{
"name": "onSelectedMessagesChanged",
"type": "function",
"description": "Fired when the selected messages change in any mail tab.",
"permissions": ["messagesRead"],
"parameters": [
{
"name": "tab",
"$ref": "tabs.Tab"
},
{
"name": "selectedMessages",
"$ref": "messages.MessageList"
}
]
}
]
}
]