UNPKG

@blizzard-api/classic-wow

Version:

A series of helpers to interact with the World of Warcraft Classic Blizzard API

1,577 lines (1,539 loc) 63.7 kB
import { BaseSearchParameters, BlizzardNamespaces, Locales, Resource, SearchResponse } from "@blizzard-api/core"; //#region ../wow/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 extends NameIdKey { realm: Realm$1; } /** * 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$1 extends NameIdKey { slug: string; } //#endregion //#region src/auction-house/types.d.ts interface AuctionHouseIndexResponse extends ResponseBase { auctions: Array<NameIdKey>; } interface AuctionsResponse extends NameId, ResponseBase { auctions: Array<Auction>; connected_realm: { href: string; }; } interface Auction { bid: number; buyout: number; id: number; item: { id: number; rand?: number; seed?: number; }; quantity: number; time_left: 'LONG' | 'MEDIUM' | 'SHORT' | 'VERY_LONG'; } //#endregion //#region src/auction-house/auction-house.d.ts /** * Returns an index of auction houses for a connected realm. * @param namespace The namespace to use. See {@link BlizzardNamespaces}. * @param connectedRealmId The ID of the connected realm. * @returns The auction house index. See {@link AuctionHouseIndexResponse}. */ declare function auctionHouseIndex(namespace: Extract<BlizzardNamespaces, 'dynamic-classic1x' | 'dynamic-classic'>, connectedRealmId: number): Resource<AuctionHouseIndexResponse>; /** * Returns all active auctions for a specific auction house on a connected realm. * * Auction house data updates at a set interval. The value was initially set at 1 hour; however, it might change over time without notice. * * Depending on the number of active auctions on the specified connected realm, the response from this endpoint may be rather large, sometimes exceeding 10 MB. * @param namespace The namespace to use. See {@link BlizzardNamespaces}. * @param connectedRealmId The ID of the connected realm. * @param auctionHouseId The ID of the auction house. * @returns The auction house data. See {@link AuctionsResponse}. */ declare function auctions(namespace: Extract<BlizzardNamespaces, 'dynamic-classic1x' | 'dynamic-classic'>, connectedRealmId: number, auctionHouseId: number): Resource<AuctionsResponse>; //#endregion //#region ../wow/src/character-achievements/types.d.ts interface CharacterAchievementsSummaryResponse$1 extends ResponseBase { achievements: Array<Achievement$1>; category_progress: Array<CategoryProgress$1>; character: Character; recent_events: Array<RecentEvent$1>; statistics: Href; total_points: number; total_quantity: number; } interface CharacterAchievementStatisticsResponse extends ResponseBase { categories: Array<Category>; character: Character; } interface Achievement$1 { achievement: NameIdKey; completed_timestamp?: number; criteria?: Criteria$1; id: number; } interface Category { 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/types.d.ts type CharacterAchievementsSummaryResponse = Omit<CharacterAchievementsSummaryResponse$1, 'statistics'>; //#endregion //#region src/character-achievements/character-achievements.d.ts /** * @param namespace The namespace to use. See {@link BlizzardNamespaces}. Note: This API is not supported for classic era realms. * @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(namespace: Extract<BlizzardNamespaces, 'profile-classic'>, realmSlug: string, characterName: string): Resource<CharacterAchievementsSummaryResponse>; /** * @param namespace The namespace to use. See {@link BlizzardNamespaces}. Note: This API is not supported for classic era realms. * @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(namespace: Extract<BlizzardNamespaces, 'profile-classic'>, realmSlug: string, characterName: string): Resource<CharacterAchievementStatisticsResponse>; //#endregion //#region ../wow/src/character-equipment/types.d.ts interface CharacterEquipmentSummaryResponse extends ResponseBase { character: Character; equipped_item_sets: Array<Set>; equipped_items: Array<EquippedItem>; } interface Armor$1 { display: NameDescription; value: number; } interface Damage$1 { 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 { 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$1; sell_price?: SellPrice; set?: Set; slot: NameType; sockets?: Array<Socket>; spells?: Array<Spell$1>; stats?: Array<Stat$1>; transmog?: Transmog; unique_equipped?: string; weapon?: Weapon$1; } 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$1 { level: DisplayStringValue; playable_classes?: PlayableClasses; } interface SellPrice { display_strings: DisplayStrings; value: number; } interface Set { display_string: string; effects: Array<Effect>; item_set: NameIdKey; items: Array<ItemElement>; } interface Socket { display_string: string; item: NameIdKey; media: KeyBase & { id: number; }; socket_type: NameType; } interface Spell$1 { description: string; spell: NameIdKey; } interface Stat$1 { 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$1 { attack_speed: DisplayStringValue; damage: Damage$1; dps: DisplayStringValue; } //#endregion //#region src/character-equipment/character-equipment.d.ts /** * Returns a summary of the items equipped by a character. * @param namespace The namespace to use. See {@link BlizzardNamespaces}. * @param realmSlug The realm slug. * @param characterName The character name. * @returns The character equipment summary. */ declare function characterEquipmentSummary(namespace: Extract<BlizzardNamespaces, 'profile-classic1x' | 'profile-classic'>, realmSlug: string, characterName: string): Resource<CharacterEquipmentSummaryResponse>; //#endregion //#region ../wow/src/character-hunter-pets/types.d.ts interface CharacterHunterPetsSummaryResponse extends ResponseBase { character: Character; 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 namespace The namespace to use. See {@link BlizzardNamespaces}. * @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(namespace: Extract<BlizzardNamespaces, 'profile-classic1x' | 'profile-classic'>, realmSlug: string, characterName: string): Resource<CharacterHunterPetsSummaryResponse>; //#endregion //#region ../wow/src/character-media/types.d.ts interface CharacterMediaSummaryResponse extends ResponseBase { assets: Array<Asset>; character: Character; } interface Asset { key: string; value: string; } //#endregion //#region src/character-media/character-media.d.ts /** * @param namespace The namespace to use. See {@link BlizzardNamespaces}. * @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(namespace: Extract<BlizzardNamespaces, 'profile-classic1x' | 'profile-classic'>, realmSlug: string, characterName: string): Resource<CharacterMediaSummaryResponse>; //#endregion //#region ../wow/src/character-profile/types.d.ts interface CharacterProfileStatusResponse extends ResponseBase { id: number; is_valid: boolean; } //#endregion //#region src/character-profile/types.d.ts interface CharacterProfileSummaryResponse extends ResponseBase { achievement_points?: number; achievements?: Href; active_spec: NameIdKey; active_title?: { name: string; }; appearance: Href; average_item_level: number; character_class: NameIdKey; equipment: Href; equipped_item_level: number; experience: number; faction: Faction; gender: Gender; guild: Guild$2; id: number; is_ghost?: boolean; is_self_found?: boolean; last_login_timestamp: number; level: number; media: Href; name: string; pvp_summary: Href; race: NameIdKey; realm: Realm$1; specializations: Href; statistics: Href; titles: Href; } interface Guild$2 extends NameIdKey { faction: Faction; realm: Realm$1; } //#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 namespace The namespace to use. See {@link BlizzardNamespaces}. * @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(namespace: Extract<BlizzardNamespaces, 'profile-classic1x' | 'profile-classic'>, realmSlug: string, characterName: string): Resource<typeof namespace extends 'profile-classic1x' ? CharacterProfileStatusResponse : never>; /** * Returns a summary of the character profile for a character. * @param namespace The namespace to use. See {@link BlizzardNamespaces}. * @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(namespace: Extract<BlizzardNamespaces, 'profile-classic1x' | 'profile-classic'>, realmSlug: string, characterName: string): Resource<CharacterProfileSummaryResponse>; //#endregion //#region src/character-specialization/types.d.ts interface CharacterSpecializationsSummaryResponse extends ResponseBase { character: Character; specialization_groups: Array<SpecializationGroup>; } interface Specialization { specialization_name: string; spent_points: number; talents: Array<TalentElement>; } interface SpecializationGroup { glyphs?: Array<NameId>; is_active: boolean; specializations?: Array<Specialization>; } interface SpellTooltip { cast_time: 'Channeled' | 'Instant' | 'Instant cast' | 'Passive'; cooldown?: string; description: string; power_cost?: null | string; range?: string; spell: NameId; } interface TalentElement { spell_tooltip: SpellTooltip; talent: { id: number; }; talent_rank: number; } //#endregion //#region src/character-specialization/character-specialization.d.ts /** * @param namespace The namespace to use. See {@link BlizzardNamespaces}. * @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(namespace: Extract<BlizzardNamespaces, 'profile-classic1x' | 'profile-classic'>, realmSlug: string, characterName: string): Resource<CharacterSpecializationsSummaryResponse>; //#endregion //#region src/character-statistics/types.d.ts interface CharacterStatisticsSummaryResponse extends ResponseBase { agility: BaseEffectiveStat; arcane_resistance: BaseEffectiveStat; armor: BaseEffectiveStat; attack_power: number; block: RatingWithValue; bonus_armor?: number; character: Character; defense?: BaseEffectiveStat; dodge: RatingWithValue; fire_resistance: BaseEffectiveStat; health: number; holy_resistance: BaseEffectiveStat; intellect: BaseEffectiveStat; 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; nature_resistance: BaseEffectiveStat; 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; ranged_crit: RatingWithValue; ranged_haste?: RatingWithValue; shadow_resistance: BaseEffectiveStat; spell_crit: RatingWithValue; spell_haste?: RatingWithValue; spell_penetration: number; spell_power: number; spirit: BaseEffectiveStat; stamina: BaseEffectiveStat; strength: BaseEffectiveStat; } interface BaseEffectiveStat { base: number; effective: number; } interface RatingWithValue { rating: number; rating_bonus: number; value: number; } //#endregion //#region src/character-statistics/character-statistics.d.ts /** * @param namespace The namespace to use. See {@link BlizzardNamespaces}. * @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(namespace: Extract<BlizzardNamespaces, 'profile-classic1x' | 'profile-classic'>, realmSlug: string, characterName: string): Resource<CharacterStatisticsSummaryResponse>; //#endregion //#region ../wow/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$1>; } /** * 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 ../wow/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>; 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 BaseSearchParameters { 'realms.timezone'?: RealmTimezone; 'status.type'?: Uppercase<RealmStatus>; } /** * Connected Realm Search API response item. * @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 ConnectedRealmSearchResponseItem extends KeyBase { data: { has_queue: boolean; id: number; population: SearchRealmPopulation; realms: Array<SearchRealm>; status: SearchRealmStatus; }; } interface Realm { category: RealmCategory; connected_realm: { href: string; }; id: number; is_tournament: boolean; locale: WithoutUnderscore<Locales>; name: string; region: NameIdKey; slug: string; timezone: RealmTimezone; type: { name: RealmType; type: RealmTypeCapitalized; }; } interface RealmLockedStatus { is_locked_for_new_characters: boolean; is_locked_for_pct: boolean; } type RealmPopulation = 'Full' | 'High' | 'Low' | 'Medium' | 'New Players'; type RealmPopulationCapitalized = 'FULL' | 'HIGH' | 'LOW' | 'MEDIUM' | 'RECOMMENDED'; type RealmStatus = 'Down' | 'Up'; interface SearchRealm { 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; }; } interface SearchRealmPopulation { name: Record<Locales, string>; type: RealmPopulationCapitalized; } interface SearchRealmStatus { name: Record<Locales, string>; type: Uppercase<RealmStatus>; } //#endregion //#region src/connected-realm/connected-realm.d.ts /** * Returns a connected realm by ID. * @param namespace The namespace to use. See {@link BlizzardNamespaces}. * @param connectedRealmId The connected realm ID. * @returns The connected realm. See {@link ConnectedRealmResponse}. */ declare function connectedRealm(namespace: Extract<BlizzardNamespaces, 'dynamic-classic1x' | 'dynamic-classic'>, connectedRealmId: number): Resource<ConnectedRealmResponse>; /** * Returns an index of connected realms. * @param namespace The namespace to use. See {@link BlizzardNamespaces}. * @returns The connected realm index. See {@link ConnectedRealmIndexResponse}. */ declare function connectedRealmIndex(namespace: Extract<BlizzardNamespaces, 'dynamic-classic1x' | 'dynamic-classic'>): Resource<ConnectedRealmIndexResponse>; /** * Performs a search of connected realms. * @param namespace The namespace to use. See {@link BlizzardNamespaces}. * @param options The search parameters. See {@link ConnectedRealmSearchParameters}. * @returns The search results. See {@link SearchResponse} & {@link ConnectedRealmSearchResponseItem}. */ declare function connectedRealmSearch(namespace: Extract<BlizzardNamespaces, 'dynamic-classic1x' | 'dynamic-classic'>, options: ConnectedRealmSearchParameters): Resource<SearchResponse<ConnectedRealmSearchResponseItem>, ConnectedRealmSearchParameters>; //#endregion //#region ../wow/src/creature/types.d.ts /** * The response for creature display media. * @see {@link https://develop.battle.net/documentation/world-of-warcraft/game-data-apis} */ interface CreatureDisplayMediaResponse extends ResponseBase { assets: Array<DisplayMediaAsset>; id: number; } /** * The response for a creature family index. * @see {@link https://develop.battle.net/documentation/world-of-warcraft/game-data-apis} */ interface CreatureFamilyIndexResponse extends ResponseBase { creature_families: Array<NameIdKey>; } /** * The response for creature family media. * @see {@link https://develop.battle.net/documentation/world-of-warcraft/game-data-apis} */ interface CreatureFamilyMediaResponse extends ResponseBase { assets: Array<MediaAsset$1>; id: number; } /** * The response for a creature family. * @see {@link https://develop.battle.net/documentation/world-of-warcraft/game-data-apis} */ interface CreatureFamilyResponse extends ResponseBase { id: number; media: Media$3; name: string; specialization: NameIdKey; } /** * The response for a creature. * @see {@link https://develop.battle.net/documentation/world-of-warcraft/game-data-apis} */ interface CreatureResponse extends ResponseBase { creature_displays: Array<CreatureDisplay>; family: NameIdKey; id: number; is_tameable: boolean; name: string; type: NameIdKey; } /** * The search parameters for a creature. * @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 CreatureSearchParameters extends BaseSearchParameters { locale: Locales; name: string; } /** * The response for a creature 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 CreatureSearchResponseItem extends KeyBase { data: { creature_displays: Array<{ id: number; }>; family?: { id: number; name: Record<Locales, string | undefined>; }; id: number; is_tameable: boolean; name: Record<Locales, string | undefined>; type: { id: number; name: Record<Locales, string | undefined>; }; }; } /** * The response for a creature type index. * @see {@link https://develop.battle.net/documentation/world-of-warcraft/game-data-apis} */ interface CreatureTypeIndexResponse extends ResponseBase { creature_types: Array<NameIdKey>; } /** * The response for a creature type. * @see {@link https://develop.battle.net/documentation/world-of-warcraft/game-data-apis} */ interface CreatureTypeResponse extends ResponseBase { id: number; name: string; } interface CreatureDisplay extends KeyBase { id: number; } interface DisplayMediaAsset { key: string; value: string; } interface Media$3 extends KeyBase { id: number; } //#endregion //#region src/creature/creature.d.ts /** * Returns a creature by ID. * @param namespace The namespace to use. See {@link BlizzardNamespaces}. * @param creatureId The creature ID. * @returns The creature. See {@link CreatureResponse}. */ declare function creature(namespace: Extract<BlizzardNamespaces, 'static-classic1x' | 'static-classic'>, creatureId: number): Resource<CreatureResponse>; /** * Returns media for a creature display by ID. * @param namespace The namespace to use. See {@link BlizzardNamespaces}. * @param creatureDisplayId The creature display ID. * @returns The creature display media. See {@link CreatureDisplayMediaResponse}. */ declare function creatureDisplayMedia(namespace: Extract<BlizzardNamespaces, 'static-classic1x' | 'static-classic'>, creatureDisplayId: number): Resource<CreatureDisplayMediaResponse>; /** * Returns a creature family by ID. * @param namespace The namespace to use. See {@link BlizzardNamespaces}. * @param creatureFamilyId The creature family ID. * @returns The creature family. See {@link CreatureFamilyResponse}. */ declare function creatureFamily(namespace: Extract<BlizzardNamespaces, 'static-classic1x' | 'static-classic'>, creatureFamilyId: number): Resource<CreatureFamilyResponse>; /** * Returns an index of creature families. * @param namespace The namespace to use. See {@link BlizzardNamespaces}. * @returns The creature family index. See {@link CreatureFamilyIndexResponse}. */ declare function creatureFamilyIndex(namespace: Extract<BlizzardNamespaces, 'static-classic1x' | 'static-classic'>): Resource<CreatureFamilyIndexResponse>; /** * Returns media for a creature family by ID. * @param namespace The namespace to use. See {@link BlizzardNamespaces}. * @param creatureFamilyId The creature family ID. * @returns The creature family media. See {@link CreatureFamilyMediaResponse}. */ declare function creatureFamilyMedia(namespace: Extract<BlizzardNamespaces, 'static-classic1x' | 'static-classic'>, creatureFamilyId: number): Resource<CreatureFamilyMediaResponse>; /** * Performs a search of creatures. * @param namespace The namespace to use. See {@link BlizzardNamespaces}. * @param options The creature search parameters. See {@link CreatureSearchParameters}. * @returns The creature search results. See {@link SearchResponse} & {@link CreatureSearchResponseItem}. */ declare function creatureSearch(namespace: Extract<BlizzardNamespaces, 'static-classic1x' | 'static-classic'>, options: CreatureSearchParameters): Resource<SearchResponse<CreatureSearchResponseItem>, Omit<CreatureSearchParameters, 'locale' | 'name'>>; /** * Returns a creature type by ID. * @param namespace The namespace to use. See {@link BlizzardNamespaces}. * @param creatureTypeId The creature type ID. * @returns The creature type. See {@link CreatureTypeResponse}. */ declare function creatureType(namespace: Extract<BlizzardNamespaces, 'static-classic1x' | 'static-classic'>, creatureTypeId: number): Resource<CreatureTypeResponse>; /** * Returns an index of creature types. * @param namespace The namespace to use. See {@link BlizzardNamespaces}. * @returns The creature type index. See {@link CreatureTypeIndexResponse}. */ declare function creatureTypeIndex(namespace: Extract<BlizzardNamespaces, 'static-classic1x' | 'static-classic'>): Resource<CreatureTypeIndexResponse>; //#endregion //#region ../wow/src/guild-crest/types.d.ts /** * The response for a guild crest border or emblem. * @see {@link https://develop.battle.net/documentation/world-of-warcraft/game-data-apis} */ interface GuildCrestBorderEmblemResponse extends ResponseBase { assets: Array<GuildCrestAsset>; id: number; } /** * The response for the guild crest components index. * @see {@link https://develop.battle.net/documentation/world-of-warcraft/game-data-apis} */ interface GuildCrestComponentsIndexResponse extends ResponseBase { borders: Array<Border$1>; colors: Colors; emblems: Array<Border$1>; } interface Background { id: number; rgba: RGBA; } interface Border$1 { id: number; media: Media$2; } interface Colors { backgrounds: Array<Background>; borders: Array<Background>; emblems: Array<Background>; } interface GuildCrestAsset { key: string; value: string; } interface Media$2 extends KeyBase { id: number; } interface RGBA { a: number; b: number; g: number; r: number; } //#endregion //#region src/guild-crest/guild-crest.d.ts /** * Returns media for a guild crest border by ID. * @param namespace The namespace to use. See {@link BlizzardNamespaces}. * @param borderId The guild crest border ID. * @returns The guild crest border. See {@link GuildCrestBorderEmblemResponse}. */ declare function guildCrestBorder(namespace: Extract<BlizzardNamespaces, 'static-classic1x' | 'static-classic'>, borderId: number): Resource<GuildCrestBorderEmblemResponse>; /** * Returns an index of guild crest media. * @param namespace The namespace to use. See {@link BlizzardNamespaces}. * @returns The guild crest components index. See {@link GuildCrestComponentsIndexResponse}. */ declare function guildCrestComponentsIndex(namespace: Extract<BlizzardNamespaces, 'static-classic1x' | 'static-classic'>): Resource<GuildCrestComponentsIndexResponse>; /** * Returns media for a guild crest emblem by ID. * @param namespace The namespace to use. See {@link BlizzardNamespaces}. * @param emblemId The guild crest emblem ID. * @returns The guild crest emblem. See {@link GuildCrestBorderEmblemResponse}. */ declare function guildCrestEmblem(namespace: Extract<BlizzardNamespaces, 'static-classic1x' | 'static-classic'>, emblemId: number): Resource<GuildCrestBorderEmblemResponse>; //#endregion //#region ../wow/src/guild/types.d.ts interface GuildAchievementsResponse extends ResponseBase { achievements: Array<Achievement>; category_progress: Array<CategoryProgress>; guild: Guild$1; recent_events: Array<RecentEvent>; total_points: number; total_quantity: number; } interface GuildResponse$1 extends ResponseBase { achievement_points: number; achievements: Href; activity: Href; created_timestamp: number; crest: Crest; faction: Faction; id: number; member_count: number; name: string; name_search: string; realm: Realm$1; roster: Href; } interface Achievement { achievement: NameIdKey; completed_timestamp?: number; criteria?: Criteria; id: number; } interface Border { color: RgbWithId; id: number; media: KeyBase & { id: number; }; } interface CategoryProgress { category: NameIdKey; points: number; quantity: number; } interface Crest { background: { color: RgbWithId; }; border: Border; emblem: Border; } interface Criteria { amount?: number; child_criteria?: Array<Criteria>; id: number; is_completed: boolean; } interface Guild$1 extends NameIdKey { faction: Faction; realm: Realm$1; } interface RecentEvent { achievement: NameIdKey; timestamp: number; } interface RgbWithId { id: number; rgba: Color; } //#endregion //#region src/guild/types.d.ts interface GuildAchievementsClassicEraResponse extends ResponseBase { guild: Guild; } interface GuildActivityResponse extends ResponseBase { activities?: Array<ActivityElement>; guild: Guild; } type GuildResponse = Omit<GuildResponse$1, 'crest'> & { crest?: GuildResponse$1['crest']; }; interface GuildRosterResponse extends ResponseBase { guild: Guild; members: Array<Member>; } interface ActivityElement { activity: { type: string; }; character_achievement: CharacterAchievement; timestamp: number; } interface CharacterAchievement { achievement: NameIdKey; character: Character; } interface Guild extends NameIdKey { faction: Faction; realm: Realm$1; } interface Member { character: RosterMemberCharacter; rank: number; } interface Playable extends KeyBase { id: number; } interface RosterMemberCharacter extends Character { level: number; playable_class: Playable; playable_race: Playable; } //#endregion //#region src/guild/guild.d.ts /** * @param namespace The namespace to use. See {@link BlizzardNamespaces}. * @param realmSlug The slug of the realm. * @param nameSlug The lowercase name of the guild. * @returns a single guild by its name and realm. */ declare function guild(namespace: Extract<BlizzardNamespaces, 'profile-classic1x' | 'profile-classic'>, realmSlug: string, nameSlug: string): Resource<GuildResponse>; /** * @param namespace The namespace to use. See {@link BlizzardNamespaces}. * @param realmSlug The slug of the realm. * @param nameSlug The lowercase name of the guild. * @returns a single guild's achievements by name and realm. */ declare function guildAchievements<T extends Extract<BlizzardNamespaces, 'profile-classic1x' | 'profile-classic'>>(namespace: T, realmSlug: string, nameSlug: string): Resource<T extends 'profile-classic1x' ? GuildAchievementsClassicEraResponse : GuildAchievementsResponse>; /** * @param namespace The namespace to use. See {@link BlizzardNamespaces}. * @param realmSlug The slug of the realm. * @param nameSlug The lowercase name of the guild. * @returns a single guild's activity by name and realm. */ declare function guildActivity(namespace: Extract<BlizzardNamespaces, 'profile-classic1x' | 'profile-classic'>, realmSlug: string, nameSlug: string): Resource<GuildActivityResponse>; /** * @param namespace The namespace to use. See {@link BlizzardNamespaces}. * @param realmSlug The slug of the realm. * @param nameSlug The lowercase name of the guild. * @returns a single guild's roster by its name and realm. */ declare function guildRoster(namespace: Extract<BlizzardNamespaces, 'profile-classic1x' | 'profile-classic'>, realmSlug: string, nameSlug: string): Resource<GuildRosterResponse>; //#endregion //#region ../wow/src/item/types.d.ts /** * The response for an item class index. * @see {@link https://develop.battle.net/documentation/world-of-warcraft/game-data-apis} */ interface ItemClassIndexResponse extends ResponseBase { item_classes: Array<NameIdKey>; } /** * The response for an item class. * @see {@link https://develop.battle.net/documentation/world-of-warcraft/game-data-apis} */ interface ItemClassResponse extends ResponseBase { class_id: number; item_subclasses: Array<NameIdKey>; name: string; } /** * The response for an item media. * @see {@link https://develop.battle.net/documentation/world-of-warcraft/game-data-apis} */ interface ItemMediaResponse extends ResponseBase { assets: Array<MediaAsset$1>; id: number; } /** * The response for an item. * @see {@link https://develop.battle.net/documentation/world-of-warcraft/game-data-apis} */ interface ItemResponse extends NameId, ResponseBase { description?: string; inventory_type: InventoryType; is_equippable: boolean; is_stackable: boolean; item_class: NameIdKey; item_subclass: NameIdKey; level: number; max_count: number; media: Media$1; preview_item: PreviewItem; purchase_price: number; purchase_quantity: number; quality: ItemQuality; required_level: number; sell_price: number; } /** * The parameters for an item 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 ItemSearchParameters extends BaseSearchParameters { locale: Locales; name: string; } /** * The response for an item 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 ItemSearchResponseItem extends KeyBase { data: { id: number; inventory_type: InventoryType; is_equippable: boolean; is_stackable: boolean; item_class: { id: number; name: Record<Locales, string | undefined>; }; item_subclass: { id: number; name: Record<Locales, string | undefined>; }; level: number; max_count: number; media: { id: number; }; name: Record<Locales, string | undefined>; purchase_price: number; purchase_quantity: number; quality: ItemQuality; required_level: number; sell_price: number; }; } /** * The response for an item set index. * @see {@link https://develop.battle.net/documentation/world-of-warcraft/game-data-apis} */ /** * The response for an item subclass. * @see {@link https://develop.battle.net/documentation/world-of-warcraft/game-data-apis} */ interface ItemSubClassResponse extends ResponseBase { class_id: number; display_name: string; hide_subclass_in_tooltips: boolean; subclass_id: number; verbose_name: string; } interface Armor { display: Display; value: number; } interface Damage { damage_class: { name: string; type: string; }; display_string: string; max_value: number; min_value: number; } interface Display { color: Color; display_string: string; } interface Durability { display_string: string; value: number; } interface InventoryType { name: Record<Locales, string | undefined>; type: 'BACK' | 'BAG' | 'CHEST' | 'FEET' | 'FINGER' | 'HANDS' | 'HEAD' | 'LEGS' | 'NECK' | 'NON_EQUIP' | 'SHIRT' | 'SHOULDER' | 'TABARD' | 'TRINKET' | 'TWOHWEAPON' | 'WAIST' | 'WRIST'; } interface ItemQuality { name: Record<Locales, string | undefined>; type: 'ARTIFACT' | 'COMMON' | 'EPIC' | 'HEIRLOOM' | 'LEGENDARY' | 'POOR' | 'RARE' | 'UNCOMMON'; } interface Media$1 extends KeyBase { id: number; } interface PreviewItem { armor?: Armor; binding?: { name: string; type: string; }; bonus_list?: Array<number>; container_slots?: Durability; context?: number; crafting_reagent?: string; description?: string; durability?: Durability; inventory_type: InventoryType; is_subclass_hidden?: boolean; item: Media$1; item_class: NameIdKey; item_subclass: NameIdKey; level?: Durability; media: Media$1; name: string; quality: ItemQuality; recipe?: Recipe; requirements?: Requirements; sell_price?: number; shield_block?: Armor; spells?: Array<Spell>; stats?: Array<Stat>; unique_equipped?: 'Unique'; weapon?: Weapon; } interface Recipe { item: RecipeItem; reagents: Array<NameIdKey & { quantity: number; }>; reagents_display_string: string; } interface RecipeItem { armor?: Armor; binding: { name: string; type: string; }; durability: Durability; inventory_type: InventoryType; item: Media$1; item_class: NameIdKey; item_subclass: NameIdKey; level: Durability; media: Media$1; name: string; quality: ItemQuality; requirements: Requirements; sell_price: { display_strings: RecipeItemDisplayStrings; value: number; }; stats: Array<Stat>; weapon?: Weapon; } interface RecipeItemDisplayStrings { copper: string; gold: string; header: string; silver: string; } interface Requirements { level: Durability; } interface Spell { description: string; spell: NameIdKey; } interface Stat { display: Display; is_negated?: boolean; type: { name: StatType; type: StatTypeCapitalized; }; value: number; } type StatType = 'Agility' | 'Critical Strike' | 'Haste' | 'Intellect' | 'Mastery' | 'Stamina' | 'Strength' | 'Versatility'; type StatTypeCapitalized = 'AGILITY' | 'CRIT_RATING' | 'HASTE_RATING' | 'INTELLECT' | 'MASTERY' | 'STAMINA' | 'STRENGTH' | 'VERSATILITY'; interface Weapon { attack_speed: Durability; damage: Damage; dps: Durability; } //#endregion //#region src/item/item.d.ts /** * Get an item by ID. * @param namespace The namespace to use. See {@link BlizzardNamespaces}. * @param itemId The item ID. * @returns The item. See {@link ItemResponse}. */ declare function item(namespace: Extract<BlizzardNamespaces, 'static-classic1x' | 'static-classic'>, itemId: number): Resource<ItemResponse>; /** * Get an item class by ID. * @param namespace The namespace to use. See {@link BlizzardNamespaces}. * @param itemClassId The item class ID. * @returns The item class. See {@link ItemClassResponse}. */ declare function itemClass(namespace: Extract<BlizzardNamespaces, 'static-classic1x' | 'static-classic'>, itemClassId: number): Resource<ItemClassResponse>; /** * Get an item class index. * @param namespace The namespace to use. See {@link BlizzardNamespaces}. * @returns The item class index. See {@link ItemClassIndexResponse}. */ declare function itemClassIndex(namespace: Extract<BlizzardNamespaces, 'static-classic1x' | 'static-classic'>): Resource<ItemClassIndexResponse>; /** * Get item media by ID. * @param namespace The namespace to use. See {@link BlizzardNamespaces}. * @param itemId The item ID. * @returns The item media. See {@link ItemMediaResponse}. */ declare function itemMedia(namespace: Extract<BlizzardNamespaces, 'static-classic1x' | 'static-classic'>, itemId: number): Resource<ItemMediaResponse>; /** * Search for items. * @param namespace The namespace to use. See {@link BlizzardNamespaces}. * @param options The search parameters. See {@link ItemSearchParameters}. * @returns The search results. See {@link SearchResponse}. */ declare function itemSearch(namespace: Extract<BlizzardNamespaces, 'static-classic1x' | 'static-classic'>, options: ItemSearchParameters): Resource<SearchResponse<ItemSearchResponseItem>, Omit<ItemSearchParameters, 'locale' | 'name'>>; /** * Get an item subclass by ID. * @param namespace The namespace to use. See {@link BlizzardNamespaces}. * @param itemClassId The item class ID. * @param itemSubclassId The item subclass ID. * @returns The item subclass. See {@link ItemSubClassResponse}. */ declare function itemSubClass(namespace: Extract<BlizzardNamespaces, 'static-classic1x' | 'static-classic'>, itemClassId: number, itemSubclassId: number): Resource<ItemSubClassResponse>; //#endregion //#region ../wow/src/media-search/types.d.ts /** * The search parameters for media. * @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 MediaSearchParameters extends BaseSearchParameters { tags?: string; } /** * The response for a media 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 MediaSearchResponseItem extends KeyBase { data: { assets: Array<MediaAsset>; id: number; }; } interface MediaAsset { file_data_id: number; key: string; value: string; } //#endregion //#region src/media-search/media-search.d.ts /** * Search for media. * @param namespace The namespace to use. See {@link BlizzardNamespaces}. * @param options The search parameters. See {@link MediaSearchParameters}. * @returns The search results. See {@link SearchResponse}. */ declare function mediaSearch(namespace: Extract<BlizzardNamespaces, 'static-classic1x' | 'static-classic'>, options: MediaSearchParameters): Resource<SearchResponse<MediaSearchResponseItem>, MediaSearchParameters>; //#endregion //#region ../wow/src/playable-class/types.d.ts /** * The response for a playable class index. * @see {@link https://develop.battle.net/documentation/world-of-warcraft/game-data-apis} */ interface PlayableClassIndexResponse extends ResponseBase { classes: Array<NameIdKey>; } /** * The response for playable class media. * @see {@link https://develop.battle.net/documentation/world-of-warcraft/game-data-apis} */ interface PlayableClassMediaResponse extends ResponseBase { assets: Array<MediaAsset$1>; id: number; } //#endregion //#region src/playable-class/types.d.ts /** * The response for a playable class. * @see {@link https://develop.battle.net/documentation/world-of-warcraft/game-data-apis} */ /** * The response for a playable class. * @see {@link https://develop.battle.net/documentation/world-of-warcraft-classic/game-data-apis} */ interface PlayableClassResponse extends NameId, ResponseBase { gender_name: GenderName; media: Media; playable_races: Array<NameIdKey>; power_type: NameIdKey; pvp_talent_slots: { href: string; }; } interface Media extends KeyBase { id: number; } //#endregion //#region src/playable-class/playable-class.d.ts /** * Get a playable class by ID. * @param namespace The namespace to use. See {@link BlizzardNamespaces}. * @param playableClassId The playable class ID. * @returns The playable class. See {@link PlayableClassResponse}. */ declare function playableClass(namespace: Extract<BlizzardNamespaces, 'static-classic1x' | 'static-classic'>, playableClassId: number): Resource<PlayableClassResponse>; /** * Get a playable class index. * @param namespace The namespace to use. See {@link BlizzardNamespaces}. * @returns The playable class index. See {@link PlayableClassIndexResponse}. */ declare function playableClassIndex(namespace: Extract<BlizzardNamespaces, 'static-classic1x' | 'static-classic'>): Resource<PlayableClassIndexResponse>; /** * Get playable class media by ID. * @param namespace The namespace to use. See {@link BlizzardNamespaces}. * @param playableClassId The playable class ID. * @returns The playable class media. See {@link PlayableClassMediaResponse}. */ declare function playableClassMedia(namespace: Extract<BlizzardNamespaces, 'static-classic1x' | 'static-classic'>, playableClassId: number): Resource<PlayableClassMediaResponse>; //#endregion //#region ../wow/src/playable-race/types.d.ts /** * The playable race index response. * @see {@link https://develop.battle.net/documentation/world-of-warcraft/game-data-apis} */ interface PlayableRaceIndexResponse extends ResponseBase { races: Array<NameIdKey>; } /** * The playable race response. * @see {@link https://develop.battle.net/documentation/world-