Class Feature
- Defined in: Feature.js
Constructor Attributes | Constructor Name and Description |
---|---|
Feature(id, url, feature)
|
Field Attributes | Field Name and Description |
---|---|
The feature’s unique identifier.
|
Method Summary
Method Attributes | Method Name and Description |
---|---|
<static> |
Feature.add(id, url, feature)
Adds a feature to the registry.
|
<static> |
Feature.get(id)
Retrieves a feature from the registry.
|
<static> |
Feature.getPermission(action)
Wrapper for the Feature._getPermission method.
|
<static> |
Feature.invoke(id, callback)
Invokes a (callback) function for a feauture.
|
<static> |
Feature.list()
Lists all available features in the registry.
|
<static> |
Feature.remove(feature)
Removes a feature from the registry.
|
Class Detail
Feature(id, url, feature)
- Parameters:
- {String} id
- A unique identifier for the feature.
- {String} url
- The URL of the website providing further information about the feature.
- {Object} feature
- The initial properties of the feature.
Field Detail
{String}
id
The feature’s unique identifier.
Method Detail
-
Adds a feature to the registry.
- Parameters:
- id
- url
- feature
-
Retrieves a feature from the registry.
- Parameters:
- {String} id
- The identifier of the desired feature.
- Returns:
- {Feature}
-
<static> {Boolean} Feature.getPermission(action)Wrapper for the Feature._getPermission method. All registered features will be evaluated.
- Parameters:
- {String} action
- The desired action to be invoked.
- Returns:
- {Boolean}
-
<static> {Object} Feature.invoke(id, callback)Invokes a (callback) function for a feauture.
- Parameters:
- {String} id
- The identifier of the desired feature. '*' can be used to address all available features.
- {Function|String} callback
- The callback function or the name of method of the feature.
- Returns:
- {Object}
-
Lists all available features in the registry.
- Returns:
- {Feature[]}
-
<static> {Number} Feature.remove(feature)Removes a feature from the registry.
- Parameters:
- {Feature} feature
- The feature object to be removed.
- Returns:
- {Number} The resulting number of features still in the registry.