massive update, probably broken
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-pyright / node_modules / pyright / dist / typeshed-fallback / stubs / Werkzeug / werkzeug / wsgi.pyi
1 from _typeshed import SupportsRead
2 from _typeshed.wsgi import InputStream, WSGIEnvironment
3 from typing import Any, Iterable, Text
4
5 from .middleware.dispatcher import DispatcherMiddleware as DispatcherMiddleware
6 from .middleware.http_proxy import ProxyMiddleware as ProxyMiddleware
7 from .middleware.shared_data import SharedDataMiddleware as SharedDataMiddleware
8
9 def responder(f): ...
10 def get_current_url(
11     environ, root_only: bool = ..., strip_querystring: bool = ..., host_only: bool = ..., trusted_hosts: Any | None = ...
12 ): ...
13 def host_is_trusted(hostname, trusted_list): ...
14 def get_host(environ, trusted_hosts: Any | None = ...): ...
15 def get_content_length(environ: WSGIEnvironment) -> int | None: ...
16 def get_input_stream(environ: WSGIEnvironment, safe_fallback: bool = ...) -> InputStream: ...
17 def get_query_string(environ): ...
18 def get_path_info(environ, charset: Text = ..., errors: Text = ...): ...
19 def get_script_name(environ, charset: Text = ..., errors: Text = ...): ...
20 def pop_path_info(environ, charset: Text = ..., errors: Text = ...): ...
21 def peek_path_info(environ, charset: Text = ..., errors: Text = ...): ...
22 def extract_path_info(
23     environ_or_baseurl, path_or_url, charset: Text = ..., errors: Text = ..., collapse_http_schemes: bool = ...
24 ): ...
25
26 class ClosingIterator:
27     def __init__(self, iterable, callbacks: Any | None = ...): ...
28     def __iter__(self): ...
29     def __next__(self): ...
30     def close(self): ...
31
32 def wrap_file(environ: WSGIEnvironment, file: SupportsRead[bytes], buffer_size: int = ...) -> Iterable[bytes]: ...
33
34 class FileWrapper:
35     file: SupportsRead[bytes]
36     buffer_size: int
37     def __init__(self, file: SupportsRead[bytes], buffer_size: int = ...) -> None: ...
38     def close(self) -> None: ...
39     def seekable(self) -> bool: ...
40     def seek(self, offset: int, whence: int = ...) -> None: ...
41     def tell(self) -> int | None: ...
42     def __iter__(self) -> FileWrapper: ...
43     def __next__(self) -> bytes: ...
44
45 class _RangeWrapper:
46     iterable: Any
47     byte_range: Any
48     start_byte: Any
49     end_byte: Any
50     read_length: Any
51     seekable: Any
52     end_reached: Any
53     def __init__(self, iterable, start_byte: int = ..., byte_range: Any | None = ...): ...
54     def __iter__(self): ...
55     def __next__(self): ...
56     def close(self): ...
57
58 def make_line_iter(stream, limit: Any | None = ..., buffer_size=..., cap_at_buffer: bool = ...): ...
59 def make_chunk_iter(stream, separator, limit: Any | None = ..., buffer_size=..., cap_at_buffer: bool = ...): ...
60
61 class LimitedStream:
62     limit: Any
63     def __init__(self, stream, limit): ...
64     def __iter__(self): ...
65     @property
66     def is_exhausted(self): ...
67     def on_exhausted(self): ...
68     def on_disconnect(self): ...
69     def exhaust(self, chunk_size=...): ...
70     def read(self, size: Any | None = ...): ...
71     def readline(self, size: Any | None = ...): ...
72     def readlines(self, size: Any | None = ...): ...
73     def tell(self): ...
74     def __next__(self): ...