From d087e86290ab1caa414b2847a17434a18e19d51b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20H=C3=B8is=C3=A6ther=20Rasch?= Date: Sun, 27 Sep 2015 13:33:48 +0200 Subject: [PATCH] Added/Updated types /w docs --- chrome/chrome.d.ts | 50 +++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 49 insertions(+), 1 deletion(-) diff --git a/chrome/chrome.d.ts b/chrome/chrome.d.ts index 905017e13..e44f5cbd5 100755 --- a/chrome/chrome.d.ts +++ b/chrome/chrome.d.ts @@ -7213,13 +7213,38 @@ declare module chrome.ttsEngine { //////////////////// // Types //////////////////// +/** + * The chrome.types API contains type declarations for Chrome. + * @since Chrome 13. + */ declare module chrome.types { interface ChromeSettingClearDetails { + /** + * Optional. + * The scope of the ChromeSetting. One of + * • regular: setting for the regular profile (which is inherited by the incognito profile if not overridden elsewhere), + * • regular_only: setting for the regular profile only (not inherited by the incognito profile), + * • incognito_persistent: setting for the incognito profile that survives browser restarts (overrides regular preferences), + * • incognito_session_only: setting for the incognito profile that can only be set during an incognito session and is deleted when the incognito session ends (overrides regular and incognito_persistent preferences). + */ scope?: string; } interface ChromeSettingSetDetails extends ChromeSettingClearDetails { + /** + * The value of the setting. + * Note that every setting has a specific value type, which is described together with the setting. An extension should not set a value of a different type. + */ value: any; + /** + * Optional. + * The scope of the ChromeSetting. One of + * • regular: setting for the regular profile (which is inherited by the incognito profile if not overridden elsewhere), + * • regular_only: setting for the regular profile only (not inherited by the incognito profile), + * • incognito_persistent: setting for the incognito profile that survives browser restarts (overrides regular preferences), + * • incognito_session_only: setting for the incognito profile that can only be set during an incognito session and is deleted when the incognito session ends (overrides regular and incognito_persistent preferences). + */ + scope?: string; } interface ChromeSettingGetDetails { @@ -7233,8 +7258,21 @@ declare module chrome.types { type DetailsCallback = (details: ChromeSettingGetResultDetails) => void; interface ChromeSettingGetResultDetails { + /** + * One of + * • not_controllable: cannot be controlled by any extension + * • controlled_by_other_extensions: controlled by extensions with higher precedence + * • controllable_by_this_extension: can be controlled by this extension + * • controlled_by_this_extension: controlled by this extension + */ levelOfControl: string; + /** The value of the setting. */ value: any; + /** + * Optional. + * Whether the effective value is specific to the incognito session. + * This property will only be present if the incognito property in the details parameter of get() was true. + */ incognitoSpecific?: boolean; } @@ -7244,14 +7282,24 @@ declare module chrome.types { /** An interface that allows access to a Chrome browser setting. See accessibilityFeatures for an example. */ interface ChromeSetting { - + /** + * Sets the value of a setting. + * @param details Which setting to change. + * @param callback Optional. Called at the completion of the set operation. + */ set(details: ChromeSettingSetDetails, callback?: Function): void; /** * Gets the value of a setting. * @param details Which setting to consider. */ get(details: ChromeSettingGetDetails, callback?: DetailsCallback): void; + /** + * Clears the setting, restoring any default value. + * @param details Which setting to clear. + * @param callback Optional. Called at the completion of the clear operation. + */ clear(details: ChromeSettingClearDetails, callback?: Function): void; + /** Fired after the setting changes. */ onChange: ChromeSettingChangedEvent; } }