ChampionMasteryManager class
A champion mastery manager - to fetch and manage all summoner's champion mastery data. Requires API key with access to champion-mastery-v4
API.
Signature:
export declare class ChampionMasteryManager implements BaseManager<ChampionMastery>
Implements: BaseManager<ChampionMastery>
References: BaseManager, ChampionMastery
Constructor
new ChampionMasteryManager (client: Client, summoner: Summoner)
Constructs a new instance of the ChampionMasteryManager
class.
Parameters:
Parameter | Type | Description |
---|---|---|
client | Client | The client this champion mastery manager belongs to. |
summoner | Summoner | The summoner this manager belongs to. |
Properties
client
The client this champion mastery manager belongs to.
Type: Client
summoner
The ID of the summoner whose mastery is managed by this manager.
Type: Summoner
totalScore
The total mastery score of this summoner.
Type: Number
Methods
.fetch ()
Fetch a champion's mastery data for the summoner.
Signature:
fetch(champion: Champion | string, options?: FetchOptions): Promise<ChampionMastery>;
Parameters:
Parameter | Type | Description |
---|---|---|
champion | Champion | String | The champion (or its ID) whose mastery data needs to be fetched. |
options | FetchOptions | The basic fetching options. |
Return type: Promise < ChampionMastery >
.fetchAll ()
Fetches all the champions' masteries data for this summoner and store them in the cache.
Signature:
fetchAll(options?: FetchOptions): Promise<Collection<string, ChampionMastery>>;
Parameters:
Parameter | Type | Description |
---|---|---|
options | FetchOptions |
Return type: Promise < Collection < String, ChampionMastery > >
.fetchTop ()
Fetches the top n champions' mastery data for this summoner. They are already sorted by mastery level.
Signature:
fetchTop(n?: number, options?: FetchOptions): Promise<ChampionMastery[]>;
Parameters:
Parameter | Type | Description |
---|---|---|
n | Number | The number of champions to fetch, defaults to 3. |
options | FetchOptions | The basic fetching options. |
Return type: Promise < ChampionMastery >
.highest ()
Get the nth highest champion mastery for the summoner.
Signature:
highest(n?: number, options?: FetchOptions): Promise<ChampionMastery>;
Parameters:
Parameter | Type | Description |
---|---|---|
n | Number | The ranking of the champion in the summoner's champions mastery, defaults to 0 (highest). |
options | FetchOptions | The basic fetching options. |
Return type: Promise < ChampionMastery >
.updateTotalScore ()
Get an updated total mastery score for this summoner.
Signature:
updateTotalScore(): Promise<number>;
Return type: Promise < Number >