Index: third_party/closure_compiler/externs/settings_private.js |
diff --git a/third_party/closure_compiler/externs/settings_private.js b/third_party/closure_compiler/externs/settings_private.js |
new file mode 100644 |
index 0000000000000000000000000000000000000000..531974e3f6865480b636593ff3e3abe11ab367da |
--- /dev/null |
+++ b/third_party/closure_compiler/externs/settings_private.js |
@@ -0,0 +1,115 @@ |
+// Copyright 2015 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+/** @fileoverview Externs generated from namespace: settingsPrivate */ |
Jeremy Klein
2015/03/20 22:06:42
@externs
Oren Blasberg
2015/03/20 23:30:30
Done.
Oren Blasberg
2015/03/20 23:30:31
Done.
|
+ |
+/** |
+ * @enum {string} |
+ */ |
+chrome.settingsPrivate.PrefType = { |
stevenjb
2015/03/20 21:53:48
With networkingPrivate, it seems that the extensio
Oren Blasberg
2015/03/20 23:30:30
Done.
|
+ BOOLEAN: 'boolean', |
+ NONE: 'none', |
+ NUMBER: 'number', |
+ STRING: 'string', |
+ URL: 'url' |
+}; |
+ |
+/** |
+ * @enum {string} |
+ */ |
+chrome.settingsPrivate.PrefSource = { |
Jeremy Klein
2015/03/20 22:06:42
These enums shouldn't really be in externs because
Oren Blasberg
2015/03/20 23:30:30
Done.
Oren Blasberg
2015/03/20 23:30:31
As discussed offline we will keep these since C++
|
+ DEVICE: 'device', |
+ NONE: 'none', |
+ USER: 'user' |
+}; |
+ |
+/** |
+ * @typedef {{ |
+ * key: string, |
+ * type: chrome.settingsPrivate.PrefType, |
+ * value: *, |
+ * source: chrome.settingsPrivate.PrefSource |
+ * }} |
+ */ |
+var PrefObject; |
stevenjb
2015/03/20 21:53:48
Shouldn't these be chrome.settingsPrivate.PrefObje
Jeremy Klein
2015/03/20 22:06:42
+1. Check out some of the typedefs in https://code
Oren Blasberg
2015/03/20 23:30:30
Done.
|
+ |
+/** |
+ * @typedef {function(success)} |
+ */ |
+var OnPrefSetCallback; |
+ |
+/** |
+ * @typedef {function(!Array<PrefObject>)} |
+ */ |
+var GetAllPrefsCallback; |
+ |
+/** |
+ * @typedef {function(PrefObject)} |
+ */ |
+var GetPrefCallback; |
+ |
+/** |
+ * @const |
+ */ |
+chrome.settingsPrivate = {}; |
+ |
+/** |
+ * Sets a boolean settings value. |
+ * @param {string} name |
+ * @param {boolean} value |
+ * @param {OnPrefSetCallback} callback |
+ * @return {boolean} Returns true if |name| matches a valid key (i.e. a |
+ * PrefObject key from getAllPrefs), or returns false and sets an error if |
+ * it does not. |
+ */ |
+chrome.settingsPrivate.setBooleanPref = function(name, value) {}; |
+ |
+/** |
+ * Sets a number settings value. |
+ * @param {string} name |
+ * @param {number} value |
+ * @param {OnPrefSetCallback} callback |
+ * @return {boolean} Returns true if |name| matches a valid key (i.e. a |
+ * PrefObject key from getAllPrefs), or returns false and sets an error if |
+ * it does not. |
+ */ |
+chrome.settingsPrivate.setNumericPref = function(name, value) {}; |
+ |
+/** |
+ * Sets a string settings value. |
+ * @param {string} name |
+ * @param {string} value |
+ * @param {OnPrefSetCallback} callback |
+ * @return {boolean} Returns true if |name| matches a valid key (i.e. a |
+ * PrefObject key from getAllPrefs), or returns false and sets an error if |
+ * it does not. |
+ */ |
+chrome.settingsPrivate.setStringPref = function(name, value) {}; |
+ |
+/** |
+ * Sets a URL settings value. |
+ * @param {string} name |
+ * @param {string} value |
+ * @param {OnPrefSetCallback} callback |
+ * @return {boolean} Returns true if |name| matches a valid key (i.e. a |
+ * PrefObject key from getAllPrefs), or returns false and sets an error if |
+ * it does not. |
+ */ |
+chrome.settingsPrivate.setURLPref = function(name, value) {}; |
+ |
+/** |
+ * Gets all the prefs. |
+ * @param {GetAllPrefsCallback} callback |
+ */ |
+chrome.settingsPrivate.getAllPrefs = function(callback) {}; |
+ |
+/** |
+ * Gets the value of a specific pref. |
+ * @param {string} name |
+ * @param {GetPrefCallback} callback |
+ */ |
+chrome.settingsPrivate.getPref = function(name, callback) {}; |
+ |
+/** @type {!ChromeEvent} */ |
+chrome.settingsPrivate.onPrefsChanged; |