mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-01 12:42:58 +08:00
Add chrome.browser type
This commit is contained in:
31
chrome/chrome.d.ts
vendored
31
chrome/chrome.d.ts
vendored
@@ -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
|
||||
////////////////////
|
||||
|
||||
Reference in New Issue
Block a user