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

import re
from typing import Callable, TYPE_CHECKING
from collections.abc import Iterable, Iterator

"""Pattern-matching utility functions for Sphinx."""
if TYPE_CHECKING:
    ...
def compile_matchers(patterns: Iterable[str]) -> list[Callable[[str], re.Match[str] | None]]:
    ...

class Matcher:
    """A pattern matcher for Multiple shell-style glob patterns.

    Note: this modifies the patterns to work with copy_asset().
          For example, "**/index.rst" matches with "index.rst"
    """
    def __init__(self, exclude_patterns: Iterable[str]) -> None:
        ...
    
    def __call__(self, string: str) -> bool:
        ...
    
    def match(self, string: str) -> bool:
        ...
    


DOTFILES = ...
_pat_cache: dict[str, re.Pattern[str]] = ...
def patmatch(name: str, pat: str) -> re.Match[str] | None:
    """Return if name matches the regular expression (pattern)
    ``pat```. Adapted from fnmatch module."""
    ...

def patfilter(names: Iterable[str], pat: str) -> list[str]:
    """Return the subset of the list ``names`` that match
    the regular expression (pattern) ``pat``.

    Adapted from fnmatch module.
    """
    ...

def get_matching_files(dirname: str | os.PathLike[str], include_patterns: Iterable[str] = ..., exclude_patterns: Iterable[str] = ...) -> Iterator[str]:
    """Get all file names in a directory, recursively.

    Filter file names by the glob-style include_patterns and exclude_patterns.
    The default values include all files ("**") and exclude nothing ("").

    Only files matching some pattern in *include_patterns* are included, and
    exclusions from *exclude_patterns* take priority over inclusions.

    """
    ...

