UNPKG

@blizzard-api/wow

Version:

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

97 lines (96 loc) 2.75 kB
import { wowBasePath, wowMediaBasePath, wowSearchBasePath } from "@blizzard-api/core"; //#region src/creature/index.ts /** * Get a creature by ID. * @param creatureId The creature ID. * @returns The creature. See {@link CreatureResponse}. */ function creature(creatureId) { return { namespace: "static", path: `${wowBasePath}/creature/${creatureId}` }; } /** * Get creature display media by ID. * @param creatureDisplayId The creature display ID. * @returns The creature display media. See {@link CreatureDisplayMediaResponse}. */ function creatureDisplayMedia(creatureDisplayId) { return { namespace: "static", path: `${wowMediaBasePath}/creature-display/${creatureDisplayId}` }; } /** * Get a creature family by ID. * @param creatureFamilyId The creature family ID. * @returns The creature family. See {@link CreatureFamilyResponse}. */ function creatureFamily(creatureFamilyId) { return { namespace: "static", path: `${wowBasePath}/creature-family/${creatureFamilyId}` }; } /** * Get a creature family index. * @returns The creature family index. See {@link CreatureFamilyIndexResponse}. */ function creatureFamilyIndex() { return { namespace: "static", path: `${wowBasePath}/creature-family/index` }; } /** * Get creature family media by ID. * @param creatureFamilyId The creature family ID. * @returns The creature family media. See {@link CreatureFamilyMediaResponse}. */ function creatureFamilyMedia(creatureFamilyId) { return { namespace: "static", path: `${wowMediaBasePath}/creature-family/${creatureFamilyId}` }; } /** * Search for creatures. * @param options The creature search parameters. See {@link CreatureSearchParameters}. * @returns The creature search results. See {@link CreatureSearchResponse}. */ function creatureSearch(options) { return { namespace: "static", parameters: { _page: options._page, [`name.${options.locale}`]: options.name, orderby: Array.isArray(options.orderby) ? options.orderby.join(",") : options.orderby }, path: `${wowSearchBasePath}/creature` }; } /** * Get a creature type by ID. * @param creatureTypeId The creature type ID. * @returns The creature type. See {@link CreatureTypeResponse}. */ function creatureType(creatureTypeId) { return { namespace: "static", path: `${wowBasePath}/creature-type/${creatureTypeId}` }; } /** * Get a creature type index. * @returns The creature type index. See {@link CreatureTypeIndexResponse}. */ function creatureTypeIndex() { return { namespace: "static", path: `${wowBasePath}/creature-type/index` }; } //#endregion export { creature, creatureDisplayMedia, creatureFamily, creatureFamilyIndex, creatureFamilyMedia, creatureSearch, creatureType, creatureTypeIndex }; //# sourceMappingURL=index.js.map