2 from _typeshed import SupportsWrite
3 from typing import Any, Callable, Dict, Optional, Pattern, Sequence, TextIO, Tuple, Union
5 if sys.platform == "win32":
6 from .winterm import WinTerm
13 def __init__(self, wrapped: TextIO, converter: SupportsWrite[str]) -> None: ...
14 def __getattr__(self, name: str) -> Any: ...
15 def __enter__(self, *args: object, **kwargs: object) -> TextIO: ...
16 def __exit__(self, *args: Any, **kwargs: Any) -> None: ...
17 def write(self, text: str) -> None: ...
18 def isatty(self) -> bool: ...
20 def closed(self) -> bool: ...
22 _WinTermCall = Callable[[Optional[int], bool, bool], None]
23 _WinTermCallDict = Dict[int, Union[Tuple[_WinTermCall], Tuple[_WinTermCall, int], Tuple[_WinTermCall, int, bool]]]
26 ANSI_CSI_RE: Pattern[str] = ...
27 ANSI_OSC_RE: Pattern[str] = ...
30 stream: StreamWrapper = ...
33 win32_calls: _WinTermCallDict = ...
35 def __init__(self, wrapped: TextIO, convert: bool | None = ..., strip: bool | None = ..., autoreset: bool = ...) -> None: ...
36 def should_wrap(self) -> bool: ...
37 def get_win32_calls(self) -> _WinTermCallDict: ...
38 def write(self, text: str) -> None: ...
39 def reset_all(self) -> None: ...
40 def write_and_convert(self, text: str) -> None: ...
41 def write_plain_text(self, text: str, start: int, end: int) -> None: ...
42 def convert_ansi(self, paramstring: str, command: str) -> None: ...
43 def extract_params(self, command: str, paramstring: str) -> Tuple[int, ...]: ...
44 def call_win32(self, command: str, params: Sequence[int]) -> None: ...
45 def convert_osc(self, text: str) -> str: ...