traverseTextBlockComponent Function

Recursively traverses a StructuralTextBlockComponent tree, yielding each child component along with its parent container. This generator enables depth-first iteration over all components in a text block structure, including paragraphs, lists, and runs.

traverseTextBlockComponent(parent: StructuralTextBlockComponent): IterableIterator<{ child: List | Paragraph | Run, parent: StructuralTextBlockComponent }>

@returns An IterableIterator yielding objects with the child component and its parent container.

Parameter Type Description
parent StructuralTextBlockComponent The root container whose children should be traversed.

Returns - IterableIterator<{ child: List | Paragraph | Run, parent: StructuralTextBlockComponent }>

An IterableIterator yielding objects with the child component and its parent container.

Defined in

Last Updated: 07 October, 2025