,
    ) -> None: ...
    def load_payload(self, payload: bytes, serializer: Optional[_serializer] = ...) -> Any: ...
    def dump_payload(self, obj: Any) -> bytes: ...
    def make_signer(self, salt: Optional[Union[Text, bytes]] = ...) -> Signer: ...
    def iter_unsigners(self, salt: Optional[Union[Text, bytes]] = ...) -> Generator[Any, None, None]: ...
    def dumps(self, obj: Any, salt: Optional[Union[Text, bytes]] = ...) -> Any: ...  # morally -> Union[str, bytes]
    def dump(self, obj: Any, f: IO[Any], salt: Optional[Union[Text, bytes]] = ...) -> None: ...
    def loads(self, s: Union[Text, bytes], salt: Optional[Union[Text, bytes]] = ...) -> Any: ...
    def load(self, f: IO[Any], salt: Optional[Union[Text, bytes]] = ...) -> Any: ...
    def loads_unsafe(self, s: Union[Text, bytes], salt: Optional[Union[Text, bytes]] = ...) -> Tuple[bool, Optional[Any]]: ...
    def load_unsafe(self, f: IO[Any], salt: Optional[Union[Text, bytes]] = ...) -> Tuple[bool, Optional[Any]]: ...

class TimedSerializer(Serializer):
    def loads(
        self,
        s: Union[Text, bytes],
        salt: Optional[Union[Text, bytes]] = ...,
        max_age: Optional[int] = ...,
        return_timestamp: bool = ...,
    ) -> Any: ...  # morally -> Union[Any, Tuple[Any, datetime]]
    def loads_unsafe(
        self, s: Union[Text, bytes], salt: Optional[Union[Text, bytes]] = ..., max_age: Optional[int] = ...
    ) -> Tuple[bool, Any]: ...

class JSONWebSignatureSerializer(Serializer):
    jws_algorithms: MutableMapping[Text, SigningAlgorithm] = ...
    default_algorithm: Text = ...
    default_serializer: Any = ...

    algorithm_name: Text
    algorithm: SigningAlgorithm
    def __init__(
        self,
        secret_key: Union[Text, bytes],
        salt: Optional[Union[Text, bytes]] = ...,
        serializer: Optional[_serializer] = ...,
        signer: Optional[Callable[..., Signer]] = ...,
        signer_kwargs: Optional[MutableMapping[str, Any]] = ...,
        algorithm_name: Optional[Text] = ...,
    ) -> None: ...
    def load_payload(
        self, payload: Union[Text, bytes], serializer: Optional[_serializer] = ..., return_header: bool = ...
    ) -> Any: ...  # morally -> Union[Any, Tuple[Any, MutableMapping[str, Any]]]
    def dump_payload(self, header: Mapping[str, Any], obj: Any) -> bytes: ...  # type: ignore
    def make_algorithm(self, algorithm_name: Text) -> SigningAlgorithm: ...
    def make_signer(self, salt: Optional[Union[Text, bytes]] = ..., algorithm: SigningAlgorithm = ...) -> Signer: ...
    def make_header(self, header_fields: Optional[Mapping[str, Any]]) -> MutableMapping[str, Any]: ...
    def dumps(
        self, obj: Any, salt: Optional[Union[Text, bytes]] = ..., header_fields: Optional[Mapping[str, Any]] = ...
    ) -> bytes: ...
    def loads(
        self, s: Union[Text, bytes], salt: Optional[Union[Text, bytes]] = ..., return_header: bool = ...
    ) -> Any: ...  # morally -> Union[Any, Tuple[Any, MutableMapping[str, Any]]]
    def loads_unsafe(
        self, s: Union[Text, bytes], salt: Optional[Union[Text, bytes]] = ..., return_header: bool = ...
    ) -> Tuple[bool, Any]: ...

class TimedJSONWebSignatureSerializer(JSONWebSignatureSerializer):
    DEFAULT_EXPIRES_IN: int = ...
    expires_in: int
    def __init__(
        self,
        secret_key: Union[Text, bytes],
        expires_in: Optional[int] = ...,
        salt: Optional[Union[Text, bytes]] = ...,
        serializer: Optional[_serializer] = ...,
        signer: Optional[Callable[..., Signer]] = ...,
        signer_kwargs: Optional[MutableMapping[str, Any]] = ...,
        algorithm_name: Optional[Text] = ...,
    ) -> None: ...
    def make_header(self, header_fields: Optional[Mapping[str, Any]]) -> MutableMapping[str, Any]: ...
    def loads(
        self, s: Union[Text, bytes], salt: Optional[Union[Text, bytes]] = ..., return_header: bool = ...
    ) -> Any: ...  # morally -> Union[Any, Tuple[Any, MutableMapping[str, Any]]]
    def get_issue_date(self, header: Mapping[str, Any]) -> Optional[datetime]: ...
    def now(self) -> int: ...

class _URLSafeSerializerMixin(object):
    default_serializer: _serializer = ...
    def load_payload(self, payload: bytes, serializer: Optional[_serializer] = ...) -> Any: ...
    def dump_payload(self, obj: Any) -> bytes: ...

class URLSafeSerializer(_URLSafeSerializerMixin, Serializer): ...
class URLSafeTimedSerializer(_URLSafeSerializerMixin, TimedSerializer): ...
PK