from .const import ATTR_ENDPOINTS as ATTR_ENDPOINTS, ATTR_STREAMS as ATTR_STREAMS, DOMAIN as DOMAIN, HLS_PROVIDER as HLS_PROVIDER, MAX_SEGMENTS as MAX_SEGMENTS, OUTPUT_IDLE_TIMEOUT as OUTPUT_IDLE_TIMEOUT, RECORDER_PROVIDER as RECORDER_PROVIDER, STREAM_RESTART_INCREMENT as STREAM_RESTART_INCREMENT, STREAM_RESTART_RESET_TIME as STREAM_RESTART_RESET_TIME
from .core import IdleTimer as IdleTimer, PROVIDERS as PROVIDERS, StreamOutput as StreamOutput
from .hls import async_setup_hls as async_setup_hls
from collections.abc import Mapping
from homeassistant.const import EVENT_HOMEASSISTANT_STOP as EVENT_HOMEASSISTANT_STOP
from homeassistant.core import Event as Event, HomeAssistant as HomeAssistant, callback as callback
from homeassistant.exceptions import HomeAssistantError as HomeAssistantError
from homeassistant.helpers.typing import ConfigType as ConfigType
from typing import Any

_LOGGER: Any
STREAM_SOURCE_RE: Any

def redact_credentials(data: str) -> str: ...
def create_stream(hass: HomeAssistant, stream_source: str, options: dict[str, str]) -> Stream: ...
async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool: ...

class Stream:
    hass: Any
    source: Any
    options: Any
    keepalive: bool
    access_token: Any
    _thread: Any
    _thread_quit: Any
    _outputs: Any
    _fast_restart_once: bool
    def __init__(self, hass: HomeAssistant, source: str, options: dict[str, str]) -> None: ...
    def endpoint_url(self, fmt: str) -> str: ...
    def outputs(self) -> Mapping[str, StreamOutput]: ...
    def add_provider(self, fmt: str, timeout: int = ...) -> StreamOutput: ...
    def remove_provider(self, provider: StreamOutput) -> None: ...
    def check_idle(self) -> None: ...
    def start(self) -> None: ...
    def update_source(self, new_source: str) -> None: ...
    def _run_worker(self) -> None: ...
    def _worker_finished(self) -> None: ...
    def stop(self) -> None: ...
    def _stop(self) -> None: ...
    async def async_record(self, video_path: str, duration: int = ..., lookback: int = ...) -> None: ...
