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

from typing import Any, NamedTuple, TYPE_CHECKING
from sphinx.builders import _epub_base
from sphinx.config import Config
from sphinx.application import Sphinx

"""Build epub3 files.

Originally derived from epub.py.
"""
if TYPE_CHECKING:
    ...
logger = ...
class NavPoint(NamedTuple):
    text: str
    refuri: str
    children: list[NavPoint]
    ...


PAGE_PROGRESSION_DIRECTIONS = ...
IBOOK_SCROLL_AXIS = ...
THEME_WRITING_MODES = ...
DOCTYPE = ...
HTML_TAG = ...
_xml_name_start_char = ...
_xml_name_char = ...
_XML_NAME_PATTERN = ...
class Epub3Builder(_epub_base.EpubBuilder):
    """
    Builder that outputs epub3 files.

    It creates the metainfo files content.opf, nav.xhtml, toc.ncx, mimetype,
    and META-INF/container.xml. Afterwards, all necessary files are zipped to
    an epub file.
    """
    name = ...
    epilog = ...
    supported_remote_images = ...
    template_dir = ...
    doctype = ...
    html_tag = ...
    use_meta_charset = ...
    def handle_finish(self) -> None:
        """Create the metainfo files and finally the epub."""
        ...
    
    def content_metadata(self) -> dict[str, Any]:
        """Create a dictionary with all metadata for the content.opf
        file properly escaped.
        """
        ...
    
    def prepare_writing(self, docnames: set[str]) -> None:
        ...
    
    def build_navlist(self, navnodes: list[dict[str, Any]]) -> list[NavPoint]:
        """Create the toc navigation structure.

        This method is almost same as build_navpoints method in epub.py.
        This is because the logical navigation structure of epub3 is not
        different from one of epub2.

        The difference from build_navpoints method is templates which are used
        when generating navigation documents.
        """
        ...
    
    def navigation_doc_metadata(self, navlist: list[NavPoint]) -> dict[str, Any]:
        """Create a dictionary with all metadata for the nav.xhtml file
        properly escaped.
        """
        ...
    
    def build_navigation_doc(self) -> None:
        """Write the metainfo file nav.xhtml."""
        ...
    


def validate_config_values(app: Sphinx) -> None:
    ...

def convert_epub_css_files(app: Sphinx, config: Config) -> None:
    """This converts string styled epub_css_files to tuple styled one."""
    ...

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

