massive update, probably broken
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-pyright / node_modules / pyright / dist / typeshed-fallback / stubs / waitress / waitress / buffers.pyi
1 from io import BufferedIOBase, BufferedRandom, BytesIO
2 from typing import Any, Callable
3
4 COPY_BYTES: int
5 STRBUF_LIMIT: int
6
7 class FileBasedBuffer:
8     remain: int = ...
9     file: BytesIO = ...
10     def __init__(self, file: BytesIO, from_buffer: BytesIO | None = ...) -> None: ...
11     def __len__(self) -> int: ...
12     def __nonzero__(self) -> bool: ...
13     __bool__: Callable[[], bool] = ...
14     def append(self, s: Any) -> None: ...
15     def get(self, numbytes: int = ..., skip: bool = ...) -> bytes: ...
16     def skip(self, numbytes: int, allow_prune: int = ...) -> None: ...
17     def newfile(self) -> Any: ...
18     def prune(self) -> None: ...
19     def getfile(self) -> Any: ...
20     def close(self) -> None: ...
21
22 class TempfileBasedBuffer(FileBasedBuffer):
23     def __init__(self, from_buffer: BytesIO | None = ...) -> None: ...
24     def newfile(self) -> BufferedRandom: ...
25
26 class BytesIOBasedBuffer(FileBasedBuffer):
27     file: BytesIO = ...
28     def __init__(self, from_buffer: BytesIO | None = ...) -> None: ...
29     def newfile(self) -> BytesIO: ...
30
31 class ReadOnlyFileBasedBuffer(FileBasedBuffer):
32     file: BytesIO = ...
33     block_size: int = ...
34     def __init__(self, file: BytesIO, block_size: int = ...) -> None: ...
35     remain: int = ...
36     def prepare(self, size: int | None = ...) -> int: ...
37     def get(self, numbytes: int = ..., skip: bool = ...) -> bytes: ...
38     def __iter__(self) -> ReadOnlyFileBasedBuffer: ...
39     def next(self) -> bytes | None: ...
40     __next__: Callable[[], bytes | None] = ...
41     def append(self, s: Any) -> None: ...
42
43 class OverflowableBuffer:
44     overflowed: bool = ...
45     buf: BufferedIOBase | None = ...
46     strbuf: bytes = ...
47     overflow: int = ...
48     def __init__(self, overflow: int) -> None: ...
49     def __len__(self) -> int: ...
50     def __nonzero__(self) -> bool: ...
51     __bool__: Callable[[], bool] = ...
52     def append(self, s: bytes) -> None: ...
53     def get(self, numbytes: int = ..., skip: bool = ...) -> bytes: ...
54     def skip(self, numbytes: int, allow_prune: bool = ...) -> None: ...
55     def prune(self) -> None: ...
56     def getfile(self) -> BytesIO: ...
57     def close(self) -> None: ...