Class

ListWalker (list/documentlist/utils)

@ckeditor/ckeditor5-list/src/documentlist/utils/listwalker

class

Document list blocks iterator.

Filtering

Properties

  • private

    _higherIndent : boolean

    Whether blocks with a higher indent level than the start block should be included in the result.

  • private

    _includeSelf : boolean

    Whether start block should be included in the result (if it's matching other criteria).

  • private

    _isForward : boolean

    The iterating direction.

  • private

    _lowerIndent : boolean

    Whether blocks with a lower indent level than the start block should be included in the result.

  • private

    _referenceIndent : number

    The reference indent. Initialized by the indent of the start block.

  • private

    _sameAttributes : Array<string>

    Additional attributes that must be the same for each block.

  • private

    _sameIndent : boolean

    Whether blocks with the same indent level as the start block should be included in the result.

  • private

    _startElement : Node

    The start list item block element.

Methods

  • constructor( startElement, options = { [options.direction], [options.higherIndent], [options.includeSelf], [options.lowerIndent], [options.sameAttributes], [options.sameIndent] } )

    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>

    Iterable interface.

    Returns

    Iterator<ListElement, any, undefined>
  • private

    _getStartNode() → null | Node

    Returns the model element to start iterating.

    Returns

    null | Node

Static methods

  • static

    first( startElement, options = { [options.direction], [options.higherIndent], [options.includeSelf], [options.lowerIndent], [options.sameAttributes], [options.sameIndent] } ) → null | ListElement

    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