from collections.abc import (
    Hashable,
    Sequence,
)
from typing import (
    final,
    overload,
)

import numpy as np
from pandas.core.indexes.base import (
    Index,
    _IndexSubclassBase,
)

from pandas._typing import (
    HashableT,
    MaskType,
    np_1darray,
    np_ndarray_anyint,
)

class RangeIndex(_IndexSubclassBase[int, np.int64]):
    def __new__(
        cls,
        start: int | RangeIndex | range = ...,
        stop: int = ...,
        step: int = ...,
        dtype=...,
        copy: bool = ...,
        name: Hashable = ...,
    ): ...
    @classmethod
    def from_range(cls, data, name: Hashable = ..., dtype=...): ...
    def __reduce__(self): ...
    @property
    def start(self) -> int: ...
    @property
    def stop(self) -> int: ...
    @property
    def step(self) -> int: ...
    @property
    def nbytes(self) -> int: ...
    def memory_usage(self, deep: bool = ...) -> int: ...
    @property
    def dtype(self) -> np.dtype: ...
    @property
    def is_unique(self) -> bool: ...
    @property
    def is_monotonic_increasing(self) -> bool: ...
    @property
    def is_monotonic_decreasing(self) -> bool: ...
    @property
    def has_duplicates(self) -> bool: ...
    def __contains__(self, key: int | np.integer) -> bool: ...
    @final
    def get_indexer(self, target, method=..., limit=..., tolerance=...): ...
    def tolist(self): ...
    def min(self, axis=..., skipna: bool = ..., *args, **kwargs): ...
    def max(self, axis=..., skipna: bool = ..., *args, **kwargs): ...
    def argsort(self, *args, **kwargs): ...
    def factorize(
        self, sort: bool = False, use_na_sentinel: bool = True
    ) -> tuple[np_1darray[np.intp], RangeIndex]: ...
    def equals(self, other): ...
    @final
    def join(
        self,
        other,
        *,
        how: str = ...,
        level=...,
        return_indexers: bool = ...,
        sort: bool = ...,
    ): ...
    def __len__(self) -> int: ...
    @property
    def size(self) -> int: ...
    def __floordiv__(self, other): ...
    def all(self, *args, **kwargs) -> bool: ...
    def any(self, *args, **kwargs) -> bool: ...
    @final
    def union(  # pyrefly: ignore
        self, other: list[HashableT] | Index, sort: bool | None = None
    ) -> Index | Index[int] | RangeIndex: ...
    @overload  # type: ignore[override]
    def __getitem__(
        self,
        idx: slice | np_ndarray_anyint | Sequence[int] | Index | MaskType,
    ) -> Index: ...
    @overload
    def __getitem__(  # pyright: ignore[reportIncompatibleMethodOverride]
        self, idx: int
    ) -> int: ...
