mirror of
https://github.com/Sendouc/sendou.ink.git
synced 2026-08-22 11:05:09 -05:00
Fix mysterious type errors
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import { shuffleArray } from "utils/arrays";
|
||||
import { Player, Match } from "./types";
|
||||
|
||||
const choosePlayersToSitOut = (
|
||||
players: Player[]
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { useEffect, useReducer } from "react";
|
||||
import { createNewMatch, teamsShouldChange, errorWithPlayers } from "./helpers";
|
||||
import { State, Action } from "./types";
|
||||
|
||||
const DEFAULT_AMOUNT_OF_ROUNDS_WITH_SAME_TEAMS = 2;
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
interface Player {
|
||||
export interface Player {
|
||||
id: number;
|
||||
name: string;
|
||||
winCount: number;
|
||||
@@ -6,14 +6,14 @@ interface Player {
|
||||
sittingOutCount: number;
|
||||
}
|
||||
|
||||
type Match = {
|
||||
export type Match = {
|
||||
alpha: string[];
|
||||
bravo: string[];
|
||||
spectators: string[];
|
||||
winner?: "alpha" | "bravo";
|
||||
};
|
||||
|
||||
interface State {
|
||||
export interface State {
|
||||
players: Player[];
|
||||
matches: Match[];
|
||||
amountOfRoundsWithSameTeams: number;
|
||||
@@ -21,9 +21,7 @@ interface State {
|
||||
noPlacingToSameTeam: [playerOneId?: number, playerTwoId?: number];
|
||||
}
|
||||
|
||||
// TODO: names must be unique
|
||||
|
||||
type Action =
|
||||
export type Action =
|
||||
| {
|
||||
type: "SET_PLAYER";
|
||||
name: string;
|
||||
|
||||
Reference in New Issue
Block a user