from _typeshed import Incomplete
from collections.abc import Generator
from docassemble.base.error import DAException as DAException
from docassemble.base.functions import word as word
from docassemble.base.logger import logmessage as logmessage
from docassemble.webapp.da_flask_mail import Message as Message

class Connection:
    mail: Incomplete
    def __init__(self, mail) -> None: ...
    def __enter__(self): ...
    def __exit__(self, exc_type, exc_value, tb) -> None: ...
    def send(self, message, envelope_from: Incomplete | None = ...) -> None: ...
    def send_message(self, *args, **kwargs) -> None: ...

class _MailMixin:
    def record_messages(self) -> Generator[Incomplete, None, None]: ...
    def send(self, message) -> None: ...
    def send_message(self, *args, **kwargs) -> None: ...

class _Mail(_MailMixin):
    api_key: Incomplete
    default_sender: Incomplete
    debug: Incomplete
    suppress: Incomplete
    ascii_attachments: Incomplete
    def __init__(self, api_key, default_sender, debug, suppress, ascii_attachments: bool = ...) -> None: ...

class Mail(_MailMixin):
    app: Incomplete
    state: Incomplete
    def __init__(self, app: Incomplete | None = ..., config: Incomplete | None = ...) -> None: ...
    def init_mail(self, config, debug: bool = ..., testing: bool = ...): ...
    def init_app(self, app: Incomplete | None = ..., config: Incomplete | None = ...): ...
    def __getattr__(self, name): ...
    def connect(self): ...
