UNPKG

@blizzard-api/sc2

Version:

A series of helpers to interact with the Starcraft II Blizzard API

61 lines (60 loc) 2.56 kB
import { t as starcraftRegion } from "../regions-Dk4G9ABq.js"; //#region src/legacy/index.ts /** * Returns the legacy achievements for the specified region. * @param regionId The region ID for Starcraft. * @returns A resource representing the legacy achievements. See {@link LegacyAchievementsResponse} */ function legacyAchievements(regionId) { return { path: `/sc2/legacy/data/achievements/${starcraftRegion[regionId]}` }; } /** * Returns the ladder information for the specified ladder. * @param regionId The region ID for Starcraft. * @param ladderId The ID of the ladder. * @returns A resource representing the ladder. See {@link LadderResponse} */ function legacyLadder(regionId, ladderId) { return { path: `/sc2/legacy/ladder/${starcraftRegion[regionId]}/${ladderId}` }; } /** * Returns the ladders for the specified profile. * @param regionId The region ID for Starcraft. * @param realmId 1 or 2 * @param profileId The ID of the profile. * @returns A resource representing the ladders for the given profile. See {@link LegacyLaddersResponse} */ function legacyLadders(regionId, realmId, profileId) { return { path: `/sc2/legacy/profile/${starcraftRegion[regionId]}/${realmId}/${profileId}/ladders` }; } /** * Returns the match history for the specified profile. * @param regionId The region ID for Starcraft. * @param realmId 1 or 2 * @param profileId The ID of the profile. * @returns A resource representing the match history for the given profile. See {@link LegacyMatchHistoryResponse} */ function legacyMatchHistory(regionId, realmId, profileId) { return { path: `/sc2/legacy/profile/${starcraftRegion[regionId]}/${realmId}/${profileId}/matches` }; } /** * Returns the profile for the specified profile. * @param regionId The region ID for Starcraft. * @param realmId 1 or 2 * @param profileId The ID of the profile. * @returns A resource representing the profile for the given ID. See {@link LegacyProfileResponse} */ function legacyProfile(regionId, realmId, profileId) { return { path: `/sc2/legacy/profile/${starcraftRegion[regionId]}/${realmId}/${profileId}` }; } /** * Returns the rewards for the specified region. * @param regionId The region ID for Starcraft. * @returns A resource representing the rewards for the given region. See {@link LegacyRewardsResponse} */ function legacyRewards(regionId) { return { path: `/sc2/legacy/data/rewards/${starcraftRegion[regionId]}` }; } //#endregion export { legacyAchievements, legacyLadder, legacyLadders, legacyMatchHistory, legacyProfile, legacyRewards }; //# sourceMappingURL=index.js.map