diff --git a/src/wikitextprocessor/parser.py b/src/wikitextprocessor/parser.py index 4e96d984..8643dc6b 100644 --- a/src/wikitextprocessor/parser.py +++ b/src/wikitextprocessor/parser.py @@ -493,6 +493,12 @@ def filter_empty_str_child(self) -> Iterator[Union[str, "WikiNode"]]: else: yield node + @overload + def find_html( + self, + target_tags: str | list[str], + ) -> Iterator["HTMLNode"]: ... + @overload def find_html( self, @@ -506,9 +512,23 @@ def find_html( def find_html( self, target_tags: str | list[str], - with_index: Literal[False] = ..., - attr_name: str = ..., - attr_value: str = ..., + with_index: Literal[False], + attr_name: str, + attr_value: str, + ) -> Iterator["HTMLNode"]: ... + + @overload + def find_html( + self, + target_tags: str | list[str], + with_index: Literal[True], + ) -> Iterator[tuple[int, "HTMLNode"]]: ... + + @overload + def find_html( + self, + target_tags: str | list[str], + with_index: Literal[False], ) -> Iterator["HTMLNode"]: ... def find_html(