UNPKG

lol-api-js

Version:

Integration package LoL Riot API and your typescript/javascript

73 lines 2.62 kB
import Summoner from "./summoner"; import { leagueData } from "./league"; import { championMasteryData } from "./championMastery"; export default class API { key: string; dataPath: string; region: string; constructor(api_key: string, path: string); /** * Returns the URL with indentifiers, keys and search params` * * @returns A @var string that represents a URL with keys and params * * @param url - string with the href * @param identifier - string to join after the url with @var encodeURI * @param args - JSON Object with search parameters * * @remarks * This method is part of lol-api-js package as a utils function * * @example * const rawURL = "https://www.google.com/"; * const identifier = "search"; * const args = {q: "I love artifical intelligence"}; * const url = buildUrl(rawURL, identifier, args) * // url = "https://www.google.com/search?q=I+love+artificial+intelligence" */ buildUrl: (url: string, identifier: string, args: Object) => string; /** * Method to retrieve a summoner object from RiotGames API * * @returns A @var string that represents a URL with keys and params * * @param summonerName - a string containing the summoner name * * @remarks * This method is part of lol-api-js package as a API class method * * @example * const api = new API('your Riot Api Key', 'your local datadragon path'); * const summoner = api.getSummoner('summonerName'); */ getSummoner: (summonerName: string) => Promise<Summoner>; /** * Sets the class properties @var championMastery as an `Array<ChampionMastery>` * * @remarks * This method is part of lol-api-js package and Summoner class * */ getChampionMastery: (id: string) => Promise<championMasteryData[]>; /** * Sets the summoner class properties @var rankedFlex and @var rankedSolo * * @remarks * This method is part of lol-api-js package and API class * */ getLeagues: (id: string) => Promise<leagueData[]>; /** * Returns an Array of matchIds. * * @remarks * This method is part of lol-api-js package and API class * * @param params - optional pre-defined Object: `params = {start: 0, count: 20};` * * @returns An array of strings: `Array<string>;` * */ getMatchIds: (puuid: string, params?: Object) => Promise<string[]>; } //# sourceMappingURL=index.d.ts.map