|
| 1 | +from collections.abc import Iterable |
1 | 2 | from re import Pattern |
2 | | -from typing import Final, TypeAlias, overload |
| 3 | +from typing import Final, overload |
3 | 4 |
|
4 | 5 | always_safe: Final[str] |
5 | 6 | urlencoded: Final[set[str]] |
6 | 7 | INVALID_HEX_PATTERN: Final[Pattern[str]] |
7 | 8 |
|
8 | | -_ExplodedQueryString: TypeAlias = list[tuple[str, str]] |
9 | | - |
10 | | -def url_encode(params: _ExplodedQueryString) -> str: ... |
11 | | -def url_decode(query: str) -> _ExplodedQueryString: ... |
12 | | -def add_params_to_qs(query: str, params: _ExplodedQueryString | dict[str, str]) -> str: ... |
13 | | -def add_params_to_uri(uri: str, params: _ExplodedQueryString, fragment: bool = False) -> str: ... |
14 | | -def quote(s: str, safe: bytes = b"/") -> str: ... |
| 9 | +def url_encode(params: Iterable[tuple[str, str]]) -> str: ... |
| 10 | +def url_decode(query: str) -> list[tuple[str, str]]: ... |
| 11 | +def add_params_to_qs(query: str, params: Iterable[tuple[str, str]] | dict[str, str]) -> str: ... |
| 12 | +def add_params_to_uri(uri: str, params: Iterable[tuple[str, str]] | dict[str, str], fragment: bool = False) -> str: ... |
| 13 | +def quote(s: str | bytes | float, safe: bytes = b"/") -> str: ... |
15 | 14 | def unquote(s: str | bytes) -> str: ... |
16 | | -def quote_url(s: str) -> str: ... |
| 15 | +def quote_url(s: str | bytes | float) -> str: ... |
17 | 16 |
|
18 | 17 | @overload |
19 | 18 | def extract_params(raw: None) -> None: ... |
20 | 19 | @overload |
21 | | -def extract_params(raw: dict[str, str]) -> _ExplodedQueryString: ... |
| 20 | +def extract_params(raw: dict[str, str]) -> list[tuple[str, str]]: ... |
22 | 21 | @overload |
23 | | -def extract_params(raw: _ExplodedQueryString | tuple[tuple[str, str], ...] | str) -> _ExplodedQueryString | None: ... |
| 22 | +def extract_params(raw: list[tuple[str, str]] | tuple[tuple[str, str], ...] | str) -> list[tuple[str, str]] | None: ... |
24 | 23 |
|
25 | 24 | def is_valid_url(url: str, fragments_allowed: bool = True) -> bool: ... |
0 commit comments