UNPKG

guildwars2-ts

Version:

GuildWars 2 API Wrapper in Typescript

167 lines (166 loc) 5.8 kB
import type { z } from 'zod'; import { ApiBase } from '../../base/apiBase'; import { WvWAbilitiesDTO, WvWMatchesDTO, WvWObjectivesDTO, WvWRanksDTO, WvWUpgradesDTO } from '../../models'; import { numberArrayType, stringArrayType } from '../v2apiUtils'; /** * /v2/wvw Api */ export declare class WorldVsWorldApi extends ApiBase { /** * Returns information about the available abilities in the World versus World game mode. */ getAbilities(): Promise<z.infer<typeof numberArrayType>>; /** * Returns information about the available abilities in the World versus World game mode. * * @param ids - List of WvW ability ids */ getAbilities(ids: number[] | 'all'): Promise<z.infer<typeof WvWAbilitiesDTO>>; /** * Returns information about which guild is associated with which region and matchmaking team for WvW. * * @param region - "na" or "eu" */ getGuilds(region: 'na' | 'eu'): Promise<Record<string, string>>; /** * Returns further details about the specified match, including the total score, kills and deaths, and further details for each map. */ getMatches(): Promise<z.infer<typeof stringArrayType>>; /** * Returns further details about the specified match, including the total score, kills and deaths, and further details for each map. * * @param ids - List of match ids, or "all" */ getMatches(ids: Array<`${number}-${number}`> | 'all'): Promise<z.infer<typeof WvWMatchesDTO>>; /** * Returns specific details pertaining to guilds in the current selected matchup. * For match stats by world, use {@link WorldVsWorldApi#getMatchesByWorld} with the "stats" type. * * @deprecated Does not seem to return any data, after the WvW Alliance update. Use {@link WorldVsWorldApi#getMatches} * * @param id - Match id * @param team - "red", "blue", or "green" * @param filter - "kills" or "kdr" */ getMatchStats(id: `${number}-${number}`, team: 'red' | 'blue' | 'green', filter: 'kills' | 'kdr'): Promise<{ guild_id: string; deaths: { red: number; blue: number; green: number; }; kills: { red: number; blue: number; green: number; }; wilson?: number | undefined; }[]>; /** * Returns further details about the specified match, including the total score, kills and deaths, and further details for each map. * The same information as {@link WorldVsWorldApi#getMatches}, however more limited. * * @param type - Overview, Scores, or Stats for the matches * @param world - World id */ getMatchesByWorld(type: 'overview' | 'scores' | 'stats', world: number): Promise<{ id: string; worlds: { red: number; blue: number; green: number; }; all_worlds: Record<"red" | "blue" | "green", number[]>; start_time: string; end_time: string; } | { id: string; scores: { red: number; blue: number; green: number; }; maps: { id: number; type: string; scores: { red: number; blue: number; green: number; }; }[]; skirmishes: { id: number; scores: { red: number; blue: number; green: number; }; map_scores: { type: "BlueHome" | "Center" | "GreenHome" | "RedHome"; scores: { red: number; blue: number; green: number; }; }[]; }[]; } | { id: string; deaths: { red: number; blue: number; green: number; }; kills: { red: number; blue: number; green: number; }; maps: { id: number; type: string; deaths: { red: number; blue: number; green: number; }; }[]; }>; /** * Returns details about World vs. World objectives such as camps, towers, and keeps. */ getObjectives(): Promise<z.infer<typeof stringArrayType>>; /** * Returns details about World vs. World objectives such as camps, towers, and keeps. * * @param ids - Objective ids, or "all" */ getObjectives(ids: Array<`${number}-${number}`>): Promise<z.infer<typeof WvWObjectivesDTO>>; /** * Returns information about the available ranks in the World versus World game mode. */ getRanks(): Promise<z.infer<typeof numberArrayType>>; /** * Returns information about the available ranks in the World versus World game mode. * * @param ids - List of WvW rank ids, or "all" */ getRanks(ids: number[] | 'all'): Promise<z.infer<typeof WvWRanksDTO>>; /** * Returns time/date information about when team assignment changes. * * @param type - "lockout" or "teamAssignment" */ getTimers(type: 'lockout' | 'teamAssignment'): Promise<Record<string, string>>; /** * Returns details about available World vs. World upgrades for objectives such as camps, towers, and keeps. */ getUpgrades(): Promise<z.infer<typeof numberArrayType>>; /** * Returns details about available World vs. World upgrades for objectives such as camps, towers, and keeps. * * @param ids - List of WvW upgrades, or "all" */ getUpgrades(ids: number[] | 'all'): Promise<z.infer<typeof WvWUpgradesDTO>>; }