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

from typing import Generator, Iterable, Iterator

"""
Utilities for interpreting CSS from Stylers for formatting non-HTML outputs.
"""
class CSSResolver:
    """
    A callable for parsing and resolving CSS to atomic properties.
    """
    UNIT_RATIOS = ...
    FONT_SIZE_RATIOS = ...
    MARGIN_RATIOS = ...
    BORDER_WIDTH_RATIOS = ...
    BORDER_STYLES = ...
    SIDE_SHORTHANDS = ...
    SIDES = ...
    CSS_EXPANSIONS = ...
    def __call__(self, declarations: str | Iterable[tuple[str, str]], inherited: dict[str, str] | None = ...) -> dict[str, str]:
        """
        The given declarations to atomic properties.

        Parameters
        ----------
        declarations_str : str | Iterable[tuple[str, str]]
            A CSS string or set of CSS declaration tuples
            e.g. "font-weight: bold; background: blue" or
            {("font-weight", "bold"), ("background", "blue")}
        inherited : dict, optional
            Atomic properties indicating the inherited style context in which
            declarations_str is to be resolved. ``inherited`` should already
            be resolved, i.e. valid output of this method.

        Returns
        -------
        dict
            Atomic CSS 2.2 properties.

        Examples
        --------
        >>> resolve = CSSResolver()
        >>> inherited = {'font-family': 'serif', 'font-weight': 'bold'}
        >>> out = resolve('''
        ...               border-color: BLUE RED;
        ...               font-size: 1em;
        ...               font-size: 2em;
        ...               font-weight: normal;
        ...               font-weight: inherit;
        ...               ''', inherited)
        >>> sorted(out.items())  # doctest: +NORMALIZE_WHITESPACE
        [('border-bottom-color', 'blue'),
         ('border-left-color', 'red'),
         ('border-right-color', 'red'),
         ('border-top-color', 'blue'),
         ('font-family', 'serif'),
         ('font-size', '24pt'),
         ('font-weight', 'bold')]
        """
        ...
    
    def size_to_pt(self, in_val, em_pt=..., conversions=...): # -> str:
        ...
    
    def atomize(self, declarations: Iterable) -> Generator[tuple[str, str], None, None]:
        ...
    
    def parse(self, declarations_str: str) -> Iterator[tuple[str, str]]:
        """
        Generates (prop, value) pairs from declarations.

        In a future version may generate parsed tokens from tinycss/tinycss2

        Parameters
        ----------
        declarations_str : str
        """
        ...
    


