UNPKG

fnbr

Version:

A library to interact with Epic Games' Fortnite HTTP and XMPP services

41 lines (40 loc) 1.21 kB
import Base from '../Base'; import type { AuthSessionStoreKey } from '../../resources/enums'; import type Client from '../Client'; import type { AxiosRequestConfig } from 'axios'; interface RequestHeaders { [key: string]: any; } type RequestConfig = Omit<AxiosRequestConfig, 'headers'> & { headers?: RequestHeaders; }; /** * Represents the client's HTTP manager * @private */ declare class HTTP extends Base { /** * The axios instance */ private axios; /** * @param client The main client */ constructor(client: Client); /** * Sends an HTTP request * @param config The request config * @param auth The auth session to use * @param retries How many times this request has been retried (5xx errors) */ request<T = any>(config: RequestConfig, retries?: number): Promise<T>; /** * Sends an HTTP request to the Fortnite API * @param config The request config * @param includeAuthentication Whether to include authentication * @throws {EpicgamesAPIError} * @throws {AxiosError} */ epicgamesRequest<T = any>(config: RequestConfig, auth?: AuthSessionStoreKey): Promise<T>; } export default HTTP;