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

from ruamel.yaml.compat import MutableSliceableSequence, ordereddict
from ruamel.yaml.tag import Tag
from collections.abc import Mapping, MutableSet, Set, Sized

if False: ...
__all__ = [
    "CommentedSeq",
    "CommentedKeySeq",
    "CommentedMap",
    "CommentedOrderedMap",
    "CommentedSet",
    "comment_attrib",
    "merge_attrib",
    "TaggedScalar",
    "C_POST",
    "C_PRE",
    "C_SPLIT_ON_FIRST_BLANK",
    "C_BLANK_LINE_PRESERVE_SPACE",
]
C_POST = ...
C_PRE = ...
C_SPLIT_ON_FIRST_BLANK = ...
C_BLANK_LINE_PRESERVE_SPACE = ...

class IDX:
    def __init__(self) -> None: ...
    def __call__(self) -> Any: ...
    def __str__(self) -> Any: ...

cidx = ...
C_ELEM_EOL = ...
C_KEY_EOL = ...
C_ELEM_PRE = ...
C_ELEM_POST = ...
C_VALUE_PRE = ...
C_KEY_POST = ...
C_TAG_EOL = ...
C_TAG_POST = ...
C_TAG_PRE = ...
C_ANCHOR_EOL = ...
C_ANCHOR_POST = ...
C_ANCHOR_PRE = ...
comment_attrib = ...
format_attrib = ...
line_col_attrib = ...
merge_attrib = ...

class Comment:
    __slots__ = ...
    attrib = ...
    def __init__(self, old: bool = ...) -> None: ...
    def __str__(self) -> str: ...
    def __repr__(self) -> str: ...
    @property
    def items(self) -> Any: ...
    @property
    def end(self) -> Any: ...
    @end.setter
    def end(self, value: Any) -> None: ...
    @property
    def pre(self) -> Any: ...
    @pre.setter
    def pre(self, value: Any) -> None: ...
    def get(self, item: Any, pos: Any) -> Any: ...
    def set(self, item: Any, pos: Any, value: Any) -> Any: ...
    def __contains__(self, x: Any) -> Any: ...

class NotNone: ...

class Format:
    __slots__ = ...
    attrib = ...
    def __init__(self) -> None: ...
    def set_flow_style(self) -> None: ...
    def set_block_style(self) -> None: ...
    def flow_style(self, default: Optional[Any] = ...) -> Any:
        """if default (the flow_style) is None, the flow style tacked on to
        the object explicitly will be taken. If that is None as well the
        default flow style rules the format down the line, or the type
        of the constituent values (simple -> flow, map/list -> block)"""
        ...

    def __repr__(self) -> str: ...

class LineCol:
    """
    line and column information wrt document, values start at zero (0)
    """

    attrib = ...
    def __init__(self) -> None: ...
    def add_kv_line_col(self, key: Any, data: Any) -> None: ...
    def key(self, k: Any) -> Any: ...
    def value(self, k: Any) -> Any: ...
    def item(self, idx: Any) -> Any: ...
    def add_idx_line_col(self, key: Any, data: Any) -> None: ...
    def __repr__(self) -> str: ...

class CommentedBase:
    @property
    def ca(self) -> Any: ...
    def yaml_end_comment_extend(self, comment: Any, clear: bool = ...) -> None: ...
    def yaml_key_comment_extend(
        self, key: Any, comment: Any, clear: bool = ...
    ) -> None: ...
    def yaml_value_comment_extend(
        self, key: Any, comment: Any, clear: bool = ...
    ) -> None: ...
    def yaml_set_start_comment(self, comment: Any, indent: Any = ...) -> None:
        """overwrites any preceding comment lines on an object
        expects comment to be without `#` and possible have multiple lines
        """
        ...

    def yaml_set_comment_before_after_key(
        self,
        key: Any,
        before: Any = ...,
        indent: Any = ...,
        after: Any = ...,
        after_indent: Any = ...,
    ) -> None:
        """
        expects comment (before/after) to be without `#` and possible have multiple lines
        """
        ...

    @property
    def fa(self) -> Any:
        """format attribute

        set_flow_style()/set_block_style()"""
        ...

    def yaml_add_eol_comment(
        self, comment: Any, key: Optional[Any] = ..., column: Optional[Any] = ...
    ) -> None:
        """
        there is a problem as eol comments should start with ' #'
        (but at the beginning of the line the space doesn't have to be before
        the #. The column index is for the # mark
        """
        ...

    @property
    def lc(self) -> Any: ...
    @property
    def anchor(self) -> Any: ...
    def yaml_anchor(self) -> Any: ...
    def yaml_set_anchor(self, value: Any, always_dump: bool = ...) -> None: ...
    @property
    def tag(self) -> Any: ...
    def yaml_set_ctag(self, value: Tag) -> None: ...
    def copy_attributes(self, t: Any, memo: Any = ...) -> Any:
        """
        copies the YAML related attributes, not e.g. .values
        returns target
        """
        ...

class CommentedSeq(MutableSliceableSequence, list, CommentedBase):
    __slots__ = ...
    def __init__(self, *args: Any, **kw: Any) -> None: ...
    def __getsingleitem__(self, idx: Any) -> Any: ...
    def __setsingleitem__(self, idx: Any, value: Any) -> None: ...
    def __delsingleitem__(self, idx: Any = ...) -> Any: ...
    def __len__(self) -> int: ...
    def insert(self, idx: Any, val: Any) -> None:
        """the comments after the insertion have to move forward"""
        ...

    def extend(self, val: Any) -> None: ...
    def __eq__(self, other: Any) -> bool: ...
    def __deepcopy__(self, memo: Any) -> Any: ...
    def __add__(self, other: Any) -> Any: ...
    def sort(self, key: Any = ..., reverse: bool = ...) -> None: ...
    def __repr__(self) -> Any: ...

class CommentedKeySeq(tuple, CommentedBase):
    """This primarily exists to be able to roundtrip keys that are sequences"""

    ...

class CommentedMapView(Sized):
    __slots__ = ...
    def __init__(self, mapping: Any) -> None: ...
    def __len__(self) -> int: ...

class CommentedMapKeysView(CommentedMapView, Set):
    __slots__ = ...
    def __contains__(self, key: Any) -> Any: ...
    def __iter__(self) -> Any: ...

class CommentedMapItemsView(CommentedMapView, Set):
    __slots__ = ...
    def __contains__(self, item: Any) -> Any: ...
    def __iter__(self) -> Any: ...

class CommentedMapValuesView(CommentedMapView):
    __slots__ = ...
    def __contains__(self, value: Any) -> Any: ...
    def __iter__(self) -> Any: ...

class CommentedMap(ordereddict, CommentedBase):
    __slots__ = ...
    def __init__(self, *args: Any, **kw: Any) -> None: ...
    def update(self, *vals: Any, **kw: Any) -> None: ...
    def insert(
        self, pos: Any, key: Any, value: Any, comment: Optional[Any] = ...
    ) -> None:
        """insert key value into given position, as defined by source YAML
        attach comment if provided
        """
        ...

    def mlget(self, key: Any, default: Any = ..., list_ok: Any = ...) -> Any:
        """multi-level get that expects dicts within dicts"""
        ...

    def __getitem__(self, key: Any) -> Any: ...
    def __setitem__(self, key: Any, value: Any) -> None: ...
    def __contains__(self, key: Any) -> bool: ...
    def get(self, key: Any, default: Any = ...) -> Any: ...
    def __repr__(self) -> Any: ...
    def non_merged_items(self) -> Any: ...
    def __delitem__(self, key: Any) -> None: ...
    def __iter__(self) -> Any: ...
    def pop(self, key: Any, default: Any = ...) -> Any: ...
    def __len__(self) -> int: ...
    def __eq__(self, other: Any) -> bool: ...
    def keys(self) -> Any: ...
    def values(self) -> Any: ...
    def items(self) -> Any: ...
    @property
    def merge(self) -> Any: ...
    def copy(self) -> Any: ...
    def add_referent(self, cm: Any) -> None: ...
    def add_yaml_merge(self, value: Any) -> None: ...
    def update_key_value(self, key: Any) -> None: ...
    def __deepcopy__(self, memo: Any) -> Any: ...

@classmethod
def raise_immutable(cls: Any, *args: Any, **kwargs: Any) -> None: ...

class CommentedKeyMap(CommentedBase, Mapping):
    __slots__ = ...
    def __init__(self, *args: Any, **kw: Any) -> None: ...

    update = ...
    def __getitem__(self, index: Any) -> Any: ...
    def __iter__(self) -> Iterator[Any]: ...
    def __len__(self) -> int: ...
    def __hash__(self) -> Any: ...
    def __repr__(self) -> Any: ...
    @classmethod
    def fromkeys(keys: Any, v: Any = ...) -> Any: ...

class CommentedOrderedMap(CommentedMap):
    __slots__ = ...

class CommentedSet(MutableSet, CommentedBase):
    __slots__ = ...
    def __init__(self, values: Any = ...) -> None: ...
    def add(self, value: Any) -> None:
        """Add an element."""
        ...

    def discard(self, value: Any) -> None:
        """Remove an element.  Do not raise an exception if absent."""
        ...

    def __contains__(self, x: Any) -> Any: ...
    def __iter__(self) -> Any: ...
    def __len__(self) -> int: ...
    def __repr__(self) -> str: ...

class TaggedScalar(CommentedBase):
    def __init__(self, value: Any = ..., style: Any = ..., tag: Any = ...) -> None: ...
    def __str__(self) -> Any: ...
    def count(
        self, s: str, start: Optional[int] = ..., end: Optional[int] = ...
    ) -> Any: ...
    def __getitem__(self, pos: int) -> Any: ...
    def __repr__(self) -> str: ...

def dump_comments(d: Any, name: str = ..., sep: str = ..., out: Any = ...) -> None:
    """
    recursively dump comments, all but the toplevel preceded by the path
    in dotted form x.0.a
    """
    ...
