<commit_before>export type Sort = 'rating' | 'time';
export type Mode = 'list' | 'chart';
export type Tab = 'pools' | 'real_time' | 'seeks' | 'now_playing';
export type GameType = 'hook' | 'friend' | 'ai';
export type TimeMode = 'realTime' | 'correspondence' | 'unlimited';
export type GameMode = 'casual' | 'rated';

// These are not true quantities. They represent the value of input elements
export type InputValue = number;
// Visible value computed from the input value
export type RealValue = number;

export interface Variant {
  id: number;
  key: VariantKey;
  name: string;
  icon: string;
}

export interface Hook {
  id: string;
  sri: string;
  clock: string;
  t: number; // time
  s: number; // speed
  i: number; // increment
  variant: VariantKey;
  perf: Exclude<Perf, 'fromPosition'>;
  prov?: true; // is rating provisional
  u?: string; // username
  rating?: number;
  ra?: 1; // rated
  c?: Color;
  action: 'cancel' | 'join';
  disabled?: boolean;
}

export interface Seek {
  id: string;
  username: string;
  rating: number;
  mode: number;
  days?: number;
  color: string;
  perf: {
    key: Exclude<Perf, 'fromPosition'>;
  };
  provisional?: boolean;
  variant?: string;
  action: 'joinSeek' | 'cancelSeek';
}

export interface Pool {
  id: PoolId;
  lim: number;
  inc: number;
  perf: string;
}

export interface LobbyOpts {
  appElement: HTMLElement;
  tableElement: HTMLElement;
  socketSend: SocketSend;
  pools: Pool[];
  blindMode: boolean;
  hasUnreadLichessMessage: boolean;
  playban: boolean;
  showRatings: boolean;
  data: LobbyData;
  i18n: I18nDict;
  trans: Trans;
}

export interface LobbyData {
  hooks: Hook[];
  seeks: Seek[];
  nbNowPlaying: number;
  nowPlaying: NowPlaying[];
  me?: {
    isBot: boolean;
    username: string;
  };
  ratingMap: Record<Perf | Speed, number> | null;
  counters: { members: number; rounds: number };
}

export interface NowPlaying {
  fullId: string;
  gameId: string;
  fen: Fen;
  color: Color;
  lastMove: string;
  variant: {
    key: string;
    name: string;
  };
  speed: string;
  perf: string;
  rated: boolean;
  hasMoved: boolean;
  opponent: {
    id: string;
    username: string;
    rating?: number;
    ai?: number;
  };
  isMyTurn: boolean;
  secondsLeft?: number;
}

export interface PoolMember {
  id: PoolId;
  range?: PoolRange;
  blocking?: string;
}

export type PoolId = string;
export type PoolRange = string;

export interface SetupStore {
  variant: VariantKey;
  fen: string;
  timeMode: TimeMode;
  gameMode: GameMode;
  ratingMin: number;
  ratingMax: number;
  aiLevel: number;
  time: number;
  increment: number;
  days: number;
}

export interface ForceSetupOptions {
  variant?: VariantKey;
  fen?: string;
  timeMode?: TimeMode;
}
<commit_msg>fix ratingMap type (perf->rating)<commit_after>export type Sort = 'rating' | 'time';
export type Mode = 'list' | 'chart';
export type Tab = 'pools' | 'real_time' | 'seeks' | 'now_playing';
export type GameType = 'hook' | 'friend' | 'ai';
export type TimeMode = 'realTime' | 'correspondence' | 'unlimited';
export type GameMode = 'casual' | 'rated';

// These are not true quantities. They represent the value of input elements
export type InputValue = number;
// Visible value computed from the input value
export type RealValue = number;

export interface Variant {
  id: number;
  key: VariantKey;
  name: string;
  icon: string;
}

export interface Hook {
  id: string;
  sri: string;
  clock: string;
  t: number; // time
  s: number; // speed
  i: number; // increment
  variant: VariantKey;
  perf: Exclude<Perf, 'fromPosition'>;
  prov?: true; // is rating provisional
  u?: string; // username
  rating?: number;
  ra?: 1; // rated
  c?: Color;
  action: 'cancel' | 'join';
  disabled?: boolean;
}

export interface Seek {
  id: string;
  username: string;
  rating: number;
  mode: number;
  days?: number;
  color: string;
  perf: {
    key: Exclude<Perf, 'fromPosition'>;
  };
  provisional?: boolean;
  variant?: string;
  action: 'joinSeek' | 'cancelSeek';
}

export interface Pool {
  id: PoolId;
  lim: number;
  inc: number;
  perf: string;
}

export interface LobbyOpts {
  appElement: HTMLElement;
  tableElement: HTMLElement;
  socketSend: SocketSend;
  pools: Pool[];
  blindMode: boolean;
  hasUnreadLichessMessage: boolean;
  playban: boolean;
  showRatings: boolean;
  data: LobbyData;
  i18n: I18nDict;
  trans: Trans;
}

export interface LobbyData {
  hooks: Hook[];
  seeks: Seek[];
  nbNowPlaying: number;
  nowPlaying: NowPlaying[];
  me?: {
    isBot: boolean;
    username: string;
  };
  ratingMap: Record<Perf, number> | null;
  counters: { members: number; rounds: number };
}

export interface NowPlaying {
  fullId: string;
  gameId: string;
  fen: Fen;
  color: Color;
  lastMove: string;
  variant: {
    key: string;
    name: string;
  };
  speed: string;
  perf: string;
  rated: boolean;
  hasMoved: boolean;
  opponent: {
    id: string;
    username: string;
    rating?: number;
    ai?: number;
  };
  isMyTurn: boolean;
  secondsLeft?: number;
}

export interface PoolMember {
  id: PoolId;
  range?: PoolRange;
  blocking?: string;
}

export type PoolId = string;
export type PoolRange = string;

export interface SetupStore {
  variant: VariantKey;
  fen: string;
  timeMode: TimeMode;
  gameMode: GameMode;
  ratingMin: number;
  ratingMax: number;
  aiLevel: number;
  time: number;
  increment: number;
  days: number;
}

export interface ForceSetupOptions {
  variant?: VariantKey;
  fen?: string;
  timeMode?: TimeMode;
}

{'fraction_non_alphanumeric': 0.12477428674611774, 'fraction_numerical': 0.0018057060310581437, 'mean_word_length': 3.7140425531914896, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 10, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3799040', 'n_tokens_mistral': 1893, 'n_tokens_neox': 1889, 'n_words': 584}