massive update, probably broken
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-pyright / node_modules / pyright / dist / typeshed-fallback / stubs / Flask / flask / wrappers.pyi
1 from typing import Any
2
3 from werkzeug.exceptions import HTTPException
4 from werkzeug.routing import Rule
5 from werkzeug.wrappers import Request as RequestBase, Response as ResponseBase
6
7 class JSONMixin:
8     @property
9     def is_json(self) -> bool: ...
10     @property
11     def json(self): ...
12     def get_json(self, force: bool = ..., silent: bool = ..., cache: bool = ...): ...
13     def on_json_loading_failed(self, e: Any) -> None: ...
14
15 class Request(RequestBase, JSONMixin):
16     url_rule: Rule | None = ...
17     view_args: dict[str, Any] = ...
18     routing_exception: HTTPException | None = ...
19     # Request is making the max_content_length readonly, where it was not the
20     # case in its supertype.
21     # We would require something like https://github.com/python/typing/issues/241
22     @property
23     def max_content_length(self) -> int | None: ...  # type: ignore
24     @property
25     def endpoint(self) -> str | None: ...
26     @property
27     def blueprint(self) -> str | None: ...
28
29 class Response(ResponseBase, JSONMixin):
30     default_mimetype: str | None = ...
31     @property
32     def max_cookie_size(self) -> int: ...