massive update, probably broken
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-pyright / node_modules / pyright / dist / typeshed-fallback / stdlib / poplib.pyi
1 import socket
2 import ssl
3 from typing import Any, BinaryIO, List, Pattern, Tuple, overload
4
5 _LongResp = Tuple[bytes, List[bytes], int]
6
7 class error_proto(Exception): ...
8
9 POP3_PORT: int
10 POP3_SSL_PORT: int
11 CR: bytes
12 LF: bytes
13 CRLF: bytes
14
15 _list = list  # conflicts with a method named "list"
16
17 class POP3:
18     encoding: str
19     host: str
20     port: int
21     sock: socket.socket
22     file: BinaryIO
23     welcome: bytes
24     def __init__(self, host: str, port: int = ..., timeout: float = ...) -> None: ...
25     def getwelcome(self) -> bytes: ...
26     def set_debuglevel(self, level: int) -> None: ...
27     def user(self, user: str) -> bytes: ...
28     def pass_(self, pswd: str) -> bytes: ...
29     def stat(self) -> tuple[int, int]: ...
30     def list(self, which: Any | None = ...) -> _LongResp: ...
31     def retr(self, which: Any) -> _LongResp: ...
32     def dele(self, which: Any) -> bytes: ...
33     def noop(self) -> bytes: ...
34     def rset(self) -> bytes: ...
35     def quit(self) -> bytes: ...
36     def close(self) -> None: ...
37     def rpop(self, user: str) -> bytes: ...
38     timestamp: Pattern[str]
39     def apop(self, user: str, password: str) -> bytes: ...
40     def top(self, which: Any, howmuch: int) -> _LongResp: ...
41     @overload
42     def uidl(self) -> _LongResp: ...
43     @overload
44     def uidl(self, which: Any) -> bytes: ...
45     def utf8(self) -> bytes: ...
46     def capa(self) -> dict[str, _list[str]]: ...
47     def stls(self, context: ssl.SSLContext | None = ...) -> bytes: ...
48
49 class POP3_SSL(POP3):
50     def __init__(
51         self,
52         host: str,
53         port: int = ...,
54         keyfile: str | None = ...,
55         certfile: str | None = ...,
56         timeout: float = ...,
57         context: ssl.SSLContext | None = ...,
58     ) -> None: ...
59     # "context" is actually the last argument, but that breaks LSP and it doesn't really matter because all the arguments are ignored
60     def stls(self, context: Any = ..., keyfile: Any = ..., certfile: Any = ...) -> bytes: ...