from .descriptions import DescriptionManager as DescriptionManager
from .flow import FlowDispatcher as FlowDispatcher, SSDPFlow as SSDPFlow
from async_upnp_client.utils import CaseInsensitiveDict
from collections.abc import Mapping
from homeassistant import config_entries as config_entries
from homeassistant.components import network as network
from homeassistant.const import EVENT_HOMEASSISTANT_STARTED as EVENT_HOMEASSISTANT_STARTED, EVENT_HOMEASSISTANT_STOP as EVENT_HOMEASSISTANT_STOP, MATCH_ALL as MATCH_ALL
from homeassistant.core import CoreState as CoreState, HomeAssistant as HomeAssistant
from homeassistant.helpers.event import async_track_time_interval as async_track_time_interval
from homeassistant.helpers.typing import ConfigType as ConfigType
from homeassistant.loader import async_get_ssdp as async_get_ssdp, bind_hass as bind_hass
from ipaddress import IPv4Address, IPv6Address
from typing import Any, Callable

DOMAIN: str
SCAN_INTERVAL: Any
IPV4_BROADCAST: Any
ATTR_SSDP_LOCATION: str
ATTR_SSDP_ST: str
ATTR_SSDP_USN: str
ATTR_SSDP_EXT: str
ATTR_SSDP_SERVER: str
ATTR_UPNP_DEVICE_TYPE: str
ATTR_UPNP_FRIENDLY_NAME: str
ATTR_UPNP_MANUFACTURER: str
ATTR_UPNP_MANUFACTURER_URL: str
ATTR_UPNP_MODEL_DESCRIPTION: str
ATTR_UPNP_MODEL_NAME: str
ATTR_UPNP_MODEL_NUMBER: str
ATTR_UPNP_MODEL_URL: str
ATTR_UPNP_SERIAL: str
ATTR_UPNP_UDN: str
ATTR_UPNP_UPC: str
ATTR_UPNP_PRESENTATION_URL: str
DISCOVERY_MAPPING: Any
_LOGGER: Any

def async_register_callback(hass: HomeAssistant, callback: Callable[[dict], None], match_dict: Union[None, dict[str, str]] = ...) -> Callable[[], None]: ...
def async_get_discovery_info_by_udn_st(hass: HomeAssistant, udn: str, st: str) -> Union[dict[str, str], None]: ...
def async_get_discovery_info_by_st(hass: HomeAssistant, st: str) -> list[dict[str, str]]: ...
def async_get_discovery_info_by_udn(hass: HomeAssistant, udn: str) -> list[dict[str, str]]: ...
async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool: ...
def _async_use_default_interface(adapters: list[network.Adapter]) -> bool: ...
def _async_process_callbacks(callbacks: list[Callable[[dict], None]], discovery_info: dict[str, str]) -> None: ...
def _async_headers_match(headers: Mapping[str, str], match_dict: dict[str, str]) -> bool: ...

class Scanner:
    hass: Any
    seen: Any
    cache: Any
    _integration_matchers: Any
    _cancel_scan: Any
    _ssdp_listeners: Any
    _callbacks: Any
    flow_dispatcher: Any
    description_manager: Any
    def __init__(self, hass: HomeAssistant, integration_matchers: dict[str, list[dict[str, str]]]) -> None: ...
    def async_register_callback(self, callback: Callable[[dict], None], match_dict: Union[None, dict[str, str]] = ...) -> Callable[[], None]: ...
    def async_stop(self, *_: Any) -> None: ...
    async def _async_build_source_set(self) -> set[Union[IPv4Address, IPv6Address]]: ...
    def async_scan(self, *_: Any) -> None: ...
    async def async_start(self) -> None: ...
    def _async_get_matching_callbacks(self, headers: Mapping[str, str]) -> list[Callable[[dict], None]]: ...
    def _async_matching_domains(self, info_with_req: CaseInsensitiveDict) -> set[str]: ...
    def _async_seen(self, header_st: Union[str, None], header_location: Union[str, None]) -> bool: ...
    def _async_see(self, header_st: Union[str, None], header_location: Union[str, None]) -> None: ...
    async def _async_process_entry(self, headers: Mapping[str, str]) -> None: ...
    def _async_headers_to_discovery_info(self, headers: Mapping[str, str]) -> dict[str, str]: ...
    def async_get_discovery_info_by_udn_st(self, udn: str, st: str) -> Union[dict[str, str], None]: ...
    def async_get_discovery_info_by_st(self, st: str) -> list[dict[str, str]]: ...
    def async_get_discovery_info_by_udn(self, udn: str) -> list[dict[str, str]]: ...

def discovery_info_from_headers_and_request(info_with_req: CaseInsensitiveDict) -> dict[str, str]: ...
def _udn_from_usn(usn: Union[str, None]) -> Union[str, None]: ...
