sendou.ink/app/modules/brackets-model/unions.ts
2023-05-20 12:04:58 +03:00

60 lines
1.3 KiB
TypeScript

/*----------------------------------------|
* Contains all the string union types.
*---------------------------------------*/
/**
* The only supported types of stage.
*/
export type StageType =
| "round_robin"
| "single_elimination"
| "double_elimination";
/**
* All the possible types of group in an elimination stage.
*
* - `single_bracket` for single elimination.
* - `winner_bracket` and `loser_bracket` for double elimination.
* - `final_group` for both single and double elimination.
*/
export type GroupType =
| "single_bracket"
| "winner_bracket"
| "loser_bracket"
| "final_group";
/**
* The possible types for a double elimination stage's grand final.
*/
export type GrandFinalType = "none" | "simple" | "double";
/**
* The possible types of final for an elimination stage.
*/
export type FinalType = "consolation_final" | "grand_final";
/**
* The possible modes for a round-robin stage.
*/
export type RoundRobinMode = "simple" | "double";
/**
* Used to order seeds.
*/
export type SeedOrdering =
| "natural"
| "reverse"
| "half_shift"
| "reverse_half_shift"
| "pair_flip"
| "inner_outer"
| "space_between"
| "groups.effort_balanced"
| "groups.seed_optimized"
| "groups.bracket_optimized";
/**
* The possible results of a duel for a participant.
*/
export type Result = "win" | "draw" | "loss";