added type hint stubs for all modules
This commit is contained in:
58
imbox/__init__.pyi
Normal file
58
imbox/__init__.pyi
Normal file
@@ -0,0 +1,58 @@
|
||||
import datetime
|
||||
from email._policybase import Policy
|
||||
from imaplib import IMAP4, IMAP4_SSL
|
||||
from inspect import Traceback
|
||||
from ssl import SSLContext
|
||||
from typing import Optional, Union, List, Tuple, Generator
|
||||
|
||||
from imbox.parser import Struct
|
||||
|
||||
|
||||
class Imbox:
|
||||
|
||||
def __init__(self, hostname: str, username: Optional[str], password: Optional[str], ssl: bool,
|
||||
port: Optional[int], ssl_context: Optional[SSLContext], policy: Optional[Policy], starttls: bool): ...
|
||||
|
||||
def __enter__(self) -> 'Imbox': ...
|
||||
|
||||
def __exit__(self, type: Exception, value: str, traceback: Traceback) -> None: ...
|
||||
|
||||
def logout(self) -> None: ...
|
||||
|
||||
def mark_seen(self, uid: bytes) -> None: ...
|
||||
|
||||
def mark_flag(self, uid: bytes) -> None: ...
|
||||
|
||||
def delete(self, uid: bytes) -> None: ...
|
||||
|
||||
def copy(self, uid: bytes, destination_folder: Union[bytes, str]) -> Tuple[str, Union[list, List[None, bytes]]]: ...
|
||||
|
||||
def move(self, uid: bytes, destination_folder: Union[bytes, str]) -> None: ...
|
||||
|
||||
def messages(self, **kwargs: Union[bool, str, datetime.date]) -> 'Messages': ...
|
||||
|
||||
def folders(self) -> Tuple[str, List[bytes]]: ...
|
||||
|
||||
|
||||
class Messages:
|
||||
|
||||
def __init__(self,
|
||||
connection: Union[IMAP4, IMAP4_SSL],
|
||||
parser_policy: Policy,
|
||||
**kwargs: Union[bool, str, datetime.date]) -> None: ...
|
||||
|
||||
def _fetch_email(self, uid: bytes) -> 'Struct': ...
|
||||
|
||||
def _query_uids(self, **kwargs: Union[bool, str, datetime.date]) -> List[bytes]: ...
|
||||
|
||||
def _fetch_email_list(self) -> Generator[Tuple[bytes, 'Struct']]: ...
|
||||
|
||||
def __repr__(self) -> str: ...
|
||||
|
||||
def __iter__(self) -> Generator[Tuple[bytes, 'Struct']]: ...
|
||||
|
||||
def __next__(self) -> 'Messages': ...
|
||||
|
||||
def __len__(self) -> int: ...
|
||||
|
||||
def __getitem__(self, index) -> Union['Struct', List['Struct']]: ...
|
||||
13
imbox/imap.pyi
Normal file
13
imbox/imap.pyi
Normal file
@@ -0,0 +1,13 @@
|
||||
from imaplib import IMAP4, IMAP4_SSL
|
||||
from ssl import SSLContext
|
||||
from typing import Optional, Union, Tuple, List
|
||||
|
||||
|
||||
class ImapTransport:
|
||||
|
||||
def __init__(self, hostname: str, port: Optional[int], ssl: bool,
|
||||
ssl_context: Optional[SSLContext], starttls: bool) -> None: ...
|
||||
|
||||
def list_folders(self) -> Tuple[str, List[bytes]]: ...
|
||||
|
||||
def connect(self, username: str, password: str) -> Union[IMAP4, IMAP4_SSL]: ...
|
||||
0
imbox/parser.pyi
Normal file
0
imbox/parser.pyi
Normal file
0
imbox/query.pyi
Normal file
0
imbox/query.pyi
Normal file
0
imbox/utils.pyi
Normal file
0
imbox/utils.pyi
Normal file
Reference in New Issue
Block a user