@blizzard-api/wow
Version:
A series of helpers to interact with the World of Warcraft Blizzard API
44 lines (43 loc) • 1.12 kB
JavaScript
import { wowBasePath, wowMediaBasePath, wowSearchBasePath } from "@blizzard-api/core";
//#region src/spell/index.ts
/**
* Get a spell by ID.
* @param spellId The spell ID.
* @returns The spell. See {@link SpellResponse}.
*/
function spell(spellId) {
return {
namespace: "static",
path: `${wowBasePath}/spell/${spellId}`
};
}
/**
* Get spell media by ID.
* @param spellId The spell ID.
* @returns The spell media. See {@link SpellMediaResponse}.
*/
function spellMedia(spellId) {
return {
namespace: "static",
path: `${wowMediaBasePath}/spell/${spellId}`
};
}
/**
* Get a spell search.
* @param options The spell search options. See {@link SpellSearchParameters}.
* @returns The spell search. See {@link SpellSearchResponse}.
*/
function spellSearch(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}/spell`
};
}
//#endregion
export { spell, spellMedia, spellSearch };
//# sourceMappingURL=index.js.map