Add chrome.browser type

This commit is contained in:
Viktor Sidochenko
2015-05-31 19:37:57 +05:00
parent aae45edc2a
commit 47ccfe38b5

31
chrome/chrome.d.ts vendored
View File

@@ -43,6 +43,37 @@ declare module chrome.alarms {
var onAlarm: AlarmEvent;
}
/**
* Use the chrome.browser API to interact with the Chrome browser associated with
* the current application and Chrome profile.
*/
declare module chrome.browser {
interface Options {
/**
* The URL to navigate to when the new tab is initially opened.
*/
url:string;
}
/**
* Opens a new tab in a browser window associated with the current application
* and Chrome profile. If no browser window for the Chrome profile is opened,
* a new one is opened prior to creating the new tab.
* @param options Configures how the tab should be opened.
* @param callback Called when the tab was successfully
* created, or failed to be created. If failed, runtime.lastError will be set.
*/
export function openTab (options: Options, callback: () => void): void;
/**
* Opens a new tab in a browser window associated with the current application
* and Chrome profile. If no browser window for the Chrome profile is opened,
* a new one is opened prior to creating the new tab. Since Chrome 42 only.
* @param options Configures how the tab should be opened.
*/
export function openTab (options: Options): void;
}
////////////////////
// Bookmarks
////////////////////