UNPKG

lol-api-js

Version:

Integration package LoL Riot API and your typescript/javascript

49 lines (45 loc) 1.5 kB
export default class ChampionMastery { championId: number; championLevel: number; championPoints: number; lastPlayTime: number; championPointsSinceLastLevel: number; championPointsUntilNextLevel: number; chestGranted: boolean; tokensEarned: number; summonerId: string; constructor(jsonObj: championMasteryData) { this.championId = jsonObj.championId; this.championLevel = jsonObj.championLevel; this.championPoints = jsonObj.championPoints; this.lastPlayTime = jsonObj.lastPlayTime; this.championPointsSinceLastLevel = jsonObj.championPointsSinceLastLevel; this.championPointsUntilNextLevel = jsonObj.championPointsUntilNextLevel; this.chestGranted = jsonObj.chestGranted; this.tokensEarned = jsonObj.tokensEarned; this.summonerId = jsonObj.summonerId; } } export interface championMasteryData { championId: number; championLevel: number; championPoints: number; lastPlayTime: number; championPointsSinceLastLevel: number; championPointsUntilNextLevel: number; chestGranted: boolean; tokensEarned: number; summonerId: string; } // Response sample // { // "championId": 39, // "championLevel": 7, // "championPoints": 75663, // "lastPlayTime": 1632425405000, // "championPointsSinceLastLevel": 54063, // "championPointsUntilNextLevel": 0, // "chestGranted": true, // "tokensEarned": 0, // "summonerId": "4OamiUKToURz60CXcn0QOZSEjo0OhmQl0ChlSkdWLBEkwQ" // },