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

from typing import Any, TYPE_CHECKING
from sphinx.transforms import SphinxTransform
from collections.abc import Iterator
from docutils.nodes import Node
from sphinx.application import Sphinx

"""Implements the low-level algorithms Sphinx uses for versioning doctrees."""
if TYPE_CHECKING:
    ...
IS_SPEEDUP = ...
VERSIONING_RATIO = ...
def add_uids(doctree: Node, condition: Any) -> Iterator[Node]:
    """Add a unique id to every node in the `doctree` which matches the
    condition and yield the nodes.

    :param doctree:
        A :class:`docutils.nodes.document` instance.

    :param condition:
        A callable which returns either ``True`` or ``False`` for a given node.
    """
    ...

def merge_doctrees(old: Node, new: Node, condition: Any) -> Iterator[Node]:
    """Merge the `old` doctree with the `new` one while looking at nodes
    matching the `condition`.

    Each node which replaces another one or has been added to the `new` doctree
    will be yielded.

    :param condition:
        A callable which returns either ``True`` or ``False`` for a given node.
    """
    ...

def get_ratio(old: str, new: str) -> float:
    """Return a "similarity ratio" (in percent) representing the similarity
    between the two strings where 0 is equal and anything above less than equal.
    """
    ...

def levenshtein_distance(a: str, b: str) -> int:
    """Return the Levenshtein edit distance between two strings *a* and *b*."""
    ...

class UIDTransform(SphinxTransform):
    """Add UIDs to doctree for versioning."""
    default_priority = ...
    def apply(self, **kwargs: Any) -> None:
        ...
    


def setup(app: Sphinx) -> dict[str, Any]:
    ...

