/**
* Namespace: browser.sidebarAction
* Generated from Mozilla sources. Do not manually edit!
*
* Use sidebar actions to add a sidebar to Firefox.
* Permissions: "manifest:sidebar_action"
*
* Comments found in source JSON schema files:
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
export declare namespace SidebarAction {
/**
* Pixel data for an image. Must be an ImageData object (for example, from a canvas element).
*/
interface ImageDataType {
}
interface SetTitleDetailsType {
/**
* The string the sidebar action should display when moused over.
*/
title: string | null;
/**
* Sets the sidebar title for the tab specified by tabId. Automatically resets when the tab is closed.
* Optional.
*/
tabId?: number;
/**
* Sets the sidebar title for the window specified by windowId.
* Optional.
*/
windowId?: number;
}
interface GetTitleDetailsType {
/**
* Specify the tab to get the title from. If no tab nor window is specified, the global title is returned.
* Optional.
*/
tabId?: number;
/**
* Specify the window to get the title from. If no tab nor window is specified, the global title is returned.
* Optional.
*/
windowId?: number;
}
interface SetIconDetailsType {
/**
* Either an ImageData object or a dictionary {size -> ImageData} representing icon to be set. If the icon is specified as a dictionary, the actual image to be used is chosen depending on screen's pixel density. If the number of image pixels that fit into one screen space unit equals scale, then image with size scale * 19 will be selected. Initially only scales 1 and 2 will be supported. At least one image must be specified. Note that 'details.imageData = foo' is equivalent to 'details.imageData = {'19': foo}'
* Optional.
*/
imageData?: ImageDataType | {[s:string]:ImageDataType};
/**
* Either a relative image path or a dictionary {size -> relative image path} pointing to icon to be set. If the icon is specified as a dictionary, the actual image to be used is chosen depending on screen's pixel density. If the number of image pixels that fit into one screen space unit equals scale, then image with size scale * 19 will be selected. Initially only scales 1 and 2 will be supported. At least one image must be specified. Note that 'details.path = foo' is equivalent to 'details.imageData = {'19': foo}'
* Optional.
*/
path?: string | SetIconDetailsTypePathC2Type;
/**
* Sets the sidebar icon for the tab specified by tabId. Automatically resets when the tab is closed.
* Optional.
*/
tabId?: number;
/**
* Sets the sidebar icon for the window specified by windowId.
* Optional.
*/
windowId?: number;
}
interface SetPanelDetailsType {
/**
* Sets the sidebar url for the tab specified by tabId. Automatically resets when the tab is closed.
* Optional.
*/
tabId?: number;
/**
* Sets the sidebar url for the window specified by windowId.
* Optional.
*/
windowId?: number;
/**
* The url to the html file to show in a sidebar. If set to the empty string (''), no sidebar is shown.
*/
panel: string | null;
}
interface GetPanelDetailsType {
/**
* Specify the tab to get the panel from. If no tab nor window is specified, the global panel is returned.
* Optional.
*/
tabId?: number;
/**
* Specify the window to get the panel from. If no tab nor window is specified, the global panel is returned.
* Optional.
*/
windowId?: number;
}
interface IsOpenDetailsType {
/**
* Specify the window to get the openness from.
* Optional.
*/
windowId?: number;
}
interface SetIconDetailsTypePathC2Type {
}
interface Static {
/**
* Sets the title of the sidebar action. This shows up in the tooltip.
*
* @param details
* @returns Promise
*/
setTitle(details: SetTitleDetailsType): Promise;
/**
* Gets the title of the sidebar action.
*
* @param details
* @returns Promise
*/
getTitle(details: GetTitleDetailsType): Promise;
/**
* Sets the icon for the sidebar action. The icon can be specified either as the path to an image file or as the pixel data from a canvas element, or as dictionary of either one of those. Either the path or the imageData property must be specified.
*
* @param details
* @returns Promise
*/
setIcon(details: SetIconDetailsType): Promise;
/**
* Sets the url to the html document to be opened in the sidebar when the user clicks on the sidebar action's icon.
*
* @param details
* @returns Promise
*/
setPanel(details: SetPanelDetailsType): Promise;
/**
* Gets the url to the html document set as the panel for this sidebar action.
*
* @param details
* @returns Promise
*/
getPanel(details: GetPanelDetailsType): Promise;
/**
* Opens the extension sidebar in the active window.
*
* @returns Promise
*/
open(): Promise;
/**
* Closes the extension sidebar in the active window if the sidebar belongs to the extension.
*
* @returns Promise
*/
close(): Promise;
/**
* Toggles the extension sidebar in the active window.
*/
toggle(): void;
/**
* Checks whether the sidebar action is open.
*
* @param details
* @returns Promise
*/
isOpen(details: IsOpenDetailsType): Promise;
}
}