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

import numpy as np
from typing import Any, TYPE_CHECKING
from pandas._typing import ArrayLike, Axis, npt
from pandas import Index

"""
Routines for filling missing data.
"""
if TYPE_CHECKING:
    ...
def check_value_size(value, mask: npt.NDArray[np.bool_], length: int):
    """
    Validate the size of the values passed to ExtensionArray.fillna.
    """
    ...

def mask_missing(arr: ArrayLike, values_to_mask) -> npt.NDArray[np.bool_]:
    """
    Return a masking array of same size/shape as arr
    with entries equaling any member of values_to_mask set to True

    Parameters
    ----------
    arr : ArrayLike
    values_to_mask: list, tuple, or scalar

    Returns
    -------
    np.ndarray[bool]
    """
    ...

def clean_fill_method(method: str | None, allow_nearest: bool = ...): # -> str | None:
    ...

NP_METHODS = ...
SP_METHODS = ...
def clean_interp_method(method: str, index: Index, **kwargs) -> str:
    ...

def find_valid_index(values, *, how: str) -> int | None:
    """
    Retrieves the index of the first valid value.

    Parameters
    ----------
    values : ndarray or ExtensionArray
    how : {'first', 'last'}
        Use this parameter to change between the first or last valid index.

    Returns
    -------
    int or None
    """
    ...

def interpolate_array_2d(data: np.ndarray, method: str = ..., axis: int = ..., index: Index | None = ..., limit: int | None = ..., limit_direction: str = ..., limit_area: str | None = ..., fill_value: Any | None = ..., coerce: bool = ..., downcast: str | None = ..., **kwargs) -> None:
    """
    Wrapper to dispatch to either interpolate_2d or _interpolate_2d_with_fill.

    Notes
    -----
    Alters 'data' in-place.
    """
    ...

def interpolate_2d(values: np.ndarray, method: str = ..., axis: Axis = ..., limit: int | None = ..., limit_area: str | None = ...) -> None:
    """
    Perform an actual interpolation of values, values will be make 2-d if
    needed fills inplace, returns the result.

    Parameters
    ----------
    values: np.ndarray
        Input array.
    method: str, default "pad"
        Interpolation method. Could be "bfill" or "pad"
    axis: 0 or 1
        Interpolation axis
    limit: int, optional
        Index limit on interpolation.
    limit_area: str, optional
        Limit area for interpolation. Can be "inside" or "outside"

    Notes
    -----
    Modifies values in-place.
    """
    ...

_fill_methods = ...
def get_fill_func(method, ndim: int = ...): # -> (values: ndarray[Unknown, Unknown], limit: int | None = None, mask: NDArray[bool_] | None = None) -> tuple[ndarray[Unknown, Unknown], NDArray[bool_]]:
    ...

def clean_reindex_fill_method(method) -> str | None:
    ...

