import { Stage, Group, Round, Match, MatchGame, Id, Database, type DataTypes } from 'brackets-model'; import { FinalStandingsItem, ParticipantSlot, RoundRobinFinalStandingsItem, RoundRobinFinalStandingsOptions } from './types'; import { BaseGetter } from './base/getter'; export declare class Get extends BaseGetter { /** * Returns the data needed to display a stage. * * @param stageId ID of the stage. */ stageData(stageId: Id): Promise; /** * Returns the data needed to display a whole tournament with all its stages. * * @param tournamentId ID of the tournament. */ tournamentData(tournamentId: Id): Promise; /** * Wrapper around `storage.select('group')`. * * Read more about the structure of a stage: https://drarig29.github.io/brackets-docs/user-guide/structure/ * * @param filter Filter for the groups. * @example * ```js * for (const group of await manager.get.groups({ stage_id: stageId })) { * const rounds = await manager.get.rounds({ group_id: group.id }); * console.log(rounds.length); * } * ``` */ groups(filter: DataTypes['group']): Promise; /** * Wrapper around `storage.select('round')`. * * Read more about the structure of a stage: https://drarig29.github.io/brackets-docs/user-guide/structure/ * * @param filter Filter for the rounds. * @example * ```js * for (const round of await manager.get.rounds({ stage_id: stageId })) { * const matches = await manager.get.matches({ round_id: round.id }); * console.log(matches.length); * } * ``` */ rounds(filter: DataTypes['round']): Promise; /** * Wrapper around `storage.select('match')`. * * Read more about the structure of a stage: https://drarig29.github.io/brackets-docs/user-guide/structure/ * * @param filter Filter for the matches. * @example * ```js * for (const match of await manager.get.matches({ round_id: round.id })) { * console.log(match.id); * } * ``` */ matches(filter: DataTypes['match']): Promise; /** * Returns the match games associated to a list of matches. * * @param matches A list of matches. */ matchGames(matches: Match[]): Promise; /** * Returns the stage that is not completed yet, because of uncompleted matches. * If all matches are completed in this tournament, there is no "current stage", so `null` is returned. * * @param tournamentId ID of the tournament. */ currentStage(tournamentId: Id): Promise; /** * Returns the round that is not completed yet, because of uncompleted matches. * If all matches are completed in this stage of a tournament, there is no "current round", so `null` is returned. * * Note: The consolation final of single elimination and the grand final of double elimination will be in a different `Group`. * * @param stageId ID of the stage. * @example * If you don't know the stage id, you can first get the current stage. * ```js * const tournamentId = 3; * const currentStage = await manager.get.currentStage(tournamentId); * const currentRound = await manager.get.currentRound(currentStage.id); * ``` */ currentRound(stageId: Id): Promise; /** * Returns the matches that can currently be played in parallel. * If the stage doesn't contain any, an empty array is returned. * * Note: * - Returned matches are ongoing (i.e. ready or running). * - Returned matches can be from different rounds. * * @param stageId ID of the stage. * @example * If you don't know the stage id, you can first get the current stage. * ```js * const tournamentId = 3; * const currentStage = await manager.get.currentStage(tournamentId); * const currentMatches = await manager.get.currentMatches(currentStage.id); * ``` */ currentMatches(stageId: Id): Promise; /** * Returns the seeding of a stage. * * @param stageId ID of the stage. */ seeding(stageId: Id): Promise; /** * Returns the final standings of an elimination stage. * * @param stageId ID of the stage. */ finalStandings(stageId: Id): Promise; /** * Returns the final standings of a round-robin stage with a ranking formula. * * @param stageId ID of the stage. * @param rankingFormula The formula to compute the points for the ranking. */ finalStandings(stageId: Id, roundRobinOptions: RoundRobinFinalStandingsOptions): Promise; /** * Returns the seeding of a round-robin stage. * * @param stage The stage. */ private roundRobinSeeding; /** * Returns the seeding of an elimination stage. * * @param stage The stage. */ private eliminationSeeding; /** * Returns the final standings of a round-robin stage. * * @param stage The stage. * @param roundRobinOptions The options for the round-robin standings. */ private roundRobinStandings; /** * Returns the final standings of a single elimination stage. * * @param stage The stage. */ private singleEliminationStandings; /** * Returns the final standings of a double elimination stage. * * @param stage The stage. */ private doubleEliminationStandings; /** * Returns only the data specific to the given stage (without the participants). * * @param stageId ID of the stage. */ private getStageSpecificData; } //# sourceMappingURL=get.d.ts.map