ClashManager class


A clash manager - to fetch and store clash tournaments and related data. Requires API key with access to clash-v1 API.

Signature:

export declare class ClashManager implements BaseManager<Tournament> 

Implements: BaseManager<Tournament>

References: BaseManager, Tournament


Constructor

new ClashManager (client: Client)

Constructs a new instance of the ClashManager class.

Parameters:

ParameterTypeDescription
clientClientThe client this clash manager belongs to.

Properties

client

The client this clash manager belongs to.

Type: Client


Methods

.fetch ()

Fetch a clash tournament by its ID.

Signature:

fetch(id: number, options?: FetchOptions): Promise<Tournament>;

Parameters:

ParameterTypeDescription
idNumberThe ID of the clash tournament.
optionsFetchOptionsThe basic fetch options.

Return type: Promise < Tournament >


.fetchAll ()

Fetch all upcoming and active clash tournaments.

Signature:

fetchAll(options?: FetchOptions): Promise<Tournament[]>;

Parameters:

ParameterTypeDescription
optionsFetchOptionsThe basic fetch options (always fetches from the API, skipping cache and storage).

Return type: Promise < Tournament >


.fetchByTeamId ()

Fetch a clash tournament by participating team's ID.

Signature:

fetchByTeamId(teamId: string, options?: FetchOptions): Promise<Tournament>;

Parameters:

ParameterTypeDescription
teamIdStringThe ID of the team.
optionsFetchOptionsThe basic fetch options (always fetches from API, skipping cache and storage).

Return type: Promise < Tournament >


.fetchPlayer ()

Fetch participation info of a summoner in clash tournaments by the summoner ID.

Signature:

fetchPlayer(summonerId: string, options?: FetchOptions): Promise<TournamentPlayer[]>;

Parameters:

ParameterTypeDescription
summonerIdStringThe ID of the summoner.
optionsFetchOptionsThe basic fetch options.

Return type: Promise < TournamentPlayer >


.fetchTeam ()

Fetch a team participating in a clash tournament by the team ID.

Signature:

fetchTeam(teamId: string, options?: FetchOptions): Promise<TournamentTeam>;

Parameters:

ParameterTypeDescription
teamIdStringThe ID of the team.
optionsFetchOptionsThe basic fetch options.

Return type: Promise < TournamentTeam >