1 from collections.abc import Iterator, Mapping, Set
2 from typing_extensions import TypedDict
4 from pygments.token import _TokenType
6 ansicolors: Set[str] # not intended to be mutable (== typing.AbstractSet, not builtins.set)
8 class _StyleDict(TypedDict):
15 roman: bool | None # lol yes, can be True or False or None
19 bgansicolor: str | None
21 class StyleMeta(type):
22 def __new__(cls, name, bases, dct): ...
23 def style_for_token(cls, token: _TokenType) -> _StyleDict: ...
24 def styles_token(cls, ttype: _TokenType) -> bool: ...
25 def list_styles(cls) -> list[tuple[_TokenType, _StyleDict]]: ...
26 def __iter__(cls) -> Iterator[tuple[_TokenType, _StyleDict]]: ...
27 def __len__(cls) -> int: ...
28 # These are a bit tricky.
29 # Technically should be ClassVar in class Style.
30 # But then we can't use StyleMeta to denote a style class.
31 # We need that because Type[Style] is not iterable, for example.
34 line_number_color: str
35 line_number_background_color: str
36 line_number_special_color: str
37 line_number_special_background_color: str
38 styles: Mapping[_TokenType, str] # not intended to be mutable
40 class Style(metaclass=StyleMeta): ...