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

import contextlib
from importlib.abc import Loader, MetaPathFinder
from importlib.machinery import ModuleSpec
from types import ModuleType
from typing import Any, TYPE_CHECKING
from collections.abc import Generator, Iterator, Sequence

"""mock for autodoc"""
if TYPE_CHECKING:
    ...
logger = ...
class _MockObject:
    """Used by autodoc_mock_imports."""
    __display_name__ = ...
    __name__ = ...
    __sphinx_mock__ = ...
    __sphinx_decorator_args__: tuple[Any, ...] = ...
    def __new__(cls, *args: Any, **kwargs: Any) -> Any:
        ...
    
    def __init__(self, *args: Any, **kwargs: Any) -> None:
        ...
    
    def __len__(self) -> int:
        ...
    
    def __contains__(self, key: str) -> bool:
        ...
    
    def __iter__(self) -> Iterator:
        ...
    
    def __mro_entries__(self, bases: tuple) -> tuple:
        ...
    
    def __getitem__(self, key: Any) -> _MockObject:
        ...
    
    def __getattr__(self, key: str) -> _MockObject:
        ...
    
    def __call__(self, *args: Any, **kwargs: Any) -> Any:
        ...
    
    def __repr__(self) -> str:
        ...
    


class _MockModule(ModuleType):
    """Used by autodoc_mock_imports."""
    __file__ = ...
    __sphinx_mock__ = ...
    def __init__(self, name: str) -> None:
        ...
    
    def __getattr__(self, name: str) -> _MockObject:
        ...
    
    def __repr__(self) -> str:
        ...
    


class MockLoader(Loader):
    """A loader for mocking."""
    def __init__(self, finder: MockFinder) -> None:
        ...
    
    def create_module(self, spec: ModuleSpec) -> ModuleType:
        ...
    
    def exec_module(self, module: ModuleType) -> None:
        ...
    


class MockFinder(MetaPathFinder):
    """A finder for mocking."""
    def __init__(self, modnames: list[str]) -> None:
        ...
    
    def find_spec(self, fullname: str, path: Sequence[bytes | str] | None, target: ModuleType | None = ...) -> ModuleSpec | None:
        ...
    
    def invalidate_caches(self) -> None:
        """Invalidate mocked modules on sys.modules."""
        ...
    


@contextlib.contextmanager
def mock(modnames: list[str]) -> Generator[None, None, None]:
    """Insert mock modules during context::

        with mock(['target.module.name']):
            # mock modules are enabled here
            ...
    """
    ...

def ismockmodule(subject: Any) -> bool:
    """Check if the object is a mocked module."""
    ...

def ismock(subject: Any) -> bool:
    """Check if the object is mocked."""
    ...

def undecorate(subject: _MockObject) -> Any:
    """Unwrap mock if *subject* is decorated by mocked object.

    If not decorated, returns given *subject* itself.
    """
    ...

