/** * Copyright (c) Double Symmetry GmbH * Commercial use requires a license. See https://rntp.dev/pricing */ import type { MediaUrl } from './MediaItem'; /** * An item in the browse tree — either a playable track or a browsable container. * * - `url` present → playable track (leaf node) * - `children` present (no `url`) → browsable container (tapping drills down) * - `url` takes precedence if both are present * * Maximum nesting depth: 4 levels (matching CarPlay's navigation stack limit). */ export interface BrowseItem { /** Unique identifier for this item. */ mediaId: string; /** Display title. */ title: string; /** Artist or subtitle. */ artist?: string; /** Artwork image URL. */ artworkUrl?: MediaUrl; /** Audio source URL. If present, this item is playable. */ url?: MediaUrl; /** Duration hint in seconds. */ duration?: number; /** Whether this is a live stream. */ isLive?: boolean; /** MIME type hint for format detection. */ mimeType?: string; /** * App-defined payload attached to this item. Opaque to the player — when a * playable item is selected from CarPlay or Android Auto, extras are loaded * into the queue and returned unchanged by {@link getActiveMediaItem}, * {@link getQueue}, and the {@link Event.MediaItemTransition} event. * * Must be JSON-serializable. Keep payloads small. * * @since 5.1.3 */ extras?: Record; /** Child items. If present (and no `url`), this item is browsable. */ children?: BrowseItem[]; } /** * A top-level category in the browse tree. * On Android Auto, each category is a browsable folder. * On CarPlay, each category is a tab (max 4; overflow creates a "More" tab). */ export interface BrowseCategory { /** Unique identifier for this category. */ mediaId: string; /** Display title for the category (e.g. "Albums", "Podcasts"). */ title: string; /** Items within this category — can be playable tracks or browsable containers. */ items: BrowseItem[]; } //# sourceMappingURL=BrowseTree.d.ts.map