Creates a range iterator. All parameters are optional, but you have to specify either boundaries or startPosition.
Optionaloptions: ViewTreeWalkerOptionsObject with configuration.
ReadonlyboundariesIterator boundaries.
When the iterator is walking 'forward' on the end of boundary or is walking 'backward'
on the start of boundary, then { done: true } is returned.
If boundaries are not defined they are set before first and after last child of the root node.
ReadonlydirectionWalking direction. Defaults 'forward'.
ReadonlyignoreFlag indicating whether iterator should ignore elementEnd tags. If set to true, walker will not
return a parent node of the start position. Each module:engine/view/element~ViewElement will be returned once.
When set to false each element might be returned twice: for 'elementStart' and 'elementEnd'.
ReadonlyshallowFlag indicating whether iterator should enter elements or not. If the iterator is shallow child nodes of any
iterated node will not be returned along with elementEnd tag.
ReadonlysingleFlag indicating whether all characters from module:engine/view/text~ViewText should be returned as one module:engine/view/text~ViewText or one by one as module:engine/view/textproxy~ViewTextProxy.
Iterator position. If start position is not defined then position depends on #direction. If direction is
'forward' position starts form the beginning, when direction is 'backward' position starts from the end.
Iterable interface.
Moves tree walker #position to provided position. Tree walker will
continue traversing from that position.
Note: in contrary to ~ViewTreeWalker#skip, this method does not iterate over the nodes along the way. It simply sets the current tree walker position to a new one. From the performance standpoint, it is better to use ~ViewTreeWalker#jumpTo rather than ~ViewTreeWalker#skip.
If the provided position is before the start boundary, the position will be set to the start boundary. If the provided position is after the end boundary, the position will be set to the end boundary. This is done to prevent the treewalker from traversing outside the boundaries.
Position to jump to.
Gets the next tree walker's value.
Object implementing iterator interface, returning information about taken step.
Moves #position in the #direction skipping values as long as the callback function returns true.
For example:
walker.skip( value => value.type == 'text' ); // <p>{}foo</p> -> <p>foo[]</p>
walker.skip( value => true ); // Move the position to the end: <p>{}foo</p> -> <p>foo</p>[]
walker.skip( value => false ); // Do not move the position.
Callback function. Gets module:engine/view/treewalker~ViewTreeWalkerValue and should
return true if the value should be skipped or false if not.
Position iterator class. It allows to iterate forward and backward over the document.