"""_format [`Private Module`]."""


from typing import Generic, TypeVar, TypeGuard, Any, Literal, NoReturn, Iterator
from typing import overload


T = TypeVar('T')

class Compressed(Generic[T]):

    def __setattr__(self, name: str, value: Any, /) -> None: ...
    def __delattr__(self, name: str) -> NoReturn: ...
    def __setitem__(self, key: str, value: Any, /) -> NoReturn: ...
    def __delitem__(self, key: str, /) -> NoReturn: ...

    @overload
    def __getitem__(self, key: Literal['bytestring'], /) -> bytes: ...
    @overload
    def __getitem__(self, key: Literal['format'], /) -> Literal['absolute', 'formatted']: ...
    @overload
    def __getitem__(self, key, /) -> NoReturn: ...

    def __str__(self) -> str: ...
    def __repr__(self) -> str: ...

    def __iter__(self) -> Iterator[str]: ...

    def __init__(self, bytestring: bytes, format: Literal['absolute', 'formatted'], origf: T) -> None: ...

    def as_bytes_(self) -> bytes: ...

    @overload
    @classmethod
    def from_bytes_(cls, bytestring: bytes) -> 'Compressed': ...
    @overload
    @classmethod
    def from_bytes_(cls, bytestring) -> NoReturn: ...

    @overload
    def get_(self, key: Literal['bytestring'], default: Any = ...) -> bytes: ...
    @overload
    def get_(self, key: Literal['format'], default: Any = ...) -> Literal['absolute', 'formatted']: ...
    @overload
    def get_(self, key, default: Any = ...) -> NoReturn: ...


class Compressor:

    @staticmethod
    def is_compressed_(candidate) -> TypeGuard[Compressed]: ...

    @staticmethod
    def compress_(content: T) -> Compressed[T]: ...

    @overload
    @staticmethod
    def decompress_(candidate: Compressed[T]) -> T: ...
    @overload
    @staticmethod
    def decompress_(candidate) -> NoReturn: ...


class Encrypted(Generic[T]):

    def __setattr__(self, name: str, value: Any, /) -> None: ...
    def __delattr__(self, name: str, /) -> NoReturn: ...
    def __setitem__(self, key: str, value: str, /) -> NoReturn: ...
    def __delitem__(self, key: str, /) -> NoReturn: ...

    @overload
    def __getitem__(self, key: Literal['ciphertext'], /) -> Compressed[T]: ...
    @overload
    def __getitem__(self, key: Literal['salt'], /) -> Compressed[bytes]: ...
    @overload
    def __getitem__(self, key: Literal['format'], /) -> Compressed[str]: ...
    @overload
    def __getitem__(self, key, /) -> NoReturn: ...

    def __str__(self) -> str: ...
    def __repr__(self) -> str: ...

    def __iter__(self) -> Iterator[str]: ...

    def as_bytes_(self) -> bytes: ...

    @classmethod
    def from_bytes(self, bytestring: bytes) -> 'Encrypted': ...

    @overload
    def get_(self, key: Literal['ciphertext'], default: Any = ...) -> Compressed[T]: ...
    @overload
    def get_(self, key: Literal['salt'], default: Any = ...) -> Compressed[bytes]: ...
    @overload
    def get_(self, key: Literal['format'], default: Any = ...) -> Compressed[str]: ...
    @overload
    def get_(self, key, default: Any = ...) -> NoReturn: ...

    def __init__(self, ciphertext: Compressed[T], salt: Compressed[bytes], format: Compressed[str]) -> None: ...


def verifyEncryptedObject_(candidate) -> TypeGuard[Encrypted]: ...