/** * Base HTTP Client for Voice.ai API * * Provides common functionality for all API clients including: * - Authentication via Bearer token * - Error handling and response parsing * - Common HTTP methods (GET, POST, PUT, PATCH, DELETE) */ import type { AuthTokenProvider } from '../types'; /** Error thrown by Voice.ai API client */ export declare class VoiceAIError extends Error { readonly status?: number | undefined; readonly code?: string | undefined; readonly detail?: string | undefined; constructor(message: string, status?: number | undefined, code?: string | undefined, detail?: string | undefined); } /** Configuration for BaseClient */ export interface BaseClientConfig { apiKey?: string; authToken?: string; getAuthToken?: AuthTokenProvider; apiUrl: string; } /** * Base HTTP client with authentication and error handling */ export declare class BaseClient { protected readonly apiKey: string; protected readonly authToken?: string; protected readonly getAuthToken?: AuthTokenProvider; protected readonly apiUrl: string; constructor(config: BaseClientConfig); protected resolveBearerToken(): Promise; /** * Build headers with authentication */ protected getHeaders(contentType?: string): Promise>; /** * Handle API response and parse errors */ protected handleResponse(response: Response): Promise; /** * Perform GET request */ protected get(path: string, params?: Record): Promise; /** * Perform GET request that returns binary data (Blob) */ protected getForBlob(path: string, params?: Record): Promise; /** * Perform POST request */ protected post(path: string, body?: any): Promise; /** * Perform POST request with FormData (for file uploads) */ protected postFormData(path: string, formData: FormData): Promise; /** * Perform PUT request */ protected put(path: string, body?: any): Promise; /** * Perform PATCH request */ protected patch(path: string, body?: any): Promise; /** * Perform DELETE request */ protected httpDelete(path: string): Promise; /** * Perform POST request that returns binary data (Blob) */ protected postForBlob(path: string, body?: any): Promise; /** * Perform POST request that returns a streaming Response */ protected postForStream(path: string, body?: any): Promise; } //# sourceMappingURL=base.d.ts.map