2 from types import TracebackType
3 from typing import Iterator, Type
4 from typing_extensions import Literal, Protocol
8 class _Stream(Protocol):
9 def isatty(self) -> bool: ...
10 def flush(self) -> None: ...
11 def write(self, s: str) -> int: ...
13 class Spinner(object):
14 spinner_cycle: Iterator[str]
19 stop_running: threading.Event | None
20 spin_thread: threading.Thread | None
21 def __init__(self, beep: bool, disable: bool, force: bool, stream: _Stream) -> None: ...
22 def start(self) -> None: ...
23 def stop(self) -> None: ...
24 def init_spin(self) -> None: ...
25 def __enter__(self) -> Spinner: ...
27 self, exc_type: Type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None
28 ) -> Literal[False]: ...
30 def spinner(beep: bool, disable: bool, force: bool, stream: _Stream) -> Spinner: ...