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

from typing import Any, Dict, Optional, Union

from ruamel.yaml.error import *
from ruamel.yaml.nodes import *

if False: ...
__all__ = [
    "BaseRepresenter",
    "SafeRepresenter",
    "Representer",
    "RepresenterError",
    "RoundTripRepresenter",
]

class RepresenterError(YAMLError): ...

class BaseRepresenter:
    yaml_representers: Dict[Any, Any] = ...
    yaml_multi_representers: Dict[Any, Any] = ...
    def __init__(
        self: Any,
        default_style: Any = ...,
        default_flow_style: Any = ...,
        dumper: Any = ...,
    ) -> None: ...
    @property
    def serializer(self) -> Any: ...
    def represent(self, data: Any) -> None: ...
    def represent_data(self, data: Any) -> Any: ...
    def represent_key(self, data: Any) -> Any:
        """
        David Fraser: Extract a method to represent keys in mappings, so that
        a subclass can choose not to quote them (for example)
        used in represent_mapping
        https://bitbucket.org/davidfraser/pyyaml/commits/d81df6eb95f20cac4a79eed95ae553b5c6f77b8c
        """
        ...

    @classmethod
    def add_representer(cls, data_type: Any, representer: Any) -> None: ...
    @classmethod
    def add_multi_representer(cls, data_type: Any, representer: Any) -> None: ...
    def represent_scalar(
        self, tag: Any, value: Any, style: Any = ..., anchor: Any = ...
    ) -> ScalarNode: ...
    def represent_sequence(
        self, tag: Any, sequence: Any, flow_style: Any = ...
    ) -> SequenceNode: ...
    def represent_omap(
        self, tag: Any, omap: Any, flow_style: Any = ...
    ) -> SequenceNode: ...
    def represent_mapping(
        self, tag: Any, mapping: Any, flow_style: Any = ...
    ) -> MappingNode: ...
    def ignore_aliases(self, data: Any) -> bool: ...

class SafeRepresenter(BaseRepresenter):
    def ignore_aliases(self, data: Any) -> bool: ...
    def represent_none(self, data: Any) -> ScalarNode: ...
    def represent_str(self, data: Any) -> Any: ...
    def represent_binary(self, data: Any) -> ScalarNode: ...
    def represent_bool(self, data: Any, anchor: Optional[Any] = ...) -> ScalarNode: ...
    def represent_int(self, data: Any) -> ScalarNode: ...

    inf_value = ...
    def represent_float(self, data: Any) -> ScalarNode: ...
    def represent_list(self, data: Any) -> SequenceNode: ...
    def represent_dict(self, data: Any) -> MappingNode: ...
    def represent_ordereddict(self, data: Any) -> SequenceNode: ...
    def represent_set(self, data: Any) -> MappingNode: ...
    def represent_date(self, data: Any) -> ScalarNode: ...
    def represent_datetime(self, data: Any) -> ScalarNode: ...
    def represent_yaml_object(
        self, tag: Any, data: Any, cls: Any, flow_style: Any = ...
    ) -> MappingNode: ...
    def represent_undefined(self, data: Any) -> None: ...

class Representer(SafeRepresenter):
    def represent_complex(self, data: Any) -> Any: ...
    def represent_tuple(self, data: Any) -> SequenceNode: ...
    def represent_name(self, data: Any) -> ScalarNode: ...
    def represent_module(self, data: Any) -> ScalarNode: ...
    def represent_object(self, data: Any) -> Union[SequenceNode, MappingNode]: ...

class RoundTripRepresenter(SafeRepresenter):
    def __init__(
        self, default_style: Any = ..., default_flow_style: Any = ..., dumper: Any = ...
    ) -> None: ...
    def ignore_aliases(self, data: Any) -> bool: ...
    def represent_none(self, data: Any) -> ScalarNode: ...
    def represent_literal_scalarstring(self, data: Any) -> ScalarNode: ...

    represent_preserved_scalarstring = ...
    def represent_folded_scalarstring(self, data: Any) -> ScalarNode: ...
    def represent_single_quoted_scalarstring(self, data: Any) -> ScalarNode: ...
    def represent_double_quoted_scalarstring(self, data: Any) -> ScalarNode: ...
    def represent_plain_scalarstring(self, data: Any) -> ScalarNode: ...
    def insert_underscore(
        self, prefix: Any, s: Any, underscore: Any, anchor: Any = ...
    ) -> ScalarNode: ...
    def represent_scalar_int(self, data: Any) -> ScalarNode: ...
    def represent_binary_int(self, data: Any) -> ScalarNode: ...
    def represent_octal_int(self, data: Any) -> ScalarNode: ...
    def represent_hex_int(self, data: Any) -> ScalarNode: ...
    def represent_hex_caps_int(self, data: Any) -> ScalarNode: ...
    def represent_scalar_float(self, data: Any) -> ScalarNode:
        """This is way more complicated"""
        ...

    def represent_sequence(
        self, tag: Any, sequence: Any, flow_style: Any = ...
    ) -> SequenceNode: ...
    def merge_comments(self, node: Any, comments: Any) -> Any: ...
    def represent_key(self, data: Any) -> Any: ...
    def represent_mapping(
        self, tag: Any, mapping: Any, flow_style: Any = ...
    ) -> MappingNode: ...
    def represent_omap(
        self, tag: Any, omap: Any, flow_style: Any = ...
    ) -> SequenceNode: ...
    def represent_set(self, setting: Any) -> MappingNode: ...
    def represent_dict(self, data: Any) -> MappingNode:
        """Write out tag if saved on loading"""
        ...

    def represent_list(self, data: Any) -> SequenceNode: ...
    def represent_datetime(self, data: Any) -> ScalarNode: ...
    def represent_tagged_scalar(self, data: Any) -> ScalarNode: ...
    def represent_scalar_bool(self, data: Any) -> ScalarNode: ...
    def represent_yaml_object(
        self, tag: Any, data: Any, cls: Any, flow_style: Optional[Any] = ...
    ) -> MappingNode: ...
