import { FieldMap } from './utils'; /** * Represents options for fetch methods * @interface */ interface Options { query?: QueryParams; } export type QueryParam = string | number | boolean | undefined | string[]; export type QueryParams = Record; /** * A HTTP Client interface that provides fetch methods * @interface */ export interface Client { /** * Fetches data from the specified endpoint and applies the {@link FieldMap} * * @param endpoint * The endpoint to fetch data from * @param mapping * The Field Mapping to applly to the fetched data * @param options * Optional parameters for the request * @returns A Promise that resolves to the fetched data with applied mapping */ fetchMapping(endpoint: string, mapping: FieldMap, options?: Options): Promise; /** * Fetches data from the specified endpoint * * @param endpoint * The endpoint to fetch data from * @param options * Optional parameters for the request * @returns A Promise that resolves to the fetched data */ fetch(endpoint: string, options?: Options): Promise; } /** * Custom error interface * @class */ export declare class HypicleError extends Error { readonly status: number; readonly success: boolean; readonly throttle?: boolean; readonly global?: boolean; /** * Constructs new {@link HypicleError} * * @param message * The error message * @param status * The HTTP error status code from {@link HypixelError} * @param success * Indicates whether the API request was successful * @param throttle * Indicates if the error is due to a throttle restriction on the API * @param global * Indicates if the throttle is applied to all users */ constructor(message: string, status: number, success: boolean, throttle?: boolean, global?: boolean); } /** * The Hypixel API Client implementation * @class */ export declare class Hypicle implements Client { #private; constructor(key: string); fetchMapping(endpoint: string, mapping: FieldMap, options?: Options): Promise; fetch(endpoint: string, options?: Options): Promise; } export {}; //# sourceMappingURL=client.d.ts.map