massive update, probably broken
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-pyright / node_modules / pyright / dist / typeshed-fallback / stubs / redis / redis / connection.pyi
1 from typing import Any, Mapping, Text, Type
2
3 ssl_available: Any
4 hiredis_version: Any
5 HIREDIS_SUPPORTS_CALLABLE_ERRORS: Any
6 HIREDIS_SUPPORTS_BYTE_BUFFER: Any
7 msg: Any
8 HIREDIS_USE_BYTE_BUFFER: Any
9 SYM_STAR: Any
10 SYM_DOLLAR: Any
11 SYM_CRLF: Any
12 SYM_EMPTY: Any
13 SERVER_CLOSED_CONNECTION_ERROR: Any
14
15 class BaseParser:
16     EXCEPTION_CLASSES: Any
17     def parse_error(self, response): ...
18
19 class SocketBuffer:
20     socket_read_size: Any
21     bytes_written: Any
22     bytes_read: Any
23     def __init__(self, socket, socket_read_size, socket_timeout) -> None: ...
24     @property
25     def length(self): ...
26     def read(self, length): ...
27     def readline(self): ...
28     def purge(self): ...
29     def close(self): ...
30     def can_read(self, timeout): ...
31
32 class PythonParser(BaseParser):
33     encoding: Any
34     socket_read_size: Any
35     def __init__(self, socket_read_size) -> None: ...
36     def __del__(self): ...
37     def on_connect(self, connection): ...
38     def on_disconnect(self): ...
39     def can_read(self, timeout): ...
40     def read_response(self): ...
41
42 class HiredisParser(BaseParser):
43     socket_read_size: Any
44     def __init__(self, socket_read_size) -> None: ...
45     def __del__(self): ...
46     def on_connect(self, connection): ...
47     def on_disconnect(self): ...
48     def can_read(self, timeout): ...
49     def read_from_socket(self, timeout=..., raise_on_timeout: bool = ...) -> bool: ...
50     def read_response(self): ...
51
52 DefaultParser: Any
53
54 class Encoder:
55     def __init__(self, encoding, encoding_errors, decode_responses: bool) -> None: ...
56     def encode(self, value: Text | bytes | memoryview | bool | float) -> bytes: ...
57     def decode(self, value: Text | bytes | memoryview, force: bool = ...) -> Text: ...
58
59 class Connection:
60     description_format: Any
61     pid: Any
62     host: Any
63     port: Any
64     db: Any
65     password: Any
66     socket_timeout: Any
67     socket_connect_timeout: Any
68     socket_keepalive: Any
69     socket_keepalive_options: Any
70     retry_on_timeout: Any
71     encoding: Any
72     encoding_errors: Any
73     decode_responses: Any
74     def __init__(
75         self,
76         host: Text = ...,
77         port: int = ...,
78         db: int = ...,
79         password: Text | None = ...,
80         socket_timeout: float | None = ...,
81         socket_connect_timeout: float | None = ...,
82         socket_keepalive: bool = ...,
83         socket_keepalive_options: Mapping[str, int | str] | None = ...,
84         socket_type: int = ...,
85         retry_on_timeout: bool = ...,
86         encoding: Text = ...,
87         encoding_errors: Text = ...,
88         decode_responses: bool = ...,
89         parser_class: Type[BaseParser] = ...,
90         socket_read_size: int = ...,
91         health_check_interval: int = ...,
92         client_name: Text | None = ...,
93         username: Text | None = ...,
94     ) -> None: ...
95     def __del__(self): ...
96     def register_connect_callback(self, callback): ...
97     def clear_connect_callbacks(self): ...
98     def connect(self): ...
99     def on_connect(self): ...
100     def disconnect(self): ...
101     def check_health(self) -> None: ...
102     def send_packed_command(self, command, check_health: bool = ...): ...
103     def send_command(self, *args): ...
104     def can_read(self, timeout=...): ...
105     def read_response(self): ...
106     def pack_command(self, *args): ...
107     def pack_commands(self, commands): ...
108     def repr_pieces(self) -> list[tuple[Text, Text]]: ...
109
110 class SSLConnection(Connection):
111     description_format: Any
112     keyfile: Any
113     certfile: Any
114     cert_reqs: Any
115     ca_certs: Any
116     def __init__(
117         self, ssl_keyfile=..., ssl_certfile=..., ssl_cert_reqs=..., ssl_ca_certs=..., ssl_check_hostname: bool = ..., **kwargs
118     ) -> None: ...
119
120 class UnixDomainSocketConnection(Connection):
121     description_format: Any
122     pid: Any
123     path: Any
124     db: Any
125     password: Any
126     socket_timeout: Any
127     retry_on_timeout: Any
128     encoding: Any
129     encoding_errors: Any
130     decode_responses: Any
131     def __init__(
132         self,
133         path=...,
134         db: int = ...,
135         username=...,
136         password=...,
137         socket_timeout=...,
138         encoding=...,
139         encoding_errors=...,
140         decode_responses=...,
141         retry_on_timeout=...,
142         parser_class=...,
143         socket_read_size: int = ...,
144         health_check_interval: int = ...,
145         client_name=...,
146     ) -> None: ...
147     def repr_pieces(self) -> list[tuple[Text, Text]]: ...
148
149 def to_bool(value: object) -> bool: ...
150
151 class ConnectionPool:
152     @classmethod
153     def from_url(cls, url: Text, db: int | None = ..., decode_components: bool = ..., **kwargs) -> ConnectionPool: ...
154     connection_class: Any
155     connection_kwargs: Any
156     max_connections: Any
157     def __init__(self, connection_class=..., max_connections=..., **connection_kwargs) -> None: ...
158     pid: Any
159     def reset(self): ...
160     def get_connection(self, command_name, *keys, **options): ...
161     def make_connection(self): ...
162     def release(self, connection): ...
163     def disconnect(self, inuse_connections: bool = ...): ...
164     def get_encoder(self) -> Encoder: ...
165     def owns_connection(self, connection: Connection) -> bool: ...
166
167 class BlockingConnectionPool(ConnectionPool):
168     queue_class: Any
169     timeout: Any
170     def __init__(self, max_connections=..., timeout=..., connection_class=..., queue_class=..., **connection_kwargs) -> None: ...
171     pid: Any
172     pool: Any
173     def reset(self): ...
174     def make_connection(self): ...
175     def get_connection(self, command_name, *keys, **options): ...
176     def release(self, connection): ...
177     def disconnect(self): ...