export interface ReplayDataChart {
  title: string;
  data: number[];
}

export interface ReplayDataSimilarScore {
  replay_id: number;
  user_id: number;
  date: string;
  pp: number;
  username: string;
  similarity: number;
  correlation: number;
}

export interface UserReplayData {
  replay_id: string;
  osu_replay_id?: string;
  username: string;
  beatmap_id: number;
  beatmap_beatmapset_id: number;
  beatmap_artist: string;
  beatmap_title: string;
  beatmap_star_rating: number;
  beatmap_creator: string;
  beatmap_version: string;
  score: number;
  mods: string[];
  ur?: number;
  adjusted_ur?: number;
  frametime: number;
  snaps: number;
  hits: number;

  mean_error?: number;
  error_variance?: number;
  error_standard_deviation?: number;
  minimum_error?: number;
  maximum_error?: number;
  error_range?: number;
  error_coefficient_of_variation?: number;
  error_kurtosis?: number;
  error_skewness?: number;

  perfect: boolean;
  max_combo: number;

  count_300: number;
  count_100: number;
  count_50: number;
  count_miss: number;

  comparable_samples?: number;
  comparable_mean_error?: number,
  comparable_error_variance?: number,
  comparable_error_standard_deviation?: number,
  comparable_minimum_error?: number,
  comparable_maximum_error?: number,
  comparable_error_range?: number,
  comparable_error_coefficient_of_variation?: number,
  comparable_error_kurtosis?: number,
  comparable_error_skewness?: number,

  similar_scores: ReplayDataSimilarScore[];
  error_distribution: ErrorDistribution;
  charts: ReplayDataChart[];
}

export function getMockReplayData(): ReplayData {
  return {
    'replay_id': 123,
    'user_id': 123,
    'username': 'username',
    'date': 'date',
    'beatmap_id': 123,
    'beatmap_beatmapset_id': 123,
    'beatmap_artist': 'beatmap_artist',
    'beatmap_title': 'beatmap_title',
    'beatmap_star_rating': 123,
    'beatmap_creator': 'beatmap_creator',
    'beatmap_version': 'beatmap_version',
    'score': 123,
    'mods': ['mods'],
    'rank': 'rank',
    'ur': 123,
    'average_ur': 123,
    'adjusted_ur': 123,
    'frametime': 123,
    'snaps': 123,
    'hits': 123,
    'pp': 123,
    'perfect': true,
    'max_combo': 123,
    'mean_error': 123,
    'error_variance': 123,
    'error_standard_deviation': 123,
    'minimum_error': 123,
    'maximum_error': 123,
    'error_range': 123,
    'error_coefficient_of_variation': 123,
    'error_kurtosis': 123,
    'error_skewness': 123,
    'count_300': 123,
    'count_100': 123,
    'count_50': 123,
    'count_miss': 123,
    'similar_scores': [],
    'error_distribution': {},
    'charts': []
  };
}

export interface ReplayData {
  replay_id: number | null;
  user_id: number;
  username: string;
  date: string;
  beatmap_id: number;
  beatmap_beatmapset_id: number;
  beatmap_artist: string;
  beatmap_title: string;
  beatmap_star_rating: number;
  beatmap_creator: string;
  beatmap_version: string;
  score: number;
  mods: string[];
  rank: string;
  ur: number;
  average_ur: number | null;
  adjusted_ur?: number;
  frametime: number;
  snaps: number;
  hits: number;

  pp: number,
  perfect: boolean;
  max_combo: number,

  mean_error?: number,
  error_variance?: number,
  error_standard_deviation?: number,
  minimum_error?: number,
  maximum_error?: number,
  error_range?: number,
  error_coefficient_of_variation?: number,
  error_kurtosis?: number,
  error_skewness?: number,

  comparable_samples?: number;
  comparable_mean_error?: number,
  comparable_error_variance?: number,
  comparable_error_standard_deviation?: number,
  comparable_minimum_error?: number,
  comparable_maximum_error?: number,
  comparable_error_range?: number,
  comparable_error_coefficient_of_variation?: number,
  comparable_error_kurtosis?: number,
  comparable_error_skewness?: number,

  count_300: number,
  count_100: number,
  count_50: number,
  count_miss: number;

  similar_scores: ReplayDataSimilarScore[];
  error_distribution: ErrorDistribution;
  charts: ReplayDataChart[];
}

export interface DistributionEntry {
  countMiss: number;
  count300: number;
  count100: number;
  count50: number;
}

export interface ErrorDistribution {
  [key: number]: DistributionEntry;
}

export interface SuspiciousScore {
  user_id: number;
  username: string;
  replay_id: number;
  date: string;
  beatmap_id: number;
  beatmap_beatmapset_id: number;
  beatmap_title: string;
  beatmap_star_rating: number;
  pp: number;
  frametime: number;
  ur: number;
}

export interface SimilarReplay {
  replay_id_1: number;
  replay_id_2: number;
  username_1: string;
  username_2: string;
  beatmap_beatmapset_id: number;
  replay_date_1: string;
  replay_date_2: string;
  replay_pp_1: number;
  replay_pp_2: number;
  beatmap_id: number;
  beatmap_title: string;
  beatmap_star_rating: number;
  similarity: number;
}
