@jlenon7/zedjs
Version:
Riot API Library for NodeJS
32 lines (31 loc) • 1.06 kB
TypeScript
import { IEndpoint } from '../endpoints';
import { ApiResponseDTO } from '../models-dto/api-response/api-response';
import { IBaseApiParams, IParams } from './base.utils';
import { BaseApiGames } from './base.const';
export declare class BaseApi<Region extends string> {
protected readonly game: BaseApiGames;
private readonly baseUrl;
private key;
private concurrency;
private rateLimitRetry;
private rateLimitRetryAttempts;
private debug;
constructor();
constructor(params: IBaseApiParams);
/**
* Base api
* @param key Riot games api key
*/
constructor(key: string);
private setParams;
private getRateLimits;
private getBaseUrl;
private getApiUrl;
private isRateLimitError;
private isServiceUnavailableError;
private getError;
private internalRequest;
private retryRateLimit;
protected getParam(): IBaseApiParams;
protected request<T>(region: Region, endpoint: IEndpoint, params?: IParams, forceError?: boolean, qs?: any): Promise<ApiResponseDTO<T>>;
}