"""
This type stub file was generated by pyright.
"""

import abc
from typing import Any, Callable, Dict, List, Optional, Tuple, Type, TypeVar, Union, overload

from dataclasses_json.cfg import LetterCase
from dataclasses_json.core import Json
from dataclasses_json.mm import JsonData, SchemaType
from dataclasses_json.undefined import Undefined

A = TypeVar("A", bound="DataClassJsonMixin")
T = TypeVar("T")
Fields = List[Tuple[str, Any]]


class DataClassJsonMixin(abc.ABC):
    """
    DataClassJsonMixin is an ABC that functions as a Mixin.

    As with other ABCs, it should not be instantiated directly.
    """

    dataclass_json_config: Optional[dict] = ...

    def to_json(
        self,
        *,
        skipkeys: bool = ...,
        ensure_ascii: bool = ...,
        check_circular: bool = ...,
        allow_nan: bool = ...,
        indent: Optional[Union[int, str]] = ...,
        separators: Optional[Tuple[str, str]] = ...,
        default: Optional[Callable] = ...,
        sort_keys: bool = ...,
        **kw,
    ) -> str: ...

    @classmethod
    def from_json(
        cls: Type[A],
        s: JsonData,
        *,
        parse_float: Callable[[str], float] = ...,
        parse_int: Callable[[str], int] = ...,
        parse_constant: Callable[[str], Any] = ...,
        infer_missing: bool = ...,
    ) -> A: ...

    @classmethod
    def from_dict(cls: Type[A], kvs: Json, *, infer_missing: bool = ...) -> A: ...

    def to_dict(self, encode_json=...) -> Dict[str, Json]: ...

    @classmethod
    def schema(
        cls: Type[A],
        *,
        infer_missing: bool = ...,
        only=...,
        exclude=...,
        many: bool = ...,
        context=...,
        load_only=...,
        dump_only=...,
        partial: bool = ...,
        unknown=...,
    ) -> SchemaType[A]: ...


@overload
def dataclass_json(
    _cls: None = ..., *, letter_case: Optional[LetterCase] = ..., undefined: Optional[Union[str, Undefined]] = ...
) -> Callable[[Type[T]], Type[T]]: ...


@overload
def dataclass_json(
    _cls: Type[T], *, letter_case: Optional[LetterCase] = ..., undefined: Optional[Union[str, Undefined]] = ...
) -> Type[T]: ...


def dataclass_json(
    _cls: Optional[Type[T]] = ...,
    *,
    letter_case: Optional[LetterCase] = ...,
    undefined: Optional[Union[str, Undefined]] = ...,
) -> Union[Callable[[Type[T]], Type[T]], Type[T]]:
    """
    Based on the code in the `dataclasses` module to handle optional-parens
    decorators. See example below:

    @dataclass_json
    @dataclass_json(letter_case=LetterCase.CAMEL)
    class Example:
        ...
    """
    ...
