B2G/gecko/toolkit/mozapps/extensions/AddonManager.jsm
/**
 * A type of add-on, used by the UI to determine how to display different types
 * of add-ons.
 *
 * @param  aID
 *         The add-on type ID
 * @param  aLocaleURI
 *         The URI of a localized properties file to get the displayable name
 *         for the type from
 * @param  aLocaleKey
 *         The key for the string in the properties file or the actual display
 *         name if aLocaleURI is null. Include %ID% to include the type ID in
 *         the key
 * @param  aViewType
 *         The optional type of view to use in the UI
 * @param  aUIPriority
 *         The priority is used by the UI to list the types in order. Lower
 *         values push the type higher in the list.
 * @param  aFlags
 *         An option set of flags that customize the display of the add-on in
 *         the UI.
 */
A type of add-on, used by the UI to determine how to display different types
of add-ons.

@param  aID
The add-on type ID
@param  aLocaleURI
The URI of a localized properties file to get the displayable name
for the type from
@param  aLocaleKey
The key for the string in the properties file or the actual display
name if aLocaleURI is null. Include %ID% to include the type ID in
the key
@param  aViewType
The optional type of view to use in the UI
@param  aUIPriority
The priority is used by the UI to list the types in order. Lower
values push the type higher in the list.
@param  aFlags
An option set of flags that customize the display of the add-on in
the UI.
A type of add - on used by the UI to determine how to display different types of add - ons . @param aID The add - on type ID @param aLocaleURI The URI of a localized properties file to get the displayable name for the type from @param aLocaleKey The key for the string in the properties file or the actual display name if aLocaleURI is null . Include %ID% to include the type ID in the key @param aViewType The optional type of view to use in the UI @param aUIPriority The priority is used by the UI to list the types in order . Lower values push the type higher in the list . @param aFlags An option set of flags that customize the display of the add - on in the UI .
function AddonType(aID, aLocaleURI, aLocaleKey, aViewType, aUIPriority, aFlags) {
  if (!aID)
    throw Components.Exception("An AddonType must have an ID", Cr.NS_ERROR_INVALID_ARG);
  if (aViewType && aUIPriority === undefined)
    throw Components.Exception("An AddonType with a defined view must have a set UI priority",
                               Cr.NS_ERROR_INVALID_ARG);
  if (!aLocaleKey)
    throw Components.Exception("An AddonType must have a displayable name",
                               Cr.NS_ERROR_INVALID_ARG);
  this.id = aID;
  this.uiPriority = aUIPriority;
  this.viewType = aViewType;
  this.flags = aFlags;
  if (aLocaleURI) {
    this.__defineGetter__("name", function() {
      delete this.name;
      let bundle = Services.strings.createBundle(aLocaleURI);
      this.name = bundle.GetStringFromName(aLocaleKey.replace("%ID%", aID));
      return this.name;
    });
  }
  else {
    this.name = aLocaleKey;
  }
}
function AddonType ( aID , aLocaleURI , aLocaleKey , aViewType , aUIPriority , aFlags ) { if ( ! aID ) throw Components . Exception ( "An AddonType must have an ID" , Cr . NS_ERROR_INVALID_ARG ) ; if ( aViewType && aUIPriority === undefined ) throw Components . Exception ( "An AddonType with a defined view must have a set UI priority" , Cr . NS_ERROR_INVALID_ARG ) ; if ( ! aLocaleKey ) throw Components . Exception ( "An AddonType must have a displayable name" , Cr . NS_ERROR_INVALID_ARG ) ; this . id = aID ; this . uiPriority = aUIPriority ; this . viewType = aViewType ; this . flags = aFlags ; if ( aLocaleURI ) { this . __defineGetter__ ( "name" , function ( ) { delete this . name ; let bundle = Services . strings . createBundle ( aLocaleURI ) ; this . name = bundle . GetStringFromName ( aLocaleKey . replace ( "%ID%" , aID ) ) ; return this . name ; } ) ; } else { this . name = aLocaleKey ; } }
A type of add-on, used by the UI to determine how to display different types
 of add-ons.
A type of add - on used by the UI to determine how to display different types of add - ons .