export interface ICastConfig {
  host?: string;
  port?: number;
  httpPort?: number;
  knownHosts?: string[];
  uuid?: string;
  ignoreCec?: boolean;
  defaultMediaReceiverAppId?: string;
  deviceInfo?: ICastDeviceInfo;
  receiverStatus?: ICastReceiverStatus;
  mediaStatus?: ICastMediaStatus;
}

export interface ICastDeviceInfo {
  uuid?: string;
  friendlyName?: string;
  modelName?: string;
  manufacturer?: string;
  castType?: string;
  host?: string;
  port?: number;
  buildVersion?: string;
  firmwareVersion?: string;
}

export interface ICastVolume {
  level?: number;
  muted?: boolean;
  controlType?: string;
}

export interface ICastApplication {
  appId?: string;
  displayName?: string;
  sessionId?: string;
  transportId?: string;
  statusText?: string;
}

export interface ICastReceiverStatus {
  applications?: ICastApplication[];
  volume?: ICastVolume;
  isActiveInput?: boolean;
  displayName?: string;
}

export interface ICastMediaImage {
  url?: string;
}

export interface ICastMediaMetadata {
  title?: string;
  subtitle?: string;
  artist?: string;
  albumName?: string;
  albumArtist?: string;
  seriesTitle?: string;
  season?: number;
  episode?: number;
  images?: ICastMediaImage[];
  [key: string]: unknown;
}

export interface ICastMediaInformation {
  contentId?: string;
  contentType?: string;
  streamType?: string;
  duration?: number;
  metadata?: ICastMediaMetadata;
  images?: ICastMediaImage[];
}

export interface ICastMediaStatus {
  mediaSessionId?: number;
  playerState?: string;
  idleReason?: string;
  currentTime?: number;
  playbackRate?: number;
  supportedMediaCommands?: number;
  volume?: ICastVolume;
  media?: ICastMediaInformation;
}

export interface ICastSnapshot {
  deviceInfo: ICastDeviceInfo;
  receiverStatus?: ICastReceiverStatus;
  mediaStatus?: ICastMediaStatus;
}

export interface ICastMdnsRecord {
  type?: string;
  name?: string;
  host?: string;
  port?: number;
  addresses?: string[];
  txt?: Record<string, string | undefined>;
}

export interface ICastManualEntry {
  host?: string;
  port?: number;
  knownHosts?: string[];
  id?: string;
  name?: string;
  model?: string;
  manufacturer?: string;
  metadata?: Record<string, unknown>;
}

export interface ICastMediaLoadOptions {
  contentId: string;
  contentType: string;
  title?: string;
  subtitle?: string;
  artist?: string;
  albumName?: string;
  imageUrl?: string;
  streamType?: 'BUFFERED' | 'LIVE';
  appId?: string;
}
