credix
Version: 
Official SDK for Credix Credit Management System
50 lines • 1.4 kB
TypeScript
import type { InternalConfig } from '../config.js';
import type { AuthManager } from './auth.js';
/**
 * Request options interface
 */
export interface RequestOptions {
    headers?: Record<string, string>;
    params?: Record<string, unknown>;
    timeout?: number;
    signal?: AbortSignal;
}
/**
 * HTTP Client for making API requests
 */
export declare class HttpClient {
    private readonly axios;
    private readonly config;
    constructor(config: InternalConfig & {
        authManager?: AuthManager;
    });
    /**
     * Makes an HTTP request
     */
    request<T>(method: 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE', path: string, data?: unknown, options?: RequestOptions): Promise<T>;
    /**
     * GET request
     */
    get<T>(path: string, options?: RequestOptions): Promise<T>;
    /**
     * POST request
     */
    post<T>(path: string, data?: unknown, options?: RequestOptions): Promise<T>;
    /**
     * PUT request
     */
    put<T>(path: string, data?: unknown, options?: RequestOptions): Promise<T>;
    /**
     * PATCH request
     */
    patch<T>(path: string, data?: unknown, options?: RequestOptions): Promise<T>;
    /**
     * DELETE request
     */
    delete<T>(path: string, options?: RequestOptions): Promise<T>;
    /**
     * Handles axios errors and converts them to OMError
     */
    private handleError;
}
//# sourceMappingURL=http-client.d.ts.map