cr.exportPath('cr.onc');
-/**
- * @typedef {(Object|Array|string|undefined)}
- */
-cr.onc.OncValue;
-
cr.define('cr.onc', function() {
'use strict';
/**
* Returns either a managed property dictionary or an unmanaged value.
* @param {string} key The property key.
- * @return {cr.onc.OncValue} The property value or dictionary if it exists,
- * otherwise undefined.
+ * @return {?} The property value or dictionary if it exists, otherwise
+ * undefined.
*/
getManagedProperty: function(key) {
var data = this.data_;
/**
* Gets the active value of a property.
* @param {string} key The property key.
- * @return {cr.onc.OncValue} The property value or undefined.
+ * @return {?} The property value or undefined.
*/
getActiveValue: function(key) {
var property = this.getManagedProperty(key);
* Gets the translated ONC value from the result of getActiveValue() using
* loadTimeData. If no translation exists, returns the untranslated value.
* @param {string} key The property key.
- * @return {cr.onc.OncValue} The translation if available or the value if
- * not.
+ * @return {?} The translation if available or the value if not.
*/
getTranslatedValue: function(key) {
var value = this.getActiveValue(key);
/**
* Gets the recommended value of a property.
* @param {string} key The property key.
- * @return {cr.onc.OncValue} The property value or undefined.
+ * @return {?} The property value or undefined.
*/
getRecommendedValue: function(key) {
var property = this.getManagedProperty(key);
var source = this.getActiveValue('Source');
if (source == undefined)
return 'None';
+ assert(typeof source == 'string');
return source;
},
var security = this.getActiveValue('WiFi.Security');
if (security == undefined)
return 'None';
+ assert(typeof security == 'string');
return security;
},
/**
* Get the effective value from a Managed property ONC dictionary.
* @param {Object} property The managed property ONC dictionary.
- * @return {cr.onc.OncValue} The effective value or undefined.
+ * @return {?} The effective value or undefined.
* @private
*/
getEffectiveValueFromProperty_: function(property) {