royale-api-types
Advanced tools
+772
-4
@@ -1,4 +0,772 @@ | ||
| import Routes from "./Routes"; | ||
| export * from "./APITypes"; | ||
| export * from "./Routes"; | ||
| export default Routes; | ||
| /** | ||
| * Values of an object | ||
| */ | ||
| declare type ValueOf<T> = T extends (infer R)[] | Map<any, infer R> ? R : T[keyof T]; | ||
| /** | ||
| * A list of API routes | ||
| */ | ||
| declare const Routes: { | ||
| /** | ||
| * Retrieve clan's clan war log. | ||
| * @param clanTag - Tag of the clan | ||
| * @deprecated **This API endpoint has been temporarily disabled, possibilities to bring it back are being investigated. | ||
| * Use {@link Routes.RiverRaceLog} instead** | ||
| */ | ||
| readonly WarLog: (clanTag: string) => `/clans/${string}/warlog`; | ||
| /** | ||
| * Search all clans by name and/or filtering the results using various criteria. | ||
| * At least one filtering criteria must be defined and if name is used as part of search, it is required to be at least three characters long. | ||
| * It is not possible to specify ordering for results so clients should not rely on any specific ordering as that may change in the future releases of the API. | ||
| */ | ||
| readonly Clans: () => "/clans"; | ||
| /** | ||
| * Retrieve clan's river race log. | ||
| * @param clanTag - Tag of the clan | ||
| */ | ||
| readonly RiverRaceLog: (clanTag: string) => `/clans/${string}/riverracelog`; | ||
| /** | ||
| * Get information about a single clan by clan tag. | ||
| * Clan tags can be found using clan search operation. | ||
| * @param clanTag - Tag of the clan | ||
| */ | ||
| readonly Clan: (clanTag: string) => `/clans/${string}`; | ||
| /** | ||
| * List clan members. | ||
| * @param clanTag - Tag of the clan | ||
| */ | ||
| readonly ClanMembers: (clanTag: string) => `/clans/${string}/members`; | ||
| /** | ||
| * Retrieve information about clan's current river race. | ||
| * @param clanTag - Tag of the clan | ||
| */ | ||
| readonly CurrentRiverRace: (clanTag: string) => `/clans/${string}/currentriverrace`; | ||
| /** | ||
| * Get information about a single player by player tag. | ||
| * Player tags can be found either in game or by from clan member lists. | ||
| * @param playerTag - Tag of the player | ||
| */ | ||
| readonly Player: (playerTag: string) => `/players/${string}`; | ||
| /** | ||
| * Get list of reward chests that the player will receive next in the game. | ||
| * @param playerTag - Tag of the player | ||
| */ | ||
| readonly UpcomingChests: (playerTag: string) => `/players/${string}/upcomingchests`; | ||
| /** | ||
| * Get list of recent battles for a player. | ||
| * @param playerTag - Tag of the player | ||
| */ | ||
| readonly BattleLog: (playerTag: string) => `/players/${string}/battlelog`; | ||
| /** | ||
| * Get list of available cards. | ||
| */ | ||
| readonly Cards: () => "/cards"; | ||
| /** | ||
| * Search all tournaments by name. | ||
| * It is not possible to specify ordering for results so clients should not rely on any specific ordering as that may change in the future releases of the API. | ||
| */ | ||
| readonly Tournaments: () => "/tournaments"; | ||
| /** | ||
| * Get information about a single tournament by a tournament tag. | ||
| * @param tournamentTag - Tag of the tournament to retrieve | ||
| */ | ||
| readonly Tournament: (tournamentTag: string) => `/tournaments/${string}`; | ||
| /** | ||
| * Get clan rankings for a specific location. | ||
| * @param locationId - Identifier of the location to retrieve | ||
| */ | ||
| readonly ClanRankings: (locationId: number | `${number}`) => `/locations/${number}/rankings/clans`; | ||
| /** | ||
| * Get player rankings for a specific location. | ||
| * @param locationId - Identifier of the location to retrieve | ||
| */ | ||
| readonly PlayerRankings: (locationId: number | `${number}`) => `/locations/${number}/rankings/players`; | ||
| /** | ||
| * Get clan war rankings for a specific location. | ||
| * @param locationId - Identifier of the location to retrieve | ||
| */ | ||
| readonly ClanWarRankings: (locationId: number | `${number}`) => `/locations/${number}/rankings/clanwars`; | ||
| /** | ||
| * Get top player league season. | ||
| * @param seasonId - Identifier of the season to retrieve | ||
| */ | ||
| readonly Season: (seasonId: string) => `/locations/global/seasons/${string}`; | ||
| /** | ||
| * Get top player rankings for a season. | ||
| * @param seasonId - Identifier of the season to retrieve | ||
| */ | ||
| readonly TopPlayerRankings: (seasonId: string) => `/locations/global/seasons/${string}/rankings/players`; | ||
| /** | ||
| * Lists top player league seasons. | ||
| */ | ||
| readonly Seasons: () => "/locations/global/seasons"; | ||
| /** | ||
| * List locations. | ||
| */ | ||
| readonly Locations: () => "/locations"; | ||
| /** | ||
| * Get information about specific location. | ||
| * @param locationId - Identifier of the location to retrieve | ||
| */ | ||
| readonly Location: (locationId: number | `${number}`) => `/locations/${number}`; | ||
| /** | ||
| * Get global tournament rankings. | ||
| * @param tournamentTag - Tag of the tournament to retrieve | ||
| */ | ||
| readonly GlobalTournamentRankings: (tournamentTag: string) => `/locations/global/rankings/tournaments/${string}`; | ||
| /** | ||
| * Get current and upcoming challenges. | ||
| * Challenges are returned as chains. | ||
| * Chains are either of type singleChallenge or challengeChain. | ||
| * Possible types for prizes are: none, cardStack, chest, cardStackRandom, resource, tradeToken, consumable. | ||
| */ | ||
| readonly Challenges: () => "/challenges"; | ||
| /** | ||
| * Get list of global tournaments. | ||
| */ | ||
| readonly GlobalTournaments: () => "/globaltournaments"; | ||
| }; | ||
| declare type Routes = { | ||
| [K in keyof typeof Routes]: ReturnType<typeof Routes[K]>; | ||
| }; | ||
| /** | ||
| * The path for a request to the API | ||
| */ | ||
| declare type Path = ValueOf<Routes>; | ||
| /** | ||
| * The response type of the API for every route. | ||
| */ | ||
| declare type ResponseType<T extends ValueOf<Routes>> = T extends Routes["WarLog"] ? APIClanWarLog : T extends Routes["Clans"] ? APIClanList : T extends Routes["RiverRaceLog"] ? APIRiverRaceLog : T extends Routes["ClanMembers"] ? APIClanMemberList : T extends Routes["CurrentRiverRace"] ? APICurrentRiverRace : T extends Routes["UpcomingChests"] ? APIUpcomingChests : T extends Routes["BattleLog"] ? APIBattleList : T extends Routes["Cards"] ? APIItemList : T extends Routes["Tournaments"] ? APITournamentHeaderList : T extends Routes["ClanRankings"] ? APIClanRankingList : T extends Routes["PlayerRankings"] ? APIPlayerRankingList : T extends Routes["ClanWarRankings"] ? APIClanRankingList : T extends Routes["TopPlayerRankings"] ? APIPlayerRankingList : T extends Routes["Seasons"] ? APILeagueSeasonList : T extends Routes["Locations"] ? APILocationList : T extends Routes["Challenges"] ? APIChallengeChainsList : T extends Routes["GlobalTournaments"] ? APILadderTournamentList : T extends Routes["Clan"] ? APIClan : T extends Routes["Player"] ? APIPlayer : T extends Routes["Tournament"] ? APITournament : T extends Routes["Season"] ? APILeagueSeason : T extends Routes["Location"] ? APILocation : T extends Routes["GlobalTournamentRankings"] ? APILadderTournamentRankingList : never; | ||
| declare type integer = number; | ||
| declare type APILadderTournamentRankingList = APIList<APILadderTournamentRanking>; | ||
| interface APILadderTournamentRanking { | ||
| clan: APIPlayerRankingClan; | ||
| wins: integer; | ||
| losses: integer; | ||
| tag: string; | ||
| name: string; | ||
| rank: integer; | ||
| previousRank: integer; | ||
| } | ||
| interface APIPlayerRankingClan { | ||
| badgeId: integer; | ||
| tag: string; | ||
| name: string; | ||
| } | ||
| interface APICurrentRiverRace { | ||
| state: APIRiverRaceState; | ||
| clan: APIRiverRaceClan; | ||
| clans: APIRiverRaceClanList; | ||
| collectionEndTime?: string; | ||
| warEndTime?: string; | ||
| sectionIndex: integer; | ||
| periodIndex: integer; | ||
| periodType: APIRiverRacePeriodType; | ||
| periodLogs: APIPeriodLogList; | ||
| } | ||
| declare type APIPeriodLogList = APIPeriodLog[]; | ||
| interface APIPeriodLog { | ||
| items: PeriodLogEntryList; | ||
| periodIndex: integer; | ||
| } | ||
| declare type PeriodLogEntryList = APIPeriodLogEntry[]; | ||
| interface APIPeriodLogEntry { | ||
| clan: APIPeriodLogEntryClan; | ||
| pointsEarned: integer; | ||
| progressStartOfDay: integer; | ||
| progressEndOfDay: integer; | ||
| endOfDayRank: integer; | ||
| progressEarned: integer; | ||
| numOfDefensesRemaining: integer; | ||
| progressEarnedFromDefenses: integer; | ||
| } | ||
| interface APIPeriodLogEntryClan { | ||
| tag: string; | ||
| } | ||
| declare type APIRiverRaceClanList = APIRiverRaceClan[]; | ||
| interface APIRiverRaceClan { | ||
| tag: string; | ||
| clanScore: integer; | ||
| badgeId: integer; | ||
| name: string; | ||
| fame: integer; | ||
| repairPoints: integer; | ||
| finishTime?: string; | ||
| participants: APIRiverRaceParticipantList; | ||
| periodPoints: integer; | ||
| } | ||
| declare type APIRiverRaceParticipantList = APIRiverRaceParticipant[]; | ||
| interface APIRiverRaceParticipant { | ||
| tag: string; | ||
| name: string; | ||
| fame: integer; | ||
| repairPoints: integer; | ||
| boatAttacks: integer; | ||
| decksUsed: integer; | ||
| decksUsedToday: integer; | ||
| } | ||
| interface APILocation { | ||
| localizedName?: string; | ||
| id: integer; | ||
| name: string; | ||
| isCountry: boolean; | ||
| countryCode?: string; | ||
| } | ||
| interface Replay { | ||
| replayInfo: string; | ||
| replayData: APIJsonNode; | ||
| version: APIVersion; | ||
| tag: string; | ||
| battleTime: string; | ||
| viewCount: integer; | ||
| shareCount: integer; | ||
| } | ||
| interface APIVersion { | ||
| build: integer; | ||
| major: integer; | ||
| content: integer; | ||
| } | ||
| interface APIJsonNode { | ||
| } | ||
| declare type APILocationList = APIList<APILocation>; | ||
| declare type APILeagueSeasonList = APIList<APILeagueSeason>; | ||
| interface APILeagueSeason { | ||
| id: string; | ||
| } | ||
| declare type APIChallengeChainsList = APIChallengeChain[]; | ||
| interface APIChallengeChain { | ||
| title?: string; | ||
| type: APIChallengeChainType; | ||
| startTime: string; | ||
| endTime: string; | ||
| challenges: APIChallengeList; | ||
| } | ||
| declare enum APIChallengeChainType { | ||
| SINGLE_CHALLENGE = "singleChallenge", | ||
| CHAIN_CHALLENGE = "chainChallenge" | ||
| } | ||
| declare type APIChallengeList = APIChallenge[]; | ||
| interface APIChallenge { | ||
| description: string; | ||
| name: string; | ||
| id: integer; | ||
| winMode: string; | ||
| casual: boolean; | ||
| maxLosses: integer; | ||
| maxWins: integer; | ||
| iconUrl: string; | ||
| gameMode: APIChallengeGameMode; | ||
| prizes: APISurvivalMilestoneRewardList; | ||
| } | ||
| declare type APISurvivalMilestoneRewardList = APISurvivalMilestoneReward[]; | ||
| interface APISurvivalMilestoneReward { | ||
| chest?: string; | ||
| rarity?: APISurvivalMilestoneRewardRarity; | ||
| resource?: APISurvivalMilestoneRewardResource; | ||
| type: APISurvivalMilestoneRewardType | null; | ||
| amount?: integer; | ||
| card?: APIItem & { | ||
| name: string | null; | ||
| }; | ||
| consumableName?: string; | ||
| wins?: integer; | ||
| } | ||
| declare enum APISurvivalMilestoneRewardRarity { | ||
| COMMON = "common", | ||
| RARE = "rare", | ||
| EPIC = "epic", | ||
| LEGENDARY = "legendary", | ||
| HERO = "hero" | ||
| } | ||
| declare enum APISurvivalMilestoneRewardResource { | ||
| GOLD = "gold", | ||
| UNKNOWN = "unknown" | ||
| } | ||
| declare enum APISurvivalMilestoneRewardType { | ||
| NONE = "none", | ||
| CARD_STACK = "cardStack", | ||
| CHEST = "chest", | ||
| CARD_STACK_RANDOM = "cardStackRandom", | ||
| RESOURCE = "resource", | ||
| TRADE_TOKEN = "tradeToken", | ||
| CONSUMABLE = "consumable" | ||
| } | ||
| interface APIItem { | ||
| iconUrls: { | ||
| medium: string; | ||
| }; | ||
| name: string; | ||
| id: integer; | ||
| maxLevel: integer; | ||
| } | ||
| interface APIChallengeGameMode { | ||
| id: integer; | ||
| name: string; | ||
| } | ||
| declare type APIClanMemberList = APIList<APIClanMember>; | ||
| interface APIClanMember { | ||
| clanChestPoints: integer; | ||
| arena: APIArena; | ||
| lastSeen: string; | ||
| tag: string; | ||
| name: string; | ||
| role: APIClanMemberRole; | ||
| expLevel: integer; | ||
| trophies: integer; | ||
| clanRank: integer; | ||
| previousClanRank: integer; | ||
| donations: integer; | ||
| donationsReceived: integer; | ||
| } | ||
| declare enum APIClanMemberRole { | ||
| NOT_MEMBER = "notMember", | ||
| MEMBER = "member", | ||
| LEADER = "leader", | ||
| ADMIN = "admin", | ||
| COLEADER = "coLeader" | ||
| } | ||
| interface APIArena { | ||
| name: string; | ||
| id: integer; | ||
| } | ||
| declare type APILadderTournamentList = APIList<APILadderTournament>; | ||
| interface APILadderTournament { | ||
| minExpLevel: integer; | ||
| maxLosses: integer; | ||
| tournamentLevel: integer; | ||
| gameMode: Omit<APIGameMode, "name">; | ||
| milestoneRewards: APISurvivalMilestoneRewardList; | ||
| freeTierRewards: APISurvivalMilestoneRewardList; | ||
| tag: string; | ||
| title: string; | ||
| startTime: string; | ||
| endTime: string; | ||
| topRankReward: APISurvivalMilestoneRewardList; | ||
| maxTopRewardRank: integer; | ||
| } | ||
| interface APIGameMode { | ||
| id: integer; | ||
| name: string; | ||
| } | ||
| declare type APIPlayerRankingList = APIList<APIPlayerRanking>; | ||
| interface APIPlayerRanking { | ||
| clan: APIPlayerRankingClan; | ||
| arena?: APIArena; | ||
| tag: string; | ||
| name: string; | ||
| expLevel: integer; | ||
| rank: integer; | ||
| previousRank?: integer; | ||
| trophies: integer; | ||
| } | ||
| interface APIVerifyTokenRequest { | ||
| token: string; | ||
| } | ||
| interface APIVerifyTokenResponse { | ||
| tag: string; | ||
| token: string; | ||
| status: string; | ||
| } | ||
| interface APIClan { | ||
| memberList: APIClanMember[]; | ||
| tag: string; | ||
| clanScore: integer; | ||
| clanWarTrophies: integer; | ||
| requiredTrophies: integer; | ||
| donationsPerWeek: integer; | ||
| badgeId: integer; | ||
| clanChestStatus: APIClanChestStatus; | ||
| clanChestLevel: integer; | ||
| clanChestMaxLevel: integer; | ||
| name: string; | ||
| location: APILocation; | ||
| type: APIClanType; | ||
| members: integer; | ||
| description: string; | ||
| clanChestPoints?: integer; | ||
| } | ||
| declare enum APIClanChestStatus { | ||
| INACTIVE = "inactive", | ||
| ACTIVE = "active", | ||
| COMPLETED = "completed", | ||
| UNKNOWN = "unknown" | ||
| } | ||
| declare enum APIClanType { | ||
| OPEN = "open", | ||
| INVITE_ONLY = "inviteOnly", | ||
| CLOSED = "closed" | ||
| } | ||
| interface APIMatch { | ||
| invites: unknown; | ||
| state: APIMatchState; | ||
| startTime: string; | ||
| battle: APIBattle; | ||
| tag: string; | ||
| } | ||
| declare enum APIMatchState { | ||
| PENDING = "pending", | ||
| CANCELLED = "cancelled", | ||
| TIMED_OUT = "timedOut", | ||
| IN_PROGRESS = "inProgress", | ||
| COMPLETE = "complete", | ||
| FAILED = "failed" | ||
| } | ||
| interface APIBattle { | ||
| deckSelection: APIBattleDeckSelection; | ||
| challengeWinCountBefore: integer; | ||
| boatBattleSide: string; | ||
| newTowersDestroyed: integer; | ||
| prevTowersDestroyed: integer; | ||
| remainingTowers: integer; | ||
| boatBattleWon: boolean; | ||
| type: APIBattleType; | ||
| opponent: APIPlayerBattleDataList; | ||
| team: APIPlayerBattleDataList; | ||
| gameMode: APIGameMode; | ||
| arena: APIArena; | ||
| battleTime: string; | ||
| challengeId: integer; | ||
| tournamentTag: string; | ||
| challengeTitle: string; | ||
| isLadderTournament: boolean; | ||
| isHostedMatch: boolean; | ||
| } | ||
| declare enum APIBattleDeckSelection { | ||
| COLLECTION = "collection", | ||
| DRAFT = "draft", | ||
| DRAFT_COMPETITIVE = "draftCompetitive", | ||
| PREDEFINED = "predefined", | ||
| EVENT_DECK = "eventDeck", | ||
| PICK = "pick", | ||
| WARDECK_PICK = "wardeckPick", | ||
| UNKNOWN = "unknown" | ||
| } | ||
| declare enum APIBattleType { | ||
| PVP = "pvp", | ||
| PVE = "pve", | ||
| CLANMATE = "clanmate", | ||
| TOURNAMENT = "tournament", | ||
| FRIENDLY = "friendly", | ||
| SURVIVAL = "survival", | ||
| PVP2v2 = "pvp2v2", | ||
| CLANMATE2v2 = "clanmate2v2", | ||
| CHALLENGE2v2 = "challenge2v2", | ||
| CLANWAR_COLLECTION_DAY = "clanwarCollectionDay", | ||
| CLANWAR_WAR_DAY = "clanwarWarDay", | ||
| CASUAL_1V1 = "casual1v1", | ||
| CASUAL_2V2 = "casual2v2", | ||
| BOAT_BATTLE = "boatBattle", | ||
| BOAT_BATTLE_PRACTICE = "boatBattlePractice", | ||
| RIVER_RACE_PVP = "riverRacePvp", | ||
| RIVER_RACE_DUEL = "riverRaceDuel", | ||
| RIVER_RACE_DUEL_COLOSSEUM = "riverRaceDuelColosseum", | ||
| UNKNOWN = "unknown" | ||
| } | ||
| declare type APIPlayerBattleDataList = APIPlayerBattleData[]; | ||
| interface APIPlayerBattleData { | ||
| clan?: APIPlayerClan; | ||
| cards: APIPlayerItemLevelList; | ||
| tag: string; | ||
| name: string; | ||
| startingTrophies?: integer; | ||
| trophyChange?: integer; | ||
| crowns?: integer; | ||
| kingTowerHitPoints?: integer; | ||
| princessTowersHitPoints?: APIIntegerList; | ||
| } | ||
| declare type APIIntegerList = integer[]; | ||
| declare type APIPlayerItemLevelList = APIPlayerItemLevel[]; | ||
| interface APIPlayerItemLevel { | ||
| id: integer; | ||
| count?: integer; | ||
| level: integer; | ||
| starLevel?: integer; | ||
| name: string; | ||
| maxLevel: integer; | ||
| iconUrls: { | ||
| large?: string; | ||
| medium: string; | ||
| }; | ||
| } | ||
| interface APIPlayerClan { | ||
| badgeId: integer; | ||
| tag: string; | ||
| name: string; | ||
| } | ||
| interface APICancelMatchResponse { | ||
| success: boolean; | ||
| } | ||
| declare type APIBattleList = APIBattle[]; | ||
| interface APICurrentClanWar { | ||
| state: APICurrentClanWarState; | ||
| clan: APIClanWarClan; | ||
| participants: APIClanWarParticipantList; | ||
| clans: APIClanWarClanList; | ||
| collectionEndTime: string; | ||
| warEndTime: string; | ||
| } | ||
| declare enum APICurrentClanWarState { | ||
| CLAN_NOT_FOUND = "clanNotFound", | ||
| ACCESS_DENIED = "accessDenied", | ||
| NOT_IN_WAR = "notInWar", | ||
| COLLECTION_DAY = "collectionDay", | ||
| MATCHMAKING = "matchmaking", | ||
| WAR_DAY = "warDay", | ||
| ENDED = "ended" | ||
| } | ||
| declare type APIClanWarClanList = APIClanWarClan[]; | ||
| interface APIClanWarClan { | ||
| tag: string; | ||
| clanScore: integer; | ||
| badgeId: integer; | ||
| crowns: integer; | ||
| name: string; | ||
| participants: integer; | ||
| battlesPlayed: integer; | ||
| wins: integer; | ||
| } | ||
| declare type APIClanWarParticipantList = APIClanWarParticipant[]; | ||
| interface APIClanWarParticipant { | ||
| tag: string; | ||
| name: string; | ||
| cardsEarned: integer; | ||
| battlesPlayed: integer; | ||
| wins: integer; | ||
| collectionDayBattlesPlayed: integer; | ||
| numberOfBattles: integer; | ||
| } | ||
| declare type APIRiverRaceLog = APIList<APIRiverRaceLogEntry>; | ||
| interface APIRiverRaceLogEntry { | ||
| standings: APIRiverRaceStandingList; | ||
| seasonId: integer; | ||
| createdDate: string; | ||
| sectionIndex: integer; | ||
| } | ||
| declare type APIRiverRaceStandingList = APIRiverRaceStanding[]; | ||
| interface APIRiverRaceStanding { | ||
| rank: integer; | ||
| trophyChange: integer; | ||
| clan: APIRiverRaceClan; | ||
| } | ||
| interface APITournament { | ||
| membersList: APITournamentMemberList; | ||
| status: APITournamentStatus; | ||
| preparationDuration: integer; | ||
| createdTime: string; | ||
| startedTime: string; | ||
| endedTime: string; | ||
| firstPlaceCardPrize: integer; | ||
| gameMode: Omit<APIGameMode, "name">; | ||
| type: APITournamentType; | ||
| duration: integer; | ||
| tag: string; | ||
| creatorTag: string; | ||
| name: string; | ||
| description: string; | ||
| capacity: integer; | ||
| maxCapacity: integer; | ||
| levelCap: integer; | ||
| } | ||
| declare enum APITournamentStatus { | ||
| IN_PREPARATION = "inPreparation", | ||
| IN_PROGRESS = "inProgress", | ||
| ENDED = "ended", | ||
| UNKNOWN = "unknown" | ||
| } | ||
| declare enum APITournamentType { | ||
| OPEN = "open", | ||
| PASSWORD_PROTECTED = "passwordProtected", | ||
| UNKNOWN = "unknown" | ||
| } | ||
| declare type APITournamentMemberList = APITournamentMember[]; | ||
| interface APITournamentMember { | ||
| rank: integer; | ||
| clan: APIPlayerClan; | ||
| previousRank?: integer; | ||
| tag: string; | ||
| name: string; | ||
| score: integer; | ||
| } | ||
| declare type APITournamentHeaderList = APIList<APITournamentHeader>; | ||
| interface APITournamentHeader { | ||
| status: APITournamentHeaderStatus; | ||
| preparationDuration: integer; | ||
| createdTime: string; | ||
| firstPlaceCardPrize: integer; | ||
| gameMode: Omit<APIGameMode, "name">; | ||
| type: APITournamentHeaderType; | ||
| duration: integer; | ||
| tag: string; | ||
| creatorTag: string; | ||
| name: string; | ||
| description: string; | ||
| capacity: integer; | ||
| maxCapacity: integer; | ||
| levelCap: integer; | ||
| } | ||
| declare enum APITournamentHeaderStatus { | ||
| IN_PREPARATION = "inPreparation", | ||
| IN_PROGRESS = "inProgress", | ||
| ENDED = "ended", | ||
| UNKNOWN = "unknown" | ||
| } | ||
| declare enum APITournamentHeaderType { | ||
| OPEN = "open", | ||
| PASSWORD_PROTECTED = "passwordProtected", | ||
| UNKNOWN = "unknown" | ||
| } | ||
| declare type APIClanList = APIList<Omit<APIClan, "clanChestPoints" | "clanChestStatus" | "description" | "memberList">>; | ||
| declare type APIClanRankingList = APIList<APIClanRanking>; | ||
| interface APIClanRanking { | ||
| clanScore: integer; | ||
| badgeId: integer; | ||
| location: APILocation; | ||
| members: integer; | ||
| tag: string; | ||
| name: string; | ||
| rank: integer; | ||
| previousRank: integer; | ||
| } | ||
| interface APIRegisterMatchRequest { | ||
| playerTags: APIStringList; | ||
| gameMode: APIRegisterMatchRequestGameMode; | ||
| } | ||
| declare type APIStringList = string[]; | ||
| declare enum APIRegisterMatchRequestGameMode { | ||
| REGULAR = "regular", | ||
| TEAM_VS_TEAM = "teamVsTeam", | ||
| DOUBLE_ELIXIR_TOURNAMENT = "doubleElixirTournament", | ||
| TRIPLE_ELIXIR_TOURNAMENT = "tripleElixirTournament", | ||
| RAGE = "rage", | ||
| SUDDEN_DEATH = "suddenDeath", | ||
| TOUCHDOWN = "touchdown", | ||
| RAMP_UP = "rampUp", | ||
| DRAFT = "draft", | ||
| MIRROR = "mirror", | ||
| DRAGON_HUNT = "dragonHunt" | ||
| } | ||
| interface APIRegisterMatchResponse { | ||
| tag: string; | ||
| } | ||
| interface APIUpcomingChests { | ||
| items: APIChestList; | ||
| } | ||
| declare type APIChestList = APIChest[]; | ||
| interface APIChest { | ||
| name: string; | ||
| index: integer; | ||
| } | ||
| declare type APIClanWarLog = APIClanWarLogEntry[]; | ||
| interface APIClanWarLogEntry { | ||
| standings: APIClanWarStandingList; | ||
| seasonId: integer; | ||
| participants: APIClanWarParticipantList; | ||
| createdDate: string; | ||
| } | ||
| declare type APIClanWarStandingList = APIClanWarStanding[]; | ||
| interface APIClanWarStanding { | ||
| trophyChange: integer; | ||
| clan: APIClanWarClan; | ||
| } | ||
| interface APIPlayer { | ||
| clan?: APIPlayerClan; | ||
| cards: APIPlayerItemLevelList; | ||
| currentFavouriteCard?: APIItem; | ||
| badges: APIPlayerAchievementBadgeList; | ||
| arena: APIArena; | ||
| role: APIPlayerRole; | ||
| wins: integer; | ||
| losses: integer; | ||
| totalDonations: integer; | ||
| leagueStatistics?: APIPlayerLeagueStatistics; | ||
| tag: string; | ||
| name: string; | ||
| expLevel: integer; | ||
| trophies: integer; | ||
| bestTrophies: integer; | ||
| donations: integer; | ||
| donationsReceived: integer; | ||
| achievements: APIPlayerAchievementProgressList; | ||
| battleCount: integer; | ||
| threeCrownWins: integer; | ||
| challengeCardsWon: integer; | ||
| challengeMaxWins: integer; | ||
| tournamentCardsWon: integer; | ||
| tournamentBattleCount: integer; | ||
| currentDeck: APIPlayerItemLevelList; | ||
| warDayWins: integer; | ||
| clanCardsCollected: integer; | ||
| starPoints?: integer; | ||
| expPoints: integer; | ||
| } | ||
| declare enum APIPlayerRole { | ||
| NOT_MEMBER = "notMember", | ||
| MEMBER = "member", | ||
| LEADER = "leader", | ||
| ADMIN = "admin", | ||
| COLEADER = "coLeader" | ||
| } | ||
| declare type APIPlayerAchievementProgressList = APIPlayerAchievementProgress[]; | ||
| interface APIPlayerAchievementProgress { | ||
| stars: integer; | ||
| value: integer; | ||
| name: string; | ||
| target: integer; | ||
| info: string; | ||
| completionInfo: string | null; | ||
| } | ||
| interface APIPlayerLeagueStatistics { | ||
| currentSeason: APILeagueSeasonResult; | ||
| bestSeason: APILeagueSeasonResult; | ||
| previousSeason: APILeagueSeasonResult; | ||
| } | ||
| interface APILeagueSeasonResult { | ||
| trophies: integer; | ||
| bestTrophies?: integer; | ||
| rank?: integer; | ||
| id?: string; | ||
| } | ||
| declare type APIPlayerAchievementBadgeList = APIPlayerAchievementBadge[]; | ||
| interface APIPlayerAchievementBadge { | ||
| iconUrls: { | ||
| large: string; | ||
| }; | ||
| maxLevel: integer; | ||
| progress: integer; | ||
| target: integer; | ||
| level: integer; | ||
| name: string; | ||
| } | ||
| declare type APIItemList = APIList<APIItem>; | ||
| interface APIClientError { | ||
| reason: string; | ||
| message?: string; | ||
| type?: string; | ||
| detail?: unknown; | ||
| } | ||
| interface APIList<T> { | ||
| items: T[]; | ||
| paging?: APIPaging; | ||
| } | ||
| interface APIPaging { | ||
| cursors: APICursors; | ||
| } | ||
| interface APICursors { | ||
| after?: string; | ||
| before?: string; | ||
| } | ||
| declare enum APIRiverRacePeriodType { | ||
| TRAINING = "training", | ||
| WAR_DAY = "warDay", | ||
| COLOSSEUM = "colosseum" | ||
| } | ||
| declare enum APIRiverRaceState { | ||
| CLAN_NOT_FOUND = "clanNotFound", | ||
| ACCESS_DENIED = "accessDenied", | ||
| MATCHMAKING = "matchmaking", | ||
| MATCHED = "matched", | ||
| FULL = "full", | ||
| ENDED = "ended" | ||
| } | ||
| export { APIArena, APIBattle, APIBattleDeckSelection, APIBattleList, APIBattleType, APICancelMatchResponse, APIChallenge, APIChallengeChain, APIChallengeChainType, APIChallengeChainsList, APIChallengeGameMode, APIChallengeList, APIChest, APIChestList, APIClan, APIClanChestStatus, APIClanList, APIClanMember, APIClanMemberList, APIClanMemberRole, APIClanRanking, APIClanRankingList, APIClanType, APIClanWarClan, APIClanWarClanList, APIClanWarLog, APIClanWarLogEntry, APIClanWarParticipant, APIClanWarParticipantList, APIClanWarStanding, APIClanWarStandingList, APIClientError, APICurrentClanWar, APICurrentClanWarState, APICurrentRiverRace, APIGameMode, APIIntegerList, APIItem, APIItemList, APIJsonNode, APILadderTournament, APILadderTournamentList, APILadderTournamentRanking, APILadderTournamentRankingList, APILeagueSeason, APILeagueSeasonList, APILeagueSeasonResult, APIList, APILocation, APILocationList, APIMatch, APIMatchState, APIPaging, APIPeriodLog, APIPeriodLogEntry, APIPeriodLogEntryClan, APIPeriodLogList, APIPlayer, APIPlayerAchievementBadge, APIPlayerAchievementBadgeList, APIPlayerAchievementProgress, APIPlayerAchievementProgressList, APIPlayerBattleData, APIPlayerBattleDataList, APIPlayerClan, APIPlayerItemLevel, APIPlayerItemLevelList, APIPlayerLeagueStatistics, APIPlayerRanking, APIPlayerRankingClan, APIPlayerRankingList, APIPlayerRole, APIRegisterMatchRequest, APIRegisterMatchRequestGameMode, APIRegisterMatchResponse, APIRiverRaceClan, APIRiverRaceClanList, APIRiverRaceLog, APIRiverRaceLogEntry, APIRiverRaceParticipant, APIRiverRaceParticipantList, APIRiverRacePeriodType, APIRiverRaceStanding, APIRiverRaceStandingList, APIRiverRaceState, APIStringList, APISurvivalMilestoneReward, APISurvivalMilestoneRewardList, APISurvivalMilestoneRewardRarity, APISurvivalMilestoneRewardResource, APISurvivalMilestoneRewardType, APITournament, APITournamentHeader, APITournamentHeaderList, APITournamentHeaderStatus, APITournamentHeaderType, APITournamentMember, APITournamentMemberList, APITournamentStatus, APITournamentType, APIUpcomingChests, APIVerifyTokenRequest, APIVerifyTokenResponse, APIVersion, Path, PeriodLogEntryList, Replay, ResponseType, Routes, ValueOf, Routes as default }; |
+5
-5
| { | ||
| "name": "royale-api-types", | ||
| "version": "1.0.0", | ||
| "version": "1.1.0", | ||
| "description": "Types for the Clash Royale API", | ||
@@ -8,9 +8,9 @@ "main": "dist/index.js", | ||
| "scripts": { | ||
| "build": "tsup && tsc --emitDeclarationOnly", | ||
| "build": "tsup", | ||
| "lint": "eslint src --fix && prettier --write src/**/*.ts", | ||
| "precommit": "npm run lint", | ||
| "prepare": "husky install", | ||
| "release:major": "npm test && npm run build && npm version major -m \"chore(release): %s\" && npm publish", | ||
| "release:minor": "npm test && npm run build && npm version minor -m \"chore(release): %s\" && npm publish", | ||
| "release:patch": "npm test && npm run build && npm version patch -m \"chore(release): %s\" && npm publish", | ||
| "release:major": "npm test && npm run build && npm version major -m \"chore(release): %s\" && git push && npm publish", | ||
| "release:minor": "npm test && npm run build && npm version minor -m \"chore(release): %s\" && git push && npm publish", | ||
| "release:patch": "npm test && npm run build && npm version patch -m \"chore(release): %s\" && git push && npm publish", | ||
| "start": "npm run build && node .", | ||
@@ -17,0 +17,0 @@ "test": "tsc --noEmit && eslint src" |
| declare type integer = number; | ||
| export declare type APILadderTournamentRankingList = APIList<APILadderTournamentRanking>; | ||
| export interface APILadderTournamentRanking { | ||
| clan: APIPlayerRankingClan; | ||
| wins: integer; | ||
| losses: integer; | ||
| tag: string; | ||
| name: string; | ||
| rank: integer; | ||
| previousRank: integer; | ||
| } | ||
| export interface APIPlayerRankingClan { | ||
| badgeId: integer; | ||
| tag: string; | ||
| name: string; | ||
| } | ||
| export interface APICurrentRiverRace { | ||
| state: APIRiverRaceState; | ||
| clan: APIRiverRaceClan; | ||
| clans: APIRiverRaceClanList; | ||
| collectionEndTime?: string; | ||
| warEndTime?: string; | ||
| sectionIndex: integer; | ||
| periodIndex: integer; | ||
| periodType: APIRiverRacePeriodType; | ||
| periodLogs: APIPeriodLogList; | ||
| } | ||
| export declare type APIPeriodLogList = APIPeriodLog[]; | ||
| export interface APIPeriodLog { | ||
| items: PeriodLogEntryList; | ||
| periodIndex: integer; | ||
| } | ||
| export declare type PeriodLogEntryList = APIPeriodLogEntry[]; | ||
| export interface APIPeriodLogEntry { | ||
| clan: APIPeriodLogEntryClan; | ||
| pointsEarned: integer; | ||
| progressStartOfDay: integer; | ||
| progressEndOfDay: integer; | ||
| endOfDayRank: integer; | ||
| progressEarned: integer; | ||
| numOfDefensesRemaining: integer; | ||
| progressEarnedFromDefenses: integer; | ||
| } | ||
| export interface APIPeriodLogEntryClan { | ||
| tag: string; | ||
| } | ||
| export declare type APIRiverRaceClanList = APIRiverRaceClan[]; | ||
| export interface APIRiverRaceClan { | ||
| tag: string; | ||
| clanScore: integer; | ||
| badgeId: integer; | ||
| name: string; | ||
| fame: integer; | ||
| repairPoints: integer; | ||
| finishTime?: string; | ||
| participants: APIRiverRaceParticipantList; | ||
| periodPoints: integer; | ||
| } | ||
| export declare type APIRiverRaceParticipantList = APIRiverRaceParticipant[]; | ||
| export interface APIRiverRaceParticipant { | ||
| tag: string; | ||
| name: string; | ||
| fame: integer; | ||
| repairPoints: integer; | ||
| boatAttacks: integer; | ||
| decksUsed: integer; | ||
| decksUsedToday: integer; | ||
| } | ||
| export interface APILocation { | ||
| localizedName?: string; | ||
| id: integer; | ||
| name: string; | ||
| isCountry: boolean; | ||
| countryCode?: string; | ||
| } | ||
| export interface Replay { | ||
| replayInfo: string; | ||
| replayData: APIJsonNode; | ||
| version: APIVersion; | ||
| tag: string; | ||
| battleTime: string; | ||
| viewCount: integer; | ||
| shareCount: integer; | ||
| } | ||
| export interface APIVersion { | ||
| build: integer; | ||
| major: integer; | ||
| content: integer; | ||
| } | ||
| export interface APIJsonNode { | ||
| } | ||
| export declare type APILocationList = APIList<APILocation>; | ||
| export declare type APILeagueSeasonList = APIList<APILeagueSeason>; | ||
| export interface APILeagueSeason { | ||
| id: string; | ||
| } | ||
| export declare type APIChallengeChainsList = APIChallengeChain[]; | ||
| export interface APIChallengeChain { | ||
| title?: string; | ||
| type: APIChallengeChainType; | ||
| startTime: string; | ||
| endTime: string; | ||
| challenges: APIChallengeList; | ||
| } | ||
| export declare enum APIChallengeChainType { | ||
| SINGLE_CHALLENGE = "singleChallenge", | ||
| CHAIN_CHALLENGE = "chainChallenge" | ||
| } | ||
| export declare type APIChallengeList = APIChallenge[]; | ||
| export interface APIChallenge { | ||
| description: string; | ||
| name: string; | ||
| id: integer; | ||
| winMode: string; | ||
| casual: boolean; | ||
| maxLosses: integer; | ||
| maxWins: integer; | ||
| iconUrl: string; | ||
| gameMode: APIChallengeGameMode; | ||
| prizes: APISurvivalMilestoneRewardList; | ||
| } | ||
| export declare type APISurvivalMilestoneRewardList = APISurvivalMilestoneReward[]; | ||
| export interface APISurvivalMilestoneReward { | ||
| chest?: string; | ||
| rarity?: APISurvivalMilestoneRewardRarity; | ||
| resource?: APISurvivalMilestoneRewardResource; | ||
| type: APISurvivalMilestoneRewardType | null; | ||
| amount?: integer; | ||
| card?: APIItem & { | ||
| name: string | null; | ||
| }; | ||
| consumableName?: string; | ||
| wins?: integer; | ||
| } | ||
| export declare enum APISurvivalMilestoneRewardRarity { | ||
| COMMON = "common", | ||
| RARE = "rare", | ||
| EPIC = "epic", | ||
| LEGENDARY = "legendary", | ||
| HERO = "hero" | ||
| } | ||
| export declare enum APISurvivalMilestoneRewardResource { | ||
| GOLD = "gold", | ||
| UNKNOWN = "unknown" | ||
| } | ||
| export declare enum APISurvivalMilestoneRewardType { | ||
| NONE = "none", | ||
| CARD_STACK = "cardStack", | ||
| CHEST = "chest", | ||
| CARD_STACK_RANDOM = "cardStackRandom", | ||
| RESOURCE = "resource", | ||
| TRADE_TOKEN = "tradeToken", | ||
| CONSUMABLE = "consumable" | ||
| } | ||
| export interface APIItem { | ||
| iconUrls: { | ||
| medium: string; | ||
| }; | ||
| name: string; | ||
| id: integer; | ||
| maxLevel: integer; | ||
| } | ||
| export interface APIChallengeGameMode { | ||
| id: integer; | ||
| name: string; | ||
| } | ||
| export declare type APIClanMemberList = APIList<APIClanMember>; | ||
| export interface APIClanMember { | ||
| clanChestPoints: integer; | ||
| arena: APIArena; | ||
| lastSeen: string; | ||
| tag: string; | ||
| name: string; | ||
| role: APIClanMemberRole; | ||
| expLevel: integer; | ||
| trophies: integer; | ||
| clanRank: integer; | ||
| previousClanRank: integer; | ||
| donations: integer; | ||
| donationsReceived: integer; | ||
| } | ||
| export declare enum APIClanMemberRole { | ||
| NOT_MEMBER = "notMember", | ||
| MEMBER = "member", | ||
| LEADER = "leader", | ||
| ADMIN = "admin", | ||
| COLEADER = "coLeader" | ||
| } | ||
| export interface APIArena { | ||
| name: string; | ||
| id: integer; | ||
| } | ||
| export declare type APILadderTournamentList = APIList<APILadderTournament>; | ||
| export interface APILadderTournament { | ||
| minExpLevel: integer; | ||
| maxLosses: integer; | ||
| tournamentLevel: integer; | ||
| gameMode: Omit<APIGameMode, "name">; | ||
| milestoneRewards: APISurvivalMilestoneRewardList; | ||
| freeTierRewards: APISurvivalMilestoneRewardList; | ||
| tag: string; | ||
| title: string; | ||
| startTime: string; | ||
| endTime: string; | ||
| topRankReward: APISurvivalMilestoneRewardList; | ||
| maxTopRewardRank: integer; | ||
| } | ||
| export interface APIGameMode { | ||
| id: integer; | ||
| name: string; | ||
| } | ||
| export declare type APIPlayerRankingList = APIList<APIPlayerRanking>; | ||
| export interface APIPlayerRanking { | ||
| clan: APIPlayerRankingClan; | ||
| arena?: APIArena; | ||
| tag: string; | ||
| name: string; | ||
| expLevel: integer; | ||
| rank: integer; | ||
| previousRank?: integer; | ||
| trophies: integer; | ||
| } | ||
| export interface APIVerifyTokenRequest { | ||
| token: string; | ||
| } | ||
| export interface APIVerifyTokenResponse { | ||
| tag: string; | ||
| token: string; | ||
| status: string; | ||
| } | ||
| export interface APIClan { | ||
| memberList: APIClanMember[]; | ||
| tag: string; | ||
| clanScore: integer; | ||
| clanWarTrophies: integer; | ||
| requiredTrophies: integer; | ||
| donationsPerWeek: integer; | ||
| badgeId: integer; | ||
| clanChestStatus: APIClanChestStatus; | ||
| clanChestLevel: integer; | ||
| clanChestMaxLevel: integer; | ||
| name: string; | ||
| location: APILocation; | ||
| type: APIClanType; | ||
| members: integer; | ||
| description: string; | ||
| clanChestPoints?: integer; | ||
| } | ||
| export declare enum APIClanChestStatus { | ||
| INACTIVE = "inactive", | ||
| ACTIVE = "active", | ||
| COMPLETED = "completed", | ||
| UNKNOWN = "unknown" | ||
| } | ||
| export declare enum APIClanType { | ||
| OPEN = "open", | ||
| INVITE_ONLY = "inviteOnly", | ||
| CLOSED = "closed" | ||
| } | ||
| export interface APIMatch { | ||
| invites: unknown; | ||
| state: APIMatchState; | ||
| startTime: string; | ||
| battle: APIBattle; | ||
| tag: string; | ||
| } | ||
| export declare enum APIMatchState { | ||
| PENDING = "pending", | ||
| CANCELLED = "cancelled", | ||
| TIMED_OUT = "timedOut", | ||
| IN_PROGRESS = "inProgress", | ||
| COMPLETE = "complete", | ||
| FAILED = "failed" | ||
| } | ||
| export interface APIBattle { | ||
| deckSelection: APIBattleDeckSelection; | ||
| challengeWinCountBefore: integer; | ||
| boatBattleSide: string; | ||
| newTowersDestroyed: integer; | ||
| prevTowersDestroyed: integer; | ||
| remainingTowers: integer; | ||
| boatBattleWon: boolean; | ||
| type: APIBattleType; | ||
| opponent: APIPlayerBattleDataList; | ||
| team: APIPlayerBattleDataList; | ||
| gameMode: APIGameMode; | ||
| arena: APIArena; | ||
| battleTime: string; | ||
| challengeId: integer; | ||
| tournamentTag: string; | ||
| challengeTitle: string; | ||
| isLadderTournament: boolean; | ||
| isHostedMatch: boolean; | ||
| } | ||
| export declare enum APIBattleDeckSelection { | ||
| COLLECTION = "collection", | ||
| DRAFT = "draft", | ||
| DRAFT_COMPETITIVE = "draftCompetitive", | ||
| PREDEFINED = "predefined", | ||
| EVENT_DECK = "eventDeck", | ||
| PICK = "pick", | ||
| WARDECK_PICK = "wardeckPick", | ||
| UNKNOWN = "unknown" | ||
| } | ||
| export declare enum APIBattleType { | ||
| PVP = "pvp", | ||
| PVE = "pve", | ||
| CLANMATE = "clanmate", | ||
| TOURNAMENT = "tournament", | ||
| FRIENDLY = "friendly", | ||
| SURVIVAL = "survival", | ||
| PVP2v2 = "pvp2v2", | ||
| CLANMATE2v2 = "clanmate2v2", | ||
| CHALLENGE2v2 = "challenge2v2", | ||
| CLANWAR_COLLECTION_DAY = "clanwarCollectionDay", | ||
| CLANWAR_WAR_DAY = "clanwarWarDay", | ||
| CASUAL_1V1 = "casual1v1", | ||
| CASUAL_2V2 = "casual2v2", | ||
| BOAT_BATTLE = "boatBattle", | ||
| BOAT_BATTLE_PRACTICE = "boatBattlePractice", | ||
| RIVER_RACE_PVP = "riverRacePvp", | ||
| RIVER_RACE_DUEL = "riverRaceDuel", | ||
| RIVER_RACE_DUEL_COLOSSEUM = "riverRaceDuelColosseum", | ||
| UNKNOWN = "unknown" | ||
| } | ||
| export declare type APIPlayerBattleDataList = APIPlayerBattleData[]; | ||
| export interface APIPlayerBattleData { | ||
| clan?: APIPlayerClan; | ||
| cards: APIPlayerItemLevelList; | ||
| tag: string; | ||
| name: string; | ||
| startingTrophies?: integer; | ||
| trophyChange?: integer; | ||
| crowns?: integer; | ||
| kingTowerHitPoints?: integer; | ||
| princessTowersHitPoints?: APIIntegerList; | ||
| } | ||
| export declare type APIIntegerList = integer[]; | ||
| export declare type APIPlayerItemLevelList = APIPlayerItemLevel[]; | ||
| export interface APIPlayerItemLevel { | ||
| id: integer; | ||
| count?: integer; | ||
| level: integer; | ||
| starLevel?: integer; | ||
| name: string; | ||
| maxLevel: integer; | ||
| iconUrls: { | ||
| large?: string; | ||
| medium: string; | ||
| }; | ||
| } | ||
| export interface APIPlayerClan { | ||
| badgeId: integer; | ||
| tag: string; | ||
| name: string; | ||
| } | ||
| export interface APICancelMatchResponse { | ||
| success: boolean; | ||
| } | ||
| export declare type APIBattleList = APIBattle[]; | ||
| export interface APICurrentClanWar { | ||
| state: APICurrentClanWarState; | ||
| clan: APIClanWarClan; | ||
| participants: APIClanWarParticipantList; | ||
| clans: APIClanWarClanList; | ||
| collectionEndTime: string; | ||
| warEndTime: string; | ||
| } | ||
| export declare enum APICurrentClanWarState { | ||
| CLAN_NOT_FOUND = "clanNotFound", | ||
| ACCESS_DENIED = "accessDenied", | ||
| NOT_IN_WAR = "notInWar", | ||
| COLLECTION_DAY = "collectionDay", | ||
| MATCHMAKING = "matchmaking", | ||
| WAR_DAY = "warDay", | ||
| ENDED = "ended" | ||
| } | ||
| export declare type APIClanWarClanList = APIClanWarClan[]; | ||
| export interface APIClanWarClan { | ||
| tag: string; | ||
| clanScore: integer; | ||
| badgeId: integer; | ||
| crowns: integer; | ||
| name: string; | ||
| participants: integer; | ||
| battlesPlayed: integer; | ||
| wins: integer; | ||
| } | ||
| export declare type APIClanWarParticipantList = APIClanWarParticipant[]; | ||
| export interface APIClanWarParticipant { | ||
| tag: string; | ||
| name: string; | ||
| cardsEarned: integer; | ||
| battlesPlayed: integer; | ||
| wins: integer; | ||
| collectionDayBattlesPlayed: integer; | ||
| numberOfBattles: integer; | ||
| } | ||
| export declare type APIRiverRaceLog = APIList<APIRiverRaceLogEntry>; | ||
| export interface APIRiverRaceLogEntry { | ||
| standings: APIRiverRaceStandingList; | ||
| seasonId: integer; | ||
| createdDate: string; | ||
| sectionIndex: integer; | ||
| } | ||
| export declare type APIRiverRaceStandingList = APIRiverRaceStanding[]; | ||
| export interface APIRiverRaceStanding { | ||
| rank: integer; | ||
| trophyChange: integer; | ||
| clan: APIRiverRaceClan; | ||
| } | ||
| export interface APITournament { | ||
| membersList: APITournamentMemberList; | ||
| status: APITournamentStatus; | ||
| preparationDuration: integer; | ||
| createdTime: string; | ||
| startedTime: string; | ||
| endedTime: string; | ||
| firstPlaceCardPrize: integer; | ||
| gameMode: Omit<APIGameMode, "name">; | ||
| type: APITournamentType; | ||
| duration: integer; | ||
| tag: string; | ||
| creatorTag: string; | ||
| name: string; | ||
| description: string; | ||
| capacity: integer; | ||
| maxCapacity: integer; | ||
| levelCap: integer; | ||
| } | ||
| export declare enum APITournamentStatus { | ||
| IN_PREPARATION = "inPreparation", | ||
| IN_PROGRESS = "inProgress", | ||
| ENDED = "ended", | ||
| UNKNOWN = "unknown" | ||
| } | ||
| export declare enum APITournamentType { | ||
| OPEN = "open", | ||
| PASSWORD_PROTECTED = "passwordProtected", | ||
| UNKNOWN = "unknown" | ||
| } | ||
| export declare type APITournamentMemberList = APITournamentMember[]; | ||
| export interface APITournamentMember { | ||
| rank: integer; | ||
| clan: APIPlayerClan; | ||
| previousRank?: integer; | ||
| tag: string; | ||
| name: string; | ||
| score: integer; | ||
| } | ||
| export declare type APITournamentHeaderList = APIList<APITournamentHeader>; | ||
| export interface APITournamentHeader { | ||
| status: APITournamentHeaderStatus; | ||
| preparationDuration: integer; | ||
| createdTime: string; | ||
| firstPlaceCardPrize: integer; | ||
| gameMode: Omit<APIGameMode, "name">; | ||
| type: APITournamentHeaderType; | ||
| duration: integer; | ||
| tag: string; | ||
| creatorTag: string; | ||
| name: string; | ||
| description: string; | ||
| capacity: integer; | ||
| maxCapacity: integer; | ||
| levelCap: integer; | ||
| } | ||
| export declare enum APITournamentHeaderStatus { | ||
| IN_PREPARATION = "inPreparation", | ||
| IN_PROGRESS = "inProgress", | ||
| ENDED = "ended", | ||
| UNKNOWN = "unknown" | ||
| } | ||
| export declare enum APITournamentHeaderType { | ||
| OPEN = "open", | ||
| PASSWORD_PROTECTED = "passwordProtected", | ||
| UNKNOWN = "unknown" | ||
| } | ||
| export declare type APIClanList = APIList<Omit<APIClan, "clanChestPoints" | "clanChestStatus" | "description" | "memberList">>; | ||
| export declare type APIClanRankingList = APIList<APIClanRanking>; | ||
| export interface APIClanRanking { | ||
| clanScore: integer; | ||
| badgeId: integer; | ||
| location: APILocation; | ||
| members: integer; | ||
| tag: string; | ||
| name: string; | ||
| rank: integer; | ||
| previousRank: integer; | ||
| } | ||
| export interface APIRegisterMatchRequest { | ||
| playerTags: APIStringList; | ||
| gameMode: APIRegisterMatchRequestGameMode; | ||
| } | ||
| export declare type APIStringList = string[]; | ||
| export declare enum APIRegisterMatchRequestGameMode { | ||
| REGULAR = "regular", | ||
| TEAM_VS_TEAM = "teamVsTeam", | ||
| DOUBLE_ELIXIR_TOURNAMENT = "doubleElixirTournament", | ||
| TRIPLE_ELIXIR_TOURNAMENT = "tripleElixirTournament", | ||
| RAGE = "rage", | ||
| SUDDEN_DEATH = "suddenDeath", | ||
| TOUCHDOWN = "touchdown", | ||
| RAMP_UP = "rampUp", | ||
| DRAFT = "draft", | ||
| MIRROR = "mirror", | ||
| DRAGON_HUNT = "dragonHunt" | ||
| } | ||
| export interface APIRegisterMatchResponse { | ||
| tag: string; | ||
| } | ||
| export interface APIUpcomingChests { | ||
| items: APIChestList; | ||
| } | ||
| export declare type APIChestList = APIChest[]; | ||
| export interface APIChest { | ||
| name: string; | ||
| index: integer; | ||
| } | ||
| export declare type APIClanWarLog = APIClanWarLogEntry[]; | ||
| export interface APIClanWarLogEntry { | ||
| standings: APIClanWarStandingList; | ||
| seasonId: integer; | ||
| participants: APIClanWarParticipantList; | ||
| createdDate: string; | ||
| } | ||
| export declare type APIClanWarStandingList = APIClanWarStanding[]; | ||
| export interface APIClanWarStanding { | ||
| trophyChange: integer; | ||
| clan: APIClanWarClan; | ||
| } | ||
| export interface APIPlayer { | ||
| clan?: APIPlayerClan; | ||
| cards: APIPlayerItemLevelList; | ||
| currentFavouriteCard?: APIItem; | ||
| badges: APIPlayerAchievementBadgeList; | ||
| arena: APIArena; | ||
| role: APIPlayerRole; | ||
| wins: integer; | ||
| losses: integer; | ||
| totalDonations: integer; | ||
| leagueStatistics?: APIPlayerLeagueStatistics; | ||
| tag: string; | ||
| name: string; | ||
| expLevel: integer; | ||
| trophies: integer; | ||
| bestTrophies: integer; | ||
| donations: integer; | ||
| donationsReceived: integer; | ||
| achievements: APIPlayerAchievementProgressList; | ||
| battleCount: integer; | ||
| threeCrownWins: integer; | ||
| challengeCardsWon: integer; | ||
| challengeMaxWins: integer; | ||
| tournamentCardsWon: integer; | ||
| tournamentBattleCount: integer; | ||
| currentDeck: APIPlayerItemLevelList; | ||
| warDayWins: integer; | ||
| clanCardsCollected: integer; | ||
| starPoints?: integer; | ||
| expPoints: integer; | ||
| } | ||
| export declare enum APIPlayerRole { | ||
| NOT_MEMBER = "notMember", | ||
| MEMBER = "member", | ||
| LEADER = "leader", | ||
| ADMIN = "admin", | ||
| COLEADER = "coLeader" | ||
| } | ||
| export declare type APIPlayerAchievementProgressList = APIPlayerAchievementProgress[]; | ||
| export interface APIPlayerAchievementProgress { | ||
| stars: integer; | ||
| value: integer; | ||
| name: string; | ||
| target: integer; | ||
| info: string; | ||
| completionInfo: string | null; | ||
| } | ||
| export interface APIPlayerLeagueStatistics { | ||
| currentSeason: APILeagueSeasonResult; | ||
| bestSeason: APILeagueSeasonResult; | ||
| previousSeason: APILeagueSeasonResult; | ||
| } | ||
| export interface APILeagueSeasonResult { | ||
| trophies: integer; | ||
| bestTrophies?: integer; | ||
| rank?: integer; | ||
| id?: string; | ||
| } | ||
| export declare type APIPlayerAchievementBadgeList = APIPlayerAchievementBadge[]; | ||
| export interface APIPlayerAchievementBadge { | ||
| iconUrls: { | ||
| large: string; | ||
| }; | ||
| maxLevel: integer; | ||
| progress: integer; | ||
| target: integer; | ||
| level: integer; | ||
| name: string; | ||
| } | ||
| export declare type APIItemList = APIList<APIItem>; | ||
| export interface APIClientError { | ||
| reason: string; | ||
| message?: string; | ||
| type?: string; | ||
| detail?: unknown; | ||
| } | ||
| export interface APIList<T> { | ||
| items: T[]; | ||
| paging?: APIPaging; | ||
| } | ||
| export interface APIPaging { | ||
| cursors: APICursors; | ||
| } | ||
| interface APICursors { | ||
| after?: string; | ||
| before?: string; | ||
| } | ||
| export declare enum APIRiverRacePeriodType { | ||
| TRAINING = "training", | ||
| WAR_DAY = "warDay", | ||
| COLOSSEUM = "colosseum" | ||
| } | ||
| export declare enum APIRiverRaceState { | ||
| CLAN_NOT_FOUND = "clanNotFound", | ||
| ACCESS_DENIED = "accessDenied", | ||
| MATCHMAKING = "matchmaking", | ||
| MATCHED = "matched", | ||
| FULL = "full", | ||
| ENDED = "ended" | ||
| } | ||
| export {}; |
-140
| import type { APIBattleList, APIChallengeChainsList, APIClan, APIClanList, APIClanMemberList, APIClanRankingList, APIClanWarLog, APICurrentRiverRace, APIItemList, APILadderTournamentList, APILadderTournamentRankingList, APILeagueSeason, APILeagueSeasonList, APILocation, APILocationList, APIPlayer, APIPlayerRankingList, APIRiverRaceLog, APITournament, APITournamentHeaderList, APIUpcomingChests } from "."; | ||
| /** | ||
| * Values of an object | ||
| */ | ||
| export declare type ValueOf<T> = T extends (infer R)[] | Map<any, infer R> ? R : T[keyof T]; | ||
| /** | ||
| * A list of API routes | ||
| */ | ||
| export declare const Routes: { | ||
| /** | ||
| * Retrieve clan's clan war log. | ||
| * @param clanTag - Tag of the clan | ||
| * @deprecated **This API endpoint has been temporarily disabled, possibilities to bring it back are being investigated. | ||
| * Use {@link Routes.RiverRaceLog} instead** | ||
| */ | ||
| readonly WarLog: (clanTag: string) => `/clans/${string}/warlog`; | ||
| /** | ||
| * Search all clans by name and/or filtering the results using various criteria. | ||
| * At least one filtering criteria must be defined and if name is used as part of search, it is required to be at least three characters long. | ||
| * It is not possible to specify ordering for results so clients should not rely on any specific ordering as that may change in the future releases of the API. | ||
| */ | ||
| readonly Clans: () => "/clans"; | ||
| /** | ||
| * Retrieve clan's river race log. | ||
| * @param clanTag - Tag of the clan | ||
| */ | ||
| readonly RiverRaceLog: (clanTag: string) => `/clans/${string}/riverracelog`; | ||
| /** | ||
| * Get information about a single clan by clan tag. | ||
| * Clan tags can be found using clan search operation. | ||
| * @param clanTag - Tag of the clan | ||
| */ | ||
| readonly Clan: (clanTag: string) => `/clans/${string}`; | ||
| /** | ||
| * List clan members. | ||
| * @param clanTag - Tag of the clan | ||
| */ | ||
| readonly ClanMembers: (clanTag: string) => `/clans/${string}/members`; | ||
| /** | ||
| * Retrieve information about clan's current river race. | ||
| * @param clanTag - Tag of the clan | ||
| */ | ||
| readonly CurrentRiverRace: (clanTag: string) => `/clans/${string}/currentriverrace`; | ||
| /** | ||
| * Get information about a single player by player tag. | ||
| * Player tags can be found either in game or by from clan member lists. | ||
| * @param playerTag - Tag of the player | ||
| */ | ||
| readonly Player: (playerTag: string) => `/players/${string}`; | ||
| /** | ||
| * Get list of reward chests that the player will receive next in the game. | ||
| * @param playerTag - Tag of the player | ||
| */ | ||
| readonly UpcomingChests: (playerTag: string) => `/players/${string}/upcomingchests`; | ||
| /** | ||
| * Get list of recent battles for a player. | ||
| * @param playerTag - Tag of the player | ||
| */ | ||
| readonly BattleLog: (playerTag: string) => `/players/${string}/battlelog`; | ||
| /** | ||
| * Get list of available cards. | ||
| */ | ||
| readonly Cards: () => "/cards"; | ||
| /** | ||
| * Search all tournaments by name. | ||
| * It is not possible to specify ordering for results so clients should not rely on any specific ordering as that may change in the future releases of the API. | ||
| */ | ||
| readonly Tournaments: () => "/tournaments"; | ||
| /** | ||
| * Get information about a single tournament by a tournament tag. | ||
| * @param tournamentTag - Tag of the tournament to retrieve | ||
| */ | ||
| readonly Tournament: (tournamentTag: string) => `/tournaments/${string}`; | ||
| /** | ||
| * Get clan rankings for a specific location. | ||
| * @param locationId - Identifier of the location to retrieve | ||
| */ | ||
| readonly ClanRankings: (locationId: number | `${number}`) => `/locations/${number}/rankings/clans`; | ||
| /** | ||
| * Get player rankings for a specific location. | ||
| * @param locationId - Identifier of the location to retrieve | ||
| */ | ||
| readonly PlayerRankings: (locationId: number | `${number}`) => `/locations/${number}/rankings/players`; | ||
| /** | ||
| * Get clan war rankings for a specific location. | ||
| * @param locationId - Identifier of the location to retrieve | ||
| */ | ||
| readonly ClanWarRankings: (locationId: number | `${number}`) => `/locations/${number}/rankings/clanwars`; | ||
| /** | ||
| * Get top player league season. | ||
| * @param seasonId - Identifier of the season to retrieve | ||
| */ | ||
| readonly Season: (seasonId: string) => `/locations/global/seasons/${string}`; | ||
| /** | ||
| * Get top player rankings for a season. | ||
| * @param seasonId - Identifier of the season to retrieve | ||
| */ | ||
| readonly TopPlayerRankings: (seasonId: string) => `/locations/global/seasons/${string}/rankings/players`; | ||
| /** | ||
| * Lists top player league seasons. | ||
| */ | ||
| readonly Seasons: () => "/locations/global/seasons"; | ||
| /** | ||
| * List locations. | ||
| */ | ||
| readonly Locations: () => "/locations"; | ||
| /** | ||
| * Get information about specific location. | ||
| * @param locationId - Identifier of the location to retrieve | ||
| */ | ||
| readonly Location: (locationId: number | `${number}`) => `/locations/${number}`; | ||
| /** | ||
| * Get global tournament rankings. | ||
| * @param tournamentTag - Tag of the tournament to retrieve | ||
| */ | ||
| readonly GlobalTournamentRankings: (tournamentTag: string) => `/locations/global/rankings/tournaments/${string}`; | ||
| /** | ||
| * Get current and upcoming challenges. | ||
| * Challenges are returned as chains. | ||
| * Chains are either of type singleChallenge or challengeChain. | ||
| * Possible types for prizes are: none, cardStack, chest, cardStackRandom, resource, tradeToken, consumable. | ||
| */ | ||
| readonly Challenges: () => "/challenges"; | ||
| /** | ||
| * Get list of global tournaments. | ||
| */ | ||
| readonly GlobalTournaments: () => "/globaltournaments"; | ||
| }; | ||
| export declare type Routes = { | ||
| [K in keyof typeof Routes]: ReturnType<typeof Routes[K]>; | ||
| }; | ||
| /** | ||
| * The path for a request to the API | ||
| */ | ||
| export declare type Path = ValueOf<Routes>; | ||
| /** | ||
| * The response type of the API for every route. | ||
| */ | ||
| export declare type ResponseType<T extends ValueOf<Routes>> = T extends Routes["WarLog"] ? APIClanWarLog : T extends Routes["Clans"] ? APIClanList : T extends Routes["RiverRaceLog"] ? APIRiverRaceLog : T extends Routes["ClanMembers"] ? APIClanMemberList : T extends Routes["CurrentRiverRace"] ? APICurrentRiverRace : T extends Routes["UpcomingChests"] ? APIUpcomingChests : T extends Routes["BattleLog"] ? APIBattleList : T extends Routes["Cards"] ? APIItemList : T extends Routes["Tournaments"] ? APITournamentHeaderList : T extends Routes["ClanRankings"] ? APIClanRankingList : T extends Routes["PlayerRankings"] ? APIPlayerRankingList : T extends Routes["ClanWarRankings"] ? APIClanRankingList : T extends Routes["TopPlayerRankings"] ? APIPlayerRankingList : T extends Routes["Seasons"] ? APILeagueSeasonList : T extends Routes["Locations"] ? APILocationList : T extends Routes["Challenges"] ? APIChallengeChainsList : T extends Routes["GlobalTournaments"] ? APILadderTournamentList : T extends Routes["Clan"] ? APIClan : T extends Routes["Player"] ? APIPlayer : T extends Routes["Tournament"] ? APITournament : T extends Routes["Season"] ? APILeagueSeason : T extends Routes["Location"] ? APILocation : T extends Routes["GlobalTournamentRankings"] ? APILadderTournamentRankingList : never; | ||
| export default Routes; |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
41700
2.17%803
0.12%7
-22.22%1
Infinity%