from types import SimpleNamespace

from ._typing import *
from .font_manager import FontProperties

get_unicode_index = ...

class MathtextBackend:
    def __init__(self) -> None: ...
    def set_canvas_size(self, w: float, h: float, d: float) -> None: ...
    def render_glyph(self, ox: float, oy: float, info: SimpleNamespace): ...
    def render_rect_filled(self, x1: float, y1: float, x2: float, y2: float): ...
    def get_results(self, box) -> tuple: ...
    def get_hinting_type(self) -> int: ...

class MathtextBackendAgg(MathtextBackend):
    def __init__(self) -> None: ...
    def set_canvas_size(self, w: float, h: float, d: float) -> None: ...
    def render_glyph(self, ox: float, oy: float, info: SimpleNamespace) -> None: ...
    def render_rect_filled(self, x1: float, y1: float, x2: float, y2: float) -> None: ...
    def get_results(self, box): ...
    def get_hinting_type(self) -> int: ...

class MathtextBackendPath(MathtextBackend):
    def __init__(self) -> None: ...
    def render_glyph(self, ox: float, oy: float, info: SimpleNamespace) -> None: ...
    def render_rect_filled(self, x1: float, y1: float, x2: float, y2: float) -> None: ...
    def get_results(self, box): ...

class MathTextWarning(Warning): ...

class MathTextParser:
    def __init__(self, output: str) -> None: ...
    def parse(self, s: str, dpi: float = ..., prop: FontProperties = ...): ...

def math_to_image(
    s: str,
    filename_or_obj: str | PathLike | FileLike,
    prop: FontProperties = ...,
    dpi: float = ...,
    format: str = ...,
    *,
    color: str = ...,
): ...
