Find an element by a selector. Parameters: element: The tree to search. selector: A function that returns True if the element matches. Returns: Element info, or None if not found.
(
element: VdomJson, selector: Selector
)
| 68 | |
| 69 | |
| 70 | def find_elements( |
| 71 | element: VdomJson, selector: Selector |
| 72 | ) -> Iterator[tuple[VdomJson, ElementInfo]]: |
| 73 | """Find an element by a selector. |
| 74 | |
| 75 | Parameters: |
| 76 | element: |
| 77 | The tree to search. |
| 78 | selector: |
| 79 | A function that returns True if the element matches. |
| 80 | |
| 81 | Returns: |
| 82 | Element info, or None if not found. |
| 83 | """ |
| 84 | return _find_elements(element, selector, (), ()) |
| 85 | |
| 86 | |
| 87 | def _find_elements( |
no test coverage detected