massive update, probably broken
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-pyright / node_modules / pyright / dist / typeshed-fallback / stubs / Flask / flask / testing.pyi
1 from typing import IO, Any, Iterable, Mapping, Text, TypeVar
2
3 from click import BaseCommand
4 from click.testing import CliRunner, Result
5 from werkzeug.test import Client, EnvironBuilder as WerkzeugEnvironBuilder
6
7 # Response type for the client below.
8 # By default _R is Tuple[Iterable[Any], Text | int, werkzeug.datastructures.Headers], however
9 # most commonly it is wrapped in a Response object.
10 _R = TypeVar("_R")
11
12 class FlaskClient(Client[_R]):
13     preserve_context: bool = ...
14     environ_base: Any = ...
15     def __init__(self, *args: Any, **kwargs: Any) -> None: ...
16     def session_transaction(self, *args: Any, **kwargs: Any) -> None: ...
17     def __enter__(self): ...
18     def __exit__(self, exc_type: Any, exc_value: Any, tb: Any) -> None: ...
19
20 class FlaskCliRunner(CliRunner):
21     app: Any = ...
22     def __init__(self, app: Any, **kwargs: Any) -> None: ...
23     def invoke(
24         self,
25         cli: BaseCommand | None = ...,
26         args: str | Iterable[str] | None = ...,
27         input: bytes | IO[Any] | Text | None = ...,
28         env: Mapping[str, str] | None = ...,
29         catch_exceptions: bool = ...,
30         color: bool = ...,
31         **extra: Any,
32     ) -> Result: ...
33
34 class EnvironBuilder(WerkzeugEnvironBuilder):
35     app: Any
36     def __init__(
37         self,
38         app: Any,
39         path: str = ...,
40         base_url: Any | None = ...,
41         subdomain: Any | None = ...,
42         url_scheme: Any | None = ...,
43         *args: Any,
44         **kwargs: Any,
45     ) -> None: ...
46     def json_dumps(self, obj: Any, **kwargs: Any) -> str: ...
47
48 def make_test_environ_builder(
49     app: Any,
50     path: str = ...,
51     base_url: Any | None = ...,
52     subdomain: Any | None = ...,
53     url_scheme: Any | None = ...,
54     *args: Any,
55     **kwargs: Any,
56 ): ...