from collections.abc import Iterable
from typing import TypeAlias

from .ast import AtRule, Comment, Declaration, Node, ParseError, QualifiedRule, WhitespaceToken

_Rule: TypeAlias = QualifiedRule | AtRule | Comment | WhitespaceToken | ParseError

def parse_one_component_value(input: str | Iterable[Node], skip_comments: bool = False) -> Node: ...
def parse_one_declaration(input: str | Iterable[Node], skip_comments: bool = False) -> Declaration | ParseError: ...
def parse_blocks_contents(
    input: str | Iterable[Node], skip_comments: bool = False, skip_whitespace: bool = False
) -> list[Declaration | AtRule | QualifiedRule | Comment | WhitespaceToken | ParseError]: ...
def parse_declaration_list(
    input: str | Iterable[Node], skip_comments: bool = False, skip_whitespace: bool = False
) -> list[Declaration | AtRule | Comment | WhitespaceToken | ParseError]: ...
def parse_one_rule(input: str | Iterable[Node], skip_comments: bool = False) -> QualifiedRule | AtRule | ParseError: ...
def parse_rule_list(input: str | Iterable[Node], skip_comments: bool = False, skip_whitespace: bool = False) -> list[_Rule]: ...
def parse_stylesheet(input: str | Iterable[Node], skip_comments: bool = False, skip_whitespace: bool = False) -> list[_Rule]: ...
