import types
from typing import Callable

from _typeshed import Incomplete
from yfinance import utils as utils
from yfinance.pricing_pb2 import PricingData as PricingData

class BaseWebSocket:
    url: Incomplete
    verbose: Incomplete
    logger: Incomplete
    def __init__(self, url: str = "wss://streamer.finance.yahoo.com/?version=2", verbose: bool = True) -> None: ...

class AsyncWebSocket(BaseWebSocket):
    def __init__(self, url: str = "wss://streamer.finance.yahoo.com/?version=2", verbose: bool = True) -> None: ...
    async def subscribe(self, symbols: str | list[str]): ...
    async def unsubscribe(self, symbols: str | list[str]): ...
    async def listen(self, message_handler: Incomplete | None = None) -> None: ...
    async def close(self) -> None: ...
    async def __aenter__(self): ...
    async def __aexit__(self, exc_type, exc_value, traceback) -> None: ...

class WebSocket(BaseWebSocket):
    def __init__(self, url: str = "wss://streamer.finance.yahoo.com/?version=2", verbose: bool = True) -> None: ...
    def subscribe(self, symbols: str | list[str]): ...
    def unsubscribe(self, symbols: str | list[str]): ...
    def listen(self, message_handler: Callable[[dict], None] | None = None): ...
    def close(self) -> None: ...
    def __enter__(self): ...
    def __exit__(
        self,
        exc_type: type[BaseException] | None,
        exc_value: BaseException | None,
        traceback: types.TracebackType | None,
    ) -> None: ...
