from __future__ import annotations

from typing import Type
from typing_extensions import Literal

from . import spec

_PLAIN = Literal["PLAIN"]
_EXTERNAL = Literal["EXTERNAL"]

class PlainCredentials:

    TYPE: _PLAIN = ...

    username: str = ...
    password: str = ...
    erase_on_connect: bool = ...
    def __init__(self, username: str, password: str, erase_on_connect: bool = ...) -> None: ...
    def response_for(self, start: spec.Connection.Start) -> tuple[_PLAIN, bytes] | tuple[None, None]: ...
    def erase_credentials(self) -> None: ...

class ExternalCredentials:

    TYPE: _EXTERNAL = ...

    erase_on_connect: bool = ...
    def response_for(self, start: spec.Connection.Start) -> tuple[_EXTERNAL, Literal[b""]] | tuple[None, None]: ...
    def erase_credentials(self) -> None: ...

_VALID_TYPES = PlainCredentials | ExternalCredentials
VALID_TYPES: list[_VALID_TYPES]
