Update chrome settings interface

This fixes two errors in the settings interface for chrome: the
interface was completely missing the clear method and the callback
parameter of the get method was defined as being an object instead of
a function.

This also adds a test for the settings interface.
This commit is contained in:
Jonathan Pevarnek
2015-04-09 16:50:08 -04:00
parent 4c9851e6e8
commit c60c192f1b
2 changed files with 32 additions and 3 deletions
+9 -3
View File
@@ -2061,8 +2061,11 @@ declare module chrome.ttsEngine {
// Types
////////////////////
declare module chrome.types {
interface ChromeSettingSetDetails {
interface ChromeSettingClearDetails {
scope?: string;
}
interface ChromeSettingSetDetails extends ChromeSettingClearDetails {
value: any;
}
@@ -2070,6 +2073,8 @@ declare module chrome.types {
incognito?: boolean;
}
type DetailsCallback = (details: ChromeSettingGetResultDetails) => void;
interface ChromeSettingGetResultDetails {
levelOfControl: string;
value: any;
@@ -2077,7 +2082,7 @@ declare module chrome.types {
}
interface ChromeSettingChangedEvent extends chrome.events.Event {
addListener(callback: (details: ChromeSettingGetResultDetails) => void): void;
addListener(callback: DetailsCallback): void;
}
interface ChromeSetting {
@@ -2086,7 +2091,8 @@ declare module chrome.types {
callback?: Function;
};
set(details: ChromeSettingSetDetails, callback?: Function): void;
get(details: ChromeSettingGetDetails, callback?: ChromeSettingGetResultDetails): void;
get(details: ChromeSettingGetDetails, callback?: DetailsCallback): void;
clear(details: ChromeSettingClearDetails, callback?: Function): void;
onChange: ChromeSettingChangedEvent;
}
}