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

from typing import TYPE_CHECKING
from sphinx.domains import Domain
from docutils import nodes
from sphinx.application import Sphinx

"""Measure document reading durations."""
if TYPE_CHECKING:
    ...
logger = ...
class DurationDomain(Domain):
    """A domain for durations of Sphinx processing."""
    name = ...
    @property
    def reading_durations(self) -> dict[str, float]:
        ...
    
    def note_reading_duration(self, duration: float) -> None:
        ...
    
    def clear(self) -> None:
        ...
    
    def clear_doc(self, docname: str) -> None:
        ...
    
    def merge_domaindata(self, docnames: list[str], otherdata: dict[str, float]) -> None:
        ...
    


def on_builder_inited(app: Sphinx) -> None:
    """Initialize DurationDomain on bootstrap.

    This clears the results of the last build.
    """
    ...

def on_source_read(app: Sphinx, docname: str, content: list[str]) -> None:
    """Start to measure reading duration."""
    ...

def on_doctree_read(app: Sphinx, doctree: nodes.document) -> None:
    """Record a reading duration."""
    ...

def on_build_finished(app: Sphinx, error: Exception) -> None:
    """Display duration ranking on the current build."""
    ...

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

