""" This type stub file was generated by pyright. """ from typing import Iterable, Iterator, Text from ._misc import _CustomText from .instruction import Instruction from .token import Token """A dedicated class for representing ANSI escape sequences.""" def isescape(text: Text) -> bool: """Return True if text is an ANSI escape sequence.""" ... class Escape(_CustomText): """A single ANSI escape sequence.""" SEPARATOR = ... ALL_ATTRIBUTE_CODES: set[int] = ... ALL_FOREGROUND_CODES: set[int] = ... ALL_BACKGROUND_CODES: set[int] = ... ALL_COLOR_CODES: set[int] = ... def tokens(self) -> Iterator[Token]: """Yield individual tokens from the escape sequence.""" ... def instructions(self) -> Iterable[Instruction]: r""" Decode a string of tokens into escapable objects. Examples -------- >>> list(Escape("\x1b[1m").instructions()) [SetAttribute(attribute=)] >>> list(Escape("\x1b[5;44m") ... .instructions()) # doctest: +NORMALIZE_WHITESPACE [SetAttribute(attribute=), SetColor(role=, color=Ansi256(code=4))] """ ...