-
-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy path_view.pyi
174 lines (159 loc) · 5.28 KB
/
_view.pyi
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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
# flake8: noqa
"""
_view - Type stubs for the view.py extension module.
Anything in this file that is defined solely for typing purposes should be
prefixed with __ to tell the developer that its not an actual symbol defined by
the extension module.
"""
from ipaddress import IPv4Address as __IPv4Address
from ipaddress import IPv6Address as __IPv6Address
from typing import Any as __Any
from typing import Awaitable as __Awaitable
from typing import Callable as __Callable
from typing import Coroutine as __Coroutine
from typing import Iterable as __Iterable
from typing import Literal as __Literal
from typing import NoReturn as __NoReturn
from typing import TypeVar as __TypeVar
from view.app import App
from view.routing import RouteData as __RouteData
from view.typing import AsgiDict as __AsgiDict
from view.typing import AsgiReceive as __AsgiReceive
from view.typing import AsgiSend as __AsgiSend
from view.typing import Middleware as __Middleware
from view.typing import Parser as __Parser
from view.typing import Part as __Part
from view.typing import RouteInputDict as __RouteInput
from view.typing import StrMethodASGI as __StrMethodASGI
from view.typing import TypeInfo as __TypeInfo
from view.typing import ViewRoute as __ViewRoute
__T = __TypeVar("__T")
class ViewApp:
def __init__(self) -> __NoReturn: ...
async def asgi_app_entry(
self,
scope: __AsgiDict,
receive: __AsgiReceive,
send: __AsgiSend,
/,
) -> None: ...
def _get(
self,
path: str,
callable: __ViewRoute,
cache_rate: int,
inputs: list[__RouteInput[__Any] | __RouteData],
errors: dict[int, __ViewRoute],
parts: list[__Part | str],
middleware: list[__Middleware],
/,
) -> None: ...
def _post(
self,
path: str,
callable: __ViewRoute,
cache_rate: int,
inputs: list[__RouteInput[__Any] | __RouteData],
errors: dict[int, __ViewRoute],
parts: list[__Part | str],
middleware: list[__Middleware],
/,
) -> None: ...
def _put(
self,
path: str,
callable: __ViewRoute,
cache_rate: int,
inputs: list[__RouteInput[__Any] | __RouteData],
errors: dict[int, __ViewRoute],
parts: list[__Part | str],
middleware: list[__Middleware],
/,
) -> None: ...
def _patch(
self,
path: str,
callable: __ViewRoute,
cache_rate: int,
inputs: list[__RouteInput[__Any] | __RouteData],
errors: dict[int, __ViewRoute],
parts: list[__Part | str],
middleware: list[__Middleware],
/,
) -> None: ...
def _delete(
self,
path: str,
callable: __ViewRoute,
cache_rate: int,
inputs: list[__RouteInput[__Any] | __RouteData],
errors: dict[int, __ViewRoute],
parts: list[__Part | str],
middleware: list[__Middleware],
/,
) -> None: ...
def _options(
self,
path: str,
callable: __ViewRoute,
cache_rate: int,
inputs: list[__RouteInput[__Any] | __RouteData],
errors: dict[int, __ViewRoute],
parts: list[__Part | str],
middleware: list[__Middleware],
/,
) -> None: ...
def _websocket(
self,
path: str,
callable: __ViewRoute,
cache_rate: int,
inputs: list[__RouteInput[__Any] | __RouteData],
errors: dict[int, __ViewRoute],
parts: list[__Part | str],
middleware: list[__Middleware],
/,
) -> None: ...
def _set_dev_state(self, value: bool, /) -> None: ...
def _exc(self, status_code: int, handler: __ViewRoute, /) -> None: ...
def _supply_parsers(self, query: __Parser, json: __Parser, /) -> None: ...
def _register_error(self, error: type, /) -> None: ...
def test_awaitable(
coro: __Coroutine[__Any, __Any, __T], /
) -> __Awaitable[__T]: ...
class Context:
def __init__(self) -> __NoReturn: ...
app: App
cookies: dict[str, str]
headers: HeaderDict
client: __IPv4Address | __IPv6Address | None
server: __IPv4Address | __IPv6Address | None
method: __StrMethodASGI
path: str
scheme: __Literal["http", "https"]
http_version: __Literal["1.0", "1.1", "2.0", "view_test"]
class TCPublic:
def _compile(
self,
iterable: __Iterable[__TypeInfo],
json_parser: __Callable[[str], dict],
/,
) -> None: ...
def _cast(self, obj: object, allow_cast: bool, /) -> __Any: ...
class ViewWebSocket:
def __init__(self) -> __NoReturn: ...
async def accept(self) -> None: ...
async def send(self, text: str | bytes, /) -> None: ...
async def close(self) -> None: ...
async def receive(self) -> str: ...
class InvalidStatusError(RuntimeError): ...
class WebSocketHandshakeError(RuntimeError): ...
def setup_route_log(func: __Callable[[int | str, str, str], None], warn: __Callable[[str], None], /) -> None: ...
def register_ws_cls(
tp: type[__Any], ws_handshake_err: type[__Any], ws_err: type[__Any], /,
) -> None: ...
class HeaderDict:
def __init__(self) -> __NoReturn: ...
def __setitem__(self, key: str, value: str, /) -> None: ...
def __getitem__(self, key: str, /) -> str | list[str]: ...
def dummy_context(app: ViewApp | None) -> Context: ...