from _typeshed import Incomplete
from collections.abc import Generator
from docassemble.base.mako import compat as compat, util as util
from docassemble.base.mako.ext.pygmentplugin import pygments_html_formatter

class MakoException(Exception): ...
class RuntimeException(MakoException): ...

def _format_filepos(lineno, pos, filename): ...

class CompileException(MakoException):
    lineno: Incomplete
    pos: Incomplete
    filename: Incomplete
    source: Incomplete
    def __init__(self, message, source, lineno, pos, filename) -> None: ...

class SyntaxException(MakoException):
    lineno: Incomplete
    pos: Incomplete
    filename: Incomplete
    source: Incomplete
    def __init__(self, message, source, lineno, pos, filename) -> None: ...

class UnsupportedError(MakoException): ...
class NameConflictError(MakoException): ...
class TemplateLookupException(MakoException): ...
class TopLevelLookupException(TemplateLookupException): ...

class RichTraceback:
    error: Incomplete
    records: Incomplete
    source: Incomplete
    lineno: Incomplete
    _has_source: bool
    def __init__(self, error: Incomplete | None = ..., traceback: Incomplete | None = ...) -> None: ...
    @property
    def errorname(self): ...
    message: Incomplete
    def _init_message(self) -> None: ...
    def _get_reformatted_records(self, records) -> Generator[Incomplete, None, None]: ...
    @property
    def traceback(self): ...
    @property
    def reverse_records(self): ...
    @property
    def reverse_traceback(self): ...
    def _init(self, trcback): ...

def text_error_template(lookup: Incomplete | None = ...): ...
def _install_pygments() -> None: ...
def _install_fallback(): ...
def _install_highlighting() -> None: ...
def html_error_template(): ...
