ListWalker (list/documentlist/utils)
@ckeditor/ckeditor5-list/src/documentlist/utils/listwalker
Document list blocks iterator.
Filtering
Properties
-
_higherIndent : Boolean
module:list/documentlist/utils/listwalker~ListWalker#_higherIndent
private
Whether blocks with a higher indent level than the start block should be included in the result.
-
_includeSelf : Boolean
module:list/documentlist/utils/listwalker~ListWalker#_includeSelf
private
Whether start block should be included in the result (if it's matching other criteria).
-
_isForward : Boolean
module:list/documentlist/utils/listwalker~ListWalker#_isForward
private
The iterating direction.
-
_lowerIndent : Boolean
module:list/documentlist/utils/listwalker~ListWalker#_lowerIndent
private
Whether blocks with a lower indent level than the start block should be included in the result.
-
_referenceIndent : Number
module:list/documentlist/utils/listwalker~ListWalker#_referenceIndent
private
The reference indent. Initialized by the indent of the start block.
-
_sameAttributes : Array.<String>
module:list/documentlist/utils/listwalker~ListWalker#_sameAttributes
private
Additional attributes that must be the same for each block.
-
_sameIndent : Boolean
module:list/documentlist/utils/listwalker~ListWalker#_sameIndent
private
Whether blocks with the same indent level as the start block should be included in the result.
-
_startElement : Element
module:list/documentlist/utils/listwalker~ListWalker#_startElement
private
The start list item block element.
Methods
-
constructor( startElement, options = { [options.direction], [options.includeSelf], [options.sameAttributes], [options.sameIndent], [options.lowerIndent], [options.higherIndent] } )
module:list/documentlist/utils/listwalker~ListWalker#constructor
Creates a document list iterator.
Parameters
startElement : Element
The start list item block element.
options : Object
-
Properties
[ options.direction ] : 'forward' | 'backward'
The iterating direction.
Defaults to
'backward'
[ options.includeSelf ] : Boolean
Whether start block should be included in the result (if it's matching other criteria).
Defaults to
false
[ options.sameAttributes ] : Array.<String> | String
Additional attributes that must be the same for each block.
Defaults to
[]
[ options.sameIndent ] : Boolean
Whether blocks with the same indent level as the start block should be included in the result.
Defaults to
false
[ options.lowerIndent ] : Boolean
Whether blocks with a lower indent level than the start block should be included in the result.
Defaults to
false
[ options.higherIndent ] : Boolean
Whether blocks with a higher indent level than the start block should be included in the result.
Defaults to
false
-
Symbol.iterator() → Iterable.<Element>
module:list/documentlist/utils/listwalker~ListWalker#Symbol.iterator
Iterable interface.
Returns
Iterable.<Element>
-
_getStartNode() → Element
module:list/documentlist/utils/listwalker~ListWalker#_getStartNode
private
Returns the model element to start iterating.
Returns
Static methods
-
first( startElement, options = { [options.direction], [options.includeSelf], [options.sameAttributes], [options.sameIndent], [options.lowerIndent], [options.higherIndent] } ) → Element | null
module:list/documentlist/utils/listwalker~ListWalker.first
static
Performs only first step of iteration and returns the result.
Parameters
startElement : Element
The start list item block element.
options : Object
-
Properties
[ options.direction ] : 'forward' | 'backward'
The iterating direction.
Defaults to
'backward'
[ options.includeSelf ] : Boolean
Whether start block should be included in the result (if it's matching other criteria).
Defaults to
false
[ options.sameAttributes ] : Array.<String> | String
Additional attributes that must be the same for each block.
Defaults to
[]
[ options.sameIndent ] : Boolean
Whether blocks with the same indent level as the start block should be included in the result.
Defaults to
false
[ options.lowerIndent ] : Boolean
Whether blocks with a lower indent level than the start block should be included in the result.
Defaults to
false
[ options.higherIndent ] : Boolean
Whether blocks with a higher indent level than the start block should be included in the result.
Defaults to
false
Returns
Element | null
Every day, we work hard to keep our documentation complete. Have you spotted an outdated information? Is something missing? Please report it via our issue tracker.