Home > @uniformdev/canvas > EnhancerBuilder

EnhancerBuilder class

Builds a definition of the enhancers to run on Canvas components to add data from other systems. Note that only the first matching enhancer will be run.

Signature:

Methods

MethodModifiersDescription
component(name, builder)Targets a subset of enhancers at a specific component type. Global enhancers will still be run if no matching enhancer is registered for this component's properties.
data(name, enhancer)Targets an enhancer to set a specific object key on the component's <code>data</code> property. Note: an exception will be thrown if the same key is registered more than once.
parameter(enhancer)Targets an enhancer to modify the value of any parameter
parameterName(name, enhancer)Targets an enhancer to modify the value of any parameter with a specific name
parameterType(type, enhancer)Targets an enhancer to modify the value of any parameter with a specific type
resolveComponentEnhancers(component)Resolves component enhancer(s) for a given component. Returns a Map where the key is the name of the data property and the value is the enhancer.
resolveParameterEnhancer(component, parameterName, parameter)Resolves the parameter enhancer for a given parameter, if one exists. The first matching enhancer by registration order is returned, if more than one could match.