massive update, probably broken
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-pyright / node_modules / pyright / dist / typeshed-fallback / stdlib / lzma.pyi
1 import io
2 from _typeshed import ReadableBuffer, Self, StrOrBytesPath
3 from typing import IO, Any, Mapping, Sequence, TextIO, Union, overload
4 from typing_extensions import Literal, final
5
6 _OpenBinaryWritingMode = Literal["w", "wb", "x", "xb", "a", "ab"]
7 _OpenTextWritingMode = Literal["wt", "xt", "at"]
8
9 _PathOrFile = Union[StrOrBytesPath, IO[bytes]]
10
11 _FilterChain = Sequence[Mapping[str, Any]]
12
13 FORMAT_AUTO: int
14 FORMAT_XZ: int
15 FORMAT_ALONE: int
16 FORMAT_RAW: int
17 CHECK_NONE: int
18 CHECK_CRC32: int
19 CHECK_CRC64: int
20 CHECK_SHA256: int
21 CHECK_ID_MAX: int
22 CHECK_UNKNOWN: int
23 FILTER_LZMA1: int
24 FILTER_LZMA2: int
25 FILTER_DELTA: int
26 FILTER_X86: int
27 FILTER_IA64: int
28 FILTER_ARM: int
29 FILTER_ARMTHUMB: int
30 FILTER_SPARC: int
31 FILTER_POWERPC: int
32 MF_HC3: int
33 MF_HC4: int
34 MF_BT2: int
35 MF_BT3: int
36 MF_BT4: int
37 MODE_FAST: int
38 MODE_NORMAL: int
39 PRESET_DEFAULT: int
40 PRESET_EXTREME: int
41
42 # from _lzma.c
43 @final
44 class LZMADecompressor(object):
45     def __init__(self, format: int | None = ..., memlimit: int | None = ..., filters: _FilterChain | None = ...) -> None: ...
46     def decompress(self, data: bytes, max_length: int = ...) -> bytes: ...
47     @property
48     def check(self) -> int: ...
49     @property
50     def eof(self) -> bool: ...
51     @property
52     def unused_data(self) -> bytes: ...
53     @property
54     def needs_input(self) -> bool: ...
55
56 # from _lzma.c
57 @final
58 class LZMACompressor(object):
59     def __init__(
60         self, format: int | None = ..., check: int = ..., preset: int | None = ..., filters: _FilterChain | None = ...
61     ) -> None: ...
62     def compress(self, __data: bytes) -> bytes: ...
63     def flush(self) -> bytes: ...
64
65 class LZMAError(Exception): ...
66
67 class LZMAFile(io.BufferedIOBase, IO[bytes]):
68     def __init__(
69         self,
70         filename: _PathOrFile | None = ...,
71         mode: str = ...,
72         *,
73         format: int | None = ...,
74         check: int = ...,
75         preset: int | None = ...,
76         filters: _FilterChain | None = ...,
77     ) -> None: ...
78     def __enter__(self: Self) -> Self: ...
79     def close(self) -> None: ...
80     @property
81     def closed(self) -> bool: ...
82     def fileno(self) -> int: ...
83     def seekable(self) -> bool: ...
84     def readable(self) -> bool: ...
85     def writable(self) -> bool: ...
86     def peek(self, size: int = ...) -> bytes: ...
87     def read(self, size: int | None = ...) -> bytes: ...
88     def read1(self, size: int = ...) -> bytes: ...
89     def readline(self, size: int | None = ...) -> bytes: ...
90     def write(self, data: ReadableBuffer) -> int: ...
91     def seek(self, offset: int, whence: int = ...) -> int: ...
92     def tell(self) -> int: ...
93
94 @overload
95 def open(
96     filename: _PathOrFile,
97     mode: Literal["r", "rb"] = ...,
98     *,
99     format: int | None = ...,
100     check: Literal[-1] = ...,
101     preset: None = ...,
102     filters: _FilterChain | None = ...,
103     encoding: None = ...,
104     errors: None = ...,
105     newline: None = ...,
106 ) -> LZMAFile: ...
107 @overload
108 def open(
109     filename: _PathOrFile,
110     mode: _OpenBinaryWritingMode,
111     *,
112     format: int | None = ...,
113     check: int = ...,
114     preset: int | None = ...,
115     filters: _FilterChain | None = ...,
116     encoding: None = ...,
117     errors: None = ...,
118     newline: None = ...,
119 ) -> LZMAFile: ...
120 @overload
121 def open(
122     filename: StrOrBytesPath,
123     mode: Literal["rt"],
124     *,
125     format: int | None = ...,
126     check: Literal[-1] = ...,
127     preset: None = ...,
128     filters: _FilterChain | None = ...,
129     encoding: str | None = ...,
130     errors: str | None = ...,
131     newline: str | None = ...,
132 ) -> TextIO: ...
133 @overload
134 def open(
135     filename: StrOrBytesPath,
136     mode: _OpenTextWritingMode,
137     *,
138     format: int | None = ...,
139     check: int = ...,
140     preset: int | None = ...,
141     filters: _FilterChain | None = ...,
142     encoding: str | None = ...,
143     errors: str | None = ...,
144     newline: str | None = ...,
145 ) -> TextIO: ...
146 @overload
147 def open(
148     filename: _PathOrFile,
149     mode: str,
150     *,
151     format: int | None = ...,
152     check: int = ...,
153     preset: int | None = ...,
154     filters: _FilterChain | None = ...,
155     encoding: str | None = ...,
156     errors: str | None = ...,
157     newline: str | None = ...,
158 ) -> LZMAFile | TextIO: ...
159 def compress(
160     data: bytes, format: int = ..., check: int = ..., preset: int | None = ..., filters: _FilterChain | None = ...
161 ) -> bytes: ...
162 def decompress(data: bytes, format: int = ..., memlimit: int | None = ..., filters: _FilterChain | None = ...) -> bytes: ...
163 def is_check_supported(__check_id: int) -> bool: ...