@blizzard-api/wow
Version:
A series of helpers to interact with the World of Warcraft Blizzard API
1,652 lines (1,607 loc) • 156 kB
TypeScript
import { BaseSearchParameters, Locales, Origins, ProtectedResource, Resource, SearchResponse } from "@blizzard-api/core";
//#region src/base.d.ts
/**
*
*/
/**
* A record containing the RGBA values of a color.
*/
/**
*
*/
/**
* A record containing the RGBA values of a color.
*/
interface Color {
a: number;
b: number;
g: number;
r: number;
}
/**
* The playable gender names/descriptions in World of Warcraft.
*/
interface GenderName {
female: string;
male: string;
}
interface Href {
href: string;
}
/**
* Base record interface containing key.href property that often appear in Blizzard API responses.
*/
interface KeyBase {
key: Href;
}
/**
* The media asset associated with a character or entity in World of Warcraft.
*/
interface MediaAsset$1 {
file_data_id: number;
key: string;
value: string;
}
/**
* Base record interface containing name and id properties that often appear together in Blizzard API responses.
*/
interface NameId {
id: number;
name: string;
}
/**
* Base record containing both {@link KeyBase} and {@link NameId} interfaces.
*/
interface NameIdKey extends KeyBase, NameId {}
/**
* Base interface for Blizzard API responses.
*/
interface ResponseBase {
_links: {
self: Href;
};
}
/**
* The playable genders in World of Warcraft.
*/
declare const Genders: {
readonly FEMALE: "FEMALE";
readonly MALE: "MALE";
};
/**
* The gender associated with a character or entity in World of Warcraft.
*/
interface Gender {
name: Capitalize<Lowercase<keyof typeof Genders>>;
type: keyof typeof Genders;
}
/**
* The playable factions in World of Warcraft.
*/
declare const Factions: {
readonly ALLIANCE: "ALLIANCE";
readonly HORDE: "HORDE";
};
/**
* The standard structure to represent a World of Warcraft Character.
*/
interface Character$2 extends NameIdKey {
realm: Realm$4;
}
/**
* The faction associated with a character or entity in World of Warcraft.
*/
interface Faction {
name: Capitalize<Lowercase<keyof typeof Factions>>;
type: keyof typeof Factions;
}
/**
* The standard structure to represent a World of Warcraft Realm.
*/
interface Realm$4 extends NameIdKey {
slug: string;
} //#endregion
//#region src/account-profile/types.d.ts
interface AccountCollectionsIndexResponse {
_links: Links;
heirlooms: Href;
mounts: Href;
pets: Href;
toys: Href;
transmogs: Href;
}
interface AccountHeirloomsCollectionSummaryResponse {
_links: Links;
heirlooms: Array<Heirloom$1>;
}
interface AccountMountsCollectionSummaryResponse {
_links: Links;
mounts: Array<Mount$1>;
}
interface AccountPetsCollectionSummaryResponse {
_links: Links;
pets: Array<Pet$1>;
unlocked_battle_pet_slots: number;
}
interface AccountProfileSummaryResponse {
_links: Links;
collections: Href;
id: number;
wow_accounts?: Array<WowAccount>;
}
interface AccountToysCollectionSummaryResponse {
_links: Links;
toys: Array<Toy$1>;
}
interface AccountTransmogsCollectionSummaryResponse {
_links: Links;
appearance_sets: Array<NameIdKey>;
slots: Array<Slot$1>;
}
interface ProtectedCharacterProfileSummaryResponse {
_links: Links;
bind_position: Position;
character: NameIdKey & Realm$4;
id: number;
money: number;
name: string;
position: Position;
protected_stats: ProtectedStats;
wow_account: number;
}
interface Character$1 {
character: Href;
faction: Faction;
gender: Gender;
id: number;
level: number;
name: string;
playable_class: NameIdKey;
playable_race: NameIdKey;
protected_character: Href;
realm: Realm$4;
}
interface Heirloom$1 {
heirloom: NameIdKey;
upgrade: {
level: number;
};
}
interface Links {
profile: Href;
self: Href;
user: Href;
}
interface Mount$1 {
is_favorite?: boolean;
mount: NameIdKey;
}
interface Pet$1 {
active_slot?: number;
creature_display?: KeyBase & {
id: number;
};
id: number;
is_active?: boolean;
is_favorite?: boolean;
level: number;
name?: string;
quality: Quality$1;
species: NameIdKey;
stats: Stats$1;
}
interface Position {
facing: number;
map: NameId;
x: number;
y: number;
z: number;
zone: NameId;
}
interface ProtectedStats {
level_gold_gained: number;
level_gold_lost: number;
level_item_value_gained: number;
level_number_deaths: number;
total_gold_gained: number;
total_gold_lost: number;
total_item_value_gained: number;
total_number_deaths: number;
}
interface Quality$1 {
name: 'Common' | 'Poor' | 'Rare' | 'Uncommon';
type: 'COMMON' | 'POOR' | 'RARE' | 'UNCOMMON';
}
interface Slot$1 {
appearances: Array<KeyBase & {
id: number;
}>;
slot: Slot$1;
}
interface Slot$1 {
name: string;
type: string;
}
interface Stats$1 {
breed_id: number;
health: number;
power: number;
speed: number;
}
interface Toy$1 {
is_favorite?: boolean;
toy: NameIdKey;
}
interface WowAccount {
characters: Array<Character$1>;
id: number;
}
//#endregion
//#region src/account-profile/account-profile.d.ts
/**
* Because this endpoint provides data about the current logged-in user's World of Warcraft account, it requires an access token with the wow.profile scope acquired via the Authorization Code Flow. See {@link https://develop.battle.net/documentation/guides/using-oauth/authorization-code-flow}
* @param token The OAuth 2.0 access token to use for authentication.
* @returns an index of collection types for an account.
*/
declare function accountCollectionsIndex(token: string): ProtectedResource<AccountCollectionsIndexResponse>;
/**
* Because this endpoint provides data about the current logged-in user's World of Warcraft account, it requires an access token with the wow.profile scope acquired via the Authorization Code Flow. See {@link https://develop.battle.net/documentation/guides/using-oauth/authorization-code-flow}
* @param token The OAuth 2.0 access token to use for authentication.
* @returns a summary of the heirlooms an account has obtained.
*/
declare function accountHeirloomsCollectionSummary(token: string): ProtectedResource<AccountHeirloomsCollectionSummaryResponse>;
/**
* Because this endpoint provides data about the current logged-in user's World of Warcraft account, it requires an access token with the wow.profile scope acquired via the Authorization Code Flow. See {@link https://develop.battle.net/documentation/guides/using-oauth/authorization-code-flow}
* @param token The OAuth 2.0 access token to use for authentication.
* @returns a summary of the mounts an account has obtained.
*/
declare function accountMountsCollectionSummary(token: string): ProtectedResource<AccountMountsCollectionSummaryResponse>;
/**
* Because this endpoint provides data about the current logged-in user's World of Warcraft account, it requires an access token with the wow.profile scope acquired via the Authorization Code Flow. See {@link https://develop.battle.net/documentation/guides/using-oauth/authorization-code-flow}
* @param token The OAuth 2.0 access token to use for authentication.
* @returns a summary of the battle pets an account has obtained.
*/
declare function accountPetsCollectionSummary(token: string): ProtectedResource<AccountPetsCollectionSummaryResponse>;
/**
* Because this endpoint provides data about the current logged-in user's World of Warcraft account, it requires an access token with the wow.profile scope acquired via the Authorization Code Flow. See {@link https://develop.battle.net/documentation/guides/using-oauth/authorization-code-flow}
* @param token The OAuth 2.0 access token to use for authentication.
* @returns a profile summary for an account.
*/
declare function accountProfileSummary(token: string): ProtectedResource<AccountProfileSummaryResponse>;
/**
* Because this endpoint provides data about the current logged-in user's World of Warcraft account, it requires an access token with the wow.profile scope acquired via the Authorization Code Flow. See {@link https://develop.battle.net/documentation/guides/using-oauth/authorization-code-flow}
* @param token The OAuth 2.0 access token to use for authentication.
* @returns a summary of the toys an account has obtained.
*/
declare function accountToysCollectionSummary(token: string): ProtectedResource<AccountToysCollectionSummaryResponse>;
/**
* Because this endpoint provides data about the current logged-in user's World of Warcraft account, it requires an access token with the wow.profile scope acquired via the Authorization Code Flow. See {@link https://develop.battle.net/documentation/guides/using-oauth/authorization-code-flow}
* @param token The OAuth 2.0 access token to use for authentication.
* @returns a summary of the transmog unlocks an account has obtained.
*/
declare function accountTransmogsCollectionSummary(token: string): ProtectedResource<AccountTransmogsCollectionSummaryResponse>;
/**
* Because this endpoint provides data about the current logged-in user's World of Warcraft account, it requires an access token with the wow.profile scope acquired via the Authorization Code Flow. See {@link https://develop.battle.net/documentation/guides/using-oauth/authorization-code-flow}
* @param realmId The realm ID.
* @param characterId The character ID.
* @param token The OAuth 2.0 access token to use for authentication.
* @returns a protected profile summary for a character.
*/
declare function protectedCharacterProfileSummary(realmId: number, characterId: number, token: string): ProtectedResource<ProtectedCharacterProfileSummaryResponse>;
//#endregion
//#region src/achievements/types.d.ts
/**
* Interface for a response from the achievement category index endpoint.
* @see {@link https://develop.battle.net/documentation/world-of-warcraft/game-data-apis}
*/
interface AchievementCategoryIndexResponse extends ResponseBase {
categories: Array<NameIdKey>;
guild_categories: Array<NameIdKey>;
root_categories: Array<NameIdKey>;
}
/**
* Interface for a response from the achievement category endpoint.
* @see {@link https://develop.battle.net/documentation/world-of-warcraft/game-data-apis}
*/
interface AchievementCategoryResponse extends NameId, ResponseBase {
achievements: Array<NameIdKey>;
aggregates_by_faction: {
alliance: {
points: number;
quantity: number;
};
horde: {
points: number;
quantity: number;
};
};
display_order: number;
isGuildCategory: boolean;
parent_category: NameIdKey;
}
/**
* Interface for a response from the achievement index endpoint.
* @see {@link https://develop.battle.net/documentation/world-of-warcraft/game-data-apis}
*/
interface AchievementIndexResponse extends ResponseBase {
achievements: Array<NameIdKey>;
}
/**
* Interface for a response from the achievement media endpoint.
* @see {@link https://develop.battle.net/documentation/world-of-warcraft/game-data-apis}
*/
interface AchievementMediaResponse extends ResponseBase {
assets: Array<AchievementMediaItem>;
id: number;
}
/**
* Interface for a response from the achievement endpoint.
* @see {@link https://develop.battle.net/documentation/world-of-warcraft/game-data-apis}
*/
interface AchievementResponse extends NameId, ResponseBase {
category: NameIdKey;
criteria: {
amount: number;
description: string;
id: number;
};
description: string;
display_order: number;
is_account_wide: boolean;
media: KeyBase;
points: number;
}
interface AchievementMediaItem {
file_data_id: number;
key: string;
value: string;
}
//#endregion
//#region src/achievements/achievements.d.ts
/**
* Get an achievement by ID.
* @param achievementId The achievement ID.
* @returns The achievement. See {@link AchievementResponse}.
*/
declare function achievement(achievementId: number): Resource<AchievementResponse>;
/**
* Get an achievement category by ID.
* @param achievementCategoryId The achievement category ID.
* @returns The achievement category. See {@link AchievementCategoryResponse}.
*/
declare function achievementCategory(achievementCategoryId: number): Resource<AchievementCategoryResponse>;
/**
* Get an achievement category index.
* @returns The achievement category index. See {@link AchievementCategoryIndexResponse}.
*/
declare function achievementCategoryIndex(): Resource<AchievementCategoryIndexResponse>;
/**
* Get an achievement index.
* @returns The achievement index. See {@link AchievementIndexResponse}.
*/
declare function achievementIndex(): Resource<AchievementIndexResponse>;
/**
* Get achievement media by ID.
* @param achievementId The achievement ID.
* @returns The achievement media. See {@link AchievementMediaResponse}.
*/
declare function achievementMedia(achievementId: number): Resource<AchievementMediaResponse>;
//#endregion
//#region src/auction-house/types.d.ts
/**
* Interface for a response from the auction house commodities endpoint.
* @see {@link https://develop.battle.net/documentation/world-of-warcraft/game-data-apis}
*/
interface AuctionHouseCommoditiesResponse extends ResponseBase {
auctions: Array<AuctionHouseCommodity>;
}
/**
* Interface for a response from the auction house endpoint.
* @see {@link https://develop.battle.net/documentation/world-of-warcraft/game-data-apis}
*/
interface AuctionHouseResponse extends ResponseBase {
auctions: Array<AuctionHousePosting>;
commodities: {
href: string;
};
connected_realm: {
href: string;
};
}
interface AuctionHouseCommodity {
id: number;
item: {
id: number;
};
quantity: number;
time_left: AuctionHouseTimeLeft;
unit_price: number;
}
interface AuctionHousePosting {
bid: number;
buyout: number;
id: number;
item: {
bonus_lists: Array<number>;
context: number;
id: number;
modifiers: Array<{
type: number;
value: number;
}>;
};
quantity: number;
time_left: AuctionHouseTimeLeft;
}
type AuctionHouseTimeLeft = 'LONG' | 'MEDIUM' | 'SHORT' | 'VERY_LONG';
//#endregion
//#region src/auction-house/auction-house.d.ts
/**
* Get auction house data for a connected realm.
* @param connectedRealmId The ID of the connected realm.
* @returns The auction house data. See {@link AuctionHouseResponse}.
*/
declare function auctions(connectedRealmId: number): Resource<AuctionHouseResponse>;
/**
* Get auction house data for all connected realms.
* @returns The auction house data. See {@link AuctionHouseResponse}.
*/
declare function commodities(): Resource<AuctionHouseCommoditiesResponse>;
//#endregion
//#region src/azerite-essence/types.d.ts
/**
* Interface for a response from the azerite essence index endpoint.
* @see {@link https://develop.battle.net/documentation/world-of-warcraft/game-data-apis}
*/
interface AzeriteEssenceIndexResponse extends ResponseBase {
azerite_essences: Array<NameIdKey>;
}
/**
* Interface for a response from the azerite essence media endpoint.
* @see {@link https://develop.battle.net/documentation/world-of-warcraft/game-data-apis}
*/
interface AzeriteEssenceMediaResponse extends ResponseBase {
assets: Array<MediaAsset$1>;
id: number;
}
/**
* Interface for a response from the azerite essence endpoint.
* @see {@link https://develop.battle.net/documentation/world-of-warcraft/game-data-apis}
*/
interface AzeriteEssenceResponse extends NameId, ResponseBase {
allowed_specializations: Array<NameIdKey>;
media: Media$15;
powers: Array<Power>;
}
/**
* Interface for search parameters for azerite essences.
* @see {@link https://develop.battle.net/documentation/world-of-warcraft/game-data-apis}
* @see {@link https://develop.battle.net/documentation/world-of-warcraft/guides/search}
*/
interface AzeriteEssenceSearchParameters extends BaseSearchParameters {
'allowed_specializations.id'?: number;
}
/**
* Interface for a response item from the azerite essence search endpoint.
* @see {@link https://develop.battle.net/documentation/world-of-warcraft/game-data-apis}
* @see {@link https://develop.battle.net/documentation/world-of-warcraft/guides/search}
*/
interface AzeriteEssenceSearchResponseItem extends KeyBase {
data: {
allowed_specializations: Array<NameId>;
name: Record<Locales, string>;
};
}
interface Media$15 extends KeyBase {
id: number;
}
interface Power {
id: number;
main_power_spell: NameIdKey;
passive_power_spell: NameIdKey;
rank: number;
}
//#endregion
//#region src/azerite-essence/azerite-essence.d.ts
/**
* Get an azerite essence by ID.
* @param azeriteEssenceId The azerite essence ID.
* @returns The azerite essence. See {@link AzeriteEssenceResponse}.
*/
declare function azeriteEssence(azeriteEssenceId: number): Resource<AzeriteEssenceResponse>;
/**
* Get an azerite essence index.
* @returns The azerite essence index. See {@link AzeriteEssenceIndexResponse}.
*/
declare function azeriteEssenceIndex(): Resource<AzeriteEssenceIndexResponse>;
/**
* Get azerite essence media by ID.
* @param azeriteEssenceId The azerite essence ID.
* @returns The azerite essence media. See {@link AzeriteEssenceMediaResponse}.
*/
declare function azeriteEssenceMedia(azeriteEssenceId: number): Resource<AzeriteEssenceMediaResponse>;
/**
* Search for azerite essences.
* @param options The search parameters. See {@link AzeriteEssenceSearchParameters}.
* @returns The search results. See {@link SearchResponse}.
*/
declare function azeriteEssenceSearch(options: AzeriteEssenceSearchParameters): Resource<SearchResponse<AzeriteEssenceSearchResponseItem>, AzeriteEssenceSearchParameters>;
//#endregion
//#region src/character-achievements/types.d.ts
interface CharacterAchievementsSummaryResponse extends ResponseBase {
achievements: Array<Achievement$1>;
category_progress: Array<CategoryProgress$1>;
character: Character$2;
recent_events: Array<RecentEvent$1>;
statistics: Href;
total_points: number;
total_quantity: number;
}
interface CharacterAchievementStatisticsResponse extends ResponseBase {
categories: Array<Category$2>;
character: Character$2;
}
interface Achievement$1 {
achievement: NameIdKey;
completed_timestamp?: number;
criteria?: Criteria$1;
id: number;
}
interface Category$2 {
id: number;
name: string;
statistics: Array<Statistic>;
sub_categories: Array<SubCategory>;
}
interface CategoryProgress$1 {
category: NameIdKey;
points: number;
quantity: number;
}
interface Criteria$1 {
amount?: number;
child_criteria?: Array<Criteria$1>;
id: number;
is_completed: boolean;
}
interface RecentEvent$1 {
achievement: NameIdKey;
timestamp: number;
}
interface Statistic {
description?: null | string;
id: number;
last_updated_timestamp: number;
name: string;
quantity: number;
}
interface SubCategory {
id: number;
name: string;
statistics: Array<Statistic>;
}
//#endregion
//#region src/character-achievements/character-achievements.d.ts
/**
* @param realmSlug The slug of the realm.
* @param characterName The lowercase name of the character.
* @returns a summary of the achievements a character has completed.
*/
declare function characterAchievementsSummary(realmSlug: string, characterName: string): Resource<CharacterAchievementsSummaryResponse>;
/**
* @param realmSlug The slug of the realm.
* @param characterName The lowercase name of the character.
* @returns a character's statistics as they pertain to achievements.
*/
declare function characterAchievementStatistics(realmSlug: string, characterName: string): Resource<CharacterAchievementStatisticsResponse>;
//#endregion
//#region src/character-appearance/types.d.ts
interface CharacterAppearanceResponse extends ResponseBase {
active_spec: NameIdKey;
character: Character$2;
customizations: Array<Customization>;
faction: Faction;
gender: Gender;
guild_crest: GuildCrest;
items: Array<Item$2>;
playable_class: NameIdKey;
playable_race: NameIdKey;
}
interface BorderEmblem {
color: RGBWithId;
id: number;
media: KeyBase & {
id: number;
};
}
interface Choice {
display_order: number;
id: number;
name?: string;
}
interface Customization {
choice: Choice;
option: NameId;
}
interface GuildCrest {
background: {
color: RGBWithId;
};
border: BorderEmblem;
emblem: BorderEmblem;
}
interface Item$2 {
enchant: number;
id: number;
internal_slot_id: number;
item_appearance_modifier_id: number;
slot: {
name: string;
type: string;
};
subclass: number;
}
interface RGBWithId {
id: number;
rgba: Color;
}
//#endregion
//#region src/character-appearance/character-appearance.d.ts
/**
* @param realmSlug The slug of the realm.
* @param characterName The lowercase name of the character.
* @returns a summary of a character's appearance settings.
*/
declare function characterAppearanceSummary(realmSlug: string, characterName: string): Resource<CharacterAppearanceResponse>;
//#endregion
//#region src/character-collections/types.d.ts
interface CharacterCollectionsIndexResponse extends ResponseBase {
character: Character$2;
heirlooms: Href;
mounts: Href;
pets: Href;
toys: Href;
transmogs: Href;
}
interface CharacterHeirloomsCollectionSummaryResponse extends ResponseBase {
heirlooms: Array<Heirloom>;
}
interface CharacterMountsCollectionSummaryResponse extends ResponseBase {
mounts: Array<Mount>;
}
interface CharacterPetsCollectionSummaryResponse extends ResponseBase {
pets: Array<Pet>;
unlocked_battle_pet_slots: number;
}
interface CharacterToysCollectionSummaryResponse extends ResponseBase {
toys: Array<Toy>;
}
interface CharacterTransmogCollectionSummaryResponse extends ResponseBase {
appearance_sets: Array<NameIdKey>;
slots: Array<Slot>;
}
interface Heirloom {
heirloom: NameIdKey;
upgrade: {
level: number;
};
}
interface Mount {
is_character_specific?: boolean;
is_favorite?: boolean;
is_useable: boolean;
mount: NameIdKey;
}
interface Pet {
active_slot?: number;
creature_display?: KeyBase & {
id: number;
};
id: number;
is_active?: boolean;
is_favorite?: boolean;
level: number;
name?: string;
quality: Quality;
species: NameIdKey;
stats: Stats;
}
interface Quality {
name: 'Common' | 'Poor' | 'Rare' | 'Uncommon';
type: 'COMMON' | 'POOR' | 'RARE' | 'UNCOMMON';
}
interface Slot {
appearances: Array<KeyBase & {
id: number;
}>;
slot: Slot;
}
interface Slot {
name: string;
type: string;
}
interface Stats {
breed_id: number;
health: number;
power: number;
speed: number;
}
interface Toy {
is_favorite?: boolean;
toy: NameIdKey;
}
//#endregion
//#region src/character-collections/character-collections.d.ts
/**
* @param realmSlug The slug of the realm.
* @param characterName The lowercase name of the character.
* @returns an index of collection types for a character.
*/
declare function characterCollectionsIndex(realmSlug: string, characterName: string): Resource<CharacterCollectionsIndexResponse>;
/**
* @param realmSlug The slug of the realm.
* @param characterName The lowercase name of the character.
* @returns a summary of the heirlooms a character has obtained.
*/
declare function characterHeirloomsCollectionSummary(realmSlug: string, characterName: string): Resource<CharacterHeirloomsCollectionSummaryResponse>;
/**
* @param realmSlug The slug of the realm.
* @param characterName The lowercase name of the character.
* @returns a summary of the mounts a character has obtained.
*/
declare function characterMountsCollectionSummary(realmSlug: string, characterName: string): Resource<CharacterMountsCollectionSummaryResponse>;
/**
* @param realmSlug The slug of the realm.
* @param characterName The lowercase name of the character.
* @returns a summary of the battle pets a character has obtained.
*/
declare function characterPetsCollectionSummary(realmSlug: string, characterName: string): Resource<CharacterPetsCollectionSummaryResponse>;
/**
* @param realmSlug The slug of the realm.
* @param characterName The lowercase name of the character.
* @returns a summary of the toys a character has obtained.
*/
declare function characterToysCollectionSummary(realmSlug: string, characterName: string): Resource<CharacterToysCollectionSummaryResponse>;
/**
* @param realmSlug The slug of the realm.
* @param characterName The lowercase name of the character.
* @returns a summary of the transmog unlocks a character has obtained.
*/
declare function characterTransmogCollectionSummary(realmSlug: string, characterName: string): Resource<CharacterTransmogCollectionSummaryResponse>;
//#endregion
//#region src/character-encounters/types.d.ts
interface CharacterDungeonsResponse extends ResponseBase {
expansions: Array<Expansion<DungeonMode>>;
}
interface CharacterEncountersSummaryResponse extends ResponseBase {
character: Character$2;
dungeons: Href;
raids: Href;
}
interface CharacterRaidsResponse extends ResponseBase {
character: Character$2;
expansions: Array<Expansion<RaidMode>>;
}
interface DungeonDifficulties {
name: 'Heroic' | 'Mythic' | 'Mythic+ Dungeons' | 'Normal';
type: 'HEROIC' | 'MYTHIC' | 'MYTHIC_KEYSTONE' | 'NORMAL';
}
interface DungeonMode {
difficulty: DungeonDifficulties;
progress: Progress;
status: Status;
}
interface Encounter {
completed_count: number;
encounter: NameIdKey;
last_kill_timestamp: number;
}
interface Expansion<T> {
expansion: NameIdKey;
instances: Array<Instance<T>>;
}
interface Instance<T> {
instance: NameIdKey;
modes: Array<T>;
}
interface Progress {
completed_count: number;
encounters: Array<Encounter>;
total_count: number;
}
interface RaidDifficulties {
name: '10 Player' | '10 Player (Heroic)' | '25 Player' | '25 Player (Heroic)' | 'Heroic' | 'Mythic' | 'Normal' | 'Raid Finder';
type: 'HEROIC' | 'LEGACY_10_MAN' | 'LEGACY_10_MAN_HEROIC' | 'LEGACY_25_MAN' | 'LEGACY_25_MAN_HEROIC' | 'LFR' | 'MYTHIC' | 'NORMAL';
}
interface RaidMode {
difficulty: RaidDifficulties;
progress: Progress;
status: Status;
}
interface Status {
name: 'Complete' | 'In Progress';
type: 'COMPLETE' | 'IN_PROGRESS';
}
//#endregion
//#region src/character-encounters/character-encounters.d.ts
/**
* @param realmSlug The slug of the realm.
* @param characterName The lowercase name of the character.
* @returns a summary of a character's completed dungeons.
*/
declare function characterDungeons(realmSlug: string, characterName: string): Resource<CharacterDungeonsResponse>;
/**
* @param realmSlug The slug of the realm.
* @param characterName The lowercase name of the character.
* @returns a summary of a character's encounters.
*/
declare function characterEncountersSummary(realmSlug: string, characterName: string): Resource<CharacterEncountersSummaryResponse>;
/**
* @param realmSlug The slug of the realm.
* @param characterName The lowercase name of the character.
* @returns a summary of a character's completed raids.
*/
declare function characterRaids(realmSlug: string, characterName: string): Resource<CharacterRaidsResponse>;
//#endregion
//#region src/character-equipment/types.d.ts
interface CharacterEquipmentSummaryResponse extends ResponseBase {
character: Character$2;
equipped_item_sets: Array<Set>;
equipped_items: Array<EquippedItem>;
}
interface Armor$1 {
display: NameDescription;
value: number;
}
interface Damage$2 {
damage_class: NameType;
display_string: string;
max_value: number;
min_value: number;
}
interface DisplayStrings {
copper: string;
gold: string;
header: string;
silver: string;
}
interface DisplayStringValue {
display_string: string;
value: number;
}
interface Effect$1 {
display_string: string;
is_active: boolean;
required_count: number;
}
interface Enchantment {
display_string: string;
enchantment_id: number;
enchantment_slot: EnchantmentSlot;
source_item?: NameIdKey;
}
interface EnchantmentSlot {
id: number;
type: string;
}
interface EquippedItem {
armor?: Armor$1;
binding: NameType;
bonus_list?: Array<number>;
context: number;
description?: string;
durability?: DisplayStringValue;
enchantments?: Array<Enchantment>;
inventory_type: NameType;
is_subclass_hidden?: boolean;
item: KeyBase & {
id: number;
};
item_class: NameIdKey;
item_subclass: NameIdKey;
level: DisplayStringValue;
limit_category?: string;
media: KeyBase & {
id: number;
};
modified_appearance_id?: number;
modified_crafting_stat?: Array<ModifiedCraftingStat>;
name: string;
name_description: NameDescription;
quality: NameType;
quantity: number;
requirements?: Requirements$3;
sell_price?: SellPrice;
set?: Set;
slot: NameType;
sockets?: Array<Socket$1>;
spells?: Array<Spell$1>;
stats?: Array<Stat$2>;
transmog?: Transmog;
unique_equipped?: string;
weapon?: Weapon$2;
}
interface ItemElement extends NameIdKey {
is_equipped?: boolean;
}
interface ModifiedCraftingStat {
id: number;
name: string;
type: string;
}
interface NameDescription {
color: Color;
display_string: string;
}
interface NameType {
name: string;
type: string;
}
interface PlayableClasses {
display_string: string;
links: Array<NameIdKey>;
}
interface Requirements$3 {
level: DisplayStringValue;
playable_classes?: PlayableClasses;
}
interface SellPrice {
display_strings: DisplayStrings;
value: number;
}
interface Set {
display_string: string;
effects: Array<Effect$1>;
item_set: NameIdKey;
items: Array<ItemElement>;
}
interface Socket$1 {
display_string: string;
item: NameIdKey;
media: KeyBase & {
id: number;
};
socket_type: NameType;
}
interface Spell$1 {
description: string;
spell: NameIdKey;
}
interface Stat$2 {
display: NameDescription;
is_equip_bonus?: boolean;
is_negated?: boolean;
type: NameType;
value: number;
}
interface Transmog {
display_string: string;
item: NameIdKey;
item_modified_appearance_id: number;
}
interface Weapon$2 {
attack_speed: DisplayStringValue;
damage: Damage$2;
dps: DisplayStringValue;
}
//#endregion
//#region src/character-equipment/character-equipment.d.ts
/**
* @param realmSlug The slug of the realm.
* @param characterName The lowercase name of the character.
* @returns a summary of the items equipped by a character.
*/
declare function characterEquipmentSummary(realmSlug: string, characterName: string): Resource<CharacterEquipmentSummaryResponse>;
//#endregion
//#region src/character-hunter-pets/types.d.ts
interface CharacterHunterPetsSummaryResponse extends ResponseBase {
character: Character$2;
hunter_pets: Array<HunterPet>;
}
interface HunterPet {
creature: NameIdKey;
creature_display: KeyBase & {
id: number;
};
is_active?: boolean;
is_summoned?: boolean;
level: number;
name: string;
slot: number;
}
//#endregion
//#region src/character-hunter-pets/character-hunter-pets.d.ts
/**
* If the character is a hunter, returns a summary of the character's hunter pets. Otherwise, returns an HTTP 404 Not Found error.
* @param realmSlug The slug of the realm.
* @param characterName The lowercase name of the character.
* @returns a summary of the character's hunter pets.
*/
declare function characterHunterPetsSummary(realmSlug: string, characterName: string): Resource<CharacterHunterPetsSummaryResponse>;
//#endregion
//#region src/character-media/types.d.ts
interface CharacterMediaSummaryResponse extends ResponseBase {
assets: Array<Asset$1>;
character: Character$2;
}
interface Asset$1 {
key: string;
value: string;
}
//#endregion
//#region src/character-media/character-media.d.ts
/**
* @param realmSlug The slug of the realm.
* @param characterName The lowercase name of the character.
* @returns a summary of the media assets available for a character (such as an avatar render).
*/
declare function characterMediaSummary(realmSlug: string, characterName: string): Resource<CharacterMediaSummaryResponse>;
//#endregion
//#region src/character-mythic-keystone-profile/types.d.ts
interface CharacterMythicKeystoneProfileIndexResponse extends ResponseBase {
character: Character$2;
current_period: CurrentPeriod;
seasons: Array<KeyBase & {
id: number;
}>;
}
interface CharacterMythicKeystoneSeasonDetailsResponse extends ResponseBase {
best_runs: Array<BestRun>;
character: NameIdKey;
mythic_rating: MythicRating$1;
season: KeyBase & {
id: number;
};
}
interface BestRun {
completed_timestamp: number;
dungeon: NameIdKey;
duration: number;
is_completed_within_time: boolean;
keystone_affixes: Array<NameIdKey>;
keystone_level: number;
members: Array<Member$2>;
mythic_rating: MythicRating$1;
}
interface CurrentPeriod {
period: KeyBase & {
id: number;
};
}
interface Member$2 {
character: NameId & {
realm: Realm$4;
};
equipped_item_level: number;
race: NameIdKey;
specialization: NameIdKey;
}
interface MythicRating$1 {
color: Color;
rating: number;
}
//#endregion
//#region src/character-mythic-keystone-profile/character-mythic-keystone-profile.d.ts
/**
* @param realmSlug The slug of the realm.
* @param characterName The lowercase name of the character.
* @returns Returns the Mythic Keystone season details for a character. Returns a 404 Not Found for characters that have not yet completed a Mythic Keystone dungeon for the specified season.
*/
declare function characterMythicKeystoneProfileIndex(realmSlug: string, characterName: string): Resource<CharacterMythicKeystoneProfileIndexResponse>;
/**
* Returns the Mythic Keystone season details for a character.
* Returns a 404 Not Found for characters that have not yet completed a Mythic Keystone dungeon for the specified season.
* @param realmSlug The slug of the realm.
* @param characterName The lowercase name of the character.
* @param seasonId The ID of the season.
* @returns the Mythic Keystone season details for a character.
*/
declare function characterMythicKeystoneSeasonDetails(realmSlug: string, characterName: string, seasonId: number): Resource<CharacterMythicKeystoneSeasonDetailsResponse>;
//#endregion
//#region src/character-professions/types.d.ts
interface CharacterProfessionsSummaryResponse extends ResponseBase {
character: Character$2;
primaries: Array<Primary>;
secondaries: Array<Secondary>;
}
interface Primary {
profession: NameIdKey;
tiers: Array<Tier$1>;
}
interface Secondary {
max_skill_points?: number;
profession: NameIdKey;
skill_points?: number;
tiers?: Array<Tier$1>;
}
interface Tier$1 {
known_recipes?: Array<NameIdKey>;
max_skill_points: number;
skill_points: number;
tier: NameId;
}
//#endregion
//#region src/character-professions/character-professions.d.ts
/**
* @param realmSlug The slug of the realm.
* @param characterName The lowercase name of the character.
* @returns a summary of the professions for a character.
*/
declare function characterProfessionsSummary(realmSlug: string, characterName: string): Resource<CharacterProfessionsSummaryResponse>;
//#endregion
//#region src/character-profile/types.d.ts
interface CharacterProfileStatusResponse extends ResponseBase {
id: number;
is_valid: boolean;
}
interface CharacterProfileSummaryResponse extends ResponseBase {
achievement_points: number;
achievements: Href;
achievements_statistics: Href;
active_spec: NameIdKey;
active_title: NameIdKey & {
display_string: string;
};
appearance: Href;
average_item_level: number;
character_class: NameIdKey;
collections: Href;
covenant_progress: CovenantProgress;
encounters: Href;
equipment: Href;
equipped_item_level: number;
experience: number;
faction: Faction;
gender: Gender;
guild: Guild$2;
hunter_pets: Href;
id: number;
last_login_timestamp: number;
level: number;
media: Href;
mythic_keystone_profile: Href;
name: string;
name_search: string;
professions: Href;
pvp_summary: Href;
quests: Href;
race: NameIdKey;
realm: Realm$4;
reputations: Href;
specializations: Href;
statistics: Href;
titles: Href;
}
interface CovenantProgress {
chosen_covenant: NameIdKey;
renown_level: number;
soulbinds: Href;
}
interface Guild$2 extends NameIdKey {
faction: Faction;
realm: Realm$4;
}
//#endregion
//#region src/character-profile/character-profile.d.ts
/**
* Returns the status and a unique ID for a character. A client should delete information about a character from their application if any of the following conditions occur:
* - an HTTP 404 Not Found error is returned
* - the is_valid value is false
* - the returned character ID doesn't match the previously recorded value for the character
*
* The following example illustrates how to use this endpoint:
*
* 1. A client requests and stores information about a character, including its unique character ID and the timestamp of the request.
* 2. After 30 days, the client makes a request to the status endpoint to verify if the character information is still valid.
* 3. If character cannot be found, is not valid, or the characters IDs do not match, the client removes the information from their application.
* 4. If the character is valid and the character IDs match, the client retains the data for another 30 days.
* @param realmSlug The slug of the realm.
* @param characterName The lowercase name of the character.
* @returns the status of the character profile for a character.
*/
declare function characterProfileStatus(realmSlug: string, characterName: string): Resource<CharacterProfileStatusResponse>;
/**
* Returns a summary of the character profile for a character.
* @param realmSlug The slug of the realm.
* @param characterName The lowercase name of the character.
* @returns a summary of the character profile for a character.
*/
declare function characterProfileSummary(realmSlug: string, characterName: string): Resource<CharacterProfileSummaryResponse>;
//#endregion
//#region src/character-pvp/types.d.ts
interface CharacterPvpBracketStatisticsResponse extends ResponseBase {
bracket: Bracket$2;
character: Character$2;
faction: Faction;
rating: number;
season: KeyBase & {
id: number;
};
season_match_statistics: MatchStatistics;
tier: KeyBase & {
id: number;
};
weekly_match_statistics: MatchStatistics;
}
interface CharacterPvpSummaryResponse extends ResponseBase {
character: Character$2;
honor_level: number;
honorable_kills: number;
pvp_map_statistics: Array<PvpMapStatistic>;
}
interface Bracket$2 {
id: number;
type: string;
}
interface MatchStatistics {
lost: number;
played: number;
won: number;
}
interface PvpMapStatistic {
match_statistics: MatchStatistics;
world_map: NameId;
}
//#endregion
//#region src/character-pvp/character-pvp.d.ts
/**
* @param realmSlug The slug of the realm.
* @param characterName The lowercase name of the character.
* @param bracketId The ID of the PvP bracket.
* @returns a PvP bracket statistics for a character.
*/
declare function characterPvpBracketStatistics(realmSlug: string, characterName: string, bracketId: '2v2' | '3v3' | 'rbg' | `shuffle-${string}-${string}`): Resource<CharacterPvpBracketStatisticsResponse>;
/**
* @param realmSlug The slug of the realm.
* @param characterName The lowercase name of the character.
* @returns a PvP summary for a character.
*/
declare function characterPvpSummary(realmSlug: string, characterName: string): Resource<CharacterPvpSummaryResponse>;
//#endregion
//#region src/character-quests/types.d.ts
interface CharacterCompletedQuestsResponse extends ResponseBase {
character: Character$2;
quests: Array<NameIdKey>;
}
interface CharacterQuestsResponse extends ResponseBase {
character: Character$2;
completed: Href;
in_progress: Array<NameIdKey>;
}
//#endregion
//#region src/character-quests/character-quests.d.ts
/**
* @param realmSlug The slug of the realm.
* @param characterName The lowercase name of the character.
* @returns a list of quests that a character has completed.
*/
declare function characterCompletedQuests(realmSlug: string, characterName: string): Resource<CharacterCompletedQuestsResponse>;
/**
* @param realmSlug The slug of the realm.
* @param characterName The lowercase name of the character.
* @returns a character's active quests as well as a link to the character's completed quests.
*/
declare function characterQuests(realmSlug: string, characterName: string): Resource<CharacterQuestsResponse>;
//#endregion
//#region src/character-reputations/types.d.ts
interface CharacterReputationsSummaryResponse extends ResponseBase {
character: Character$2;
reputations: Array<Reputation$1>;
}
interface Paragon {
max: number;
raw: number;
value: number;
}
interface Reputation$1 {
faction: NameIdKey;
paragon?: Paragon;
standing: Standing;
}
interface Standing {
max: number;
name: string;
raw: number;
tier: number;
value: number;
}
//#endregion
//#region src/character-reputations/character-reputations.d.ts
/**
* @param realmSlug The slug of the realm.
* @param characterName The lowercase name of the character.
* @returns a summary of a character's reputations.
*/
declare function characterReputationsSummary(realmSlug: string, characterName: string): Resource<CharacterReputationsSummaryResponse>;
//#endregion
//#region src/character-soulbinds/types.d.ts
interface CharacterSoulbindsResponse extends ResponseBase {
character: Character$2;
chosen_covenant: NameIdKey;
renown_level: number;
soulbinds: Array<Soulbind>;
}
interface ConduitSocket {
socket: Socket;
type: TypeClass;
}
interface Socket {
conduit: NameIdKey;
rank: number;
}
interface Soulbind {
is_active?: boolean;
soulbind: NameIdKey;
traits: Array<Trait>;
}
interface Trait {
conduit_socket?: ConduitSocket;
display_order: number;
tier: number;
trait?: NameIdKey;
}
interface TypeClass {
name: 'Endurance Conduit Slot' | 'Finesse Conduit Slot' | 'Potency Conduit Slot';
type: 'ENDURANCE' | 'FINESSE' | 'POTENCY';
}
//#endregion
//#region src/character-soulbinds/character-soulbinds.d.ts
/**
* @param realmSlug The slug of the realm.
* @param characterName The lowercase name of the character.
* @returns a character's soulbinds.
*/
declare function characterSoulbinds(realmSlug: string, characterName: string): Resource<CharacterSoulbindsResponse>;
//#endregion
//#region src/character-specializations/types.d.ts
interface CharacterSpecializationsSummaryResponse extends ResponseBase {
active_hero_talent: NameIdKey;
active_specialization: NameIdKey;
character: Character$2;
specializations: Array<Specialization$1>;
}
interface Loadout {
is_active: boolean;
selected_class_talent_tree: NameIdKey;
selected_class_talents: Array<SelectedTalent>;
selected_spec_talent_tree: NameIdKey;
selected_spec_talents?: Array<SelectedTalent>;
talent_loadout_code: string;
}
interface PvpTalentSlot {
selected: Selected;
slot_number: number;
}
interface Selected {
spell_tooltip: SpellTooltip$2;
talent: NameIdKey;
}
interface SelectedTalent {
default_points?: number;
id: number;
rank: number;
tooltip: Selected;
}
interface Specialization$1 {
glyphs?: Array<NameIdKey>;
loadouts: Array<Loadout>;
pvp_talent_slots?: Array<PvpTalentSlot>;
specialization: NameIdKey;
}
interface SpellTooltip$2 {
cast_time: '1.5 sec cast' | '2.5 sec cast' | '3 sec cast' | 'Channeled' | 'Instant' | 'Passive';
cooldown?: string;
description: string;
power_cost?: string;
range?: '8-30 yd range' | '15 yd range' | '30 yd range' | '40 yd range' | '50 yd range' | '55 yd range' | '100 yd range' | 'Melee Range';
spell: NameIdKey;
}
//#endregion
//#region src/character-specializations/character-specializations.d.ts
/**
* @param realmSlug The slug of the realm.
* @param characterName The lowercase name of the character.
* @returns a summary of a character's specializations.
*/
declare function characterSpecializationsSummary(realmSlug: string, characterName: string): Resource<CharacterSpecializationsSummaryResponse>;
//#endregion
//#region src/character-statistics/types.d.ts
interface CharacterStatisticsSummaryResponse extends ResponseBase {
agility: BaseEffectiveStat;
armor: BaseEffectiveStat;
attack_power: number;
avoidance: Rating;
block: RatingWithValue;
bonus_armor: number;
character: Character$2;
dodge: RatingWithValue;
health: number;
intellect: BaseEffectiveStat;
lifesteal: RatingWithValue;
main_hand_damage_max: number;
main_hand_damage_min: number;
main_hand_dps: number;
main_hand_speed: number;
mana_regen: number;
mana_regen_combat: number;
mastery: RatingWithValue;
melee_crit: RatingWithValue;
melee_haste: RatingWithValue;
off_hand_damage_max: number;
off_hand_damage_min: number;
off_hand_dps: number;
off_hand_speed: number;
parry: RatingWithValue;
power: number;
power_type: Character$2;
ranged_crit: RatingWithValue;
ranged_haste: RatingWithValue;
speed: Rating;
spell_crit: RatingWithValue;
spell_haste: RatingWithValue;
spell_penetration: number;
spell_power: number;
stamina: BaseEffectiveStat;
strength: BaseEffectiveStat;
versatility: number;
versatility_damage_done_bonus: number;
versatility_damage_taken_bonus: number;
versatility_healing_done_bonus: number;
}
interface BaseEffectiveStat {
base: number;
effective: number;
}
interface Rating {
rating: number;
rating_bonus: number;
}
interface RatingWithValue {
rating: number;
rating_bonus: number;
value: number;
}
//#endregion
//#region src/character-statistics/character-statistics.d.ts
/**
* @param realmSlug The slug of the realm.
* @param characterName The lowercase name of the character.
* @returns a statistics summary for a character.
*/
declare function characterStatisticsSummary(realmSlug: string, characterName: string): Resource<CharacterStatisticsSummaryResponse>;
//#endregion
//#region src/character-titles/types.d.ts
interface CharacterTitlesSummaryResponse extends ResponseBase {
active_title: NameIdKey & {
display_string: string;
};
character: Character$2;
titles: Array<NameIdKey>;
}
//#endregion
//#region src/character-titles/character-titles.d.ts
/**
* @param realmSlug The slug of the realm.
* @param characterName The lowercase name of the character.
* @returns a summary of titles a character has obtained.
*/
declare function characterTitlesSummary(realmSlug: string, characterName: string): Resource<CharacterTitlesSummaryResponse>;
//#endregion
//#region src/realm/types.d.ts
/**
* The category of a realm.
* @see {@link https://develop.battle.net/documentation/world-of-warcraft/game-data-apis}
*/
type RealmCategory = 'Brazil' | 'English' | 'French' | 'German' | 'Italian' | 'Latin America' | 'Oceanic' | 'PS' | 'Russian' | 'Spanish' | 'United States' | '한국';
/**
* The response for a realm index.
* @see {@link https://develop.battle.net/documentation/world-of-warcraft/game-data-apis}
*/
interface RealmIndexResponse extends ResponseBase {
realms: Array<Realm$4>;
}
/**
* The response for a realm.
* @see {@link https://develop.battle.net/documentation/world-of-warcraft/game-data-apis}
*/
interface RealmResponse extends NameId, ResponseBase {
category: RealmCategory;
connected_realm: {
href: string;
};
is_tournament: boolean;
locale: WithoutUnderscore<Locales>;
region: NameIdKey;
slug: string;
timezone: RealmTimezone;
type: {
name: RealmType;
type: RealmTypeCapitalized;
};
}
/**
* The search parameters for realms.
* @see {@link https://develop.battle.net/documentation/world-of-warcraft/game-data-apis}
* @see {@link https://develop.battle.net/documentation/world-of-warcraft/guides/search}
*/
interface RealmSearchParameters extends BaseSearchParameters {
timezone?: RealmTimezone;
}
/**
* The response for a realm search.
* @see {@link https://develop.battle.net/documentation/world-of-warcraft/game-data-apis}
* @see {@link https://develop.battle.net/documentation/world-of-warcraft/guides/search}
*/
interface RealmSearchResponseItem extends KeyBase {
data: {
category: Record<Locales, string | undefined>;
id: number;
is_tournament: boolean;
locale: WithoutUnderscore<Locales>;
name: Record<Locales, string | undefined>;
region: {
id: number;
name: Record<Locales, string | undefined>;
};
slug: string;
timezone: RealmTimezone;
type: {
name: Record<Locales, string | undefined>;
type: RealmTypeCapitalized;
};
};
}
/**
* The timezone of a realm.
*/
type RealmTimezone = 'America/Chicago' | 'America/Denver' | 'America/Los_Angeles' | 'America/New_York' | 'America/Sao_Paulo' | 'Asia/Seoul' | 'Australia/Melbourne' | 'Europe/Paris';
/**
* The type of a realm, not capitalized or shortened.
*/
type RealmType = 'Normal' | 'Roleplaying';
/**
* The type of a realm, capitalized and shortended).
*/
type RealmTypeCapitalized = 'NORMAL' | 'RP';
type WithoutUnderscore<T extends string> = T extends `${infer Prefix}_${infer Suffix}` ? `${Prefix}${Suffix}` : never;
//#endregion
//#region src/connected-realm/types.d.ts
/**
* Connected Realm Index API response.
* @see https://develop.battle.net/documentation/world-of-warcraft/game-data-apis
*/
interface ConnectedRealmIndexResponse extends ResponseBase {
connected_realms: Array<{
href: string;
}>;
}
/**
* Connected Realm API response.
* @see https://develop.battle.net/documentation/world-of-warcraft/game-data-apis
*/
interface ConnectedRealmResponse extends ResponseBase {
auctions: {
href: string;
};
has_queue: boolean;
id: number;
mythic_leaderboards: {
href: string;
};
population: {
name: RealmPopulation;
type: RealmPopulationCapitalized;
};
realm_locked_status?: RealmLockedStatus;
realms: Array<Realm$3>;
status: {
name: RealmStatus;
type: Uppercase<RealmStatus>;
};
}
/**
* Connected Realm Search API parameters.
* @see {@link https://develop.battle.net/documentation/world-of-warcraft/game-data-apis}
* @see {@link https://develop.battle.net/documentation/world-of-warcraft/guides/search}
*/
interface ConnectedRealmSearchParameters extends BaseSea