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

from typing import Any, TYPE_CHECKING
from docutils.parsers.rst import directives
from sphinx.directives import ObjectDescription
from sphinx.domains import Domain
from collections.abc import Iterator
from docutils.nodes import Element
from sphinx.addnodes import desc_signature, pending_xref
from sphinx.application import Sphinx
from sphinx.builders import Builder
from sphinx.environment import BuildEnvironment
from sphinx.util.typing import OptionSpec

"""The reStructuredText domain."""
if TYPE_CHECKING:
    ...
logger = ...
dir_sig_re = ...
class ReSTMarkup(ObjectDescription[str]):
    """
    Description of generic reST markup.
    """
    option_spec: OptionSpec = ...
    def add_target_and_index(self, name: str, sig: str, signode: desc_signature) -> None:
        ...
    
    def get_index_text(self, objectname: str, name: str) -> str:
        ...
    


def parse_directive(d: str) -> tuple[str, str]:
    """Parse a directive signature.

    Returns (directive, arguments) string tuple.  If no arguments are given,
    returns (directive, '').
    """
    ...

class ReSTDirective(ReSTMarkup):
    """
    Description of a reST directive.
    """
    def handle_signature(self, sig: str, signode: desc_signature) -> str:
        ...
    
    def get_index_text(self, objectname: str, name: str) -> str:
        ...
    
    def before_content(self) -> None:
        ...
    
    def after_content(self) -> None:
        ...
    


class ReSTDirectiveOption(ReSTMarkup):
    """
    Description of an option for reST directive.
    """
    option_spec: OptionSpec = ...
    def handle_signature(self, sig: str, signode: desc_signature) -> str:
        ...
    
    def add_target_and_index(self, name: str, sig: str, signode: desc_signature) -> None:
        ...
    
    @property
    def current_directive(self) -> str:
        ...
    


class ReSTRole(ReSTMarkup):
    """
    Description of a reST role.
    """
    def handle_signature(self, sig: str, signode: desc_signature) -> str:
        ...
    
    def get_index_text(self, objectname: str, name: str) -> str:
        ...
    


class ReSTDomain(Domain):
    """ReStructuredText domain."""
    name = ...
    label = ...
    object_types = ...
    directives = ...
    roles = ...
    initial_data: dict[str, dict[tuple[str, str], str]] = ...
    @property
    def objects(self) -> dict[tuple[str, str], tuple[str, str]]:
        ...
    
    def note_object(self, objtype: str, name: str, node_id: str, location: Any = ...) -> None:
        ...
    
    def clear_doc(self, docname: str) -> None:
        ...
    
    def merge_domaindata(self, docnames: list[str], otherdata: dict[str, Any]) -> None:
        ...
    
    def resolve_xref(self, env: BuildEnvironment, fromdocname: str, builder: Builder, typ: str, target: str, node: pending_xref, contnode: Element) -> Element | None:
        ...
    
    def resolve_any_xref(self, env: BuildEnvironment, fromdocname: str, builder: Builder, target: str, node: pending_xref, contnode: Element) -> list[tuple[str, Element]]:
        ...
    
    def get_objects(self) -> Iterator[tuple[str, str, str, str, str, int]]:
        ...
    


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

