UNPKG

@blizzard-api/wow

Version:

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

91 lines (90 loc) 2.93 kB
import { BaseSearchParameters, Faction, Factions, KeyBase, Locales, NameIdKey, NullishNameIdKey, Resource, ResponseBase, SearchResponseWithoutResults } from "@blizzard-api/core"; //#region src/mount/types.d.ts /** * The response for a mount index. * @see {@link https://develop.battle.net/documentation/world-of-warcraft/game-data-apis} */ interface MountIndexResponse extends ResponseBase { mounts: Array<NullishNameIdKey>; } /** * The response for a mount. * @see {@link https://develop.battle.net/documentation/world-of-warcraft/game-data-apis} */ interface MountResponse extends ResponseBase { creature_displays: Array<CreatureDisplay>; description: null | string; faction?: Faction; id: number; name: string; requirements?: { classes?: Array<NameIdKey>; faction?: Faction; races?: Array<NameIdKey>; }; should_exclude_if_uncollected?: boolean; source?: Source; } /** * The search parameters for mounts. * @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 MountSearchParameters extends BaseSearchParameters { locale: Locales; name: string; } /** * The response for a mount 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 MountSearchResponse extends SearchResponseWithoutResults { results: Array<MountSearchResponseItem>; } interface CreatureDisplay extends KeyBase { id: number; } interface MountSearchResponseItem extends KeyBase { data: { creature_displays: Array<{ id: number; }>; faction?: { name: Record<Locales, string>; type: Factions; }; id: number; name: Record<Locales, string | undefined>; source: { name: Record<Locales, string>; type: string; }; }; } interface Source { name: string; type: string; } //#endregion //#region src/mount/index.d.ts /** * Get a mount by ID. * @param mountId The mount ID. * @returns The mount. See {@link MountResponse}. */ declare function mount(mountId: number): Resource<MountResponse>; /** * Get a mount index. * @returns The mount index. See {@link MountIndexResponse}. */ declare function mountIndex(): Resource<MountIndexResponse>; /** * Get a mount search. * @param options The search parameters. See {@link MountSearchParameters}. * @returns The search results. See {@link MountSearchResponse}. */ declare function mountSearch(options: MountSearchParameters): Resource<MountSearchResponse, Omit<MountSearchParameters, 'locale' | 'name'>>; //#endregion export { MountResponse as a, MountIndexResponse as i, mountIndex as n, MountSearchParameters as o, mountSearch as r, MountSearchResponse as s, mount as t }; //# sourceMappingURL=index-CG0HaW0R.d.ts.map