ListWalker (list/documentlist/utils)
@ckeditor/ckeditor5-list/src/documentlist/utils/listwalker
Document list blocks iterator.
Filtering
Properties
-
Whether blocks with a higher indent level than the start block should be included in the result.
-
Whether start block should be included in the result (if it's matching other criteria).
-
The iterating direction.
-
Whether blocks with a lower indent level than the start block should be included in the result.
-
private
_referenceIndent : number
module:list/documentlist/utils/listwalker~ListWalker#_referenceIndent
The reference indent. Initialized by the indent of the start block.
-
private
_sameAttributes : Array<string>
module:list/documentlist/utils/listwalker~ListWalker#_sameAttributes
Additional attributes that must be the same for each block.
-
Whether blocks with the same indent level as the start block should be included in the result.
-
The start list item block element.
Methods
-
constructor( startElement, options = { [options.direction], [options.higherIndent], [options.includeSelf], [options.lowerIndent], [options.sameAttributes], [options.sameIndent] } )
module:list/documentlist/utils/listwalker~ListWalker#constructor
Creates a document list iterator.
Parameters
startElement : Node
The start list item block element.
options : object
-
Properties
[ options.direction ] : 'forward' | 'backward'
The iterating direction.
[ options.higherIndent ] : boolean
Whether blocks with a higher indent level than the start block should be included in the result.
[ options.includeSelf ] : boolean
Whether start block should be included in the result (if it's matching other criteria).
[ options.lowerIndent ] : boolean
Whether blocks with a lower indent level than the start block should be included in the result.
[ options.sameAttributes ] : ArrayOrItem<string>
Additional attributes that must be the same for each block.
[ options.sameIndent ] : boolean
Whether blocks with the same indent level as the start block should be included in the result.
-
Symbol.iterator() → Iterator<ListElement, any, undefined>
module:list/documentlist/utils/listwalker~ListWalker#Symbol.iterator
-
private
_getStartNode() → null | Node
module:list/documentlist/utils/listwalker~ListWalker#_getStartNode
Static methods
-
static
first( startElement, options = { [options.direction], [options.higherIndent], [options.includeSelf], [options.lowerIndent], [options.sameAttributes], [options.sameIndent] } ) → null | ListElement
module:list/documentlist/utils/listwalker~ListWalker.first
Performs only first step of iteration and returns the result.
Parameters
startElement : Node
The start list item block element.
options : object
-
Properties
[ options.direction ] : 'forward' | 'backward'
The iterating direction.
[ options.higherIndent ] : boolean
Whether blocks with a higher indent level than the start block should be included in the result.
[ options.includeSelf ] : boolean
Whether start block should be included in the result (if it's matching other criteria).
[ options.lowerIndent ] : boolean
Whether blocks with a lower indent level than the start block should be included in the result.
[ options.sameAttributes ] : ArrayOrItem<string>
Additional attributes that must be the same for each block.
[ options.sameIndent ] : boolean
Whether blocks with the same indent level as the start block should be included in the result.
Returns
null | ListElement
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.