export type Auth = { username: string salt: string; hash: string } export interface ServerInfo { name: string version: string openSubsonic: boolean extensions: string[] } export type StreamFormat = 'raw' | 'opus' export type StreamSettings = { format: StreamFormat bitrate: number } export enum ReplayGainMode { None, // No gain correction – play audio as-is Track, // Normalise each track independently Album, // Normalise relative to the full album (preserves dynamic contrast) _Length // Sentinel value – used to cycle through modes with modulo } export type ReplayGain = { trackGain: number // dB adjustment for a single track trackPeak: number // Peak sample value for a single track (0–1) albumGain: number // dB adjustment relative to the full album albumPeak: number // Peak sample value for the full album } export type SearchMode = null | 'artist' | 'album' | 'track' export type AlbumSort = 'a-z' | 'recently-added'| 'recently-played' | 'most-played' | 'random' export interface AlbumArtist { id: string, name: string } export interface Track { id: string title: string duration: number size: number favourite: boolean image?: string url?: string track?: number album?: string albumId?: string artists: AlbumArtist[] isStream?: boolean isPodcast?: boolean isUnavailable?: boolean playCount?: number replayGain?: ReplayGain } export interface Genre { id: string name: string albumCount: number trackCount: number } export interface AlbumGenre { name: string } export interface Album { id: string name: string description?: string artists: {name: string, id: string}[] year: number favourite: boolean genres: AlbumGenre[] image?: string lastFmUrl?: string musicBrainzUrl?: string tracks?: Track[] releaseType?: string } export interface Artist { id: string name: string description?: string genres: AlbumGenre[] albumCount: number trackCount: number favourite: boolean lastFmUrl?: string musicBrainzUrl?: string topTracks?: Track[] similarArtist?: Artist[] albums?: Album[] image?: string } export interface SearchResult { artists: Artist[] albums: Album[] tracks: Track[] } export interface Directory { id: string name: string parent?: string tracks: Track[] directories: { id: string name: string }[] } export interface Playlist { id: string name: string comment: string owner?: string isPublic: boolean isReadOnly: boolean trackCount: number duration: number createdAt: string updatedAt: string image?: string tracks?: Track[] } export interface PlayQueue { tracks: Track[] currentTrack: number currentTrackPosition: number }