UNPKG

@blizzard-api/wow

Version:

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

159 lines (158 loc) 5.77 kB
import { BaseSearchParameters, KeyBase, Locales, MediaAsset, NameIdKey, Resource, ResponseBase, SearchResponseWithoutResults } from "@blizzard-api/core"; //#region 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>; 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; 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 CreatureSearchResponse extends SearchResponseWithoutResults { results: Array<CreatureSearchResponseItem>; } /** * 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 CreatureSearchResponseItem extends KeyBase { data: { creature_displays: Array<{ id: number; }>; family?: { id: number; name: Record<Locales, string>; }; id: number; is_tameable: boolean; name: Record<Locales, string | undefined>; type: { id: number; name: Record<Locales, string>; }; }; } interface DisplayMediaAsset { key: string; value: string; } interface Media extends KeyBase { id: number; } //#endregion //#region src/creature/index.d.ts /** * Get a creature by ID. * @param creatureId The creature ID. * @returns The creature. See {@link CreatureResponse}. */ declare function creature(creatureId: number): Resource<CreatureResponse>; /** * Get creature display media by ID. * @param creatureDisplayId The creature display ID. * @returns The creature display media. See {@link CreatureDisplayMediaResponse}. */ declare function creatureDisplayMedia(creatureDisplayId: number): Resource<CreatureDisplayMediaResponse>; /** * Get a creature family by ID. * @param creatureFamilyId The creature family ID. * @returns The creature family. See {@link CreatureFamilyResponse}. */ declare function creatureFamily(creatureFamilyId: number): Resource<CreatureFamilyResponse>; /** * Get a creature family index. * @returns The creature family index. See {@link CreatureFamilyIndexResponse}. */ declare function creatureFamilyIndex(): Resource<CreatureFamilyIndexResponse>; /** * Get creature family media by ID. * @param creatureFamilyId The creature family ID. * @returns The creature family media. See {@link CreatureFamilyMediaResponse}. */ declare function creatureFamilyMedia(creatureFamilyId: number): Resource<CreatureFamilyMediaResponse>; /** * Search for creatures. * @param options The creature search parameters. See {@link CreatureSearchParameters}. * @returns The creature search results. See {@link CreatureSearchResponse}. */ declare function creatureSearch(options: CreatureSearchParameters): Resource<CreatureSearchResponse, Omit<CreatureSearchParameters, 'locale' | 'name'>>; /** * Get a creature type by ID. * @param creatureTypeId The creature type ID. * @returns The creature type. See {@link CreatureTypeResponse}. */ declare function creatureType(creatureTypeId: number): Resource<CreatureTypeResponse>; /** * Get a creature type index. * @returns The creature type index. See {@link CreatureTypeIndexResponse}. */ declare function creatureTypeIndex(): Resource<CreatureTypeIndexResponse>; //#endregion export { CreatureTypeResponse as _, creatureFamilyMedia as a, creatureTypeIndex as c, CreatureFamilyMediaResponse as d, CreatureFamilyResponse as f, CreatureTypeIndexResponse as g, CreatureSearchResponse as h, creatureFamilyIndex as i, CreatureDisplayMediaResponse as l, CreatureSearchParameters as m, creatureDisplayMedia as n, creatureSearch as o, CreatureResponse as p, creatureFamily as r, creatureType as s, creature as t, CreatureFamilyIndexResponse as u }; //# sourceMappingURL=index-B0pIiKpC.d.ts.map