Merge pull request #4502 from clicman/master

Add chrome.browser type
This commit is contained in:
Masahiro Wakame
2015-05-31 10:15:05 -07:00

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
////////////////////