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

import sys
import typing

from marshmallow import Schema, fields


class _TimestampField(fields.Field): ...


class _IsoField(fields.Field): ...


class _UnionField(fields.Field):
    def __init__(self, desc, cls, field, *args, **kwargs) -> None: ...


class _TupleVarLen(fields.List):
    """
    variable-length homogeneous tuples
    """

    ...


TYPES = ...
A = typing.TypeVar("A")
JsonData = typing.Union[str, bytes, bytearray]
TEncoded = typing.Dict[str, typing.Any]
TOneOrMulti = typing.Union[typing.List[A], A]
TOneOrMultiEncoded = typing.Union[typing.List[TEncoded], TEncoded]
if sys.version_info >= (3, 7) or typing.TYPE_CHECKING:

    class SchemaF(Schema, typing.Generic[A]):
        """Lift Schema into a type constructor"""

        def __init__(self, *args, **kwargs) -> None:
            """
            Raises exception because this class should not be inherited.
            This class is helper only.
            """
            ...

        @typing.overload
        def dump(self, obj: typing.List[A], many: typing.Optional[bool] = ...) -> typing.List[TEncoded]: ...

        @typing.overload
        def dump(self, obj: A, many: typing.Optional[bool] = ...) -> TEncoded: ...

        def dump(self, obj: TOneOrMulti, many: typing.Optional[bool] = ...) -> TOneOrMultiEncoded: ...

        @typing.overload
        def dumps(self, obj: typing.List[A], many: typing.Optional[bool] = ..., *args, **kwargs) -> str: ...

        @typing.overload
        def dumps(self, obj: A, many: typing.Optional[bool] = ..., *args, **kwargs) -> str: ...

        def dumps(self, obj: TOneOrMulti, many: typing.Optional[bool] = ..., *args, **kwargs) -> str: ...

        @typing.overload
        def load(
            self,
            data: typing.List[TEncoded],
            many: bool = ...,
            partial: typing.Optional[bool] = ...,
            unknown: typing.Optional[str] = ...,
        ) -> typing.List[A]: ...

        @typing.overload
        def load(
            self,
            data: TEncoded,
            many: None = ...,
            partial: typing.Optional[bool] = ...,
            unknown: typing.Optional[str] = ...,
        ) -> A: ...

        def load(
            self,
            data: TOneOrMultiEncoded,
            many: typing.Optional[bool] = ...,
            partial: typing.Optional[bool] = ...,
            unknown: typing.Optional[str] = ...,
        ) -> TOneOrMulti: ...

        @typing.overload
        def loads(
            self,
            json_data: JsonData,
            many: typing.Optional[bool] = ...,
            partial: typing.Optional[bool] = ...,
            unknown: typing.Optional[str] = ...,
            **kwargs,
        ) -> typing.List[A]: ...

        def loads(
            self,
            json_data: JsonData,
            many: typing.Optional[bool] = ...,
            partial: typing.Optional[bool] = ...,
            unknown: typing.Optional[str] = ...,
            **kwargs,
        ) -> TOneOrMulti: ...

    SchemaType = SchemaF[A]
else:
    ...


def build_type(
    type_, options, mixin, field, cls
):  # -> Nested | Field | _TupleVarLen | Tuple | Bool | Decimal | Dict | Float | Function | Int | List | Mapping | Raw | Str | UUID | _TimestampField | Enum | _UnionField:
    ...


def schema(cls, mixin, infer_missing):  # -> dict[Any, Any]:
    ...


def build_schema(cls: typing.Type[A], mixin, infer_missing, partial) -> typing.Type[SchemaType[A]]: ...
