from .const import DEFAULT_NAME as DEFAULT_NAME, DOMAIN as DOMAIN
from _typeshed import Incomplete
from homeassistant.components import media_source as media_source
from homeassistant.components.media_player import BrowseError as BrowseError, BrowseMedia as BrowseMedia, MediaClass as MediaClass, MediaType as MediaType, SearchError as SearchError, SearchMedia as SearchMedia, SearchMediaQuery as SearchMediaQuery
from homeassistant.core import HomeAssistant as HomeAssistant
from music_assistant_client import MusicAssistantClient as MusicAssistantClient
from music_assistant_models.enums import MediaType as MASSMediaType
from music_assistant_models.media_items import MediaItemType, SearchResults as SearchResults
from typing import Any

MEDIA_TYPE_AUDIOBOOK: str
MEDIA_TYPE_RADIO: str
PLAYABLE_MEDIA_TYPES: Incomplete
LIBRARY_ARTISTS: str
LIBRARY_ALBUMS: str
LIBRARY_TRACKS: str
LIBRARY_PLAYLISTS: str
LIBRARY_RADIO: str
LIBRARY_PODCASTS: str
LIBRARY_AUDIOBOOKS: str
LIBRARY_TITLE_MAP: Incomplete
LIBRARY_MEDIA_CLASS_MAP: Incomplete
MEDIA_CONTENT_TYPE_FLAC: str
THUMB_SIZE: int
SORT_NAME: str
LOGGER: Incomplete

def media_source_filter(item: BrowseMedia) -> bool: ...
async def async_browse_media(hass: HomeAssistant, mass: MusicAssistantClient, media_content_id: str | None, media_content_type: str | None) -> BrowseMedia: ...
async def build_main_listing(hass: HomeAssistant) -> BrowseMedia: ...
async def build_playlists_listing(mass: MusicAssistantClient) -> BrowseMedia: ...
async def build_playlist_items_listing(mass: MusicAssistantClient, identifier: str) -> BrowseMedia: ...
async def build_artists_listing(mass: MusicAssistantClient) -> BrowseMedia: ...
async def build_artist_items_listing(mass: MusicAssistantClient, identifier: str) -> BrowseMedia: ...
async def build_albums_listing(mass: MusicAssistantClient) -> BrowseMedia: ...
async def build_album_items_listing(mass: MusicAssistantClient, identifier: str) -> BrowseMedia: ...
async def build_tracks_listing(mass: MusicAssistantClient) -> BrowseMedia: ...
async def build_podcasts_listing(mass: MusicAssistantClient) -> BrowseMedia: ...
async def build_audiobooks_listing(mass: MusicAssistantClient) -> BrowseMedia: ...
async def build_radio_listing(mass: MusicAssistantClient) -> BrowseMedia: ...
def build_item(mass: MusicAssistantClient, item: MediaItemType, can_expand: bool = True, media_class: Any = None) -> BrowseMedia: ...
async def _search_within_album(mass: MusicAssistantClient, album_uri: str, search_query: str, limit: int) -> SearchMedia: ...
async def _search_within_artist(mass: MusicAssistantClient, artist_uri: str, search_query: str, limit: int) -> SearchResults: ...
def _get_media_types_from_query(query: SearchMediaQuery) -> list[MASSMediaType]: ...
def _process_search_results(mass: MusicAssistantClient, search_results: SearchResults, media_types: list[MASSMediaType]) -> list[BrowseMedia]: ...
def _should_expand_media_type(media_type: str) -> bool: ...
def _get_media_class_for_type(media_type: str) -> MediaClass | None: ...
async def async_search_media(mass: MusicAssistantClient, query: SearchMediaQuery) -> SearchMedia: ...
