-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathurlpattern.pyi
More file actions
107 lines (98 loc) · 2.74 KB
/
urlpattern.pyi
File metadata and controls
107 lines (98 loc) · 2.74 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
from typing import Optional, TypedDict, Union, overload
from typing_extensions import TypeAlias
URLPatternInput: TypeAlias = Union[str, URLPatternInit]
class URLPatternOptions(TypedDict, total=False):
ignoreCase: bool
class URLPattern:
@overload
def __init__(
self,
input: str,
baseURL: str,
options: URLPatternOptions = {},
) -> None: ...
@overload
def __init__(
self,
input: str,
baseURL: str,
options: None,
) -> None: ...
@overload
def __init__(
self,
input: URLPatternInit,
baseURL: str,
options: URLPatternOptions = {},
) -> None: ...
@overload
def __init__(
self,
input: URLPatternInit,
baseURL: str,
options: None,
) -> None: ...
@overload
def __init__(self, input: str, options: URLPatternOptions = {}) -> None: ...
@overload
def __init__(self, input: str, options: None) -> None: ...
@overload
def __init__(
self, input: URLPatternInit = {}, options: URLPatternOptions = {}
) -> None: ...
@overload
def __init__(self, input: URLPatternInit, options: None) -> None: ...
@overload
def test(self, input: str, baseURL: Optional[str] = None) -> bool: ...
@overload
def test(
self, input: URLPatternInit = {}, baseURL: Optional[str] = None
) -> bool: ...
@overload
def exec(
self, input: str, baseURL: Optional[str] = None
) -> Optional[URLPatternResult]: ...
@overload
def exec(
self, input: URLPatternInit = {}, baseURL: Optional[str] = None
) -> Optional[URLPatternResult]: ...
@property
def protocol(self) -> str: ...
@property
def username(self) -> str: ...
@property
def password(self) -> str: ...
@property
def hostname(self) -> str: ...
@property
def port(self) -> str: ...
@property
def pathname(self) -> str: ...
@property
def search(self) -> str: ...
@property
def hash(self) -> str: ...
class URLPatternInit(TypedDict, total=False):
protocol: str
username: str
password: str
hostname: str
port: str
pathname: str
search: str
hash: str
baseURL: str
class URLPatternResult(TypedDict):
inputs: list[URLPatternInput]
protocol: URLPatternComponentResult
username: URLPatternComponentResult
password: URLPatternComponentResult
hostname: URLPatternComponentResult
port: URLPatternComponentResult
pathname: URLPatternComponentResult
search: URLPatternComponentResult
hash: URLPatternComponentResult
class URLPatternComponentResult(TypedDict):
input: str
groups: dict[str, str]
URLPatternCompatible: TypeAlias = Union[str, URLPatternInit, URLPattern]