import Interface, { APILocale } from "../interface.js"; /** * Interfaces with all of game related endpoints. * * @internal @sealed */ export default class Games extends Interface { /** * Fetches data for a game or games. * * @param gameId - The id of the game to fetch. * @param locale - The locale of the response. * @returns Data about the games. * * @see {@link https://vickz84259.github.io/lolesports-api-docs/#operation/getGames | vickz84259's endpoint documentation}. * * @public @sealed */ get(gameId: string, locale?: APILocale): Promise<{ data: { games: { id: string; state: "completed" | "unstarted" | "inProgress"; number: 1 | 3 | 5 | 2 | 4; vods: ({ parameter: string; } & { locale: "en-US" | "en-GB" | "en-AU" | "cs-CZ" | "de-DE" | "el-GR" | "es-ES" | "es-MX" | "fr-FR" | "hu-HU" | "it-IT" | "pl-PL" | "pt-BR" | "ro-RO" | "ru-RU" | "tr-TR" | "ja-JP" | "ko-KR"; provider: "youtube" | "twitch"; offset: number; })[]; }[]; }; }>; /** * Fetches overall information for a particular section of a game, such as game state, objectives taken and participants scoreboard information. * * @remarks * The response's data contains a `frames` array property which includes "snapshots" of game states for a time span of 10 seconds. * * @param startingAt - The starting date of the segment to fetch from the game. If it is later than the end date of the game, retrieves the last 10 frames. * If `undefined`, returns the first 10 frames of the game. * @returns Data on a segment of the game. * * @see {@link https://vickz84259.github.io/lolesports-api-docs/#operation/getGames | vickz84259's endpoint documentation}. * * @public @sealed */ getWindow(gameId: string, startingAt?: string | Date): Promise<{ esportsGameId: string; esportsMatchId: string; gameMetadata: { patchVersion: string; blueTeamMetadata: { esportsTeamId: string; participantMetadata: ({ participantId: 1 | 3 | 5 | 2 | 4 | 6 | 7 | 8 | 9 | 10; summonerName: string; championId: string; role: "top" | "jungle" | "mid" | "bottom" | "support"; } | ({ participantId: 1 | 3 | 5 | 2 | 4 | 6 | 7 | 8 | 9 | 10; summonerName: string; championId: string; role: "top" | "jungle" | "mid" | "bottom" | "support"; } & { esportsPlayerId: string; }))[]; }; redTeamMetadata: { esportsTeamId: string; participantMetadata: ({ participantId: 1 | 3 | 5 | 2 | 4 | 6 | 7 | 8 | 9 | 10; summonerName: string; championId: string; role: "top" | "jungle" | "mid" | "bottom" | "support"; } | ({ participantId: 1 | 3 | 5 | 2 | 4 | 6 | 7 | 8 | 9 | 10; summonerName: string; championId: string; role: "top" | "jungle" | "mid" | "bottom" | "support"; } & { esportsPlayerId: string; }))[]; }; }; frames: ({ rfc460Timestamp: string; } & { rfc460Timestamp: string; gameState: "in_game" | "finished"; blueTeam: { totalGold: number; inhibitors: number; towers: number; barons: number; totalKills: number; dragons: ("ocean" | "mountain" | "infernal" | "cloud" | "elder")[]; participants: ({ participantId: 1 | 3 | 5 | 2 | 4 | 6 | 7 | 8 | 9 | 10; level: number; kills: number; deaths: number; assists: number; creepScore: number; } & { totalGold: number; currentHealth: number; maxHealth: number; })[]; }; redTeam: { totalGold: number; inhibitors: number; towers: number; barons: number; totalKills: number; dragons: ("ocean" | "mountain" | "infernal" | "cloud" | "elder")[]; participants: ({ participantId: 1 | 3 | 5 | 2 | 4 | 6 | 7 | 8 | 9 | 10; level: number; kills: number; deaths: number; assists: number; creepScore: number; } & { totalGold: number; currentHealth: number; maxHealth: number; })[]; }; })[]; }>; /** * Fetches detailed information for a particular section of a game, such as participants' champion stats and ability level up sequence. * * @remarks * The response's data contains a `frames` array property which includes "snapshots" of game states for a time span of 10 seconds. * * @param gameId - The game id from which to fetch data. * @param participantIdsOrIds - The ids of the participants from which to fetch data. * @param startingAt - The starting date of the segment to fetch from the game. If it is later than the end date of the game, retrieves the last 10 frames. * @returns * * @example Log the details on the last 10 frames * ```ts * import APIClient from 'lol-esports-api'; * * const client = new APIClient(); * const liveEvents = await client.getLive(); * * console.log(liveEvents); * ``` * * @see {@link https://vickz84259.github.io/lolesports-api-docs/#operation/getDetails | vickz84259's endpoint documentation}. * * @public @sealed */ getDetails(gameId: string, startingAt: string | Date, participantIdsOrIds?: number | [number, ...number[]]): Promise<{ frames: ({ rfc460Timestamp: string; } & { participants: ({ participantId: 1 | 3 | 5 | 2 | 4 | 6 | 7 | 8 | 9 | 10; level: number; kills: number; deaths: number; assists: number; creepScore: number; } & { totalGold: number; currentHealth: number; maxHealth: number; } & { totalGoldEarned: number; killParticipation: number; championDamageShare: number; wardsPlaced: number; wardsDestroyed: number; attackDamage: number; abilityPower: number; criticalChance: number; attackSpeed: number; lifeSteal: number; armor: number; magicResistance: number; tenacity: number; items: number[]; perkMetadata: { styleId: 8000 | 8100 | 8200 | 8300 | 8400; subStyleId: 8000 | 8100 | 8200 | 8300 | 8400; perks: number[]; }; abilities: "Q" | "W" | "E" | "R"; })[]; })[]; }>; } //# sourceMappingURL=games.d.ts.map