from aiohttp import web
from collections.abc import Callable as Callable
from homeassistant import config_entries as config_entries, data_entry_flow as data_entry_flow
from homeassistant.auth.permissions.const import CAT_CONFIG_ENTRIES as CAT_CONFIG_ENTRIES, POLICY_EDIT as POLICY_EDIT
from homeassistant.components import websocket_api as websocket_api
from homeassistant.components.http import HomeAssistantView as HomeAssistantView, require_admin as require_admin
from homeassistant.core import HomeAssistant as HomeAssistant, callback as callback
from homeassistant.exceptions import DependencyError as DependencyError, Unauthorized as Unauthorized
from homeassistant.helpers.data_entry_flow import FlowManagerIndexView as FlowManagerIndexView, FlowManagerResourceView as FlowManagerResourceView
from homeassistant.helpers.dispatcher import async_dispatcher_connect as async_dispatcher_connect
from homeassistant.loader import Integration as Integration, IntegrationNotFound as IntegrationNotFound, async_get_config_flows as async_get_config_flows, async_get_integration as async_get_integration, async_get_integrations as async_get_integrations
from typing import Any, NoReturn

async def async_setup(hass: HomeAssistant) -> bool: ...

class ConfigManagerEntryIndexView(HomeAssistantView):
    url: str
    name: str
    async def get(self, request: web.Request) -> web.Response: ...

class ConfigManagerEntryResourceView(HomeAssistantView):
    url: str
    name: str
    async def delete(self, request: web.Request, entry_id: str) -> web.Response: ...

class ConfigManagerEntryResourceReloadView(HomeAssistantView):
    url: str
    name: str
    async def post(self, request: web.Request, entry_id: str) -> web.Response: ...

def _prepare_config_flow_result_json(result: data_entry_flow.FlowResult, prepare_result_json: Callable[[data_entry_flow.FlowResult], data_entry_flow.FlowResult]) -> data_entry_flow.FlowResult: ...

class ConfigManagerFlowIndexView(FlowManagerIndexView):
    url: str
    name: str
    async def get(self, request: web.Request) -> NoReturn: ...
    async def post(self, request: web.Request) -> web.Response: ...
    def _prepare_result_json(self, result: data_entry_flow.FlowResult) -> data_entry_flow.FlowResult: ...

class ConfigManagerFlowResourceView(FlowManagerResourceView):
    url: str
    name: str
    async def get(self, request: web.Request, flow_id: str) -> web.Response: ...
    async def post(self, request: web.Request, flow_id: str) -> web.Response: ...
    def _prepare_result_json(self, result: data_entry_flow.FlowResult) -> data_entry_flow.FlowResult: ...

class ConfigManagerAvailableFlowView(HomeAssistantView):
    url: str
    name: str
    async def get(self, request: web.Request) -> web.Response: ...

class OptionManagerFlowIndexView(FlowManagerIndexView):
    url: str
    name: str
    async def post(self, request: web.Request) -> web.Response: ...

class OptionManagerFlowResourceView(FlowManagerResourceView):
    url: str
    name: str
    async def get(self, request: web.Request, flow_id: str) -> web.Response: ...
    async def post(self, request: web.Request, flow_id: str) -> web.Response: ...

def config_entries_progress(hass: HomeAssistant, connection: websocket_api.ActiveConnection, msg: dict[str, Any]) -> None: ...
def send_entry_not_found(connection: websocket_api.ActiveConnection, msg_id: int) -> None: ...
def get_entry(hass: HomeAssistant, connection: websocket_api.ActiveConnection, entry_id: str, msg_id: int) -> config_entries.ConfigEntry | None: ...
async def config_entry_get_single(hass: HomeAssistant, connection: websocket_api.ActiveConnection, msg: dict[str, Any]) -> None: ...
async def config_entry_update(hass: HomeAssistant, connection: websocket_api.ActiveConnection, msg: dict[str, Any]) -> None: ...
async def config_entry_disable(hass: HomeAssistant, connection: websocket_api.ActiveConnection, msg: dict[str, Any]) -> None: ...
async def ignore_config_flow(hass: HomeAssistant, connection: websocket_api.ActiveConnection, msg: dict[str, Any]) -> None: ...
async def config_entries_get(hass: HomeAssistant, connection: websocket_api.ActiveConnection, msg: dict[str, Any]) -> None: ...
async def config_entries_subscribe(hass: HomeAssistant, connection: websocket_api.ActiveConnection, msg: dict[str, Any]) -> None: ...
async def async_matching_config_entries(hass: HomeAssistant, type_filter: list[str] | None, domain: str | None) -> list[dict[str, Any]]: ...
def entry_json(entry: config_entries.ConfigEntry) -> dict[str, Any]: ...
