UNPKG

@fnlb-project/fnbr

Version:

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

38 lines (37 loc) 1.1 kB
import Base from '../Base'; import type { AuthSessionStoreKey } from '../../resources/enums'; import type Client from '../Client'; interface RequestHeaders { [key: string]: any; } export type RequestConfig = { method?: string; headers?: RequestHeaders; data?: any; url: string; responseType?: 'json' | 'arraybuffer' | 'blob'; }; /** * Represents the client's HTTP manager * @private */ declare class HTTP extends Base { /** * @param client The main client */ constructor(client: Client); /** * Sends an HTTP request * @param config The request config * @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} */ epicgamesRequest<T = any>(config: RequestConfig, auth?: AuthSessionStoreKey): Promise<T>; } export default HTTP;