AutomaticLinkDecorators
Helper class that ties together all LinkDecoratorAutomaticDefinition and provides the downcast dispatchers for them.
Properties
length : numberreadonlymodule:link/utils/automaticdecorators~AutomaticLinkDecorators#lengthGives information about the number of decorators stored in the
AutomaticLinkDecoratorsinstance._conflictChecker : LinkDecoratorConflictChecker | undefinedprivatemodule:link/utils/automaticdecorators~AutomaticLinkDecorators#_conflictCheckerA callback that checks if a decorator can be applied to a given element. Returns
trueif there is a conflict preventing the decorator from being applied._definitions : Set<NormalizedLinkDecoratorAutomaticDefinition>privatemodule:link/utils/automaticdecorators~AutomaticLinkDecorators#_definitionsStores the definition of automatic decorators. This data is used as a source for a downcast dispatcher to create a proper conversion to output data.
Methods
add( item ) → voidmodule:link/utils/automaticdecorators~AutomaticLinkDecorators#addAdds automatic decorator objects or an array with them to be used during downcasting.
Parameters
item : ArrayOrItem<NormalizedLinkDecoratorAutomaticDefinition>A configuration object of automatic rules for decorating links. It might also be an array of such objects.
Returns
void
getDispatcher() → ( dispatcher: DowncastDispatcher ) => voidmodule:link/utils/automaticdecorators~AutomaticLinkDecorators#getDispatcherProvides the conversion helper used in the
addmethod.Returns
( dispatcher: DowncastDispatcher ) => voidA dispatcher function used as conversion helper in
add.
getDispatcherForLinkedImage() → ( dispatcher: DowncastDispatcher ) => voidmodule:link/utils/automaticdecorators~AutomaticLinkDecorators#getDispatcherForLinkedImageProvides the conversion helper used in the
addmethod when linking images.Returns
( dispatcher: DowncastDispatcher ) => voidA dispatcher function used as conversion helper in
add.
setConflictChecker( checker ) → voidmodule:link/utils/automaticdecorators~AutomaticLinkDecorators#setConflictCheckerSets a callback that checks if a decorator can be applied to a given element.
Parameters
checker : LinkDecoratorConflictCheckerA function that returns
trueif there is a conflict preventing the decorator from being applied.
Returns
void