mirror of
https://github.com/davidhalter/django-stubs.git
synced 2025-12-08 04:54:48 +08:00
51 lines
1.5 KiB
Python
51 lines
1.5 KiB
Python
from typing import (
|
|
List,
|
|
Optional,
|
|
Tuple,
|
|
Union,
|
|
)
|
|
|
|
|
|
def normalize_whitespace(string: str) -> str: ...
|
|
|
|
|
|
def parse_html(html: str) -> Element: ...
|
|
|
|
|
|
class Element:
|
|
def __contains__(self, element: Element) -> bool: ...
|
|
def __eq__(self, element: Union[str, Element]) -> bool: ...
|
|
def __getitem__(self, key: int) -> Union[str, Element]: ...
|
|
def __hash__(self) -> int: ...
|
|
def __init__(
|
|
self,
|
|
name: Optional[str],
|
|
attributes: Union[Tuple, List[Tuple[str, None]], List[Tuple[str, str]], List[Union[Tuple[str, str], Tuple[str, None]]]]
|
|
) -> None: ...
|
|
def __repr__(self) -> str: ...
|
|
def __str__(self) -> str: ...
|
|
def _count(self, element: Union[str, Element], count: bool = ...) -> int: ...
|
|
def append(self, element: Union[str, Element]) -> None: ...
|
|
def count(self, element: Element) -> int: ...
|
|
def finalize(self) -> None: ...
|
|
|
|
|
|
class Parser:
|
|
def __init__(self) -> None: ...
|
|
@property
|
|
def current(self) -> Element: ...
|
|
def handle_charref(self, name: str) -> None: ...
|
|
def handle_data(self, data: str) -> None: ...
|
|
def handle_endtag(self, tag: str) -> None: ...
|
|
def handle_entityref(self, name: str) -> None: ...
|
|
def handle_startendtag(self, tag: str, attrs: List[Tuple[str, str]]) -> None: ...
|
|
def handle_starttag(
|
|
self,
|
|
tag: str,
|
|
attrs: Union[List[Union[Tuple[str, str], Tuple[str, None]]], List[Tuple[str, str]]]
|
|
) -> None: ...
|
|
|
|
|
|
class RootElement:
|
|
def __init__(self) -> None: ...
|
|
def __str__(self) -> str: ... |