import {
  AudioTrack,
  TrackPlayerState,
} from '@modules/chats/instances/TrackPlayer';

export interface AudioPlayerContextProps {
  currentId: string;
  state?: TrackPlayerState;
  rate: number;
  pause: () => void;
  seekTo: (position: number, params?: {id: string; duration: number}) => void;
  toggleRate: () => void; // returns the current speed
  play: (params: AudioTrack) => Promise<void>;
  initializePlaylist: (params: AudioTrack[]) => void;
  addTrack: (params: AudioTrack) => void;
}

export type ProgressItem = {
  position: number;
  duration: number;
};
