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

import numpy as np
from typing import Any, Callable, TYPE_CHECKING, TypeVar
from pandas._libs.tslibs import BaseOffset, Resolution
from pandas.util._decorators import Appender, cache_readonly, doc
from pandas.core.arrays import DatetimeArray, PeriodArray, TimedeltaArray
from pandas.core.arrays.datetimelike import DatetimeLikeArrayMixin
from pandas.core.indexes.base import Index, _index_shared_docs
from pandas.core.indexes.extension import NDArrayBackedExtensionIndex, inherit_names

"""
Base and utility classes for tseries type pandas objects.
"""
if TYPE_CHECKING:
    ...
_index_doc_kwargs = ...
_T = TypeVar("_T", bound="DatetimeIndexOpsMixin")
_TDT = TypeVar("_TDT", bound="DatetimeTimedeltaMixin")
@inherit_names(["inferred_freq", "_resolution_obj", "resolution"], DatetimeLikeArrayMixin, cache=True)
@inherit_names(["mean", "asi8", "freq", "freqstr"], DatetimeLikeArrayMixin)
class DatetimeIndexOpsMixin(NDArrayBackedExtensionIndex):
    """
    Common ops mixin to support a unified interface datetimelike Index.
    """
    _is_numeric_dtype = ...
    _can_hold_strings = ...
    _data: DatetimeArray | TimedeltaArray | PeriodArray
    freq: BaseOffset | None
    freqstr: str | None
    _resolution_obj: Resolution
    @cache_readonly
    def hasnans(self) -> bool:
        ...
    
    def equals(self, other: Any) -> bool:
        """
        Determines if two Index objects contain the same elements.
        """
        ...
    
    @Appender(Index.__contains__.__doc__)
    def __contains__(self, key: Any) -> bool:
        ...
    
    def format(self, name: bool = ..., formatter: Callable | None = ..., na_rep: str = ..., date_format: str | None = ...) -> list[str]:
        """
        Render a string representation of the Index.
        """
        ...
    
    def shift(self: _T, periods: int = ..., freq=...) -> _T:
        """
        Shift index by desired number of time frequency increments.

        This method is for shifting the values of datetime-like indexes
        by a specified time increment a given number of times.

        Parameters
        ----------
        periods : int, default 1
            Number of periods (or increments) to shift by,
            can be positive or negative.
        freq : pandas.DateOffset, pandas.Timedelta or string, optional
            Frequency increment to shift by.
            If None, the index is shifted by its own `freq` attribute.
            Offset aliases are valid strings, e.g., 'D', 'W', 'M' etc.

        Returns
        -------
        pandas.DatetimeIndex
            Shifted index.

        See Also
        --------
        Index.shift : Shift values of Index.
        PeriodIndex.shift : Shift values of PeriodIndex.
        """
        ...
    


class DatetimeTimedeltaMixin(DatetimeIndexOpsMixin):
    """
    Mixin class for methods shared by DatetimeIndex and TimedeltaIndex,
    but not PeriodIndex
    """
    _data: DatetimeArray | TimedeltaArray
    _comparables = ...
    _attributes = ...
    _is_monotonic_increasing = ...
    _is_monotonic_decreasing = ...
    _is_unique = ...
    _join_precedence = ...
    def is_type_compatible(self, kind: str) -> bool:
        ...
    
    @property
    def values(self) -> np.ndarray:
        ...
    
    @doc(NDArrayBackedExtensionIndex.delete)
    def delete(self, loc) -> DatetimeTimedeltaMixin:
        ...
    
    @doc(NDArrayBackedExtensionIndex.insert)
    def insert(self, loc: int, item): # -> Self@DatetimeTimedeltaMixin | Index:
        ...
    
    @Appender(_index_shared_docs["take"] % _index_doc_kwargs)
    def take(self, indices, axis=..., allow_fill=..., fill_value=..., **kwargs): # -> NDArrayBackedExtensionIndex:
        ...
    


