API Status: Development
new (require("bajaux/registry/Registry"))( [obj])
Parameters:
| Name | Type | Argument | Description |
|---|---|---|---|
obj |
Object |
<optional> |
a JSON object to use to initially build this registry |
- Since:
-
- Niagara 4.10
- Mixes In:
- tinyevents
Methods
-
getLocal()
-
Returns:
-
queryAll(value, params)
-
By default, just queries from the entries registered locally. Most likely,
subclasses will override this with something more useful.Parameters:
Name Type Description value* paramsmodule:bajaux/registry/Registry~QueryParams Returns:
promise to be resolved with an array of all matching
RegistryEntrys- Type
- Promise.<Array.<module:bajaux/registry/RegistryEntry>>
-
queryFirst(value, params)
-
By default, just queries from the entries registered locally. Most likely,
subclasses will override this with something more useful.Parameters:
Name Type Description value* paramsmodule:bajaux/registry/Registry~QueryParams Returns:
promise to be resolved with the first matching
RegistryEntry- Type
- Promise.<module:bajaux/registry/RegistryEntry>
-
register(key [, params])
-
Register a RequireJS module ID locally for the given key. Upon
completion, will cause the registry to emit achangedtinyevent.Parameters:
Name Type Argument Description keyString paramsmodule:bajaux/registry/Registry~QueryParams <optional>
query parameters/metadata for this RequireJS module
Returns:
promise to be resolved after registration is complete
- Type
- Promise
-
resolveAll(value, params)
-
Perform a query on the registry and resolve all RequireJS modules
represented. This will resolve an array of Widget constructors, menu
agent functions, etc.Parameters:
Name Type Description value* paramsmodule:bajaux/registry/Registry~QueryParams Returns:
promise to be resolved with an array of the
exported results of all RequireJS modules represented, or empty if none
found; rejected if the station could not be successfully queried for
registry info, or if any of the RequireJS modules failed to resolve- Type
- Promise.<Array.<*>>
-
resolveFirst(value, params)
-
Perform a query on the registry and attempt to resolve the first
matching entry's RequireJS module. Note that this differs fromresolveAll
in that if the first entry fails to resolve (for instance, an invalid
RequireJS module ID), it will move on to the next entry and keep trying
to resolve all the way down until it can resolve something.Parameters:
Name Type Description value* paramsmodule:bajaux/registry/Registry~QueryParams Returns:
promise to be resolved with the exported
results of the first matching entry that successfully resolves its
RequireJS module ID, or undefined if none found- Type
- Promise.<*>
-
toJSON()
-
Return an object suitable for serialization using
JSON.stringifyor
similar. The returned object can be passed right back to a
Registryconstructor to reconstitute later.Returns:
- Type
- Object
Type Definitions
-
QueryParams
-
Query parameters to narrow the results resolved for a given registry key.
Type:
- Object
Properties:
Name Type Argument Description rjsString <optional>
If given, only resolve entries that have this
particular RequireJS ID.depsArray.<String> <optional>
If given, only resolve entries that have
this exact set of RequireJS dependencies.hasAnyArray.<String> <optional>
If given, only resolve entries that
have at least one of thesetags.hasAllArray.<String> <optional>
If given, only resolve entries that
have all of thesetags.