@blizzard-api/wow
Version:
A series of helpers to interact with the World of Warcraft Blizzard API
43 lines (42 loc) • 1.04 kB
JavaScript
import { wowBasePath, wowSearchBasePath } from "@blizzard-api/core";
//#region src/realm/index.ts
/**
* Get a realm by slug.
* @param realmSlug The realm slug.
* @returns The realm. See {@link RealmResponse}.
*/
function realm(realmSlug) {
return {
namespace: "dynamic",
path: `${wowBasePath}/realm/${realmSlug}`
};
}
/**
* Get a realm index.
* @returns The realm index. See {@link RealmIndexResponse}.
*/
function realmIndex() {
return {
namespace: "dynamic",
path: `${wowBasePath}/realm/index`
};
}
/**
* Search for realms.
* @param options The search parameters. See {@link RealmSearchParameters}.
* @returns The search results. See {@link RealmSearchResponse}.
*/
function realmSearch(options) {
return {
namespace: "dynamic",
parameters: {
_page: options._page,
orderby: Array.isArray(options.orderby) ? options.orderby.join(",") : options.orderby,
timezone: options.timezone
},
path: `${wowSearchBasePath}/realm`
};
}
//#endregion
export { realm, realmIndex, realmSearch };
//# sourceMappingURL=index.js.map