from json import JSONEncoder
from typing import Any, Dict, List, Optional, Tuple, Type, Union

from django.db.models import Field
from .mixins import CheckFieldDefaultMixin

class JsonAdapter(object):
    encoder: Any = ...
    def __init__(self, adapted: Any, dumps: Optional[Any] = ..., encoder: Optional[Any] = ...) -> None: ...
    def dumps(self, obj: Any): ...

class JSONField(CheckFieldDefaultMixin, Field):
    empty_strings_allowed: bool = ...
    description: Any = ...
    default_error_messages: Any = ...
    encoder: Any = ...
    def __init__(
        self, verbose_name: None = ..., name: None = ..., encoder: Optional[Type[JSONEncoder]] = ..., **kwargs: Any
    ) -> None: ...
    def db_type(self, connection: Any): ...
    def deconstruct(self) -> Tuple[None, str, List[Any], Dict[str, Union[Type[JSONEncoder], bool]]]: ...
    def get_transform(self, name: Any): ...
    def get_prep_value(self, value: Any): ...
    def validate(self, value: Any, model_instance: Any) -> None: ...
    def value_to_string(self, obj: Any): ...
    def formfield(self, **kwargs: Any): ...
