guildwars2-ts
Version:
GuildWars 2 API Wrapper in Typescript
125 lines (124 loc) • 4.19 kB
TypeScript
import type { z } from 'zod';
import { ApiBase } from '../../base/apiBase';
import { PvPAmuletsDTO, PvPGamesDTO, PvPHeroesDTO, PvPRanksDTO, PvPSeasonDTO, PvPSeasonLeaderboardRegionsDTO, PvPSeasonLeaderboardsDTO } from '../../models';
import { numberArrayType, stringArrayType } from '../v2apiUtils';
/**
* /v2/pvp Api
*/
export declare class PvPApi extends ApiBase {
/**
* Returns information about the PvP amulets that are in the game.
*/
getAmulets(): Promise<z.infer<typeof numberArrayType>>;
/**
* Returns information about the PvP amulets that are in the game.
*
* @param ids - List of amulet ids, or "all"
*/
getAmulets(ids: number[] | 'all'): Promise<z.infer<typeof PvPAmuletsDTO>>;
/**
* Returns information about past PvP matches the player has participated in.
*/
getGames(): Promise<z.infer<typeof stringArrayType>>;
/**
* Returns information about past PvP matches the player has participated in.
*
* @param ids - List of game ids, or "all"
*/
getGames(ids: string[] | 'all'): Promise<z.infer<typeof PvPGamesDTO>>;
/**
* Returns information about pvp heroes that are available in-game.
*/
getHeroes(): Promise<z.infer<typeof stringArrayType>>;
/**
* Returns information about pvp heroes that are available in-game.
*
* @param ids - List of hero ids, or "all"
*/
getHeroes(ids: string[] | 'all'): Promise<z.infer<typeof PvPHeroesDTO>>;
/**
* Returns information about the available ranks in the Player versus Player game mode.
*/
getRanks(): Promise<z.infer<typeof numberArrayType>>;
/**
* Returns information about the available ranks in the Player versus Player game mode.
*
* @param ids - List of rank ids, or "all"
*/
getRanks(ids: number[] | 'all'): Promise<z.infer<typeof PvPRanksDTO>>;
/**
* Returns information about League seasons.
*/
getSeasons(): Promise<z.infer<typeof stringArrayType>>;
/**
* Returns information about League seasons.
*
* @param ids - Season ids, or "all"
*/
getSeasons(ids: string[] | 'all'): Promise<z.infer<typeof PvPSeasonDTO>>;
/**
* Returns information about League season leaderboards for either NA or EU.
*
* @param id - PvP season id
*/
getLeaderboards(id: string): Promise<z.infer<typeof PvPSeasonLeaderboardRegionsDTO>>;
/**
* Returns information about League season leaderboards for either NA or EU.
*
* @param id - PvP season id
* @param region - EU or NA region
* @param type - For season 1-4, legendary or guild type. For season 5+, "ladder"
*/
getLeaderboards(id: string, region: 'na' | 'eu', type: 'legendary' | 'guild' | 'ladder'): Promise<z.infer<typeof PvPSeasonLeaderboardsDTO>>;
/**
* Returns information about player pips.
*/
getStandings(): Promise<{
current: {
total_points: number;
division: number;
tier: number;
points: number;
repeats: number;
rating?: number | undefined;
decay?: number | undefined;
};
best: {
total_points: number;
division: number;
tier: number;
points: number;
repeats: number;
};
season_id: string;
}[]>;
/**
* Resource returns information about wins and losses in the account's PvP matches.
*/
getStats(): Promise<{
pvp_rank: number;
pvp_rank_points: number;
pvp_rank_rollovers: number;
aggregate: {
wins: number;
losses: number;
desertions: number;
byes: number;
forfeits: number;
};
professions: Record<string, {
wins: number;
losses: number;
desertions: number;
byes: number;
forfeits: number;
}>;
ladders: Record<string, {
wins: number;
losses: number;
desertions: number;
byes: number;
forfeits: number;
}>;
}>;
}