UNPKG

@blizzard-api/sc2

Version:

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

181 lines (180 loc) 5.34 kB
import { t as StarcraftRegion } from "./regions-C2THJaaU.js"; import { Resource } from "@blizzard-api/core"; //#region src/legacy/types.d.ts interface LegacyAchievementsResponse { achievements: Array<Achievement>; categories: Array<Category>; } interface LegacyLaddersResponse { currentSeason: Array<unknown>; previousSeason: Array<unknown>; showcasePlacement: Array<unknown>; } interface LegacyMatchHistoryResponse { matches: Array<Match>; } interface LegacyProfileResponse { achievements: Achievements; campaign: Campaign; career: Career; clanName: string; clanTag: string; displayName: string; id: string; portrait: Icon; profilePath: string; realm: number; rewards: Rewards; season: Season; swarmLevels: SwarmLevels; } interface LegacyRewardsResponse { animations: Array<Animation>; portraits: Array<Animation>; protossDecals: Array<Animation>; skins: Array<Animation>; terranDecals: Array<Animation>; zergDecals: Array<Animation>; } interface Achievement { achievementId: string; categoryId: string; description: string; icon: Icon; points: number; title: string; } interface Achievements { achievements: Array<{ achievementId: string; completionDate: number; }>; points: Points; } interface Animation { achievementId: string; command?: '/dance'; icon: Icon; id: string; name?: string; title: string; } interface Campaign { hots: string; wol: string; } interface Career { careerTotalGames: number; highest1v1Rank: string; highestTeamRank: string; primaryRace: string; protossWins: number; seasonTotalGames: number; terranWins: number; zergWins: number; } interface Category { categoryId: string; children?: Array<CategoryChild>; featuredAchievementId: string; title: string; } interface CategoryChild { categoryId: string; featuredAchievementId: string; title: string; } interface Icon { h: number; offset: number; url: string; w: number; x: number; y: number; } interface Match { date: number; decision: 'Left' | 'Loss' | 'Win'; map: string; speed: 'Fast' | 'Faster'; type: '2v2' | '3v3' | 'Co-Op' | 'Custom'; } interface Points { categoryPoints: Record<string, number>; totalPoints: number; } interface Rewards { earned: Array<string>; selected: Array<string>; } interface Season { seasonId: number; seasonNumber: number; seasonYear: number; stats: Array<Stat>; totalGamesThisSeason: number; } interface Stat { games: number; type: string; wins: number; } interface SwarmLevels { level: number; protoss: SwarmLevelsByRace; terran: SwarmLevelsByRace; zerg: SwarmLevelsByRace; } interface SwarmLevelsByRace { currentLevelXP: number; level: number; totalLevelXP: number; } //#endregion //#region src/legacy/index.d.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} */ declare function legacyAchievements(regionId: StarcraftRegion): Resource<LegacyAchievementsResponse>; /** * 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} */ declare function legacyLadder(regionId: StarcraftRegion, ladderId: number): Resource<unknown>; /** * 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} */ declare function legacyLadders(regionId: StarcraftRegion, realmId: 1 | 2, profileId: number): Resource<LegacyLaddersResponse>; /** * 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} */ declare function legacyMatchHistory(regionId: StarcraftRegion, realmId: 1 | 2, profileId: number): Resource<LegacyMatchHistoryResponse>; /** * 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} */ declare function legacyProfile(regionId: StarcraftRegion, realmId: 1 | 2, profileId: number): Resource<LegacyProfileResponse>; /** * 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} */ declare function legacyRewards(regionId: StarcraftRegion): Resource<LegacyRewardsResponse>; //#endregion export { legacyProfile as a, LegacyLaddersResponse as c, LegacyRewardsResponse as d, legacyMatchHistory as i, LegacyMatchHistoryResponse as l, legacyLadder as n, legacyRewards as o, legacyLadders as r, LegacyAchievementsResponse as s, legacyAchievements as t, LegacyProfileResponse as u }; //# sourceMappingURL=index-C6XacDRF.d.ts.map