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:

ParameterTypeDescription
clientClientThe client this champion mastery manager belongs to.
summonerSummonerThe 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:

ParameterTypeDescription
championChampion | StringThe champion (or its ID) whose mastery data needs to be fetched.
optionsFetchOptionsThe 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:

ParameterTypeDescription
optionsFetchOptions

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:

ParameterTypeDescription
nNumberThe number of champions to fetch, defaults to 3.
optionsFetchOptionsThe 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:

ParameterTypeDescription
nNumberThe ranking of the champion in the summoner's champions mastery, defaults to 0 (highest).
optionsFetchOptionsThe 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 >