import { APIBattle, APIBattlePlayer, BattleResult, BattleType, Mode } from "../_interfaces/interfaces"; /** * Represents a star player in a battle. * @interface * @property {string} tag - The player's tag. * @property {string} name - The player's in-game name. * @property {Object} brawler - An object containing information about the player's selected brawler. * @property {string} brawler.name - The name of the brawler. * @property {number} brawler.power - The power level of the brawler. * @property {number} brawler.trophies - The number of trophies earned by the brawler. */ export interface StarPlayer { tag: string; name: string; brawler: { name: string; power: number; trophies: number; }; } /** * Represents a battle in Brawl Stars. * @class */ export declare class Battle { /** * The time the battle took place. * @type {string} */ time: string; /** * The mode in which the battle was played. * @type {Mode} */ mode: Mode; /** * The map on which the battle was played. * @type {string} */ map: string; /** * The type of battle. * @type {BattleType} */ type: BattleType; /** * The result of the battle. * @type {BattleResult} */ result?: BattleResult; /** * The duration of the battle in seconds. * @type {number} */ duration?: number; /** * The player's rank at the end of the battle. * @type {number} */ rank?: number; /** * The change in the player's trophies after the battle. * @type {number} */ trophyChange?: number; /** * The star player of the battle. * @type {null | StarPlayer} */ starPlayer: null | StarPlayer; /** * The teams that participated in the battle. * @type {[APIBattlePlayer[], APIBattlePlayer[], APIBattlePlayer[]?, APIBattlePlayer[]?, APIBattlePlayer[]?, APIBattlePlayer[]?, APIBattlePlayer[]?, APIBattlePlayer[]?, APIBattlePlayer[]?, APIBattlePlayer[]?]} */ teams: [ APIBattlePlayer[], APIBattlePlayer[], APIBattlePlayer[]?, APIBattlePlayer[]?, APIBattlePlayer[]?, APIBattlePlayer[]?, APIBattlePlayer[]?, APIBattlePlayer[]?, APIBattlePlayer[]?, APIBattlePlayer[]? ]; /** * Creates a new Battle instance. * @param {APIBattle} api The battle data returned by the API. * @constructor */ constructor(api: APIBattle); /** * Returns an array of all the player tags in the battle. * @returns {string[]} */ getTags(): string[]; /** * Returns an array of all the player names in the battle. * @returns {string[]} */ getNames(): string[]; } /** * Represents a log of battles in Brawl Stars. * @class */ export default class BattleLog { /** * The history of battles. * @type {Battle[]} */ history: Battle[]; /** * Creates a new BattleLog instance. * @param {APIBattle[]} api The battle log data returned by the API. * @constructor */ constructor(api: APIBattle[]); /** * Returns the most recent battle in the log. * @returns {Battle} */ last(): Battle; /** * Returns the specified battle in the log. * @param {number} number The index of the battle to return, with the most recent battle being 1. * @returns {Battle} */ game(number: number): Battle; }