TokenList (engine/view)
@ckeditor/ckeditor5-engine/src/view/tokenlist
Token list. Allows handling (adding, removing, retrieving) a set of tokens (for example class names).
Filtering
Properties
-
Returns true if token list has no tokens set.
-
Number of tokens.
-
The set of tokens.
Methods
-
clear() → voidmodule:engine/view/tokenlist~TokenList#clear -
has( name ) → booleanmodule:engine/view/tokenlist~TokenList#has -
isSimilar( other ) → booleanmodule:engine/view/tokenlist~TokenList#isSimilar -
keys() → Array<string>module:engine/view/tokenlist~TokenList#keys -
remove( tokens ) → voidmodule:engine/view/tokenlist~TokenList#remove -
set( tokens ) → voidmodule:engine/view/tokenlist~TokenList#setSets a given token without affecting other tokens.
Parameters
tokens : ArrayOrItem<string>
Returns
void
-
setTo( value ) → thismodule:engine/view/tokenlist~TokenList#setTo -
toString() → stringmodule:engine/view/tokenlist~TokenList#toString -
Used by
_canMergeAttributesFromto verify if the given attribute can be merged without conflicts into the attribute.This method is indirectly used by the
DowncastWriterwhile downcasting anAttributeElementto merge it with otherAttributeElement.Returns
boolean
-
-
internal
_getConsumables( [ name ] ) → Array<string>module:engine/view/tokenlist~TokenList#_getConsumablesReturns a list of consumables for the attribute.
Could be filtered by the given token name.
Parameters
[ name ] : string
Returns
Array<string>
-
internal
_getTokensMatch( tokenPattern ) → undefined | Array<string>module:engine/view/tokenlist~TokenList#_getTokensMatchUsed by the Matcher to collect matching attribute tokens.
Parameters
tokenPattern : string | true | RegExpThe matched token name pattern.
Returns
undefined | Array<string>An array of matching tokens.
-
Used by
_canSubtractAttributesOfto verify if the given attribute can be fully subtracted from the attribute.This method is indirectly used by the
DowncastWriterwhile down-casting anAttributeElementto unwrap the AttributeElement.Parameters
other : TokenList
Returns
boolean
-
Used by
_mergeAttributesFromto merge a given attribute into the attribute.This method is indirectly used by the
DowncastWriterwhile down-casting anAttributeElementto merge it with other AttributeElement.Parameters
other : TokenList
Returns
void
Every day, we work hard to keep our documentation complete. Have you spotted outdated information? Is something missing? Please report it via our issue tracker.
With the release of version 42.0.0, we have rewritten much of our documentation to reflect the new import paths and features. We appreciate your feedback to help us ensure its accuracy and completeness.