massive update, probably broken
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-pyright / node_modules / pyright / dist / typeshed-fallback / stubs / Werkzeug / werkzeug / middleware / lint.pyi
1 import sys
2 from _typeshed import SupportsWrite
3 from _typeshed.wsgi import StartResponse, WSGIApplication, WSGIEnvironment
4 from typing import Any, Iterable, Iterator, Mapping, Protocol, Tuple
5
6 from ..datastructures import Headers
7
8 class WSGIWarning(Warning): ...
9 class HTTPWarning(Warning): ...
10
11 def check_string(context: str, obj: object, stacklevel: int = ...) -> None: ...
12
13 class _SupportsReadEtc(Protocol):
14     def read(self, __size: int = ...) -> bytes: ...
15     def readline(self, __size: int = ...) -> bytes: ...
16     def __iter__(self) -> Iterator[bytes]: ...
17     def close(self) -> Any: ...
18
19 class InputStream(object):
20     def __init__(self, stream: _SupportsReadEtc) -> None: ...
21     def read(self, __size: int = ...) -> bytes: ...
22     def readline(self, __size: int = ...) -> bytes: ...
23     def __iter__(self) -> Iterator[bytes]: ...
24     def close(self) -> None: ...
25
26 class _SupportsWriteEtc(Protocol):
27     def write(self, __s: str) -> Any: ...
28     def flush(self) -> Any: ...
29     def close(self) -> Any: ...
30
31 class ErrorStream(object):
32     def __init__(self, stream: _SupportsWriteEtc) -> None: ...
33     def write(self, s: str) -> None: ...
34     def flush(self) -> None: ...
35     def writelines(self, seq: Iterable[str]) -> None: ...
36     def close(self) -> None: ...
37
38 class GuardedWrite(object):
39     def __init__(self, write: SupportsWrite[str], chunks: list[int]) -> None: ...
40     def __call__(self, s: str) -> None: ...
41
42 class GuardedIterator(object):
43     closed: bool
44     headers_set: bool
45     chunks: list[int]
46     def __init__(self, iterator: Iterable[str], headers_set: bool, chunks: list[int]) -> None: ...
47     def __iter__(self) -> GuardedIterator: ...
48     if sys.version_info >= (3, 0):
49         def __next__(self) -> str: ...
50     else:
51         def next(self) -> str: ...
52     def close(self) -> None: ...
53
54 class LintMiddleware(object):
55     def __init__(self, app: WSGIApplication) -> None: ...
56     def check_environ(self, environ: WSGIEnvironment) -> None: ...
57     def check_start_response(
58         self, status: str, headers: list[tuple[str, str]], exc_info: Tuple[Any, ...] | None
59     ) -> tuple[int, Headers]: ...
60     def check_headers(self, headers: Mapping[str, str]) -> None: ...
61     def check_iterator(self, app_iter: Iterable[bytes]) -> None: ...
62     def __call__(self, environ: WSGIEnvironment, start_response: StartResponse) -> GuardedIterator: ...