@afriex/core
Version:
HTTP client, configuration and typed errors for the Afriex Business API SDK
19 lines • 797 B
TypeScript
import { Config } from "../config/Config.js";
export interface RequestOptions {
headers?: Record<string, string>;
params?: Record<string, string | number | boolean | undefined> | object;
timeout?: number;
}
export declare class HttpClient {
private kyInstance;
private logger;
constructor(config: Config);
private handleError;
private buildOptions;
get<T>(path: string, options?: RequestOptions): Promise<T>;
post<T>(path: string, data?: unknown, options?: RequestOptions): Promise<T>;
put<T>(path: string, data?: unknown, options?: RequestOptions): Promise<T>;
patch<T>(path: string, data?: unknown, options?: RequestOptions): Promise<T>;
delete<T>(path: string, options?: RequestOptions): Promise<T>;
}
//# sourceMappingURL=HttpClient.d.ts.map